Table of Contents

**ccdstat
in=**image [parameter=value]

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

**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*

% 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 discardedHere 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-%2Here 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=0Here is an example of calculating the chi2 goodness of fit for a gaussian distribution:

% ccdmath "" - "rang(0,1)" | ccdstat - npar=1Generating a map from scratch chi2= 1.03431 df= 98

src/image/miscccdstat.c

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