This HTML automatically generated with rman for NEMO
Table of Contents

Name

ccdstat - statistics (1st through 4th moment) and chi2

Synopsis

ccdstat in=image [parameter=value]

Description

ccdstat calculates all moments (up to fourth order) of the values in an image/cube, and calculate some human understandable numbers (mean, dispersion, skewness, curtosis) from them. It can optionally use a weighting map, in case the map needs to be weighted per pixel.

Optionally, if the map contains an error normalized difference between an observation and model, it can also compute a chi2 goodness of fit if the number of of fitting parameters is given (npar, must be > 0 to trigger this option), as well as the number of independant points per beam (nppb):

    chi2 = sum_{i,j}(map(i,j)^2)/nppb/(N/nppb-npar)
where N is the number of non-bad values in the map. The input map is now assumed to contain a dimensionless (obs-mod)/sigma

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.
in=in-file
input file, in Image(5) format [no default]
min=min_value
If given, all values below this value are ignored in the statistics. By default no lower limit is used.
max=max_value
If given, all values above this value are ignored in the statistics. By default no upper limit is used.
bad=bad_value
If given, all values identical to this value are ignored in the statistics. Note that, apart for bad=0, it is dangerous to use equating to a real value as a masking operating.
win=weight-file
optional input file, in Image(5) format, of which the mapvalues are used as a relative weight factor. Should be all positive, with 0 meaning no weight. [no default]
npar=
Number of fitting parameters. If given > 0, this will trigger the computation of chi2 goodness of fit, instead of the normal statistics.
nppb=
Number of (independant) points per beam. Only used in the computation for chi2, and
median=t|f
Optional display of the median value
torben=t|f
Use the torben method to compute the median. [Default: f]
robust=t|f
Conmpute robust mean, median and dispersion. [Default: f]
sratio=t|f
Conmpute signed flux ratio (FP-FN)/(FP+FN).. [Default: f]
mmcount=t|f
Count occurances of min and max
maxpos=t|f
Report the location where the max occured. [Default: f]
half=f|t
Only use half (negative) values and symmetrize them
maxmom=
Maximum moments it should compute. The current maximum is 4, moments up through the kurtosis are computed. For maxmom<0 no work is done, except for reading the file, which can be used to benchmark your disk I/O for large NEMO images. [Default: 4].
ignore=t|f
This will ignore the cell width when summing emission for any axis that has only one cell (assumed infinity, or a result of ccdmom(1NEMO) ). Setting this to false, will not ignore that cell width. [Default : t]
sort=t|f
Sorting routine (not activated yet) Flux not implemented yet. [ Default: f]
planes=-1|0|start:end:step
Either the whole cube is taken as one (-1, the default), or planes can be selected. 0 means all planes, if a start:end:step is selected, only those planes are. Step defaults to 1. Default: -1
tab=
If a table output filename is given, data values are written here. otherwise on screen.
qac=t|f
If selected, a QAC listing is selected. This gives the mean, rms, min, max, etc. See qac_stats(5NEMO) for more info. [Default: f]
label=
Descriptive label for QAC output. Normally the filename is used, but for awkward long or short (a pipe) filenames this can be useful. Default: in_file

Example


  % ccdstat image.ccd min=-2
Min=-1.879409  Max=2.265516
Number of points     : 95
Mean and dispersion  : 0.097891 0.956030
Skewness and kurtosis: -0.059936 -0.654776
5/100 out-of-range points discarded
Here is an example how to created a weight file which is a circular annulus:
  % ccdmath out=map1 "fie=iflt(%r,50,1,0)" size=200,200 crpix=100,100
  % ccdmath out=map2 "fie=iflt(%r,20,1,0)" size=200,200 crpix=100,100
  % ccdmath map1,map2 map3 %1-%2
Here is an two masking example: firstignoring the exact value of 0, followed by an example of a small range around 0:
  % ccdstat map1 bad=0
  % ccdmath map1 - ’iflt(abs(%1),0.001,0,%1)’ | ccdstat - bad=0
Here is an example of calculating the chi2 goodness of fit for a gaussian distribution:
  % ccdmath "" - "rang(0,1)" | ccdstat - npar=1    
Generating a map from scratch
chi2= 1.03431
df= 98

See Also

snapccd(1NEMO) , image(5NEMO) , qac_stats(5NEMO)

Author

Peter Teuben

Files


src/image/misc    ccdstat.c

Update History


 4-Oct-88    V1.0: Created        PJT
9-may-03    V1.3: added bad=    PJT
5-jun-03    V1.4: added win=    PJT
14-nov-04    V1.5: added the chi2 trigger with npar= and nppb=    PJT
24-may-06    V1.8: added mmcount    PJT
15-oct-11    V1.10: added maxmom= and bench options    PJT
14-feb-13    V2.0:  ignore=t to properly handle units    PJT
4-dec-2020    V3.8: added qac=    PJT
1-dec-2022    V3.12: added sratio=    PJT


Table of Contents