stella.parameter
Class SignalToNoise

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.SignalToNoise
All Implemented Interfaces:
Cloneable, Remote, EventListener, EventTrigger, Parameter, RemoteFitsParameter, RemoteParameter, Value, ExitCleaning, Initializable, LocalizedSupplying, PropertySupplying, Reloadable, ResourceSupplying, RmiCaster

public class SignalToNoise
extends AbstractFitsValue
implements Reloadable

From a fits file, we extract a window and estimate the Signal-to-Noise from photon statistics. The array of adus provided by the parental class is sorted, the background is estimated and an average row-sum is calculated. After applying the gain factor, the sqrt from this number gets the S/N.


Nested Class Summary
static class SignalToNoise.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 DEFGAIN
          Default gain.
private static double DEFHIGHSIGNAL
           
static String DEFNAME
          Name of this parameter.
private static double DEFREADNOISE
          Default readnoise.
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_READNOISE
          Estimate of the read-noise of the CCD, just for histogram bins.
 
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
SignalToNoise(Map<String,String> prop)
          Constructs a new S/N estimate.
 
Method Summary
private  Double estimateSignalToNoise(List<Double> adus)
          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.
 double rescanned(String key, String old, String newval)
          Makes this method public, no further changes.
 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_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

DEFHIGHSIGNAL

private static final double DEFHIGHSIGNAL
See Also:
Constant Field Values
Constructor Detail

SignalToNoise

public SignalToNoise(Map<String,String> prop)
Constructs a new S/N estimate. After construction, the fits file must be registerd before retrieving the value.

Method Detail

rescanned

public double rescanned(String key,
                        String old,
                        String newval)
Makes this method public, no further changes.

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

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

estimateSignalToNoise

private Double estimateSignalToNoise(List<Double> adus)
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 - Extracted adus from SES spectrograph.