stella.util
Class Annulus

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by stella.util.Annulus
All Implemented Interfaces:
Cloneable, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying

public class Annulus
extends PropertyBundles

A class to produce sequences of fits file that simulate the fiber entrance seen with a secondary guider unit on STELLA. This class can be used to dry-test the AuxiliaryPinholeUnit algortihms. The stellar flux is expressed as a I times the normalized Moffat function,

   psf(r)=(β-1)/πα²[1+(r/α)²],
   
where FWHM = 2α√(21/β-1).
Subtracted from that is a pinhole, which is modeled with an arctan according to
   ph(r)=1+(atan(k*(x-FWHM/2))-atan(k*(x+FWHM/2)))/π,
   
where bigger k's mean steeper slope, see for k between 5 and 50.


Nested Class Summary
static class Annulus.Series
          Use some command-line switches to generate simulated pinhole data.
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
private  double alpha
          Alpha of moffat function, calculated from FWHM on init.
private  double beta
          beta of moffat function
private static double DEFBIAS
          Default bias level on the ccd with no noise.
private static double DEFBRIGHTNESS
          Default stellar brightness in counts.
private static double DEFDARK
          Additional dark with a Poisson-statistic photon count.
private static double DEFDIAMETER
          The telescope diameter for image motion.
private static File DEFDIR
          Default directory where images are created.
private static double DEFEXPOSURETIME
          Default read-out time to apply .
private static int DEFFITSBITS
          The number of bits usable per pixel.
private static Dimension DEFFITSSIZE
          Default size of the fits files generated.
private static double DEFGAIN
          Default gain of the CCD.
private static int DEFIMAGECOUNT
          Default number of images to generate.
private static double DEFLIGHTLOSS
          Default light-loss in the system.
private static double DEFMINADU
          Default minimum possible ADU recorded value.
private static double DEFMOFFATBETA
          The moffat-beta, 4.765 is literature value.
private static double DEFPINHOLEDEEP
          Broad-band anti-reflective coating, typically.
private static double DEFPINHOLESIZE
          Default size (FWHM) of pinhole, arcsec.
private static double DEFPINHOLESTEEP
          Pinhole model steepness.
private static double DEFPINXDRIFT
          Default pinhole drift in pixel per second.
private static double DEFPINXNOISE
          Default pinhole jitter in pixel.
private static double DEFPINYDRIFT
          Default pinhole drift in pixel per second.
private static double DEFPINYNOISE
          Default pinhole jitter in pixel.
private static double DEFPLATESCALE
          Default plate scale in arcsec per pixel.
private static double DEFREADOUT
          Additional read-out with a Poisson-statistic photon count.
private static double DEFREADOUTTIME
          Default read-out time per pixel.
private static double DEFSEEING
          Default seeing fwhm in arcsec.
private static double DEFWINDSPEED
          Default wind speed.
private static double DEFXCENTER
          Default pinhole center is center of frame.
private static double DEFXMOTIONNOISE
          The white-noise of the telescope motion.
private static String DEFXOSCILLATION
          The default oscillation, 0.5 arcsec frequency 0.15915Hz.
private static double DEFYCENTER
          Default pinhole center is center of frame.
private static double DEFYMOTIONNOISE
          The white-noise of the telescope motion.
private static String DEFYOSCILLATION
          The default oscillation, 0.5 arcsec frequency 0.15915Hz.
private static String[] FITSKEYS
          Keys and comments in the header.
private  double intensity
          Intensity from magnitude brightness, calculated on init.
static String KEY_BIAS
          The nominal bias level.
static String KEY_BRIGHTNESS
          The intensity factor of the primary star.
static String KEY_DARK
          The applicable dark noise level, electron/sec.
static String KEY_DIAMETER
          The telescope diameter for image motion.
static String KEY_DIR
          The directory where simulated images should be created.
static String KEY_EXPOSURETIME
          The rate of exposures, equal the exposure time.
static String KEY_FITSBITS
          The number of bits usable per pixel.
static String KEY_FITSSIZE
          The size on the guider ccd used on guiding, unbinned.
static String KEY_GAIN
          The gain factor on the ccd, i.e.
static String KEY_IMAGECOUNT
          The number of images to generate.
static String KEY_INTENSITY
          The intensity factor of the primary star.
static String KEY_LIGHTLOSS
          The light-loss factor, ioncluding telescope and CCD.
static String KEY_MINADU
          ADUs cannot drop below this value
static String KEY_MOFFATBETA
          The moffat-beta, 4.765 is literature value.
static String KEY_PINHOLEDEEP
          The pinhole model minimum transmission .
static String KEY_PINHOLESIZE
          The pinhole diameter.
static String KEY_PINHOLESTEEP
          The pinhole model steepness .
static String KEY_PINXDRIFT
          Pinhole center drift vector.
static String KEY_PINXNOISE
          Pinhole center jitter vector.
static String KEY_PINYDRIFT
          Pinhole center drift vector.
static String KEY_PINYNOISE
          Pinhole center jitter vector.
static String KEY_PLATESCALE
          Defautl plate scale in arcsec.
static String KEY_READOUT
          The applicable bias noise level.
static String KEY_READOUTTIME
          The time to read out a 1x1 pixel array.
static String KEY_SEEING
          The seeing fwhm .
static String KEY_WINDSPEED
          The wind-speed for image motion.
static String KEY_XCENTER
          Pinhole center.
static String KEY_XHOLEACTUAL
          The actual shift applied to the star is recorded here.
static String KEY_XMOTIONNOISE
          The level of random (white noise) telescope motion.
static String KEY_XOFFACTUAL
          The actual difference from star to pinhole is recorded here.
static String KEY_XOSCILLATION
          An expression describing the telescope oscillation.
static String KEY_XSHIFTACTUAL
          The actual shift applied to the star is recorded here.
static String KEY_YCENTER
          Pinhole center.
static String KEY_YHOLEACTUAL
          The actual shift applied to the star is recorded here.
static String KEY_YMOTIONNOISE
          The level of random (white noise) telescope motion.
static String KEY_YOFFACTUAL
          The actual difference from star to pinhole is recorded here.
static String KEY_YOSCILLATION
          An expression describing the telescope oscillation.
static String KEY_YSHIFTACTUAL
          The actual shift applied to the star is recorded here.
private static PoissonRandom RANDOM
          The random generator.
private  double[] xmotion
          The array of image motions in x-direction.
private  Function xosc
          Oscillatory function in x.
private  double[] ymotion
          The array of image motions in x-direction.
private  Function yosc
          Oscillatory function in y.
 
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
Annulus(Map<String,String> prop)
          Constructs a new annulus, defaulting all non-set properties.
 
Method Summary
private  nom.tam.fits.Fits generateFits(int index, nom.tam.fits.Fits buffer)
          Uses the simulated data to create a fits object out of it.
 void init()
          Allocates the image motion array.
static void main(String[] arg)
          A test class.
private  short[][] simulate(int index)
          The method returns an unsigned-short array of the size of the fits data, giving simulated image data.
private  boolean writeFits(String head, int index, nom.tam.fits.Fits data)
          Writes a fits file containing simulated data.
 
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

KEY_FITSSIZE

public static final String KEY_FITSSIZE
The size on the guider ccd used on guiding, unbinned.

See Also:
Constant Field Values

KEY_FITSBITS

public static final String KEY_FITSBITS
The number of bits usable per pixel.

See Also:
Constant Field Values

KEY_MOFFATBETA

public static final String KEY_MOFFATBETA
The moffat-beta, 4.765 is literature value.

See Also:
Constant Field Values

KEY_SEEING

public static final String KEY_SEEING
The seeing fwhm .

See Also:
Constant Field Values

KEY_BRIGHTNESS

public static final String KEY_BRIGHTNESS
The intensity factor of the primary star.

See Also:
Constant Field Values

KEY_INTENSITY

public static final String KEY_INTENSITY
The intensity factor of the primary star.

See Also:
Constant Field Values

KEY_MINADU

public static final String KEY_MINADU
ADUs cannot drop below this value

See Also:
Constant Field Values

KEY_BIAS

public static final String KEY_BIAS
The nominal bias level.

See Also:
Constant Field Values

KEY_READOUT

public static final String KEY_READOUT
The applicable bias noise level.

See Also:
Constant Field Values

KEY_DARK

public static final String KEY_DARK
The applicable dark noise level, electron/sec.

See Also:
Constant Field Values

KEY_PINHOLESIZE

public static final String KEY_PINHOLESIZE
The pinhole diameter.

See Also:
Constant Field Values

KEY_PINHOLESTEEP

public static final String KEY_PINHOLESTEEP
The pinhole model steepness .

See Also:
Constant Field Values

KEY_PINHOLEDEEP

public static final String KEY_PINHOLEDEEP
The pinhole model minimum transmission .

See Also:
Constant Field Values

KEY_WINDSPEED

public static final String KEY_WINDSPEED
The wind-speed for image motion.

See Also:
Constant Field Values

KEY_DIAMETER

public static final String KEY_DIAMETER
The telescope diameter for image motion.

See Also:
Constant Field Values

KEY_XMOTIONNOISE

public static final String KEY_XMOTIONNOISE
The level of random (white noise) telescope motion.

See Also:
Constant Field Values

KEY_YMOTIONNOISE

public static final String KEY_YMOTIONNOISE
The level of random (white noise) telescope motion.

See Also:
Constant Field Values

KEY_XOSCILLATION

public static final String KEY_XOSCILLATION
An expression describing the telescope oscillation.

See Also:
Constant Field Values

KEY_YOSCILLATION

public static final String KEY_YOSCILLATION
An expression describing the telescope oscillation.

See Also:
Constant Field Values

KEY_XCENTER

public static final String KEY_XCENTER
Pinhole center.

See Also:
Constant Field Values

KEY_YCENTER

public static final String KEY_YCENTER
Pinhole center.

See Also:
Constant Field Values

KEY_PLATESCALE

public static final String KEY_PLATESCALE
Defautl plate scale in arcsec. per pixel.

See Also:
Constant Field Values

KEY_PINXDRIFT

public static final String KEY_PINXDRIFT
Pinhole center drift vector.

See Also:
Constant Field Values

KEY_PINYDRIFT

public static final String KEY_PINYDRIFT
Pinhole center drift vector.

See Also:
Constant Field Values

KEY_PINXNOISE

public static final String KEY_PINXNOISE
Pinhole center jitter vector.

See Also:
Constant Field Values

KEY_PINYNOISE

public static final String KEY_PINYNOISE
Pinhole center jitter vector.

See Also:
Constant Field Values

KEY_EXPOSURETIME

public static final String KEY_EXPOSURETIME
The rate of exposures, equal the exposure time.

See Also:
Constant Field Values

KEY_READOUTTIME

public static final String KEY_READOUTTIME
The time to read out a 1x1 pixel array.

See Also:
Constant Field Values

KEY_LIGHTLOSS

public static final String KEY_LIGHTLOSS
The light-loss factor, ioncluding telescope and CCD.

See Also:
Constant Field Values

KEY_GAIN

public static final String KEY_GAIN
The gain factor on the ccd, i.e. electrons per ADU.

See Also:
Constant Field Values

KEY_IMAGECOUNT

public static final String KEY_IMAGECOUNT
The number of images to generate.

See Also:
Constant Field Values

KEY_DIR

public static final String KEY_DIR
The directory where simulated images should be created.

See Also:
Constant Field Values

KEY_XSHIFTACTUAL

public static final String KEY_XSHIFTACTUAL
The actual shift applied to the star is recorded here.

See Also:
Constant Field Values

KEY_YSHIFTACTUAL

public static final String KEY_YSHIFTACTUAL
The actual shift applied to the star is recorded here.

See Also:
Constant Field Values

KEY_XHOLEACTUAL

public static final String KEY_XHOLEACTUAL
The actual shift applied to the star is recorded here.

See Also:
Constant Field Values

KEY_YHOLEACTUAL

public static final String KEY_YHOLEACTUAL
The actual shift applied to the star is recorded here.

See Also:
Constant Field Values

KEY_XOFFACTUAL

public static final String KEY_XOFFACTUAL
The actual difference from star to pinhole is recorded here.

See Also:
Constant Field Values

KEY_YOFFACTUAL

public static final String KEY_YOFFACTUAL
The actual difference from star to pinhole is recorded here.

See Also:
Constant Field Values

DEFFITSSIZE

private static final Dimension DEFFITSSIZE
Default size of the fits files generated.


DEFMOFFATBETA

private static final double DEFMOFFATBETA
The moffat-beta, 4.765 is literature value.

See Also:
Constant Field Values

DEFFITSBITS

private static final int DEFFITSBITS
The number of bits usable per pixel.

See Also:
Constant Field Values

DEFSEEING

private static final double DEFSEEING
Default seeing fwhm in arcsec.

See Also:
Constant Field Values

DEFBRIGHTNESS

private static final double DEFBRIGHTNESS
Default stellar brightness in counts.

See Also:
Constant Field Values

DEFMINADU

private static final double DEFMINADU
Default minimum possible ADU recorded value.

See Also:
Constant Field Values

DEFBIAS

private static final double DEFBIAS
Default bias level on the ccd with no noise. Like an offset.

See Also:
Constant Field Values

DEFREADOUT

private static final double DEFREADOUT
Additional read-out with a Poisson-statistic photon count.

See Also:
Constant Field Values

DEFDARK

private static final double DEFDARK
Additional dark with a Poisson-statistic photon count.

See Also:
Constant Field Values

DEFPINHOLESIZE

private static final double DEFPINHOLESIZE
Default size (FWHM) of pinhole, arcsec.

See Also:
Constant Field Values

DEFPINHOLESTEEP

private static final double DEFPINHOLESTEEP
Pinhole model steepness.

See Also:
Constant Field Values

DEFPINHOLEDEEP

private static final double DEFPINHOLEDEEP
Broad-band anti-reflective coating, typically.

See Also:
Constant Field Values

DEFWINDSPEED

private static final double DEFWINDSPEED
Default wind speed.

See Also:
Constant Field Values

DEFDIAMETER

private static final double DEFDIAMETER
The telescope diameter for image motion.

See Also:
Constant Field Values

DEFXMOTIONNOISE

private static final double DEFXMOTIONNOISE
The white-noise of the telescope motion.

See Also:
Constant Field Values

DEFYMOTIONNOISE

private static final double DEFYMOTIONNOISE
The white-noise of the telescope motion.

See Also:
Constant Field Values

DEFXOSCILLATION

private static final String DEFXOSCILLATION
The default oscillation, 0.5 arcsec frequency 0.15915Hz.

See Also:
Constant Field Values

DEFYOSCILLATION

private static final String DEFYOSCILLATION
The default oscillation, 0.5 arcsec frequency 0.15915Hz.

See Also:
Constant Field Values

DEFXCENTER

private static final double DEFXCENTER
Default pinhole center is center of frame.

See Also:
Constant Field Values

DEFYCENTER

private static final double DEFYCENTER
Default pinhole center is center of frame.

See Also:
Constant Field Values

DEFPLATESCALE

private static final double DEFPLATESCALE
Default plate scale in arcsec per pixel.

See Also:
Constant Field Values

DEFPINXDRIFT

private static final double DEFPINXDRIFT
Default pinhole drift in pixel per second.

See Also:
Constant Field Values

DEFPINYDRIFT

private static final double DEFPINYDRIFT
Default pinhole drift in pixel per second.

See Also:
Constant Field Values

DEFPINXNOISE

private static final double DEFPINXNOISE
Default pinhole jitter in pixel.

See Also:
Constant Field Values

DEFPINYNOISE

private static final double DEFPINYNOISE
Default pinhole jitter in pixel.

See Also:
Constant Field Values

DEFLIGHTLOSS

private static final double DEFLIGHTLOSS
Default light-loss in the system. Telescope loss times optics, CCD.

See Also:
Constant Field Values

DEFGAIN

private static final double DEFGAIN
Default gain of the CCD.

See Also:
Constant Field Values

DEFEXPOSURETIME

private static final double DEFEXPOSURETIME
Default read-out time to apply .

See Also:
Constant Field Values

DEFREADOUTTIME

private static final double DEFREADOUTTIME
Default read-out time per pixel.

See Also:
Constant Field Values

DEFIMAGECOUNT

private static final int DEFIMAGECOUNT
Default number of images to generate.

See Also:
Constant Field Values

DEFDIR

private static final File DEFDIR
Default directory where images are created.


RANDOM

private static final PoissonRandom RANDOM
The random generator.


FITSKEYS

private static final String[] FITSKEYS
Keys and comments in the header. Special order!


xmotion

private double[] xmotion
The array of image motions in x-direction.


ymotion

private double[] ymotion
The array of image motions in x-direction.


xosc

private Function xosc
Oscillatory function in x.


yosc

private Function yosc
Oscillatory function in y.


alpha

private double alpha
Alpha of moffat function, calculated from FWHM on init.


beta

private double beta
beta of moffat function


intensity

private double intensity
Intensity from magnitude brightness, calculated on init.

Constructor Detail

Annulus

public Annulus(Map<String,String> prop)
Constructs a new annulus, defaulting all non-set properties.

Method Detail

init

public void init()
Allocates the image motion array.

Specified by:
init in interface Initializable
Overrides:
init in class PropertyResources

simulate

private short[][] simulate(int index)
The method returns an unsigned-short array of the size of the fits data, giving simulated image data.


generateFits

private nom.tam.fits.Fits generateFits(int index,
                                       nom.tam.fits.Fits buffer)
                                throws nom.tam.fits.FitsException
Uses the simulated data to create a fits object out of it. Allocates a new buffer if necessary.

Parameters:
index - Index number of annulus frame.
buffer - If non-null, simulated data is stored in the buffer.
Returns:
The fits containing the simulated data as its first extension.
Throws:
nom.tam.fits.FitsException

writeFits

private boolean writeFits(String head,
                          int index,
                          nom.tam.fits.Fits data)
                   throws IOException
Writes a fits file containing simulated data. The header is part of the fits-file name created, augmented with the index formatted according to the rule of Unique

Throws:
IOException

main

public static void main(String[] arg)
                 throws Exception
A test class.

Throws:
Exception