net.grelf.astro
Class Star

java.lang.Object
  extended by net.grelf.astro.Star
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class Star
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

A star can have several ids, from different catalogues. The commonId is for the brightest stars, comprising the constellation abbreviation and Flamsteed number and/or Bayer letter. If the user enters a reference of their own it is held in the otherId field.

9.12.20: Enabled star to have multiple magnitudes in different bands, held in a list.

See Also:
Serialized Form

Field Summary
static long serialVersionUID
           
protected  double xdd
          Recalculated for different star charts.
protected  double zdd
          Recalculated for different star charts.
 
Constructor Summary
Star()
          Set the fields individually after construction, if you really must.
Star(java.lang.String commonId, java.lang.String hipparcosId, java.lang.String tychoId, RA ra, Dec dec, Epoch epoch, Magnitude magnitude, Variability variability)
          Generally two of the ids passed in will be expected to be null; they may get set after construction.
Star(java.lang.String commonId, java.lang.String hipparcosId, java.lang.String tychoId, RA ra, Dec dec, Epoch epoch, Magnitude magnitude, Variability variability, double xdd, double zdd)
          Generally two of the ids passed in will be expected to be null.
Star(java.lang.String commonId, java.lang.String hipparcosId, java.lang.String tychoId, RA ra, Dec dec, Epoch epoch, Magnitude magnitude, Variability variability, ProperMotion pm)
          Generally two of the ids passed in will be expected to be null; they may get set after construction.
Star(java.lang.String commonId, java.lang.String hipparcosId, java.lang.String tychoId, RA ra, Dec dec, Epoch epoch, Magnitude magnitude, Variability variability, ProperMotion pm, double xdd, double zdd)
          Generally two of the ids passed in will be expected to be null.
 
Method Summary
 void addMagnitude(Magnitude m)
          Add another magnitude for this star.
protected  MeasuredValue calibrateImage(java.util.List<BlobMeas> refBlobs)
          Uses known celestial coordinates of refBlobs (from a StarChart: every BlobMeas must have a Star) to return scale factor in degrees per pixel.
 void changeEpoch(Epoch newEquinox, JulianDate newEpoch)
          This adjusts the fields of the current object to the given new equinox (eg, J2000) and epoch (eg, JD now) by first applying proper motion for the new epoch and then calling SkyPoint.changeEpoch (equinox) on the resulting position.
 Star clone()
          Returns a new Star object with the same data.
 boolean equals(java.lang.Object other)
          Does not involve the fields xdd and zdd because a given star may be plotted in different positions on different StarCharts.
 java.lang.String getCommonId()
          Comprising the constellation abbreviation and Flamsteed number and/or Bayer letter (only brightest stars have these).
 java.lang.String getHipparcosId()
           
 java.lang.String getId()
          If the star has a commonId return that; otherwise if it has a hipparcosId return that; otherwise if it has a tychoId return that; otherwise if it has an otherId return that; otherwise return an empty string.
 Magnitude getMagnitude()
          Get the "principal" magnitude.
 Magnitude getMagnitude(java.lang.String bandId)
          Get the magnitude with given band id, or null if not found.
 java.util.List<Magnitude> getMagnitudes()
          Get the list of magnitudes
 java.lang.String getOtherId()
           
 java.awt.Point getPlotPoint()
           
 SkyPoint getPosition()
          If the star's position is unknown this returns null.
 ProperMotion getProperMotion()
          If the star's proper motion is unknown this returns a ProperMotion object in which both components are zero.
 java.lang.String getTychoId()
           
 java.lang.String getTypeOfStellarObject()
           
 Variability getVariability()
          If the star's variability is unknown this returns null, not a special value.
 int hashCode()
          Enable objects of this class to be used as hash keys.
 SkyPoint measurePosition(ImFrame parentFrame, BlobMeasList measList)
          If this star has unknown position (RA/Dec), do astrometry using the known reference stars in the given MeasList.
protected  SkyPoint measureTargetBlob(java.util.List<BlobMeas> refBlobs, BlobMeas targetMeas, Epoch epoch, MeasuredValue degreesPerPixel)
           
protected  SkyPoint measureTargetBlob2(java.util.List<BlobMeas> refBlobs, BlobMeas targetMeas, Epoch epoch, MeasuredValue degreesPerPixel)
           
 void setCommonId(java.lang.String id)
           
 void setHipparcosId(java.lang.String id)
           
 void setMagnitude(Magnitude m)
          For entering a manual magnitude value to replace all others (as in BlobMenu).
 void setOtherId(java.lang.String id)
          For user-entered reference of their own devising.
 void setPlotPoint(java.awt.Point pt)
          Set by StarChart when first plotting the star.
 void setPosition(SkyPoint pt)
           
 void setProperMotion(ProperMotion pm)
           
 void setTychoId(java.lang.String id)
           
 void setTypeOfStellarObject(java.lang.String type)
          Some data sources will provide some kind of description to be set here.
 void setVariability(Variability v)
           
 java.lang.String toFoldedString()
          More detailed and more suitable for display to the user - reasonably formatted multi-line text, using "\n" as the line feed character.
 java.lang.String toFoldedString(java.lang.String lineFeed)
          The lineFeed might be "\n" or "
" etc.
 java.lang.String toString()
          Simplified summary
 java.lang.StringBuffer toXML(java.lang.String indent)
          The indent string would typically contain some tab characters (\t).
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values

xdd

protected transient double xdd
Recalculated for different star charts.


zdd

protected transient double zdd
Recalculated for different star charts.

Constructor Detail

Star

public Star(java.lang.String commonId,
            java.lang.String hipparcosId,
            java.lang.String tychoId,
            RA ra,
            Dec dec,
            Epoch epoch,
            Magnitude magnitude,
            Variability variability)
Generally two of the ids passed in will be expected to be null; they may get set after construction. If magnitude or variability are unknown enter null for each.


Star

public Star(java.lang.String commonId,
            java.lang.String hipparcosId,
            java.lang.String tychoId,
            RA ra,
            Dec dec,
            Epoch epoch,
            Magnitude magnitude,
            Variability variability,
            double xdd,
            double zdd)
Generally two of the ids passed in will be expected to be null. They may get set after construction. If magnitude or variability are unknown enter null for each. This constructor also takes the transformed coordinates (xdd, zdd) for plotting on a star chart. See class StarChart for details of the transformation.


Star

public Star(java.lang.String commonId,
            java.lang.String hipparcosId,
            java.lang.String tychoId,
            RA ra,
            Dec dec,
            Epoch epoch,
            Magnitude magnitude,
            Variability variability,
            ProperMotion pm)
Generally two of the ids passed in will be expected to be null; they may get set after construction. If magnitude or variability are unknown enter null for each.


Star

public Star(java.lang.String commonId,
            java.lang.String hipparcosId,
            java.lang.String tychoId,
            RA ra,
            Dec dec,
            Epoch epoch,
            Magnitude magnitude,
            Variability variability,
            ProperMotion pm,
            double xdd,
            double zdd)
Generally two of the ids passed in will be expected to be null. They may get set after construction. If magnitude or variability are unknown enter null for each. This constructor also takes the transformed coordinates (xdd, zdd) for plotting on a star chart. See class StarChart for details of the transformation.


Star

public Star()
Set the fields individually after construction, if you really must.

Method Detail

getId

public java.lang.String getId()
If the star has a commonId return that; otherwise if it has a hipparcosId return that; otherwise if it has a tychoId return that; otherwise if it has an otherId return that; otherwise return an empty string.


getCommonId

public java.lang.String getCommonId()
Comprising the constellation abbreviation and Flamsteed number and/or Bayer letter (only brightest stars have these).


setCommonId

public void setCommonId(java.lang.String id)

getHipparcosId

public java.lang.String getHipparcosId()

setHipparcosId

public void setHipparcosId(java.lang.String id)

getTychoId

public java.lang.String getTychoId()

setTychoId

public void setTychoId(java.lang.String id)

getOtherId

public java.lang.String getOtherId()

setOtherId

public void setOtherId(java.lang.String id)
For user-entered reference of their own devising.


getTypeOfStellarObject

public java.lang.String getTypeOfStellarObject()

setTypeOfStellarObject

public void setTypeOfStellarObject(java.lang.String type)
Some data sources will provide some kind of description to be set here.


getPosition

public SkyPoint getPosition()
If the star's position is unknown this returns null.


setPosition

public void setPosition(SkyPoint pt)

getMagnitudes

public java.util.List<Magnitude> getMagnitudes()
Get the list of magnitudes


addMagnitude

public void addMagnitude(Magnitude m)
Add another magnitude for this star. A star can have multiple magnitudes, in different bands.


setMagnitude

public void setMagnitude(Magnitude m)
For entering a manual magnitude value to replace all others (as in BlobMenu). NB: REPLACES ALL.


getMagnitude

public Magnitude getMagnitude()
Get the "principal" magnitude. If the star has only one magnitude value that is returned. Otherwise the list of magnitudes is scanned. If one is found that has band id "V" or "v" that is returned. Otherwise the first one in the list is returned. If the star's magnitude is unknown (the magnitudes list is empty) this returns null, not a special value.


getMagnitude

public Magnitude getMagnitude(java.lang.String bandId)
Get the magnitude with given band id, or null if not found.


getVariability

public Variability getVariability()
If the star's variability is unknown this returns null, not a special value.


setVariability

public void setVariability(Variability v)

getProperMotion

public ProperMotion getProperMotion()
If the star's proper motion is unknown this returns a ProperMotion object in which both components are zero.


setProperMotion

public void setProperMotion(ProperMotion pm)

equals

public boolean equals(java.lang.Object other)
Does not involve the fields xdd and zdd because a given star may be plotted in different positions on different StarCharts.

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Enable objects of this class to be used as hash keys. NB: Does not involve the fields xdd and zdd because a given star may be plotted in different positions on different StarCharts.

Overrides:
hashCode in class java.lang.Object

clone

public Star clone()
Returns a new Star object with the same data.

Overrides:
clone in class java.lang.Object

changeEpoch

public void changeEpoch(Epoch newEquinox,
                        JulianDate newEpoch)
This adjusts the fields of the current object to the given new equinox (eg, J2000) and epoch (eg, JD now) by first applying proper motion for the new epoch and then calling SkyPoint.changeEpoch (equinox) on the resulting position.


measurePosition

public SkyPoint measurePosition(ImFrame parentFrame,
                                BlobMeasList measList)
If this star has unknown position (RA/Dec), do astrometry using the known reference stars in the given MeasList. The star's position field is then set and also returned (null if not successful).
NB: All stars in the measList which have unknown position will be measured.


measureTargetBlob

protected SkyPoint measureTargetBlob(java.util.List<BlobMeas> refBlobs,
                                     BlobMeas targetMeas,
                                     Epoch epoch,
                                     MeasuredValue degreesPerPixel)

measureTargetBlob2

protected SkyPoint measureTargetBlob2(java.util.List<BlobMeas> refBlobs,
                                      BlobMeas targetMeas,
                                      Epoch epoch,
                                      MeasuredValue degreesPerPixel)

calibrateImage

protected MeasuredValue calibrateImage(java.util.List<BlobMeas> refBlobs)
Uses known celestial coordinates of refBlobs (from a StarChart: every BlobMeas must have a Star) to return scale factor in degrees per pixel.


toString

public java.lang.String toString()
Simplified summary

Overrides:
toString in class java.lang.Object

toFoldedString

public java.lang.String toFoldedString()
More detailed and more suitable for display to the user - reasonably formatted multi-line text, using "\n" as the line feed character.


toFoldedString

public java.lang.String toFoldedString(java.lang.String lineFeed)
The lineFeed might be "\n" or "
" etc.


toXML

public java.lang.StringBuffer toXML(java.lang.String indent)
The indent string would typically contain some tab characters (\t).


setPlotPoint

public void setPlotPoint(java.awt.Point pt)
Set by StarChart when first plotting the star.


getPlotPoint

public java.awt.Point getPlotPoint()