stella.parameter
Class Efficiency

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by stella.parameter.AbstractParameter
                  extended by stella.parameter.AbstractRemoteParameter
                      extended by stella.parameter.AbstractFitsParameter
                          extended by stella.parameter.AbstractFitsValue
                              extended by stella.parameter.Efficiency
All Implemented Interfaces:
Cloneable, Remote, EventListener, EventTrigger, Parameter, ParameterDepending, RemoteFitsParameter, RemoteParameter, Value, ExitCleaning, Initializable, LocalizedSupplying, PropertySupplying, Reloadable, ResourceSupplying, RmiCaster

public class Efficiency
extends AbstractFitsValue
implements ParameterDepending, Reloadable

This class takes a fits file, extracts a region around AbstractFitsValue.KEY_WINDOW, determines the total flux there and relates it to the incident flux of the star on top of the atmosphere.

The flux is determined in the following way:

Note that an R=0 star has ~1.07*10^10 photons/m2/sec. magnitude


Nested Class Summary
static class Efficiency.File
          Test class and class for processing fits files in-situ.
 
Nested classes/interfaces inherited from class stella.parameter.AbstractFitsValue
AbstractFitsValue.Extract
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
private static double DEFANGSTROMPIXEL
          Default Angstrom per pixel at window.
private static double DEFGAIN
          Default gain.
private static double DEFHIGHSIGNAL
           
static String DEFNAME
          Name of this parameter.
private static double DEFR0FLUX
          Photon flux per Angstrom around 6500, for 1.2m telescope.
private static double DEFREADNOISE
          Default readnoise.
static String KEY_ANGSTROMPIXEL
          Angstrom per pixel at the center of the extracted region.
static String KEY_GAIN
          Gain of the SES CCD.
static String KEY_HIGHSIGNAL
          Multiplier to get from statistic sigma to upper-limit bound.
static String KEY_R0FLUX
          Photon flux of R=0.0 star for STELLA M1 size above atmosphere.
static String KEY_READNOISE
          Estimate of the read-noise of the CCD, just for histogram bins.
static String KEY_RMAG
          Name of the rmag parameter.
private  Value rmag
          The rmag of the target, set remotely.
 
Fields inherited from class stella.parameter.AbstractFitsValue
KEY_WINDOW
 
Fields inherited from class stella.parameter.AbstractRemoteParameter
DEFBIND, KEY_BIND
 
Fields inherited from class stella.parameter.AbstractParameter
KEY_FORMAT, KEY_NAME, KEY_PRESERVE, UNKNOWN
 
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.PropertySupplying
CONFIG, KEY_CLASS
 
Fields inherited from interface util.ResourceSupplying
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME
 
Constructor Summary
Efficiency(Map<String,String> prop)
          Constructs a new efficiency measuring tool.
 
Method Summary
private  Double estimateEfficiency(List<Double> adus, double exptime, float rmag)
          Provide a fits file, an exposure time in seconds and an R-magnitude of the object and determine the fraction of photons detected.
 Number getValue()
          Returns the efficiency measure as a Double value.
 void registerParameter(Parameter what)
          Registers the RMag of the target to this parameter.
 double rescanned(String key, String old, String newval)
          As any parameter depending instance we fail if the parameter we depend on is now a different one.
 Number setValue(Number val)
          Sets the efficiency, which is a read-only variable, therefore this method throws an UnsupportedOperationException.
 
Methods inherited from class stella.parameter.AbstractFitsValue
get, getAdus, getMode, getSigmaFromLow, getSignal, getWindow, processFits
 
Methods inherited from class stella.parameter.AbstractFitsParameter
addRmiListener, getDateObs, getExposureTime, getRegistered, registerFits, registerMonitor, removeRmiListener, rmiDateObs, rmiExposureTime, rmiRegistered, set, setDateObs, setExposureTime, setRegistered
 
Methods inherited from class stella.parameter.AbstractRemoteParameter
bindToRegistry, exit, init, isValid, remoteGet, unbindFromRegistry
 
Methods inherited from class stella.parameter.AbstractParameter
createParameter, delivers, getFormatted, getFormatted, getName, getPreserveFile, getString, getString, register, setName, toString
 
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, setObject, setProperties, setProperty, stringProperties
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface util.Reloadable
reload
 
Methods inherited from interface stella.Parameter
getFormatted, getName, getString, set
 
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
 
Methods inherited from interface util.Initializable
init
 
Methods inherited from interface stella.rmi.RemoteParameter
remoteGet
 
Methods inherited from interface util.rmi.RmiCaster
bindToRegistry, isValid, unbindFromRegistry
 
Methods inherited from interface util.ResourceSupplying
getResource, getResourceAsStream, getResources
 

Field Detail

KEY_GAIN

public static final String KEY_GAIN
Gain of the SES CCD.

See Also:
Constant Field Values

KEY_READNOISE

public static final String KEY_READNOISE
Estimate of the read-noise of the CCD, just for histogram bins.

See Also:
Constant Field Values

KEY_ANGSTROMPIXEL

public static final String KEY_ANGSTROMPIXEL
Angstrom per pixel at the center of the extracted region.

See Also:
Constant Field Values

KEY_R0FLUX

public static final String KEY_R0FLUX
Photon flux of R=0.0 star for STELLA M1 size above atmosphere.

See Also:
Constant Field Values

KEY_RMAG

public static final String KEY_RMAG
Name of the rmag parameter.

See Also:
Constant Field Values

KEY_HIGHSIGNAL

public static final String KEY_HIGHSIGNAL
Multiplier to get from statistic sigma to upper-limit bound.

See Also:
Constant Field Values

DEFNAME

public static final String DEFNAME
Name of this parameter.

See Also:
Constant Field Values

DEFGAIN

private static final double DEFGAIN
Default gain.

See Also:
Constant Field Values

DEFREADNOISE

private static final double DEFREADNOISE
Default readnoise.

See Also:
Constant Field Values

DEFANGSTROMPIXEL

private static final double DEFANGSTROMPIXEL
Default Angstrom per pixel at window.

See Also:
Constant Field Values

DEFR0FLUX

private static final double DEFR0FLUX
Photon flux per Angstrom around 6500, for 1.2m telescope.

See Also:
Constant Field Values

DEFHIGHSIGNAL

private static final double DEFHIGHSIGNAL
See Also:
Constant Field Values

rmag

private Value rmag
The rmag of the target, set remotely.

Constructor Detail

Efficiency

public Efficiency(Map<String,String> prop)
Constructs a new efficiency measuring tool. After construct, call estimateEfficiency(java.util.List, double, float) retrieve the value.

Method Detail

rescanned

public double rescanned(String key,
                        String old,
                        String newval)
As any parameter depending instance we fail if the parameter we depend on is now a different one.

Specified by:
rescanned in interface Reloadable
Overrides:
rescanned in class AbstractFitsValue

registerParameter

public void registerParameter(Parameter what)
Registers the RMag of the target to this parameter. We only register the R-mag of the target, as the fits file should be set when it was entirely read.

Specified by:
registerParameter in interface ParameterDepending

getValue

public Number getValue()
Returns the efficiency measure as a Double value. If the rmag is missing or not set or the fits file is invalid, we return null.

Specified by:
getValue in interface Value

setValue

public Number setValue(Number val)
                throws UnsupportedOperationException
Sets the efficiency, which is a read-only variable, therefore this method throws an UnsupportedOperationException.

Specified by:
setValue in interface Value
Overrides:
setValue in class AbstractFitsValue
Throws:
UnsupportedOperationException

estimateEfficiency

private Double estimateEfficiency(List<Double> adus,
                                  double exptime,
                                  float rmag)
Provide a fits file, an exposure time in seconds and an R-magnitude of the object and determine the fraction of photons detected. If anything fails, -1 is returned.

Parameters:
adus - ADU count statistic from a representative SES area
exptime - Exposure time in seconds.
rmag - Magnitude of star in R band.