kombine¶
kombine combines astrometrically calibrated frames into one image: a deep
stack of a series, a mosaic of several fields, or one frame resampled onto a
new grid.
Each frame is reprojected through its own WCS onto the output grid and the frames are averaged pixel by pixel. By default the average is a mean clipped by the noise model of the frames, so cosmic rays, hot pixels and satellite trails are rejected. The stored image is N × the mean of N frames, which for equal exposures is simply their sum. The background of each frame is subtracted first.
Usage¶
munipack kombine [options] file(s)
The inputs must be 2-D frames with a WCS, for example from astrometry. Frames without one are skipped with an error message and the rest are still combined. If you want to do photometry on the result, calibrate the inputs with phcorr first.
Options¶
Any grid parameter you leave out is taken from the first input frame. Options listed as a pair work only when both are given.
Output grid¶
Option |
Argument |
Default |
Description |
|---|---|---|---|
|
code |
first frame’s (usually |
WCS projection code, e.g. |
|
integer [pix] |
first frame’s size |
Size of the output. Give both. |
|
real [pix] |
centre of the output |
Pixel where the projection centre falls. Give both. |
|
real [deg] |
centre of the first frame |
RA and Dec of the projection centre. Give both. |
|
real [pix/deg] |
first frame’s scale |
Output scale; 3600 means 1″ per pixel. |
|
real [deg] |
first frame’s rotation |
Position angle; |
|
|
first frame’s |
Mirror the output or not. |
Moving targets¶
Option |
Argument |
Default |
Description |
|---|---|---|---|
|
real [deg/day] |
0, 0 |
Motion of the target, so that it stays sharp and the stars trail. Give both. |
|
real [JD] |
mid-exposure of the first frame |
Time at which the target position is taken. |
Resampling and averaging¶
Option |
Argument |
Default |
Description |
|---|---|---|---|
|
|
|
Interpolation method, see Resampling. |
|
— |
off |
Conserve the total flux of objects instead of surface brightness. |
|
— |
off |
Keep the background instead of subtracting it. |
|
— |
off |
Plain exposure-weighted mean: no rejection, much less memory. |
|
— |
off |
The older Hampel robust mean, for reproducing old results. |
Output and general¶
Option |
Argument |
Default |
Description |
|---|---|---|---|
|
file |
|
Output file (overwritten if it exists). |
|
|
|
Data type of the output. |
|
— |
off |
Print a summary of the output and warnings. |
|
— |
— |
Show the help and exit. |
Warning
Keep the default -B -32. With an integer BITPIX the error planes of the
output often do not fit, and kombine then stops without writing anything.
Resampling¶
near(the default) is the fastest and keeps output pixels independent, but undersampled frames may look a little blocky.bilinearandbicubicgive smoother images;bi3convis meant for strongly undersampled frames. They can leave faint fringes on the background where frames overlap.
Interpolation mixes neighbouring pixels, so the output noise is correlated: per-pixel errors underestimate the noise in an aperture. There is no drizzle-style resampling, so avoid strong downsampling.
By default the output preserves surface brightness: the sky per pixel stays
the same, while star fluxes change with the pixel area. Halving the scale
(2″ pixels instead of 1″) makes star fluxes four times smaller. Use
--flux-conserve when you need total fluxes for photometry.
Output¶
One FITS file with three HDUs:
primary: the combined image (the sum for equal exposures), with the WCS of the output grid, the total
EXPTIME, the earliestDATE-OBS, andFILTERandOBJECTfrom the first frame.STDERR: the standard error of the image, on the same scale; NaN where only one frame covers a pixel.
MAXDEV: the largest deviation of each pixel’s values from the mean, in units of σ; handy for spotting outliers. Not written with
--arith.
Examples¶
Stack a series onto the grid of the first frame:
munipack kombine -o stack.fits frame_*.fits
Build a 1000 × 1000 mosaic at 2″/pixel, north up, keeping total fluxes and the sky for photometry:
munipack kombine --rcen 201.365 --dcen -43.019 --width 1000 --height 1000 \
--scale 1800 --angle 0 --reflex no --flux-conserve --disable-back \
-i bilinear -o mosaic.fits field_*.fits
Follow a comet moving 0.4°/day in RA and −0.01°/day in Dec:
munipack kombine --pm-ra 0.4 --pm-dec -0.01 -o comet.fits comet_*.fits
Notes¶
The default and
--hampelkeep every reprojected frame in memory (about 400 MB for 100 frames of 1000 × 1000 pixels). For very large sets of frames already free of cosmic rays, use--arith. The two options cannot be combined.The clipped mean reads
GAIN,READNS(orRDNOISE) andBIASLEVfrom each frame. WithoutGAINit relies on the scatter of the values only.The RA rate of
--pm-rais the rate of the coordinate itself, not multiplied by cos δ.To find the scale of a frame, read its CD matrix (
munipack fits -K CD1_1,CD1_2 frame.fits); the scale in pix/deg is 1/√(CD1_1² + CD1_2²).To make a colour image, resample each band with
kombineonto the same grid and pass the results to colouring.