net.grelf.astro
Class StarChart

java.lang.Object
  extended by net.grelf.astro.StarChartLoader
      extended by net.grelf.astro.StarChart

public class StarChart
extends StarChartLoader

A square of star chart, centred at user-provided coordinates and of user-chosen size, displayed in an ImFrame. First attempts to use AstroGrid but if that is not available tries to load data from Hipparcos and Tycho data files on disc (both downloadable from http://cdsarc.u-strasbg.fr/viz-bin/Cat?I/196


Nested Class Summary
static class StarChart.StarChartDialogue
          Enable users to set coordinates and other parameters for creating a star chart.
 
Field Summary
static int STAR_SIZE
           
 
Fields inherited from class net.grelf.astro.StarChartLoader
cos90ap, cosdp, epoch, equinox, sin90ap, sindp, sinFieldRadius
 
Constructor Summary
StarChart(java.lang.String title, RA ra, Dec dec, Epoch equinox, JulianDate epoch, double fieldWidthDegrees, boolean showVariables, boolean showChartCentre, StarChartSource source)
          If the title is null then one is constructed from the data (so many degrees around position).
StarChart(java.lang.String title, RA ra, Dec dec, Epoch equinox, JulianDate epoch, double fieldWidthDegrees, StarChartSource source)
          Use this constructor if you always want to mark variable stars and the chart centre.
 
Method Summary
static void createChart()
          Interacts with user to determine which area to chart.
static void createChart(java.awt.Frame parent)
          Interacts with user to determine which area to chart.
 Star findNearestStar(int x, int y)
          Return the star nearest to the given chart coordinates.
static Star getSelectedStar()
          Get a reference to the star most recently selected (by the user clicking near it).
static StarChart getSourceOfSelectedStar()
          Get a reference to the chart from which the most recently selected star came.
 java.util.List<Star> getStars()
          Get a reference to the list of stars used in the chart.
static StarChart loadFromHTML(java.lang.String filePath)
          Attempt to load from an HTML file which is a saved AAVSO reference sequence page.
static StarChart loadFromXML(java.lang.String filePath)
          Load from a .chart file saved from this class.
static void mergeCharts(java.util.List<StarChartFrame> chartFrames)
          Let user select a number of .chart files which are then merged into one new one.
NB: Changed 10.4.7 to pass chartFrames in as a parameter, thus enabling StarChart to compile independently of GRIP.
 void saveAsXML(java.lang.String filePath, java.lang.String title)
           
 void showNearestStarData(int x, int y)
          Displays details of the star nearest to the given position, in a message dialogue, and puts the Star object on the clipboard.
 java.lang.StringBuffer toXML(java.lang.String title)
           
 
Methods inherited from class net.grelf.astro.StarChartLoader
calculateChartCoordinates, getEpoch, getEquinox, initialiseChartCoordinates
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STAR_SIZE

public static final int STAR_SIZE
See Also:
Constant Field Values
Constructor Detail

StarChart

public StarChart(java.lang.String title,
                 RA ra,
                 Dec dec,
                 Epoch equinox,
                 JulianDate epoch,
                 double fieldWidthDegrees,
                 StarChartSource source)
Use this constructor if you always want to mark variable stars and the chart centre. If the title is null then one is constructed from the data (so many degrees around position).


StarChart

public StarChart(java.lang.String title,
                 RA ra,
                 Dec dec,
                 Epoch equinox,
                 JulianDate epoch,
                 double fieldWidthDegrees,
                 boolean showVariables,
                 boolean showChartCentre,
                 StarChartSource source)
If the title is null then one is constructed from the data (so many degrees around position). Equinox is for coordinates (precession). Epoch is for proper motion.

Method Detail

getStars

public java.util.List<Star> getStars()
Get a reference to the list of stars used in the chart.


getSelectedStar

public static Star getSelectedStar()
Get a reference to the star most recently selected (by the user clicking near it). This enables BlobMenu to associate the star with a BlobMeas.


getSourceOfSelectedStar

public static StarChart getSourceOfSelectedStar()
Get a reference to the chart from which the most recently selected star came.


createChart

public static void createChart()
Interacts with user to determine which area to chart.


createChart

public static void createChart(java.awt.Frame parent)
Interacts with user to determine which area to chart.


showNearestStarData

public void showNearestStarData(int x,
                                int y)
Displays details of the star nearest to the given position, in a message dialogue, and puts the Star object on the clipboard. Normally invoked by ImPane when the drawing mode is STAR_CHART


findNearestStar

public Star findNearestStar(int x,
                            int y)
Return the star nearest to the given chart coordinates.


mergeCharts

public static void mergeCharts(java.util.List<StarChartFrame> chartFrames)
Let user select a number of .chart files which are then merged into one new one.
NB: Changed 10.4.7 to pass chartFrames in as a parameter, thus enabling StarChart to compile independently of GRIP. Get the chartFrames like this:
java.util.List chartFrames = net.grelf.grip.GRIP.getInstance ().getAllStarChartFrames ();


loadFromHTML

public static StarChart loadFromHTML(java.lang.String filePath)
Attempt to load from an HTML file which is a saved AAVSO reference sequence page. Of course we have no control over AAVSO's format, which may change. We assume the first table element contains the data we need. The first row is parsed to find out which column is which (RA, Dec, etc) and the other rows are then interpreted accordingly to build a chart. Assume epoch 2000. Returns null if any error is detected.


loadFromXML

public static StarChart loadFromXML(java.lang.String filePath)
Load from a .chart file saved from this class.


saveAsXML

public void saveAsXML(java.lang.String filePath,
                      java.lang.String title)

toXML

public java.lang.StringBuffer toXML(java.lang.String title)