public class FitsReduction extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
FitsReduction.Write |
| Modifier and Type | Field and Description |
|---|---|
private static String |
FILTER |
private static String |
RASTER |
| Constructor and Description |
|---|
FitsReduction() |
| Modifier and Type | Method and Description |
|---|---|
static ArrayLayout |
checkLayout(MImageHDU calib,
ArrayLayout against) |
static float[] |
gauss(MImageHDU hdu,
double fwhm,
double trunc)
Uses java image libraries for a fast truncated Gauss convolution
filtering.
|
static Pair<StarDetection,Double> |
getClosestToPosition(Point2D at,
List<StarDetection> raw,
double maxdist)
Scans for a
StarDetection around the requested position. |
static List<StarDetection> |
getDetections(MImageHDU reduced,
float[] trg,
int datamin,
int datamax,
int searchbox,
int thick,
int skyframe,
double threshold,
float[] xst,
float[] yst)
Tries to detect stars in a reduced image.
|
private static float[] |
getFrame(float[] adu,
ArrayLayout layout,
int xlf,
int yup,
int wdt,
int hgt,
int tck) |
static List<StarDetection> |
getNeighbours(Point2D at,
List<StarDetection> all,
double pixdist)
Returns all detections within a certain pixel distance to a stated point.
|
static float[] |
read(MImageHDU calib) |
static MImageHDU |
reduce(MImageHDU raw,
double exptime,
MImageHDU bias,
MImageHDU dark,
MImageHDU flat)
/**
From a raw image we do basic reduction steps by subtracting the bias,
scaling the dark to the exposure time and also subtracting it from the
raw image and finally flat-fielding.
|
static float[] |
reduceFloat(MImageHDU raw,
double exptime,
MImageHDU bias,
MImageHDU dark,
MImageHDU flat)
From a raw image we do basic reduction steps by subtracting the bias,
scaling the dark to the exposure time and also subtracting it from the
raw image and finally flat-fielding.
|
private static float[] |
stripesM(MImageHDU hdu,
double fwhm,
double trunc,
boolean xdir) |
static float[] |
xstripesM(MImageHDU reduced,
double fwhm,
double tr)
Convolution with a x-boxed Gaussian, thus a gaussian in x and on/off in
y.
|
static float[] |
ystripesM(MImageHDU reduced,
double fwhm,
double tr)
Convolution with a y-boxed Gaussian, thus on/off in x and a gaussian in
y.
|
private static final String FILTER
private static final String RASTER
public static MImageHDU reduce(MImageHDU raw, double exptime, MImageHDU bias, MImageHDU dark, MImageHDU flat) throws BasicFitsException
raw - Raw image dataexptime - Exposure time of the frame in secondsbias - Bias of the camera or nulldark - Dark current of the camera, i.e. normalized to 1 sec exposure or
nullflat - Flat-fielding normalization or nullBasicFitsExceptionpublic static ArrayLayout checkLayout(MImageHDU calib, ArrayLayout against)
public static float[] read(MImageHDU calib)
public static float[] reduceFloat(MImageHDU raw, double exptime, MImageHDU bias, MImageHDU dark, MImageHDU flat) throws BasicFitsException
raw - Raw image dataexptime - Exposure time of the frame in secondsbias - Bias/Null of the cameradark - Dark/Null current of the camera, i.e. normalized to 1 sec exposureflat - Flat-fielding normalization/NullBasicFitsExceptionpublic static float[] gauss(MImageHDU hdu, double fwhm, double trunc) throws BasicFitsException
hdu - The (reduced) imagefwhm - pixel-fwhm of the Gaussian convolution.trunc - The truncation radius in FWHM.BasicFitsExceptionFitsExceptionpublic static float[] xstripesM(MImageHDU reduced, double fwhm, double tr) throws BasicFitsException
reduced - fwhm - pixel-fwhm of the Gaussian convolution.tr - The truncation radius in FWHM.FitsExceptionBasicFitsExceptionpublic static float[] ystripesM(MImageHDU reduced, double fwhm, double tr) throws BasicFitsException
reduced - fwhm - pixel-fwhm of the Gaussian convolution.tr - The truncation radius in FWHM.FitsExceptionBasicFitsExceptionprivate static float[] stripesM(MImageHDU hdu, double fwhm, double trunc, boolean xdir) throws BasicFitsException
BasicFitsExceptionpublic static List<StarDetection> getDetections(MImageHDU reduced, float[] trg, int datamin, int datamax, int searchbox, int thick, int skyframe, double threshold, float[] xst, float[] yst) throws BasicFitsException
reduced - The bias-subtracted, dark corrected and flat-fielded imagegauss - The array of a truncated Gaussian filtered imagedatamin - Minimum ADU to account for a star signal.datamax - Maximum ADU to account for a star signal.searchbox - All detected pixel within this box belong to a star. If too small,
a star might show up as two detections. If too big, binaries may
show up only as a single detection.thick - Edge region with artifacts from Gauss convolution, pixel.skyframe - Thickness around searchbox for background determinationthreshold - Signal is higher than this times background σ.xstripes - Readout stripes in x-direction (rectangular Gaussian)ystripes - Readout stripes in y-direction (rectangular Gaussian)BasicFitsExceptionprivate static float[] getFrame(float[] adu,
ArrayLayout layout,
int xlf,
int yup,
int wdt,
int hgt,
int tck)
throws BasicFitsException
BasicFitsExceptionpublic static Pair<StarDetection,Double> getClosestToPosition(Point2D at, List<StarDetection> raw, double maxdist)
StarDetection around the requested position. Returns
the closest object plus distance or null if no object is within reach.
Position refers to possible binned and windowed read-out, i.e., as
extracted by #getDetectedStars.at - Search closest to this position as extracted from CCD window.raw - The list of stars detected.maxdist - Maximum pixel distance. Return any if zero or negative.public static List<StarDetection> getNeighbours(Point2D at, List<StarDetection> all, double pixdist)
at - Search closest to this position as extracted from CCD window.all - All stars detected in frame.pixdist - Maximum pixel distance to be considered a neighbour