|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectutil.PropertyContainer
util.PropertyResources
util.PropertyBundles
astro.fits.CrosstalkDark
public class CrosstalkDark
Small class to prepare the WiFSIP crosstalk measures for further processing.
This starts with two dark frames taken between the crosstalk frames.
These dark frames are already averaged and split into single-extension
fits files, known to this class as the two arrays
#DARK1 and #DARK2. We then take a measurement file
(an out-of-focus image of Regulus spanning most of a single amplifier
quadrant). From the sky estimate (either mode, median, or average of the
image), we scale the two dark (α, β)
such that we match this sky estimate, e.g.
for amplifier 0 we have dark1-mode=2263, dark2-mod=3743. For reg_2amp,
all of them taken just before DARK1 and way before dark 2, we get a sky
estimate that is lower than 2263, thus we get negative β and an
α > 1 (BC: α+β=1), for reg_1 and reg_3 accordingly
0< α,β< 1 and for reg4, taken after both darks, we expect
β > 1 and α < 0.
| Nested Class Summary | |
|---|---|
static class |
CrosstalkDark.Scale
The known possible scaling values. |
static class |
CrosstalkDark.Scalings
Reads properties - normally none are sufficient - and prints the scaling factors for each quadrant and file for sanity checks. |
static class |
CrosstalkDark.Subtract
Creates dark-subtracted fits from the input list by scaling the two master darks to match the background estimate. |
| Nested classes/interfaces inherited from class util.PropertyResources |
|---|
PropertyResources.URLResource |
| Field Summary | |
|---|---|
private List<nom.tam.fits.ImageHDU> |
dark1
The list of early dark HDU, one per amplifier section. |
private List<nom.tam.fits.ImageHDU> |
dark2
The list of late dark HDU, one per amplifier section. |
private static String |
DEFDARK1
The default list of early dark images. |
private static String |
DEFDARK2
The default list of late dark images. |
private static String |
DEFFITS
The default list of fits files. |
private static String |
DEFILLU
The default list of illuminated quadrants. |
private static double |
DEFLOWER
The default upper bound for reject, times sigma. |
private static int |
DEFREJECT
The default number of maximum rejection loops. |
private static String |
DEFSCALE
The default scaling algorithm. |
private static double |
DEFUPPER
The default upper bound for reject, times sigma. |
private Map<File,Integer> |
illu
For each file the quadrant index with the illuminated section. |
static String |
KEY_DARK1
The list of early dark images, one per amplifier. |
static String |
KEY_DARK2
The list of late dark images, one per amplifier. |
static String |
KEY_FITS
The list of images in the order they are processed. |
static String |
KEY_ILLU
The amplifier index in alpha beta where the illuminated image is. |
static String |
KEY_LOWER
The lower bound for reject (remove all at least xsigma below av.) |
static String |
KEY_REJECT
The default number of iterative rejection steps. |
static String |
KEY_SCALE
The scaling item: AVERGAE, MODE or median. |
static String |
KEY_UPPER
The upper bound for reject (remove all at least xsigma above av.) |
private VectorG |
scale1
The 4Vector of scaling values in the early darks. |
private VectorG |
scale2
The 4Vector of scaling values in the early darks. |
| Fields inherited from class util.PropertyBundles |
|---|
KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_RESOURCEBUNDLES |
| Fields inherited from class util.PropertyResources |
|---|
KEY_NOINITONCREATE, localurl, locate, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_URL, urlset |
| Fields inherited from class util.PropertyContainer |
|---|
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR |
| Fields inherited from interface util.ResourceSupplying |
|---|
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME |
| Fields inherited from interface util.PropertySupplying |
|---|
CONFIG, KEY_CLASS |
| Constructor Summary | |
|---|---|
CrosstalkDark(Map<String,String> prop)
Constructs and defaults a new crosstalk-dark fitter. |
|
| Method Summary | |
|---|---|
private static double |
averageIndex(VectorG v,
int i0)
Takes the statistical mean over all indices in the vector except the one stated in i0. |
void |
darkCorrectAll()
Does a scaling on all crosstalk fits to remove the dark background. |
private VectorG[] |
getAlphBeta(File amp)
For a fits file, read its scaling factors and return the alpha and beta scaling to all its quadrants as a length-of-two array of 4-Vectors. |
private VectorG |
getDarkScaling(List<nom.tam.fits.ImageHDU> dark)
Tries to read a list of dark, single-extension images, belonging to a single dark, ordered by amplifier. |
private CrosstalkDark.Scale |
getScaleFactor()
Converts a string to the appropriate scaling. |
private double |
getScaling(nom.tam.fits.ImageHDU data,
CrosstalkDark.Scale how)
Takes a single Image HDU, calculates the ADU statistic and returns the scaling factor, i.e. |
void |
init()
On init, we read the dark images and get their scaling factors. |
private static String |
pretty(VectorG v)
Converts an alpha or beta vector to a pretty print. |
private List<nom.tam.fits.ImageHDU> |
readDarkList(List<String> dark)
Tries to read a list of dark, single-extension images, belonging to a single dark, ordered by amplifier. |
private VectorG |
readWifsip(File amp)
Reads all four extension of a fits file, calculates for each the scaling factor, and return those as a four-vector. |
private nom.tam.fits.Fits |
subtractScaledDark(File f,
VectorG alpha,
VectorG beta)
From a file f we read all HDUs and scale them such that the dark sky is (partly) removed. |
| Methods inherited from class util.PropertyBundles |
|---|
clone, getLocalized, getLocalized, getLocalizedString, getLocalizedString, loadResource |
| Methods inherited from class util.PropertyResources |
|---|
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, keyCreate, keyCreate, reload, setApplet |
| Methods inherited from class util.PropertyContainer |
|---|
augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, reload, removeProperty, rescanned, setObject, setProperties, setProperty, stringProperties, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface util.ResourceSupplying |
|---|
getResource, getResourceAsStream, getResources |
| Methods inherited from interface util.PropertySupplying |
|---|
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringProperties |
| Field Detail |
|---|
public static final String KEY_DARK1
public static final String KEY_DARK2
public static final String KEY_SCALE
public static final String KEY_FITS
public static final String KEY_REJECT
public static final String KEY_UPPER
public static final String KEY_LOWER
public static final String KEY_ILLU
private static final String DEFSCALE
private static final int DEFREJECT
private static final double DEFUPPER
private static final double DEFLOWER
private static final String DEFDARK1
private static final String DEFDARK2
private static final String DEFILLU
private static final String DEFFITS
private List<nom.tam.fits.ImageHDU> dark1
private VectorG scale1
private List<nom.tam.fits.ImageHDU> dark2
private VectorG scale2
private Map<File,Integer> illu
| Constructor Detail |
|---|
public CrosstalkDark(Map<String,String> prop)
| Method Detail |
|---|
public void init()
init in interface Initializableinit in class PropertyResources
public void darkCorrectAll()
throws nom.tam.fits.FitsException,
IOException
nom.tam.fits.FitsException
IOException
private static final double averageIndex(VectorG v,
int i0)
private nom.tam.fits.Fits subtractScaledDark(File f,
VectorG alpha,
VectorG beta)
throws nom.tam.fits.FitsException,
IOException
nom.tam.fits.FitsException
IOException
private VectorG readWifsip(File amp)
throws nom.tam.fits.FitsException,
IOException
nom.tam.fits.FitsException
IOException
private VectorG[] getAlphBeta(File amp)
throws nom.tam.fits.FitsException,
IOException
nom.tam.fits.FitsException
IOException
private List<nom.tam.fits.ImageHDU> readDarkList(List<String> dark)
throws nom.tam.fits.FitsException,
IOException
nom.tam.fits.FitsException
IOException
private VectorG getDarkScaling(List<nom.tam.fits.ImageHDU> dark)
throws nom.tam.fits.FitsException,
IOException
nom.tam.fits.FitsException
IOException
private double getScaling(nom.tam.fits.ImageHDU data,
CrosstalkDark.Scale how)
throws nom.tam.fits.FitsException,
IOException
nom.tam.fits.FitsException
IOExceptionprivate final CrosstalkDark.Scale getScaleFactor()
private static String pretty(VectorG v)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||