jsky.plot
Class ElevationPlotModel

java.lang.Object
  extended by jsky.plot.ElevationPlotModel

public class ElevationPlotModel
extends java.lang.Object

A model class for plotting elevation vs local sidereal time for a given list of target positions. This class can be used to display the graph using JFreeChart.

Version:
$Revision: 1.7 $
Author:
Allan Brighton

Field Summary
static int HOURS_TO_MILLISEC
           
static java.lang.String LST
          Constant for local sidereal time
static java.lang.String SITE_TIME
          Constant for telescope site time
static java.lang.String UT
          Constant for UT time
 
Constructor Summary
ElevationPlotModel(SiteDesc site, java.util.Date date, TargetDesc[] targets)
          Initialize an elevation plot model for the given date, location, and target coordinates.
ElevationPlotModel(SiteDesc site, java.util.Date date, TargetDesc[] targets, java.lang.String timeZoneDisplayName, java.lang.String timeZoneId)
          Initialize an elevation plot model for the given date, location, and target coordinates.
 
Method Summary
 void addChangeListener(javax.swing.event.ChangeListener l)
          register to receive change events from this object whenever the model changes.
 java.util.Date getAstronomicalTwilightEnd()
          Return the end time of astronomical twilight in the selected time zone
 java.util.Date getAstronomicalTwilightStart()
          Return the start time of astronomical twilight in the selected time zone
 java.lang.String[] getCategories()
          Return an array of the available categories
 java.util.Date getDate()
          Return the date for the plot
 java.util.Date getDateForHour(double hour)
          Return the date/time given the UT hour between 0 and 24
 java.util.Date getEndDate()
          Return the maximum date value
 org.jfree.data.category.IntervalCategoryDataset getIntervalCategoryDataset(java.lang.String category)
          Return an IntervalCategoryDataset for this model for the given category
 java.util.Date getLst(java.util.Date date)
          Return the LST date for the given UT date
 double getMaxElevation(int targetIndex)
          Return the approximate maximum elevation for the given target index
 double getMaxElevationTime(int targetIndex)
          Return the approximate time in ms of the maximum elevation for the given target index
 java.util.Date getNauticalTwilightEnd()
          Return the end time of nautical twilight in the selected time zone
 java.util.Date getNauticalTwilightStart()
          Return the start time of nautical twilight in the selected time zone
 int getNumTargets()
          Return the number of target objects returned by getTargets().
static double getObsThreshold()
          Return the threshold in degrees above the horizon where targets are considered observable
 org.jfree.data.xy.XYDataset getSecondaryDataset()
          Return an XYDataset for this model that shows parallactic angle against time
 SiteDesc getSite()
          Return the name and location of the observatory site
 java.util.Date getStartDate()
          Return the minimum date value
 java.util.Date getSunrise()
          Return the official sunrise time in the selected time zone
 java.util.Date getSunset()
          Return the official sunset time in the selected time zone
 javax.swing.table.TableModel getTableModel(int targetIndex)
          Return the TableModel corresponding to the given index in the array returned from getTargets().
 TargetDesc[] getTargets()
          Return an array of target objects, whose elevations are being plotted
 java.util.TimeZone getTimeZone()
          Return the time zone to use for the X values
 java.lang.String getTimeZoneDisplayName()
          Return the time zone display name to use for the X values
 java.lang.String getTimeZoneId()
          Return the time zone id to use for the X values
 java.lang.String getTitle()
          Return a title based on the site and the date
 org.jfree.data.xy.XYDataset getXYDataset()
          Return an XYDataset for this model that shows altitude against time
 void removeChangeListener(javax.swing.event.ChangeListener l)
          Stop receiving change events from this object.
 void setDate(java.util.Date date)
          Set the date of the plot
static void setObsThreshold(double d)
          Set the threshold in degrees above the horizon where targets are considered observable
 void setSampleInterval(int minutes)
          Set the sample interval for the plot.
 void setSite(SiteDesc site)
          Set the observatory site description
 void setTargets(TargetDesc[] targets)
          Set the array of target objects, whose elevations are being plotted
 void setTimeZone(java.lang.String timeZoneDisplayName, java.lang.String timeZoneId)
          Set the time zone to use to display the X values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HOURS_TO_MILLISEC

public static final int HOURS_TO_MILLISEC
See Also:
Constant Field Values

LST

public static final java.lang.String LST
Constant for local sidereal time

See Also:
Constant Field Values

UT

public static final java.lang.String UT
Constant for UT time

See Also:
Constant Field Values

SITE_TIME

public static final java.lang.String SITE_TIME
Constant for telescope site time

See Also:
Constant Field Values
Constructor Detail

ElevationPlotModel

public ElevationPlotModel(SiteDesc site,
                          java.util.Date date,
                          TargetDesc[] targets,
                          java.lang.String timeZoneDisplayName,
                          java.lang.String timeZoneId)
Initialize an elevation plot model for the given date, location, and target coordinates.

Parameters:
site - the name and location of the observatory site
date - the date for which the plot should be calculated
targets - an array of target object descriptions
timeZoneDisplayName - the display name for the time zone for the X axis
timeZoneId - the time zone id for the X axis (one of "UT", "LST", or some standard time zone id)

ElevationPlotModel

public ElevationPlotModel(SiteDesc site,
                          java.util.Date date,
                          TargetDesc[] targets)
Initialize an elevation plot model for the given date, location, and target coordinates.

Parameters:
site - the name and location of the observatory site
date - the date for which the plot should be calculated
targets - an array of target object descriptions
Method Detail

setSampleInterval

public void setSampleInterval(int minutes)
Set the sample interval for the plot.


getTitle

public java.lang.String getTitle()
Return a title based on the site and the date


getObsThreshold

public static double getObsThreshold()
Return the threshold in degrees above the horizon where targets are considered observable


setObsThreshold

public static void setObsThreshold(double d)
Set the threshold in degrees above the horizon where targets are considered observable


getSite

public SiteDesc getSite()
Return the name and location of the observatory site


setSite

public void setSite(SiteDesc site)
Set the observatory site description


getTimeZoneDisplayName

public java.lang.String getTimeZoneDisplayName()
Return the time zone display name to use for the X values


getTimeZoneId

public java.lang.String getTimeZoneId()
Return the time zone id to use for the X values


getTimeZone

public java.util.TimeZone getTimeZone()
Return the time zone to use for the X values


setTimeZone

public void setTimeZone(java.lang.String timeZoneDisplayName,
                        java.lang.String timeZoneId)
Set the time zone to use to display the X values.

Parameters:
timeZoneDisplayName - name to display for the time zone
timeZoneId - the id of the time zone

getDate

public java.util.Date getDate()
Return the date for the plot


setDate

public void setDate(java.util.Date date)
Set the date of the plot


getNumTargets

public int getNumTargets()
Return the number of target objects returned by getTargets().


getTargets

public TargetDesc[] getTargets()
Return an array of target objects, whose elevations are being plotted


setTargets

public void setTargets(TargetDesc[] targets)
Set the array of target objects, whose elevations are being plotted


getTableModel

public javax.swing.table.TableModel getTableModel(int targetIndex)
Return the TableModel corresponding to the given index in the array returned from getTargets().


getXYDataset

public org.jfree.data.xy.XYDataset getXYDataset()
Return an XYDataset for this model that shows altitude against time


getSecondaryDataset

public org.jfree.data.xy.XYDataset getSecondaryDataset()
Return an XYDataset for this model that shows parallactic angle against time


getMaxElevation

public double getMaxElevation(int targetIndex)
Return the approximate maximum elevation for the given target index


getMaxElevationTime

public double getMaxElevationTime(int targetIndex)
Return the approximate time in ms of the maximum elevation for the given target index


getCategories

public java.lang.String[] getCategories()
Return an array of the available categories


getIntervalCategoryDataset

public org.jfree.data.category.IntervalCategoryDataset getIntervalCategoryDataset(java.lang.String category)
Return an IntervalCategoryDataset for this model for the given category


getLst

public java.util.Date getLst(java.util.Date date)
Return the LST date for the given UT date


getStartDate

public java.util.Date getStartDate()
Return the minimum date value


getEndDate

public java.util.Date getEndDate()
Return the maximum date value


getDateForHour

public java.util.Date getDateForHour(double hour)
Return the date/time given the UT hour between 0 and 24


getSunset

public java.util.Date getSunset()
Return the official sunset time in the selected time zone


getSunrise

public java.util.Date getSunrise()
Return the official sunrise time in the selected time zone


getNauticalTwilightStart

public java.util.Date getNauticalTwilightStart()
Return the start time of nautical twilight in the selected time zone


getNauticalTwilightEnd

public java.util.Date getNauticalTwilightEnd()
Return the end time of nautical twilight in the selected time zone


getAstronomicalTwilightStart

public java.util.Date getAstronomicalTwilightStart()
Return the start time of astronomical twilight in the selected time zone


getAstronomicalTwilightEnd

public java.util.Date getAstronomicalTwilightEnd()
Return the end time of astronomical twilight in the selected time zone


addChangeListener

public void addChangeListener(javax.swing.event.ChangeListener l)
register to receive change events from this object whenever the model changes.


removeChangeListener

public void removeChangeListener(javax.swing.event.ChangeListener l)
Stop receiving change events from this object.