public class StellaGuider extends PropertyResources implements FitsGuiding, Initializable
| Modifier and Type | Class and Description |
|---|---|
static class |
StellaGuider.Continuous
A class to test the continuous mode.
|
private class |
StellaGuider.ExposeThread
The thread that does continuous exposures.
|
private class |
StellaGuider.ReduceThread
This thread does the reduction of CCD data to a level that a list of
detected stars can be retrieved.
|
static class |
StellaGuider.Single
Takes a single shot through the guider and detects the stars there.
|
PropertyResources.Load, PropertyResources.URLResourceGuiding.RawFrame, Guiding.RawStar| Modifier and Type | Field and Description |
|---|---|
protected File |
biasfits
The file name of the master bias or empty if not available.
|
protected double |
biastime
The exposure time of the bias, non-null on shutter-less systems.
|
private CcdDriver |
ccd
My guider ccd camera.
|
private Object |
ccdlock
And my lock.
|
static int |
CLEAN
Flag for writing clean-images.
|
static String |
CLEANNAME
Ending of fits for clean image.
|
private long |
contexpose
If we ask for a continuous guiding, this is the exposure time.
|
private int |
curcount
The current exposure number, used by exposure thread, set reduced.
|
protected File |
darkfits
The file name of the master dark or empty if not available.
|
protected double |
darktime
The exposure time of the dark in ms.
|
private static float |
DEFDEPTHMEDIAN
Depth of the applied median filter.
|
private static String |
DEFFITSDIR
Default fits directory where the guider server writes.
|
private static float |
DEFGAUSSFWHM
FWHM of the gaussian filter applied.
|
private static float |
DEFGAUSSTRUNCATE
Truncation of the gaussian filter applied.
|
private static String |
DEFGUIDINGIMG
Default file name of the guider image.
|
private static double |
DEFLOWPASS
Characteristic length-scale of the low-pass filter applied.
|
private static double |
DEFMAGTRUNCATE
Raw entries truncate threshold.
|
private static String |
DEFMATCHERVERSION
Default matching algorithm to use.
|
private static boolean |
DEFNATIVELIB
Default uses native library.
|
private static String |
DEFREDUCEDIR
Default file name of the guider image.
|
private static long |
DEFREDUCETIME
The default reduce time during a guider period.
|
private static int |
DEFSIZELOWPASS
Radius of the applied low-pass filter.
|
private static int |
DEFSIZEMEDIAN
Radius of the applied median filter.
|
private static int |
DEFSKYFRAME |
private static double |
DEFSKYTHRESHOLD |
private static String |
DEFTMPDIR
Default fits directory where the guider server writes.
|
private StellaGuider.ExposeThread |
doexpose
This is the thread that continuosly exposes and notifies.
|
private StellaGuider.ReduceThread |
doreduce
This is the thread that continuosly reduces fits data.
|
static int |
GAUSS
Flag for writing enhanced-images.
|
static String |
GAUSSNAME
Ending of fits for gauss enhanced image.
|
private MFitsStarFind |
javafits
The pure java implementation to find stars.
|
static String |
KEY_DEPTHMEDIAN
Radius of the applied median filter.
|
static String |
KEY_FITSDIR
Directory path where the FITS image will be stored.
|
static String |
KEY_GAUSSFWHM
FWHM of the gaussian filter applied.
|
static String |
KEY_GAUSSTRUNCATE
Truncation of the gaussian filter applied.
|
static String |
KEY_GUIDINGIMG
Name of the CCD image.
|
static String |
KEY_LOWPASS
Characteristic length-scale of the low-pass filter applied.
|
static String |
KEY_MAGTRUNCATE
Raw entries deviating more then this from last catalog are deleted.
|
static String |
KEY_MATCHERVERSION
Matcher version.
|
static String |
KEY_REDUCEDIR
Directory path where the bias/dark frames reside.
|
static String |
KEY_REDUCETIME
Reduction time of a single guider loop execution.
|
static String |
KEY_SIZELOWPASS
Radius of the applied low-pass filter.
|
static String |
KEY_SIZEMEDIAN
Radius of the applied median filter.
|
static String |
KEY_SKYFRAME |
static String |
KEY_SKYTHRESHOLD |
static String |
KEY_TMPDIR
Directory path where the FITS image will be stored.
|
private MImageHDU |
lastfits |
static int |
LOWPASS
Flag for writing lowpass-images.
|
static String |
LOWPASSNAME
Ending of fits for lowpass image.
|
protected Dimension |
maxsize
The maximum size of the ccd, queried at registering.
|
static int |
MEDIAN
Flag for writing median-images.
|
static String |
MEDIANNAME
Ending of fits for reduced image.
|
static String |
RECTANGULARMATCHER
Constatn for RectangularMatcher matcher version.
|
static int |
REDUCED
Flag for writing reduced images.
|
static String |
REDUCEDNAME
Ending of fits for reduced image.
|
static int |
SKYFRAME
Pixel width of the skyframe in native part.
|
static String |
STARREGISTER
Constant for StarRegister matcher version.
|
KEY_NOINITONCREATE, POSTFIX_ALPHABET, POSTFIX_BYTES, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_MODTIME, POSTFIX_URLKEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATORKEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOMECONFIG, KEY_CLASS| Constructor and Description |
|---|
StellaGuider(Map<String,String> info)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected double |
background(Point2D center,
int xoff,
int yoff,
int binx,
int biny,
int box)
Returns the background estimate around the anticipated star.
|
void |
cancelContinuous()
Stops a continuous guiding exposure.
|
protected int |
countSum(Point2D center,
int xoff,
int yoff,
int binx,
int biny,
int box)
Returns the count sum around the anticipated star.
|
protected File |
createFitsFile(Guiding.RawFrame frame,
long expt,
String store) |
protected MFits |
createFitsObject(Guiding.RawFrame frame,
long expt) |
protected double |
fluxInside(int sbox,
double fwhm)
Returns the amount of flux inside the quadratic aperture in pixel, if the
fwhm is given.
|
protected CcdDriver |
getCcd()
Returns the ccd driver.
|
protected Dimension |
getCcdSize()
Returns the maximum size of the guider ccd.
|
List<Guiding.RawStar> |
getContinuousList()
Retrieves the recently read stars during continuos operation.
|
long |
getContinuousMinimumExpose()
Returns the minimum time allowd in continuous mode.
|
protected int |
getCurrentExpsoureNumber()
Returns the current exposure number, which may differ from the current
reduce number.
|
protected File |
getFitsDir()
Returns the directory where the fits file will be written.
|
List<Guiding.RawStar> |
getGuidingStars(Guiding.RawFrame frame,
long expt,
float gaussfwhm,
float gausstrunc,
int datamin,
int datamax,
int search,
String type,
String store,
int steps) |
List<Guiding.RawStar> |
getGuidingStars(Guiding.RawFrame frame,
long expt,
int datamin,
int datamax,
int search,
String type)
Takes a guiding frame and processes it in a way that any steps necessary
to derive star positions out of it.
|
List<Guiding.RawStar> |
getGuidingStars(Guiding.RawFrame frame,
long expt,
int datamin,
int datamax,
int search,
String type,
String store,
int steps)
Takes a guiding frame and processes it in a way that any steps necessary
to derive star positions out of it.
|
MImageHDU |
getLastGuidingImage()
Returns the lately cached fits file.
|
protected File |
getTmpDir()
Returns the temporary directory where the fits file can be written.
|
protected String |
getTmpFitsname() |
void |
init() |
protected List<Guiding.RawStar> |
interpretFitsFile(File fitsfile,
Guiding.RawFrame frame,
long expt,
float gaussfwhm,
float gausstrunc,
int datamin,
int datamax,
int search,
String type,
String store,
int steps) |
protected List<Guiding.RawStar> |
interpretFitsFile(File fitsfile,
Guiding.RawFrame frame,
long expt,
int datamin,
int datamax,
int search,
String type,
String store,
int steps) |
boolean |
isReady()
Returns if we are ready to take guider ccd images.
|
Point2D |
match(List<Guiding.RawStar> raw,
List<Guiding.RawStar> catalog,
double deltaPix,
double dmag)
Matches a list of
Guiding.RawStars measured against a list of
Guiding.RawStars constructed from a catalog. |
protected double |
photometry(Point2D center,
int xoff,
int yoff,
int binx,
int biny,
double fwhm,
int box)
Does aperture photometry.
|
void |
prepareContinuous(long expt)
Prepares a continuous guiding exposure.
|
protected List<Guiding.RawStar> |
reduceFitsFile(File fitsfile,
String biasname,
double btime,
String darkname,
double dtime,
int xoff,
int yoff,
int binx,
int biny,
long expt,
float gaussfwhm,
float gausstrunc,
int datamin,
int datamax,
int search,
String type,
String store,
int steps)
Does reduction on a writtn fits file.
|
private List<Guiding.RawStar> |
reduceFitsFilePure(File fitsfile,
String biasname,
String darkname,
double dtime,
int xoff,
int yoff,
int binx,
int biny,
long expt,
float gaussfwhm,
float gausstrunc,
int datamin,
int datamax,
int search,
String type,
String store,
int steps)
Does reduction on a writtn fits file using pure java code.
|
void |
registerCcd(CcdDriver fechner)
Registers the guider ccd driver to the stella guider.
|
protected void |
setBiasReduction(File biasfile,
double exposure)
Sets the fits file holding the bias frame, and additionally on
shutter-less systems, the exposure time of the bias frame.
|
protected void |
setDarkReduction(File darkfile,
double exposure)
Sets the fits file holding the bias frame, and additionally on
shutter-less systems, the exposure time of the bias frame.
|
protected void |
setGuiding(boolean isguide) |
boolean |
startContinuous(String keepfits,
float gaufwhm,
float gautrunc,
int min,
int max,
int box,
int keep,
FrameShifting guide,
PostReducing loop)
Starts a continuous guiding exposure.
|
boolean |
startContinuous(String keepfits,
int min,
int max,
int box,
int keep,
FrameShifting guide,
PostReducing loop)
Starts a continuous guiding exposure.
|
void |
stopContinuous() |
clone, createFrom, createFrom, createFrom, createInstance, getApplet, getAsResources, getLocate, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, hasLocalURLs, initProperties, keyCreate, keyCreate, reload, setAppletaugment, augment, 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, parseObject, reload, removeProperty, requires, rescanned, setObject, setProperties, setProperty, stringProperties, toStringequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdefaultBoolean, 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, stringPropertiespublic static final int REDUCED
public static final int LOWPASS
public static final int MEDIAN
public static final int CLEAN
public static final int GAUSS
public static final int SKYFRAME
public static final String REDUCEDNAME
public static final String LOWPASSNAME
public static final String MEDIANNAME
public static final String CLEANNAME
public static final String GAUSSNAME
public static final String STARREGISTER
public static final String RECTANGULARMATCHER
public static final String KEY_SKYFRAME
public static final String KEY_SKYTHRESHOLD
public static final String KEY_FITSDIR
public static final String KEY_TMPDIR
public static final String KEY_GUIDINGIMG
public static final String KEY_REDUCEDIR
public static final String KEY_SIZELOWPASS
public static final String KEY_LOWPASS
public static final String KEY_SIZEMEDIAN
public static final String KEY_DEPTHMEDIAN
public static final String KEY_GAUSSFWHM
public static final String KEY_GAUSSTRUNCATE
public static final String KEY_MATCHERVERSION
public static final String KEY_REDUCETIME
public static final String KEY_MAGTRUNCATE
private static final String DEFTMPDIR
private static final String DEFFITSDIR
private static final String DEFGUIDINGIMG
private static final String DEFREDUCEDIR
private static final int DEFSIZELOWPASS
private static final double DEFLOWPASS
private static final int DEFSIZEMEDIAN
private static final float DEFDEPTHMEDIAN
private static final float DEFGAUSSFWHM
private static final float DEFGAUSSTRUNCATE
private static final String DEFMATCHERVERSION
private static final long DEFREDUCETIME
private static final double DEFMAGTRUNCATE
private static final boolean DEFNATIVELIB
private static final int DEFSKYFRAME
private static final double DEFSKYTHRESHOLD
protected File biasfits
protected double biastime
protected File darkfits
protected double darktime
private CcdDriver ccd
private final Object ccdlock
protected Dimension maxsize
private MFitsStarFind javafits
private long contexpose
private StellaGuider.ExposeThread doexpose
private StellaGuider.ReduceThread doreduce
private int curcount
private MImageHDU lastfits
public void init()
init in interface Initializableprotected File getFitsDir()
protected File getTmpDir()
protected String getTmpFitsname()
protected void setBiasReduction(File biasfile, double exposure)
biasfile - The fits file containing the bias frame.exposure - The exposure time of this frame in milliseconds.protected void setDarkReduction(File darkfile, double exposure)
darkfile - The fits file containing the dark frame.exposure - The exposure time of this frame in milliseconds.public void registerCcd(CcdDriver fechner)
registerCcd in interface Guidingprotected CcdDriver getCcd()
public boolean isReady()
public MImageHDU getLastGuidingImage()
getLastGuidingImage in interface FitsGuidingpublic List<Guiding.RawStar> getGuidingStars(Guiding.RawFrame frame, long expt, int datamin, int datamax, int search, String type) throws IOException, IllegalWindowException, IllegalSearchBoxException
Guiding.RawStars. The search box is a dimension in pixel.getGuidingStars in interface Guidingguide - A rectangle specifying the guiding frame in pixel.binx - Binning factor in x.biny - Binning factor in y.expt - The exposure time in ms.search - The size of the quadratic search box in unbinned pixel.datamin - Minimum data value to consider.datamax - Maximum data value to consider to exclude cosmics.Guiding.RawStars.IllegalWindowException - If the rectangle is invalid, i.e. if the size and/or the
upper left coordinate cannot be realized on the guider CCD.IllegalSearchBoxException - If the search box is too large.IOException - If the CCD cannot be read.public List<Guiding.RawStar> getGuidingStars(Guiding.RawFrame frame, long expt, int datamin, int datamax, int search, String type, String store, int steps) throws IOException, IllegalWindowException, IllegalSearchBoxException
Guiding.RawStars. The search box is a dimension in pixel.
Additionally the user may specify which reduction fits should be stored
giving a truncated file name and an integer specifying the fits to store.guide - A rectangle specifying the guiding frame in pixel.binx - Binning factor in x.biny - Binning factor in y.expt - The exposure time in ms.search - The size of the quadratic search box in unbinned pixel.datamin - Minimum data value to consider.datamax - Maximum data value to consider to exclude cosmics.store - A truncated file name for the guider framessteps - An ored int of MEDIAN etc.Guiding.RawStars.IllegalWindowException - If the rectangle is invalid, i.e. if the size and/or the
upper left coordinate cannot be realized on the guider CCD.IllegalSearchBoxException - If the search box is too large.IOException - If the CCD cannot be read.public List<Guiding.RawStar> getGuidingStars(Guiding.RawFrame frame, long expt, float gaussfwhm, float gausstrunc, int datamin, int datamax, int search, String type, String store, int steps) throws IOException, IllegalWindowException, IllegalSearchBoxException
protected List<Guiding.RawStar> interpretFitsFile(File fitsfile, Guiding.RawFrame frame, long expt, int datamin, int datamax, int search, String type, String store, int steps) throws IllegalWindowException, IllegalSearchBoxException
protected List<Guiding.RawStar> interpretFitsFile(File fitsfile, Guiding.RawFrame frame, long expt, float gaussfwhm, float gausstrunc, int datamin, int datamax, int search, String type, String store, int steps) throws IllegalWindowException, IllegalSearchBoxException
protected File createFitsFile(Guiding.RawFrame frame, long expt, String store) throws IOException, IllegalWindowException
IOExceptionIllegalWindowExceptionprotected MFits createFitsObject(Guiding.RawFrame frame, long expt) throws IOException, IllegalWindowException
IOExceptionIllegalWindowExceptionpublic void prepareContinuous(long expt)
throws IOException,
IllegalWindowException
startContinuous(java.lang.String, int, int, int, int, stella.adapter.FrameShifting, stella.adapter.PostReducing). The settings are
invalidated with a call to #stopContiuous.IOExceptionIllegalWindowExceptionpublic long getContinuousMinimumExpose()
protected void setGuiding(boolean isguide)
public boolean startContinuous(String keepfits, int min, int max, int box, int keep, FrameShifting guide, PostReducing loop)
#stopContiuous, lists of
raw stars can be retrieved with #getLatestStars. The method does
return immediately. public boolean startContinuous(String keepfits, float gaufwhm, float gautrunc, int min, int max, int box, int keep, FrameShifting guide, PostReducing loop)
stopContinuous(), lists of
raw stars can be retrieved with getContinuousList(). The method
does return immediately.public void cancelContinuous()
public void stopContinuous()
public List<Guiding.RawStar> getContinuousList() throws IOException
IOExceptionprotected Dimension getCcdSize()
protected int getCurrentExpsoureNumber()
protected double photometry(Point2D center, int xoff, int yoff, int binx, int biny, double fwhm, int box)
center - The star center in physical CCD-coordinates.xoff - Upper left corner of the frame, x.yoff - Upper left corner of the frame, y.binx - Binning in x direction.biny - Binning in y direction.fwhm - In unbinned pixels, determined from somewhere else, probably
the seeing fit.box - Radius of the squared aperture box in unbinned pixel.protected double fluxInside(int sbox,
double fwhm)
protected double background(Point2D center, int xoff, int yoff, int binx, int biny, int box)
center - The star center in physical CCD-coordinates.xoff - Upper left corner of the frame, x.yoff - Upper left corner of the frame, y.binx - Binning in x direction.biny - Binning in y direction.box - Radius of the squared aperture box in unbinned pixel.protected int countSum(Point2D center, int xoff, int yoff, int binx, int biny, int box)
center - The star center in physical CCD-coordinates.xoff - Upper left corner of the frame, x.yoff - Upper left corner of the frame, y.binx - Binning in x direction.biny - Binning in y direction.box - Radius of the squared aperture box in unbinned pixel.protected List<Guiding.RawStar> reduceFitsFile(File fitsfile, String biasname, double btime, String darkname, double dtime, int xoff, int yoff, int binx, int biny, long expt, float gaussfwhm, float gausstrunc, int datamin, int datamax, int search, String type, String store, int steps)
binx - Binning factor in x.biny - Binning factor in y.expt - The exposure time in ms.search - The size of the quadratic search box in unbinned pixel.datamin - Minimum data value to consider.datamax - Maximum data value to consider to exclude cosmics.type - Ignored, may be nullstore - A truncated file name for the guider framessteps - An ored int of MEDIAN etc.Guiding.RawStars.private List<Guiding.RawStar> reduceFitsFilePure(File fitsfile, String biasname, String darkname, double dtime, int xoff, int yoff, int binx, int biny, long expt, float gaussfwhm, float gausstrunc, int datamin, int datamax, int search, String type, String store, int steps)
binx - Binning factor in x.biny - Binning factor in y.expt - The exposure time in ms.search - The size of the quadratic search box in unbinned pixel.datamin - Minimum data value to consider.datamax - Maximum data value to consider to exclude cosmics.type - Ignored, may be nullstore - A truncated file name for the guider framessteps - An ored int of MEDIAN etc.Guiding.RawStars.FitsExceptionpublic Point2D match(List<Guiding.RawStar> raw, List<Guiding.RawStar> catalog, double deltaPix, double dmag) throws AmbiguousPatternException, NoStarException, CannotMatchException
Guiding.RawStars measured against a list of
Guiding.RawStars constructed from a catalog. In constructing the
list from a catalog, an extra border is applied to account for possible
misspointings of the telescope. The supplied pixel values are applied to
both sides of the guiding frame.match in interface Guidingraw - The list of Guiding.RawStars. The master deletes all
invalid (i.e. non-star objects) from the list returned by
getGuidingStars(stella.adapter.Guiding.RawFrame, long, int, int, int, java.lang.String).catalog - The list of Guiding.RawStarss provided by the
AdapterMaster, calculated from a star catalog. This
list will comprise a bigger field then the expected actual
guider field.width - The additional frame thickness between catalog and image in
pixel.height - The additional frame thickness between catalog and image in
pixel.deltaPix - expected uncertainity of the catalog positions in pixels.AmbiguousPatternException - If more stars are seen in the raw data than can be matched to
the catalog.NoStarException - If the supplied list of raw stars is empty.CannotMatchException - If matching fails for any other reason.