stella.parameter
Class MoonLight

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by stella.parameter.AbstractParameter
                  extended by stella.parameter.AbstractTargetParameter
                      extended by stella.parameter.AbstractTargetValue
                          extended by stella.parameter.FilterTarget
                              extended by stella.parameter.MoonLight
All Implemented Interfaces:
Cloneable, Parameter, TargetDependingValue, ParameterDepending, TargetDepending, TargetDependingParameter, Value, ExitCleaning, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying

public class MoonLight
extends FilterTarget
implements ParameterDepending

A model of the sky brightness caused by moon-light following the prescription of K. Krisciunas and B. Schaefer, PASP 103, p1033 (1991). The accuracy of the prediction should range between 8-23% and is valid only for separations larger than 10 degrees. In the original formulars, (20, 21, 3, 15) all constants are for V magnitudes only. To extend this to other colors, we proceed as follows:

The principal formulars for V are given as:
   I = 10^-0.4*(3.84+0.026|α|+4.0E-9α^4)
f(θ)=C(λ) [1.06+cos(θ)&pow2;]+10^(6.15-θ/40)
B = f(θ) I 10^(-0.4kX_moon) [1-10^(-0.4kX_obj)].
where we use
   α...phase angle of the moon, degree
θ...separation moon-object, degree
X_moon...airmass of moon
X_obj...airmass of object
C(λ) Rayleigh constant, see above.
.


Nested Class Summary
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
private  Value alt
          Target height.
private static String DEFALTTARGET
          The default name of the target height to use.
private static String DEFEXTINCTIONCOEFFICIENT
          The default name of the target height to use.
private static String DEFFILTER
          If no filter is stated by the target, we use this one.
private static String DEFFILTERWAVELENGTH
          The default name of the target height to use.
private static String DEFMOONANGLE
          The default name of the moon phase angle to use.
private static String DEFMOONBRIGHTNESS
          The full-moon brightness in different filters.
private static String DEFMOONHEIGHT
          The default name of the moon height to use.
private static String DEFMOONSEPARATION
          The default name of the moon-target distance to use.
static String DEFNAME
          The default name of this parameter.
private  FilterWavelength fw
          The wavelength lookup table for Rayleigh scatering.
static String KEY_ALTTARGET
          The name of the target height parameter to use.
static String KEY_EXTINCTIONCOEFFICIENT
          Table of extinction coefficients.
static String KEY_FILTERWAVELENGTH
          Table of filter name to central wavelength in nm.
static String KEY_MOONANGLE
          The name of the moon phase angle parameter to use.
static String KEY_MOONBRIGHTNESS
          Table of filter name to moon magnitudes.
static String KEY_MOONHEIGHT
          The name of the moon height parameter to use.
static String KEY_MOONSEPARATION
          The name of the on-sky distance of the object to the moon.
private  ExtinctionCoefficient kp
          The extinction coefficients.
private  Value moonalt
          Moon height.
private  Map<String,Double> moonmag
          Default moon brightness in various filters.
private  Value moonphi
          Moon phase angle value.
private  Value separation
          Distance parameter.
 
Fields inherited from class stella.parameter.FilterTarget
filter, KEY_CONSTANT, KEY_SETUP
 
Fields inherited from class stella.parameter.AbstractTargetParameter
KEY_INDEX
 
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
MoonLight(Map<String,String> prop)
          Constrcuts a new moon-brightness parameter.
 
Method Summary
private  Double getBrightnessLambert(double sep, double zero, double h, double kprime, double lambda)
          Calculates the moon brightness for the stated on-sky separation between target and moon, target and moon height, moon zero magnitude and extinction coefficient for the specific band in question.
protected  Number getFilterValue(String f)
          Returns the moon zero brightness in the specified filter or its visual brightness, if brightness for the filter in question is undefined.
 Number getForTarget(TargetDefinition td)
          If queried with a target, we always ignore the filter registered.
 Number getValue()
          We get the value for the stated filter.
 void registerParameter(Parameter p)
          Registers the moon height, the on-sky separation of the target to the moon, the moon phase angle and the target height to this parameter.
 void registerTarget(TargetDefinition td)
          We register the target.
 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.
 
Methods inherited from class stella.parameter.FilterTarget
parseFilter, setValue
 
Methods inherited from class stella.parameter.AbstractTargetValue
get, set
 
Methods inherited from class stella.parameter.AbstractTargetParameter
getAsStar, getConstant, getFormattedFor, getSetup
 
Methods inherited from class stella.parameter.AbstractParameter
createParameter, delivers, exit, getFormatted, getFormatted, getName, getPreserveFile, getString, getString, init, 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 stella.TargetDependingParameter
getFormattedFor
 
Methods inherited from interface stella.Parameter
getFormatted, getName, getString
 
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 util.ResourceSupplying
getResource, getResourceAsStream, getResources
 

Field Detail

KEY_MOONSEPARATION

public static final String KEY_MOONSEPARATION
The name of the on-sky distance of the object to the moon.

See Also:
Constant Field Values

KEY_MOONANGLE

public static final String KEY_MOONANGLE
The name of the moon phase angle parameter to use.

See Also:
Constant Field Values

KEY_MOONHEIGHT

public static final String KEY_MOONHEIGHT
The name of the moon height parameter to use.

See Also:
Constant Field Values

KEY_ALTTARGET

public static final String KEY_ALTTARGET
The name of the target height parameter to use.

See Also:
Constant Field Values

KEY_FILTERWAVELENGTH

public static final String KEY_FILTERWAVELENGTH
Table of filter name to central wavelength in nm.

See Also:
Constant Field Values

KEY_MOONBRIGHTNESS

public static final String KEY_MOONBRIGHTNESS
Table of filter name to moon magnitudes.

See Also:
Constant Field Values

KEY_EXTINCTIONCOEFFICIENT

public static final String KEY_EXTINCTIONCOEFFICIENT
Table of extinction coefficients.

See Also:
Constant Field Values

DEFNAME

public static final String DEFNAME
The default name of this parameter.

See Also:
Constant Field Values

DEFMOONANGLE

private static final String DEFMOONANGLE
The default name of the moon phase angle to use.

See Also:
Constant Field Values

DEFMOONSEPARATION

private static final String DEFMOONSEPARATION
The default name of the moon-target distance to use.

See Also:
Constant Field Values

DEFMOONHEIGHT

private static final String DEFMOONHEIGHT
The default name of the moon height to use.

See Also:
Constant Field Values

DEFALTTARGET

private static final String DEFALTTARGET
The default name of the target height to use.

See Also:
Constant Field Values

DEFFILTERWAVELENGTH

private static final String DEFFILTERWAVELENGTH
The default name of the target height to use.

See Also:
Constant Field Values

DEFEXTINCTIONCOEFFICIENT

private static final String DEFEXTINCTIONCOEFFICIENT
The default name of the target height to use.

See Also:
Constant Field Values

DEFMOONBRIGHTNESS

private static final String DEFMOONBRIGHTNESS
The full-moon brightness in different filters.

See Also:
Constant Field Values

DEFFILTER

private static final String DEFFILTER
If no filter is stated by the target, we use this one.

See Also:
Constant Field Values

moonmag

private Map<String,Double> moonmag
Default moon brightness in various filters.


separation

private Value separation
Distance parameter.


moonphi

private Value moonphi
Moon phase angle value.


moonalt

private Value moonalt
Moon height.


alt

private Value alt
Target height.


fw

private FilterWavelength fw
The wavelength lookup table for Rayleigh scatering.


kp

private ExtinctionCoefficient kp
The extinction coefficients.

Constructor Detail

MoonLight

public MoonLight(Map<String,String> prop)
Constrcuts a new moon-brightness parameter.

Method Detail

registerParameter

public void registerParameter(Parameter p)
Registers the moon height, the on-sky separation of the target to the moon, the moon phase angle and the target height to this parameter.

Specified by:
registerParameter in interface ParameterDepending

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.

Overrides:
rescanned in class AbstractParameter

registerTarget

public void registerTarget(TargetDefinition td)
We register the target. Grabs the the target filter from the setup and constant name section.

Specified by:
registerTarget in interface TargetDepending
Overrides:
registerTarget in class FilterTarget

getForTarget

public Number getForTarget(TargetDefinition td)
If queried with a target, we always ignore the filter registered.

Specified by:
getForTarget in interface TargetDependingValue
Specified by:
getForTarget in interface TargetDependingParameter
Overrides:
getForTarget in class FilterTarget

getValue

public Number getValue()
We get the value for the stated filter. Normally this is a look-up into a string-to-double table.

Specified by:
getValue in interface Value
Overrides:
getValue in class FilterTarget

getFilterValue

protected Number getFilterValue(String f)
Returns the moon zero brightness in the specified filter or its visual brightness, if brightness for the filter in question is undefined.

Specified by:
getFilterValue in class FilterTarget

getBrightnessLambert

private Double getBrightnessLambert(double sep,
                                    double zero,
                                    double h,
                                    double kprime,
                                    double lambda)
Calculates the moon brightness for the stated on-sky separation between target and moon, target and moon height, moon zero magnitude and extinction coefficient for the specific band in question. Only the moon phase and height are not handed over, as they are not target depending.

Parameters:
sep - On-sky separation between moon and target, degrees
zero - Magnitude of full moon in band in question
h - Height of target, deg.
kprime - Extinction coefficient for filter band
lambda - Ratio of filter wavelength to V-wavelength.
Returns:
The moon brightness in nano-lambert.