This HTML automatically generated with rman for NEMO
Table of Contents

Name

ccdgen - create or add objects to an image

Synopsis

ccdgen out=image-file [parameter=value]

Description

ccdgen creates or modified (2D) images by adding simple parameterized two-dimensional objects. For arbitrary expressions use ccdmath(1NEMO) instead.

An added feature is that the objects can be added as if they are in a "galactic" disk with given inclination and position angle. The default is a "face-on" view (inc=0). No corrections for brightness due to inclination are made however.

3D images are supported if size= contains a 3rd non-1 value.

Parameters

The following parameters are recognized in order; they may be given in any order if the keyword is also given. Use --help to confirm this man page is up to date.
out=
Output file, in standard image(5NEMO) format. No default.
object=
Object type. Valid are flat, exp, gauss, bar, spiral, noise, test, blobs. See below for an explanation and their parameters. Default: flat
spar=
Parameters for this object. The first parameter is often the peak value, and the second one a scale length. Some object have more complex geometries and require more parameters. The meaning of the peak value can be modified by setting totflux=t (see below). The defaults are defined per object, but are typically 1,1...
For certain objects, the multiple objects can be given, and the sequence of parameters can be repeated. Currently object=blobs has this option for 3D cubes.
size=
Mapsize. It is allowed to have a different size in X and Y.
cell=
Cellsize [1] *not used yet*
pa=
Position Angle of disk in which the object lives. Counted positive starting at North through East in the standard astronomical fashion. Default: 0
inc=
Inclination Angle of disk in which object lives. 0 is face on. Default: 0
totflux=t|f
If set to true, the amplitude (always the first parameter in spar) is interpreted as the total integrated intensity instead of the peak value of the object. Default: f.
factor=
The factor by which an image is multiplied before the object is added. Warning: if the amplitude (usually the first of the spar= numbers) is 0, this will not apply, and the output would equal the input. Default: 1
center=
Center of object (in 0-based pixel coordinates). The lower left corner is counted as (0,0) here. Default: mapcenter.
crpix=
Override/Set crpix (1,1,1)
crval=
Override/Set crval (0,0,0)
cdelt=
Override/Set cdelt (1,1,1)
seed=
Random seed [0]
headline=
Random verbiage added to the image. Default: none
in=
Input file (optional) to be added to the output file. Default: none, map is generated.

Object

The object= keyword allows for the following objects, and spar= for their parameters
OBJECT    -        SPAR
flat    A        A
exp    A.exp(-r/h)    A,h
gauss    A.exp(-r^2/(2h^2))    A,h
bar    A.exp(-r/h)    A,h,e,b   (e=1-minor/major   b=bar position angle w.r.t. disk)
noise    gaussian(m,s)    mean,sigma
spiral    A.exp(-r/h)    A,h,k,p,m,r0,p0
ferrers    A.(1-r^2)^p    A,h,e,b,p (h=size of bar, p=power to 1-r^2)
isothermal    A.(1+r^2)^p    A,h,p
test    x+10y+100z    -
blobs    A,x,y,z,size    they can be repeated for many blobs
maybe to be implemented:
j1x    J1(x)/x
comet    2d proj
jet    jet model w/ power law brightness
shell    2d proj of shell
poisson 
A few object that are in MIRIAD’s imgen(1MIRIAD) program and not listed here directly, can be simulated or replaced by:
level    same as our flat
cluster    same as isothermal, except we also allow p different from -0.5
noise    notice we have a mean, miriad doesn’t, also miriad has a crude low
approximation
point    use exp with a very small scale length h
gaussian    our gauss, but bmin/bmaj via inc
gauss3    no equivalent, ccdgen does not support 3D models yet
disk    use ferrers with p=0

Most of these objects have a peak or representative intensity value as the first argument, and a scale length as the second parameter. The next parameters are sometimes scale free

Bars have an additional axis ratio (we mostly use e=1-b/a here) and position angle of the bar w.r.t. the disk in the disk plane (see snaprotate(1NEMO) for an approach if you know the angle of the bar in the sky plane). A Ferrers bar also needs to know the power (usuall an integer) to which 1-r^2 is raised.

Spirals are yet more complex: A and h are the usual peak and exponential scale-length. k is the wavenumber (related to the pitch angle as tan(pitch) =1/(2.pi.k.r), see also mkspiral(1NEMO) ), p controls the relative width of the spiral (assumed to be cos^p(m*phi), r0 the starting radius of the spiral (defaults to 0), p0 the phase of the spiral at radius r0, and m the number of spiral arms. In particular, since the pow(3) function is used internally for non-integer values of p, the behavior of m for integer and non-integer values of p is different: for integer values our own internal powi(3NEMO) is used, and correctly represents. For example, for m=1 and p=1 you’ll get a one armed spiral, but with negative counter-arm. With p=2 it becomes a 2-armed spiral, as they will get progressively narrower as p remains even and gets higher. For odd values of p you will again have a positive and negative spiral, and as p gets larger, the arms get narrower. By making sure p becomes non-integer, e.g. p=2.0001, the negative arm becomes 0.

Examples

Here’s how to make a simple barred galaxy by adding an exponential disk and a (smaller) exponential bar:
ccdgen - object=exp spar=1,40 pa=60 inc=45 size=256 |\
 ccdgen in=- out=bar.ccd object=bar spar=10,6,0.5,70 pa=60 inc=45
or if you want them to be a bit more astronomical, you’ll need to make the units come out in degrees for the conversion to FITS, viz.:
ccdgen - object=exp spar=1,40/3600 pa=60 inc=45 size=256 cdelt=-1/3600,1/3600
|\
 ccdgen - object=bar spar=10,6/3600,0.5,70 pa=60 inc=45 in=- |\
 ccdfits - bar.fits radecvel=t
and the option to fill your cube with some random blobs and noise is a bit more involved:
nemoinp 1:100 |\
  tabmath - - ’ranu(0,1),ranu(10,100),ranu(10,100),ranu(10,100),ranu(0,5)’
all > b100.tab
ccdgen - blobs @b100.tab size=128,128,128 |\
  ccdgen - noise 0,0.02 in=- |\
  ccdsmooth - - 5   |\
  ccdsky - -  |\
  ccdfits - junk2.fits radecvel=t ndim=4
Here is an example of making a new data section (in this case just noise) by stealing the header from existing fits(5NEMO) file. In bash notation:
  fitshead NGC5194_91112.fits > tmp.fitshead
  nx=$(grep NAXIS1 tmp.fitshead|awk ’{print $3}’)
  ny=$(grep NAXIS2 tmp.fitshead|awk ’{print $3}’)
  nz=$(grep NAXIS3 tmp.fitshead|awk ’{print $3}’)
  ccdgen - object=noise spar=0,1 size=$nx,$ny,$nz |\
     ccdfits - noise.fits fitshead=NGC5194_91112.fits
  
A test cube234.fits with value x + 10y + 100z can be made as follows:
  ccdmath out=- fie=%x+10*%y+100*%z size=2,3,4 | ccdfits - cube234.fits

Caveats

Seting the WCS is not working well. There is cell=, there is crpix,cdelt,crval

See Also

ccdmath(1NEMO) , snaprotate(1NEMO) , image(5NEMO)

https://github.com/GalSim-developers/GalSim

imfit::makeimage

There are also good simulators in starlab and amuse

Files

src/image/trans

Author

Peter Teuben

Update History


4-Jan-05    V0.1 Created    PJT
6-jan-05    V0.7 added (many features and) factor=    PJT
8-jan-05    V0.8 add #arms parameter to spiral    PJT
31-jan-12    V0.9 added object=test    PJT
12-mar-2020    V1.0 added object=blobs        PJT
8-may-2022    V1.2 moved center= down the arg list     PJT
8-dec-2022    V2.0 moved in= down the arg list    PJT


Table of Contents