Building FITS images for testing and simulations.
Last updated: Aug18,2020

I often have a need to create test images written in FITS format.


TBD:  
  make2dimg --help 
  ellradius.sh  --help               
  clip_build_fits.sh         no help 

Primary List
  1. Build a test image.
  2. Simple 256 pixel square images.
  3. Elliptical radius image.
  4. Simple galaxy images.



Build a test image.

Here is an easy way to make an image.


clip_build_fits.sh 

usage: clip_build_fits.sh 775 771 PolyFile a.fits [-v] [-h] [{-p ]  
arg1 - X dimension of image to be made (= NAXIS1). 
arg2 - Y dimension of image to be made (= NAXIS2). 
arg3 - polynomial coefficients file (bgnmp-style) 
arg4 - name of output fits file 
N.B. If PolyFile is not present, Zero image is made. 
Additional options: 
 -v = print verbose comments and run in debug mode 
 -h = just show usage message  

% clip_build_fits.sh 50 50 poly.1 a.fits -p pix.1 

% cat poly.1 
50.0 
-0.5 
0.2
+0.6
 
% cat pix.1 
25 25 10 40 100.0
10 40 25 25 120.0

This makes a smooth, curved background with a cross in the middle of the image.




Simple 256 pixel square images.

In my early days of learving python I used some routines to generate fixed format FITS images that were 256x256 in size.


tim_stripes.sh 
usage: tim_stripes.sh 1.0 25.0 test.fits [-v] [-h]  
arg1 - column 1 value 
arg2 - column 256 value 
arg3 - name of output test image
Additional options: 
 -v = print verbose comments and run in debug mode 
 -h = just show usage message  

tim_circle .sh 
usage: tim_circle.sh 50.0 60.0  30.0 100.0 50.0 test.fits [-v] [-h]  
arg1 - Xo of circle 
arg2 - Yo of circle 
arg3 - Ro, radius of circle 
arg4 - I value at R=0 
arg5 - I value at R=Ro 
arg6 - name of output test image
Additional options: 
 -v = print verbose comments and run in debug mode 
 -h = just show usage message  

 
Return to top of page.



Elliptical radius image.

The ellradius.sh routine creates a a radius image. The output name of the FITS image is always "rad.fits" The user specifies the size of the image and the paramters describing the elliptical source (center, sise, orientation).


The ellradius.sh 
usage: ellradius.sh 1992 1992 123.0 300.0 20.0 0.75 25.0  
arg1 - X dimension of output image
arg2 - Y dimension of output image
arg3 - X center in pixels 
arg4 - Y center in pixels 
arg5 - circle radius (asemi) in pixels 
arg6 - axis ratio (b/a) 
arg7 - PA in degrees (GALPHOT convention)
 



Simple model galaxy images.

The make2dimg.sh routine makes simple images based of the radius images generated in the prvious section. It can be used for all kinds of stuff. In fact, and early use of this code had nothing to do with galaxies, I just wanted to generate some ellipse shapes oriennted at different angles to test my WCS codes with simulated images. In particular, in that webdoc I describe some scirpts that do a variety of things with make2dimg, these are named: SimIm0, SimIm2, SimIm3, SimIm4, SimIm5. These scripts all use the model_images_1 routine to make multiples runs of ellradius.sh amd make2dimg.sh and stack them to create final composite images.




Back to SCO code page