astro.fits
Class FitsStatistic

java.lang.Object
  extended by astro.fits.FitsStatistic

public class FitsStatistic
extends Object

Link between a fits (image) and the statistic package. Similar to IRAF imstat.


Nested Class Summary
static class FitsStatistic.Add
          Reads a list of input files, decompresses them sequentially if necessary, adds them as doubles, but saves them as floats.
static class FitsStatistic.AduMinMax
          Finds the location of the minimum and maximum.
static class FitsStatistic.AduSplit
          Tests the fits file on the command line, if its 9th bit (value 2^8=256) is always set in the third quadrant (index number 2).
static class FitsStatistic.Bias
          Does bias subtraction.
static class FitsStatistic.Bitstat
          Gets the bit-statistic for a 16-bit fits
static class FitsStatistic.CombinePixel
          From two dead/hot pixel maps, retain only pixel found in both.
static class FitsStatistic.Constant
          Multidimensional that returns one.
static class FitsStatistic.Coordinate
          Multidimensional that returns the x or y of the input vector.
static class FitsStatistic.Count
          Counts how many pixel have ADU below the given value.
static class FitsStatistic.DeadPixel
          Reads an input fits and marks all pixels above the below ADU value as dead pixels.
static class FitsStatistic.Flat
          Does flatfielding subtraction.
static class FitsStatistic.FlatSky
          Tries to re-establish the zero-point offset from the _f.fits files and put it into the corresponding _mos.fits.
static class FitsStatistic.HotPixel
          Reads an input fits and marks all pixels above the given ADU value (default 65535) as hot pixels.
static class FitsStatistic.Imstat
          IRAF imstat, without the akward extension modifier.
static class FitsStatistic.Line
          Outputs average and std-dev of the quadrants along with header card values of the fits file.
static class FitsStatistic.Mosaic
          Tries to re-establish the zero-point offset from the _f.fits files and put it into the corresponding _mos.fits.
static class FitsStatistic.Nomode
          Reads a fits file, does an independant sky reduction on all extension found and writes the final fits.
static class FitsStatistic.Normalize
          Does median normalization.
static class FitsStatistic.Nosky
          Reads a fits file, does an independant sky reduction on all extension found and writes the final fits.
static class FitsStatistic.RowMedian
          Prints the median of all rows in the specified fits image.
static class FitsStatistic.Scale
           
static class FitsStatistic.Square
          Multidimensional that returns the x or y of the input vector squared.
static class FitsStatistic.WeightMap
          From a dead and a hot pixel map, we derive a weight map, i.e.
static class FitsStatistic.XY
          Multidimensional that returns x times y
 
Field Summary
static String BIASAV
           
private static String BIASAVREM
           
static String BIASRMS
           
private static String BIASRMSREM
           
static String BIASSEM
           
private static String BIASSEMREM
           
static String FAVREJ
           
private static String FAVREJREM
           
static String FCOMBINE
           
private static String FCOMBINEREM
           
static String FLATAV
           
private static String FLATAVREM
           
static String FLATRMS
           
private static String FLATRMSREM
           
static String FLATSEM
           
private static String FLATSEMREM
           
static String FMAXREJ
           
private static String FMAXREJREM
           
static String FRMSMAX
           
private static String FRMSMAXREM
           
static String FXMAX
           
private static String FXMAXREM
           
static String FXRMS
           
private static String FXRMSREM
           
static String FYMAX
           
private static String FYMAXREM
           
static String FYRMS
           
private static String FYRMSREM
           
static String MMAV
           
private static String MMAVREM
           
static String MMCOMB
           
private static String MMCOMBREM
           
static String MMRMS
           
static String MMRMSMAX
           
private static String MMRMSMAXREM
           
private static String MMRMSREM
           
static String MMSEM
           
private static String MMSEMREM
           
static String MMXMAX
           
private static String MMXMAXREM
           
static String MMYMAX
           
private static String MMYMAXREM
           
static String RGAINMAX
           
private static String RGAINMAXREM
           
static String RGAINMIN
           
private static String RGAINMINREM
           
static String ROWGAIN
           
private static String ROWGAINREM
           
static String ROWMAX
           
private static String ROWMAXREM
           
static String ROWMIN
           
private static String ROWMINREM
           
static String ZAVREJ
           
private static String ZAVREJREM
           
static String ZCOMBINE
           
private static String ZCOMBINEREM
           
static String ZMAXREJ
           
private static String ZMAXREJREM
           
static String ZRMSMAX
           
private static String ZRMSMAXREM
           
static String ZXMAX
           
private static String ZXMAXREM
           
static String ZXRMS
           
private static String ZXRMSREM
           
static String ZYMAX
           
private static String ZYMAXREM
           
static String ZYRMS
           
private static String ZYRMSREM
           
 
Constructor Summary
FitsStatistic()
           
 
Method Summary
static Vector3D[] aduMinMax(nom.tam.fits.ImageHDU hdu)
          Returns location of minimum and maximum ADU value in the first and second index, respectively.
static SortedMap<Double,List<Point>> aduSort(nom.tam.fits.ImageHDU hdu)
          Sorts ADUs.
static nom.tam.fits.ImageHDU avSigClipCombine(List<nom.tam.fits.ImageHDU> flat, FitsStatistic.Scale mode, boolean combav, double siglo, double sighi, int keep, boolean useav, int nmax)
          Combines images with the avsigclip algorithm, which is suitable for photon-noise limited data (or no read-out noise data).
static Vector2D backgroundFrameMean(nom.tam.fits.ImageHDU hdu, Rectangle box, int thick)
          Background is mean of frame, RMS is standard deviation, no clipping.
static Vector2D backgroundFrameMedian(nom.tam.fits.ImageHDU hdu, Rectangle box, int thick)
          Background is mean of frame, RMS is standard deviation, no clipping.
static Vector2D backgroundMean(nom.tam.fits.ImageHDU hdu, Rectangle box)
          Background is mean of frame, RMS is standard deviation, no clipping.
static Vector2D backgroundMedian(nom.tam.fits.ImageHDU hdu, Rectangle box)
          Background is mean of frame, RMS is standard deviation, no clipping.
static Point2D brightestBlob(double[][] adu, Dimension blob, Vector1D swindle)
          We scan an input image for the brightest blob.
static Point2D brightestBlob(nom.tam.fits.ImageHDU src, Rectangle window, Dimension blob)
          We scan an input image for the brightest blob.
static Point2D brightestBlob(nom.tam.fits.ImageHDU src, Rectangle window, Dimension blob, Vector1D swindle)
          We scan an input image for the brightest blob.
static nom.tam.fits.Fits debias(nom.tam.fits.Fits raw, nom.tam.fits.Fits bias, int numext)
          Subtracts two fits from each other.
static nom.tam.fits.ImageData debias(nom.tam.fits.ImageHDU raw, nom.tam.fits.ImageHDU bias)
          Subtracts two fits from each other.
static List<VectorG> extractBackground(double[][] src, nom.tam.fits.ImageHDU sig, int nreject, double lofac, double hifac)
          We get all the sky-background pixel in the image hdu by searching for the mode and retaining all pixel +/- lofac and hifac around it in term of adu-sigmas.
static List<VectorG> extractBackground(nom.tam.fits.ImageHDU sky, nom.tam.fits.ImageHDU sig, int nreject, double lofac, double hifac)
          We get all the sky-background pixel in the image hdu by searching for the mode and retaining all pixel +/- lofac and hifac around it in term of adu-sigmas.
static nom.tam.fits.Fits flatten(nom.tam.fits.Fits raw, nom.tam.fits.Fits flat, int numext)
          Flatfields an image by dividing through the flatfield.
static nom.tam.fits.ImageData flatten(nom.tam.fits.ImageHDU raw, nom.tam.fits.ImageHDU flat)
          Subtracts two fits from each other.
static int[] get16BitOccurence(nom.tam.fits.ImageHDU hdu)
          If the image hdu is a 16-bit image, we return the number of occurancies a bit is set in all image data.
static Statistic getAduStatistic(double[][] hdu)
          Reads the entire pixel array in the HDU and return a statistic object.
static Statistic getAduStatistic(nom.tam.fits.Fits fits)
          Reads the first non-null image HDU in the fits file and returns the statistic to it
static Statistic getAduStatistic(nom.tam.fits.Fits fits, int skip)
          Skips the first non-null image HDU in the fits file and returns the statistic to the then next valid HDU.
static Statistic getAduStatistic(float[][] hdu)
          Reads the entire pixel array in the HDU and return a statistic object.
static Statistic getAduStatistic(nom.tam.fits.ImageHDU hdu)
          Reads the entire pixel array in the HDU and return a statistic object.
static Statistic getAduStatistic(nom.tam.fits.ImageHDU hdu, Rectangle box)
          Reads the stated pixel array in the HDU and return a statistic object.
static double[][] getAsArray(nom.tam.fits.ImageHDU src)
          Converts an image HDU to a double array, regardless of input type.
static double[][] getAsArray(nom.tam.fits.ImageHDU src, Rectangle window)
          Converts an image HDU to a double array, regardless of input type.
static float[][] getAsFloatArray(nom.tam.fits.ImageHDU src)
          Converts an image HDU to a float array, regardless of input type.
static float[][] getAsFloatArray(nom.tam.fits.ImageHDU src, Rectangle window)
          Converts an image HDU to a double array, regardless of input type.
static Statistic getBackgroundStatistic(nom.tam.fits.ImageHDU hdu, Rectangle active, int thick)
          Reads a frame for background statistics.
static Statistic getRowStatistic(double[][] hdu, int row)
          Reads the entire pixel array in the HDU and return a statistic object for the specified row.
static nom.tam.fits.Fits medianNormalize(nom.tam.fits.Fits raw, int numext)
          Flatfields an image by dividing through the flatfield.
static nom.tam.fits.ImageData medianNormalize(nom.tam.fits.ImageHDU raw)
          Subtracts two fits from each other.
private static nom.tam.fits.ImageData medianNormalize(nom.tam.fits.ImageHDU raw, Vector1D med)
           
static nom.tam.fits.ImageHDU minMaxCombine(List<nom.tam.fits.ImageHDU> dark, boolean dumphi, boolean dumplo)
          Combines images by rejecting just the maximum abd/or minimum of the combined ADUs.
static nom.tam.fits.ImageHDU removeMode(nom.tam.fits.ImageHDU sky, int n, double lofac, double hifac)
          Removes the mode of the image, can act as a simple version of background removal.
static nom.tam.fits.ImageHDU removeSky(nom.tam.fits.ImageHDU sky, Multidimensional[] model, int n, double lofac, double hifac)
          Models the background and removes it from the image.
private static float[][][] sanityCheck(List<nom.tam.fits.ImageHDU> bias)
          Takes a list of images and returns a three-dimensional double array, first index is the image number, then image column (y), followed by row data (x).
static GeneralLinearRegression shuffleForRegression(List<VectorG> valid, Multidimensional[] model, boolean sigma)
          Shuffels ADU 4-vectors with x, y, ADU, [sigma] into the format for a general linear regression and fuels them into one.
static nom.tam.fits.ImageHDU zeroCombine(List<nom.tam.fits.ImageHDU> bias, boolean combav, double rn, double gain)
          Takes a list of input image hdus and performs a zero-combination on these.
static nom.tam.fits.ImageHDU zeroCombine(List<nom.tam.fits.ImageHDU> bias, boolean combav, double rn, double gain, double siglo, double sighi, int keep, boolean useav, int nmax)
          Takes a list of input image hdus and performs a zero-combination on these.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FLATRMS

public static final String FLATRMS
See Also:
Constant Field Values

FLATSEM

public static final String FLATSEM
See Also:
Constant Field Values

FLATAV

public static final String FLATAV
See Also:
Constant Field Values

FCOMBINE

public static final String FCOMBINE
See Also:
Constant Field Values

FRMSMAX

public static final String FRMSMAX
See Also:
Constant Field Values

FXRMS

public static final String FXRMS
See Also:
Constant Field Values

FYRMS

public static final String FYRMS
See Also:
Constant Field Values

FMAXREJ

public static final String FMAXREJ
See Also:
Constant Field Values

FXMAX

public static final String FXMAX
See Also:
Constant Field Values

FYMAX

public static final String FYMAX
See Also:
Constant Field Values

FAVREJ

public static final String FAVREJ
See Also:
Constant Field Values

ROWGAIN

public static final String ROWGAIN
See Also:
Constant Field Values

RGAINMAX

public static final String RGAINMAX
See Also:
Constant Field Values

ROWMAX

public static final String ROWMAX
See Also:
Constant Field Values

RGAINMIN

public static final String RGAINMIN
See Also:
Constant Field Values

ROWMIN

public static final String ROWMIN
See Also:
Constant Field Values

MMRMS

public static final String MMRMS
See Also:
Constant Field Values

MMSEM

public static final String MMSEM
See Also:
Constant Field Values

MMAV

public static final String MMAV
See Also:
Constant Field Values

MMCOMB

public static final String MMCOMB
See Also:
Constant Field Values

MMRMSMAX

public static final String MMRMSMAX
See Also:
Constant Field Values

MMXMAX

public static final String MMXMAX
See Also:
Constant Field Values

MMYMAX

public static final String MMYMAX
See Also:
Constant Field Values

BIASRMS

public static final String BIASRMS
See Also:
Constant Field Values

BIASSEM

public static final String BIASSEM
See Also:
Constant Field Values

BIASAV

public static final String BIASAV
See Also:
Constant Field Values

ZRMSMAX

public static final String ZRMSMAX
See Also:
Constant Field Values

ZXRMS

public static final String ZXRMS
See Also:
Constant Field Values

ZYRMS

public static final String ZYRMS
See Also:
Constant Field Values

ZCOMBINE

public static final String ZCOMBINE
See Also:
Constant Field Values

ZMAXREJ

public static final String ZMAXREJ
See Also:
Constant Field Values

ZXMAX

public static final String ZXMAX
See Also:
Constant Field Values

ZYMAX

public static final String ZYMAX
See Also:
Constant Field Values

ZAVREJ

public static final String ZAVREJ
See Also:
Constant Field Values

FLATRMSREM

private static final String FLATRMSREM
See Also:
Constant Field Values

FLATSEMREM

private static final String FLATSEMREM
See Also:
Constant Field Values

FLATAVREM

private static final String FLATAVREM
See Also:
Constant Field Values

FRMSMAXREM

private static final String FRMSMAXREM
See Also:
Constant Field Values

FXRMSREM

private static final String FXRMSREM
See Also:
Constant Field Values

FYRMSREM

private static final String FYRMSREM
See Also:
Constant Field Values

FCOMBINEREM

private static final String FCOMBINEREM
See Also:
Constant Field Values

FMAXREJREM

private static final String FMAXREJREM
See Also:
Constant Field Values

FXMAXREM

private static final String FXMAXREM
See Also:
Constant Field Values

FYMAXREM

private static final String FYMAXREM
See Also:
Constant Field Values

FAVREJREM

private static final String FAVREJREM
See Also:
Constant Field Values

ROWGAINREM

private static final String ROWGAINREM
See Also:
Constant Field Values

RGAINMAXREM

private static final String RGAINMAXREM
See Also:
Constant Field Values

ROWMAXREM

private static final String ROWMAXREM
See Also:
Constant Field Values

RGAINMINREM

private static final String RGAINMINREM
See Also:
Constant Field Values

ROWMINREM

private static final String ROWMINREM
See Also:
Constant Field Values

MMRMSREM

private static final String MMRMSREM
See Also:
Constant Field Values

MMSEMREM

private static final String MMSEMREM
See Also:
Constant Field Values

MMAVREM

private static final String MMAVREM
See Also:
Constant Field Values

MMCOMBREM

private static final String MMCOMBREM
See Also:
Constant Field Values

MMRMSMAXREM

private static final String MMRMSMAXREM
See Also:
Constant Field Values

MMXMAXREM

private static final String MMXMAXREM
See Also:
Constant Field Values

MMYMAXREM

private static final String MMYMAXREM
See Also:
Constant Field Values

BIASRMSREM

private static final String BIASRMSREM
See Also:
Constant Field Values

BIASSEMREM

private static final String BIASSEMREM
See Also:
Constant Field Values

BIASAVREM

private static final String BIASAVREM
See Also:
Constant Field Values

ZRMSMAXREM

private static final String ZRMSMAXREM
See Also:
Constant Field Values

ZXRMSREM

private static final String ZXRMSREM
See Also:
Constant Field Values

ZYRMSREM

private static final String ZYRMSREM
See Also:
Constant Field Values

ZCOMBINEREM

private static final String ZCOMBINEREM
See Also:
Constant Field Values

ZMAXREJREM

private static final String ZMAXREJREM
See Also:
Constant Field Values

ZXMAXREM

private static final String ZXMAXREM
See Also:
Constant Field Values

ZYMAXREM

private static final String ZYMAXREM
See Also:
Constant Field Values

ZAVREJREM

private static final String ZAVREJREM
See Also:
Constant Field Values
Constructor Detail

FitsStatistic

public FitsStatistic()
Method Detail

medianNormalize

public static nom.tam.fits.Fits medianNormalize(nom.tam.fits.Fits raw,
                                                int numext)
                                         throws nom.tam.fits.FitsException,
                                                IOException
Flatfields an image by dividing through the flatfield. If multiple extensions are found, each extension is used. Flatfielding fails, if image sizes are different or if different extension numbers are found.

Throws:
nom.tam.fits.FitsException
IOException

medianNormalize

public static nom.tam.fits.ImageData medianNormalize(nom.tam.fits.ImageHDU raw)
                                              throws nom.tam.fits.FitsException
Subtracts two fits from each other. If multiple extensions are found, each extension is used. Subtraction fails, if image sizes are different or if different extension numbers are found.

Throws:
nom.tam.fits.FitsException

medianNormalize

private static nom.tam.fits.ImageData medianNormalize(nom.tam.fits.ImageHDU raw,
                                                      Vector1D med)
                                               throws nom.tam.fits.FitsException
Throws:
nom.tam.fits.FitsException

avSigClipCombine

public static nom.tam.fits.ImageHDU avSigClipCombine(List<nom.tam.fits.ImageHDU> flat,
                                                     FitsStatistic.Scale mode,
                                                     boolean combav,
                                                     double siglo,
                                                     double sighi,
                                                     int keep,
                                                     boolean useav,
                                                     int nmax)
                                              throws nom.tam.fits.FitsException
Combines images with the avsigclip algorithm, which is suitable for photon-noise limited data (or no read-out noise data). No sigma-adjustment is done with the scaling, so images should have comparable intensity levels. On calculating the statistic, no sampling is done, thus we might loose some performance.

Throws:
nom.tam.fits.FitsException

minMaxCombine

public static nom.tam.fits.ImageHDU minMaxCombine(List<nom.tam.fits.ImageHDU> dark,
                                                  boolean dumphi,
                                                  boolean dumplo)
                                           throws nom.tam.fits.FitsException
Combines images by rejecting just the maximum abd/or minimum of the combined ADUs.

Throws:
nom.tam.fits.FitsException

zeroCombine

public static nom.tam.fits.ImageHDU zeroCombine(List<nom.tam.fits.ImageHDU> bias,
                                                boolean combav,
                                                double rn,
                                                double gain)
                                         throws nom.tam.fits.FitsException
Takes a list of input image hdus and performs a zero-combination on these.

Throws:
nom.tam.fits.FitsException

zeroCombine

public static nom.tam.fits.ImageHDU zeroCombine(List<nom.tam.fits.ImageHDU> bias,
                                                boolean combav,
                                                double rn,
                                                double gain,
                                                double siglo,
                                                double sighi,
                                                int keep,
                                                boolean useav,
                                                int nmax)
                                         throws nom.tam.fits.FitsException
Takes a list of input image hdus and performs a zero-combination on these. The images should be overscan-corrected and clipped to the useful area. No header entries are retained. On return, an average RMS value is added to the returned header with the key.

Throws:
nom.tam.fits.FitsException

get16BitOccurence

public static int[] get16BitOccurence(nom.tam.fits.ImageHDU hdu)
                               throws nom.tam.fits.FitsException
If the image hdu is a 16-bit image, we return the number of occurancies a bit is set in all image data.

Throws:
nom.tam.fits.FitsException

sanityCheck

private static float[][][] sanityCheck(List<nom.tam.fits.ImageHDU> bias)
                                throws nom.tam.fits.FitsException
Takes a list of images and returns a three-dimensional double array, first index is the image number, then image column (y), followed by row data (x).

Returns:
null, if only a single image is found
Throws:
nom.tam.fits.FitsException - If list is null, empty or not all images have identical size.

getAduStatistic

public static Statistic getAduStatistic(nom.tam.fits.ImageHDU hdu,
                                        Rectangle box)
                                 throws nom.tam.fits.FitsException
Reads the stated pixel array in the HDU and return a statistic object. This can further be used for pixel rejection and/or histogram calculations.

Throws:
nom.tam.fits.FitsException

getAduStatistic

public static Statistic getAduStatistic(nom.tam.fits.ImageHDU hdu)
                                 throws nom.tam.fits.FitsException
Reads the entire pixel array in the HDU and return a statistic object. This can further be used for pixel rejection and/or histogram calculations.

Throws:
nom.tam.fits.FitsException

getBackgroundStatistic

public static Statistic getBackgroundStatistic(nom.tam.fits.ImageHDU hdu,
                                               Rectangle active,
                                               int thick)
                                        throws nom.tam.fits.FitsException
Reads a frame for background statistics.

Throws:
nom.tam.fits.FitsException

getAduStatistic

public static Statistic getAduStatistic(double[][] hdu)
                                 throws nom.tam.fits.FitsException
Reads the entire pixel array in the HDU and return a statistic object. This can further be used for pixel rejection and/or histogram calculations.

Throws:
nom.tam.fits.FitsException

getAduStatistic

public static Statistic getAduStatistic(float[][] hdu)
                                 throws nom.tam.fits.FitsException
Reads the entire pixel array in the HDU and return a statistic object. This can further be used for pixel rejection and/or histogram calculations.

Throws:
nom.tam.fits.FitsException

getRowStatistic

public static Statistic getRowStatistic(double[][] hdu,
                                        int row)
                                 throws nom.tam.fits.FitsException
Reads the entire pixel array in the HDU and return a statistic object for the specified row.

Throws:
nom.tam.fits.FitsException

getAduStatistic

public static Statistic getAduStatistic(nom.tam.fits.Fits fits)
                                 throws nom.tam.fits.FitsException,
                                        IOException
Reads the first non-null image HDU in the fits file and returns the statistic to it

Throws:
nom.tam.fits.FitsException
IOException

getAduStatistic

public static Statistic getAduStatistic(nom.tam.fits.Fits fits,
                                        int skip)
                                 throws nom.tam.fits.FitsException,
                                        IOException
Skips the first non-null image HDU in the fits file and returns the statistic to the then next valid HDU.

Throws:
nom.tam.fits.FitsException
IOException

getAsArray

public static final double[][] getAsArray(nom.tam.fits.ImageHDU src)
                                   throws nom.tam.fits.FitsException
Converts an image HDU to a double array, regardless of input type. Does value BSCALE and BZERO.

Returns:
An array with y as the inner index, x as outer (see fits def)
Throws:
nom.tam.fits.FitsException

getAsArray

public static final double[][] getAsArray(nom.tam.fits.ImageHDU src,
                                          Rectangle window)
                                   throws nom.tam.fits.FitsException
Converts an image HDU to a double array, regardless of input type. Does value BSCALE and BZERO.

Throws:
nom.tam.fits.FitsException

brightestBlob

public static Point2D brightestBlob(nom.tam.fits.ImageHDU src,
                                    Rectangle window,
                                    Dimension blob)
                             throws nom.tam.fits.FitsException
We scan an input image for the brightest blob. This is the position of the brightest (=highest ADU sum) sub-rectangle of dimension blob, using the center position.

Throws:
nom.tam.fits.FitsException

brightestBlob

public static Point2D brightestBlob(nom.tam.fits.ImageHDU src,
                                    Rectangle window,
                                    Dimension blob,
                                    Vector1D swindle)
                             throws nom.tam.fits.FitsException
We scan an input image for the brightest blob. This is the position of the brightest (=highest ADU sum) sub-rectangle of dimension blob, using the center position. If the Vector1D is non-null, the value of the blob is set within.

Throws:
nom.tam.fits.FitsException

backgroundMean

public static Vector2D backgroundMean(nom.tam.fits.ImageHDU hdu,
                                      Rectangle box)
                               throws nom.tam.fits.FitsException
Background is mean of frame, RMS is standard deviation, no clipping.

Throws:
nom.tam.fits.FitsException

backgroundMedian

public static Vector2D backgroundMedian(nom.tam.fits.ImageHDU hdu,
                                        Rectangle box)
                                 throws nom.tam.fits.FitsException
Background is mean of frame, RMS is standard deviation, no clipping.

Throws:
nom.tam.fits.FitsException

backgroundFrameMean

public static Vector2D backgroundFrameMean(nom.tam.fits.ImageHDU hdu,
                                           Rectangle box,
                                           int thick)
                                    throws nom.tam.fits.FitsException
Background is mean of frame, RMS is standard deviation, no clipping.

Throws:
nom.tam.fits.FitsException

backgroundFrameMedian

public static Vector2D backgroundFrameMedian(nom.tam.fits.ImageHDU hdu,
                                             Rectangle box,
                                             int thick)
                                      throws nom.tam.fits.FitsException
Background is mean of frame, RMS is standard deviation, no clipping.

Throws:
nom.tam.fits.FitsException

brightestBlob

public static Point2D brightestBlob(double[][] adu,
                                    Dimension blob,
                                    Vector1D swindle)
We scan an input image for the brightest blob. This is the position of the brightest (=highest ADU sum) sub-rectangle of dimension blob, using the center position.


getAsFloatArray

public static final float[][] getAsFloatArray(nom.tam.fits.ImageHDU src)
                                       throws nom.tam.fits.FitsException
Converts an image HDU to a float array, regardless of input type. Does value BSCALE and BZERO.

Throws:
nom.tam.fits.FitsException

getAsFloatArray

public static final float[][] getAsFloatArray(nom.tam.fits.ImageHDU src,
                                              Rectangle window)
                                       throws nom.tam.fits.FitsException
Converts an image HDU to a double array, regardless of input type. Does value BSCALE and BZERO.

Throws:
nom.tam.fits.FitsException

aduSort

public static SortedMap<Double,List<Point>> aduSort(nom.tam.fits.ImageHDU hdu)
                                             throws nom.tam.fits.FitsException
Sorts ADUs. Returns a mapping of adu values to pixel positions.

Throws:
nom.tam.fits.FitsException

aduMinMax

public static Vector3D[] aduMinMax(nom.tam.fits.ImageHDU hdu)
                            throws nom.tam.fits.FitsException
Returns location of minimum and maximum ADU value in the first and second index, respectively. Return value has in z-component the ADU value

Throws:
nom.tam.fits.FitsException

extractBackground

public static List<VectorG> extractBackground(nom.tam.fits.ImageHDU sky,
                                              nom.tam.fits.ImageHDU sig,
                                              int nreject,
                                              double lofac,
                                              double hifac)
                                       throws nom.tam.fits.FitsException
We get all the sky-background pixel in the image hdu by searching for the mode and retaining all pixel +/- lofac and hifac around it in term of adu-sigmas.

Throws:
nom.tam.fits.FitsException

extractBackground

public static List<VectorG> extractBackground(double[][] src,
                                              nom.tam.fits.ImageHDU sig,
                                              int nreject,
                                              double lofac,
                                              double hifac)
                                       throws nom.tam.fits.FitsException
We get all the sky-background pixel in the image hdu by searching for the mode and retaining all pixel +/- lofac and hifac around it in term of adu-sigmas.

Throws:
nom.tam.fits.FitsException

removeMode

public static nom.tam.fits.ImageHDU removeMode(nom.tam.fits.ImageHDU sky,
                                               int n,
                                               double lofac,
                                               double hifac)
                                        throws nom.tam.fits.FitsException
Removes the mode of the image, can act as a simple version of background removal.

Throws:
nom.tam.fits.FitsException

shuffleForRegression

public static GeneralLinearRegression shuffleForRegression(List<VectorG> valid,
                                                           Multidimensional[] model,
                                                           boolean sigma)
Shuffels ADU 4-vectors with x, y, ADU, [sigma] into the format for a general linear regression and fuels them into one.


removeSky

public static nom.tam.fits.ImageHDU removeSky(nom.tam.fits.ImageHDU sky,
                                              Multidimensional[] model,
                                              int n,
                                              double lofac,
                                              double hifac)
                                       throws nom.tam.fits.FitsException
Models the background and removes it from the image.

Throws:
nom.tam.fits.FitsException

flatten

public static nom.tam.fits.Fits flatten(nom.tam.fits.Fits raw,
                                        nom.tam.fits.Fits flat,
                                        int numext)
                                 throws nom.tam.fits.FitsException,
                                        IOException
Flatfields an image by dividing through the flatfield. If multiple extensions are found, each extension is used. Flatfielding fails, if image sizes are different or if different extension numbers are found.

Throws:
nom.tam.fits.FitsException
IOException

flatten

public static nom.tam.fits.ImageData flatten(nom.tam.fits.ImageHDU raw,
                                             nom.tam.fits.ImageHDU flat)
                                      throws nom.tam.fits.FitsException
Subtracts two fits from each other. If multiple extensions are found, each extension is used. Subtraction fails, if image sizes are different or if different extension numbers are found.

Throws:
nom.tam.fits.FitsException

debias

public static nom.tam.fits.Fits debias(nom.tam.fits.Fits raw,
                                       nom.tam.fits.Fits bias,
                                       int numext)
                                throws nom.tam.fits.FitsException,
                                       IOException
Subtracts two fits from each other. If multiple extensions are found, each extension is used. Subtraction fails, if image sizes are different or if different extension numbers are found.

Throws:
nom.tam.fits.FitsException
IOException

debias

public static nom.tam.fits.ImageData debias(nom.tam.fits.ImageHDU raw,
                                            nom.tam.fits.ImageHDU bias)
                                     throws nom.tam.fits.FitsException
Subtracts two fits from each other. If multiple extensions are found, each extension is used. Subtraction fails, if image sizes are different or if different extension numbers are found.

Throws:
nom.tam.fits.FitsException