|
mhuss utils 1.1.5ws | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.mhuss.AstroLib.VisLimit
public class VisLimit
Calculates sky brightness and limiting magnitude.
Based on C code by Bill Gray (www.projectpluto.com), which was in
turn based on Brad Schaefer's article and code on pages 57-60,
May 1998 _Sky & Telescope_, "To the Visual Limits".
[Bill Gray's Comments:]
The computations for sky brightness and limiting magnitude can be
logically broken up into several pieces. Some computations depend
on things that are constant for a given observing site and time:
the lunar and solar zenith distances, the air masses to those
objects, the temperature and relative humidity, and so forth.
For use in Guide, I expect to compute brightness at many points
in the sky, while all these other values hold constant. So my
first step (after putting lat/lon and these other data into an
instance of VisLimitAngularBrightnessData) is to call the
setBrightnessParams() function. This function does a lot of
"setup work", figuring out the absorption per unit air mass at
various wavelengths from various causes (gas, aerosol, ozone),
the number of air masses to the sun and moon, and so forth.
Once you've done all this, you can call computeSkyBrightness() for any point in the sky. You do need to provide the zenith angle, and the angular distance of that point from the moon and sun. The brightnesses are available via the brightness() functions. The 'mask' value can be used to specify which of the five bands is to be computed. (For example, if I use this to make a realistic sky background, I may just concern myself with the V band... maybe with B and R if I want to attempt a colored sky. In either case, computing all five bands would be excessive.)
Next, you can call computeExtinction() to set any or all of the five extinction values. Normally, I wouldn't see much use for this data. But you do need to have that data if you intend to call the computeLimitingMag() function.
If you use the explicit (all values) constructor, all of the above functions are called for you automatically.
Notice that we modified his test conditions. He had the moon and sun well below the horizon; I found that this didn't make testing contributions from those objects any easier, so we put them where they could contribute more brightness.
Field Summary | |
---|---|
static int |
BAND_0
Band mask |
static int |
BAND_1
Band mask |
static int |
BAND_2
Band mask |
static int |
BAND_3
Band mask |
static int |
BAND_4
Band mask |
Constructor Summary | |
---|---|
VisLimit()
Default constructor. |
|
VisLimit(int bandMask,
VisLimitFixedBrightnessData fbd,
VisLimitAngularBrightnessData abd)
Explicit (all values) constructor. |
Method Summary | |
---|---|
void |
computeSkyBrightness(VisLimitAngularBrightnessData abd)
Compute the sky brightness. |
double |
getBrightness(int i)
Get the brightess value. |
double |
getExtinction(int i)
Get the extinction value. |
double |
getK(int i)
Get the K band value. |
double |
limitingMagnitude()
Calculate the limiting magnitude. |
static void |
main(java.lang.String[] args)
(for unit testing only) |
void |
setBrightnessParams(VisLimitFixedBrightnessData fbd)
Set the fixed brightness parameters. |
void |
setMask(int m)
Set the mask value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int BAND_0
public static final int BAND_1
public static final int BAND_2
public static final int BAND_3
public static final int BAND_4
Constructor Detail |
---|
public VisLimit()
public VisLimit(int bandMask, VisLimitFixedBrightnessData fbd, VisLimitAngularBrightnessData abd)
Note that the BrightnessData parameters are expected to contain valid data.
bandMask
- A logical mask which represents one or more of
the five possible bands to calculate.fbd
- The fixed brightness dataabd
- The angular brightness dataMethod Detail |
---|
public void setBrightnessParams(VisLimitFixedBrightnessData fbd)
fbd
- The fixed brightness datapublic void computeSkyBrightness(VisLimitAngularBrightnessData abd)
abd
- The angular brightness datapublic double limitingMagnitude()
public void setMask(int m)
public double getK(int i) throws ValueException
i
- Index into the band data
ValueException
public double getBrightness(int i) throws ValueException
i
- Index into the band data
ValueException
public double getExtinction(int i) throws ValueException
i
- Index into the band data
ValueException
public static void main(java.lang.String[] args)
|
mhuss utils 1.1.5ws | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |