This HTML automatically generated with rman for NEMO
Table of Contents

Name

ccdblob - properties of a blob in an image

Synopsis

ccdblob [parameter=value]

Description

ccdblob is a poor man’s source extractor and computes some properties of a blob ("star") in an image. With given rough pixel coordinates and a box size, it will determine the peak, shape and flux of the blob, assuming the background signal (box needs to be big enough for this) is well characterised by the median value. This current algorithm thus does not work in crowded fields.

Selection of the pixels involved in the fitting is via two keywords: box= and clip=. Apart from visual inspection, a good strategy could be to clip at a fraction of (datamax-datamin)

See also ccdshape(1NEMO) from which this program was derived.

Pixel coordinates are 0-based.

Parameters

The following parameters are recognized in any order if the keyword is also given:
in=
Input image(5NEMO) file.
No default.
pos=x,y
(x,y) center of the box. Positions are 0-based integers With the special value pos=max the location of the maximum in the image is used.
Default is center of image.
box=size
Box size (in pixels) to use around pos. It is best to choose something odd, for an even box size, the center pixel will be in the upper-right quadrant. gi
Default: 7.
clip=
Use only values above clip from the selected area.
Default will use all values within the box.
wcs=t|f
Use WCS of the cube (otherwise use pixel coordinates 1..N).
radecvel=t|f
Split the RA/DEC from VEL
[f]
weight=t|f
Weigh moments of inertia by intensity?
[t]
cross=
Use cross correlations between X and Y to...
scale=
Scale factor to be applied to output radii. A common value is 3600 if the input units are degrees.
Default: 1
out=
Optional output file. If given, the pixel coordinates and intensities are written out, for programs such as tabnlllsqfit(1NEMO) to fit models.

Examples

An example of creating a gaussian blob with a given Signal/Noise (sn=) and running it through ccdblob:

sn=100 ccdgen - gauss 1,3 127,127 |\ ccdgen - noise 0,1/$sn in=- seed=123 |\
ccdblob -

Npoints: 49 Box: 7 DataMinMax: 0.345445 1.00188 Min at: 60 66 (0 based) Max at: 63 63 Mean: 0.6649 Median: 1.00188 DataSum: 32.5801 Flux: -16.5122 ImSize: 127 127 1 Center: 0.000935206 -0.00434081 0 [wcs] BLOB: 63 63 0.000935206 -0.00434081 7 1.00188 1.00188 -16.5122 e_x: 1.00000 0.70711 0.70711 0.00000 90.0 45.0
e_y: 1.00000 -0.70711 0.70711 0.00000 90.0 135.0
e_z: 1.00000 0.00000 0.00000 1.00000 0.0 0.0
qpole: 7941.36475 0.70711 0.70711 0.00000
: 3.35181 0.70711 -0.70711 0.00000
: 0.00000 0.00000 0.00000 1.00000
a,b: 89.1143 1.83079 inc: 88.8228 (meaningless without radecvel) pa: 135 (meaningless without radecvel)

The same example as before, but now feeding a table with 37 points to a 2d gaussfit. These fits are often very dependant on the initial guess, but it does a pretty good job here:

ns=100 ccdgen - gauss 1,3 127,127 |\ ccdgen - noise 0,1/$sn in=- seed=123 |\
ccdblob - clip=0.5 out=gauss.tab
tabnllsqfit gauss.tab 1,2 3 fit=gauss2d par=1,2,64,64,2

nrt=16 Fitting a+b*exp(-[(x-c)^2+(y-d)^2]/(2*e^2)): a= -0.076949 0.126768 b= 1.07709 0.123398 c= 63.0009 0.0110594 d= 62.9887 0.011061 e= 3.15046 0.244319 npt= 37 rms= 0.00801193 rms2/chi2= 0.00237507 rms/chi = 1

tabnllsqfit gauss.tab 1,2 3 fit=peak2d par=1,-1,-1,63,63 Fitting : y = a+b*(x-d)**2+*c*(y-e)**2: a= 0.977191 0.00428134 b= -0.0414872 0.000758877 c= -0.0408268 0.000758877 d= 63.0008 0.0148635 e= 62.9876 0.0151057 FWZP= 0.206048 0.204401 npt= 37 rms= 0.0119193 rms2/chi2= 0.00525659 rms/chi = 1

See Also

ccdshape(1NEMO) , ccdstat(1NEMO) , ccdcross(1NEMO) , image(5NEMO)
https://github.com/perwin/imfit

Files

src/image/misc/ccdblob.c

Author

Peter Teuben

History


15-feb-2020    V0.1 Created    PJT
14-feb-2025    V0.3 fix boxsize when no pos given    PJT
30-may-2025    V0.5 allow pos=max    PJT
7-jun-2025    V0.8 WCS fixes,and use 0-based pixels    PJT


Table of Contents