make2dimg.sh
Last updated: Aug19,2020

This routine is used to construct simulated images. The make2dimg code is meant to work with the ellradius.sh routine, which creates for each source an image of the radius values for each pixel. This code,make2dimg, just fills in the pixel values given a model for radial dependence of brightness in the target. The make2dimg script currently works on a single target at a time, but the wrapper script "model_images_1m discussed below, is set up to place multiple sources onto a single output simulated image.

 
# Create the radius image named rad.fits:  
% ellradius.sh 200 200 100 100 60.0 0.70 -30.0  
See web description of ellradius 

# Fill in the values with a 1-term polynomial (a constant value):  
%  make2dimg.sh rad.fits polyn 1.0 0.0 0.0 0.0 
arg1 - name of radius image (FITS) file
arg2 - function name (polyn)
arg3 - parameter_1
arg4 - parameter_2
arg5 - parameter_3
arg6 - parameter_4
 
In the example above we made a 200x200 image and built a source centered at X,Y=100,100. The source has a semi-major axis size of 60 pixels and an axis ration of b/a=0.70. The position angle of the major axis is PA=-30 degrees. The make2dimg. code fills in the value of each pixel using a radial function. Ithis case we use a polynomial of the form: I = 1.0 + 0.0*r + 0.0* r^2 + 0.0*r^4. In other words, we just fill in the pixels with the value "1.0" to build an elliptical source with constant surface brightness.

You can read about I used make2dimg.sh to test my WCS codes with simulated images.

NOTE: I only have the polyn function installed. I need to add the functions: expon,gdvr4,gaus etc....

We usually desire to build an image with multiple model sources, and the script "model_images_1" can be used for this. You just specify the size of the image and a file that contains the parameters describing each source. Currently, the script is set up to ONLY fill in contant surface brightness sources.

 
% model_images_1 200 200 pfile.1 

# The source parametsr are given by pfile.1 
% cat pfile.1  
  100.0  100.0  20.0  0.2   90.0   1
  135.0  100.0  12.0  0.3   0.0    2 
   40.0 160.0  10.0   0.99  25.0   3 
  180.0 160.0  10.0   0.99  45.0   4 
  100.0 40.0    6.0   0.99  0.0    5 

  Xcen   Ycen   a-semi  b/a  PA    I   
  I=pixel value for source
 

The image made with this proedure is shown below:

A test image made with model_images_1. We use make2dimss.sh (along with ellradius.sh) to build 5 differnt model images. The final step in model_images_1. is to sum the 5 different images to create the image above. Here we used fixed pixel values for each source. Hence, each ellipse above shows up with a different color (for pixeel value equal to 1, 2, 3, 4, and 5).




Back to SCO CODES page