Package uk.ac.starlink.votable
Class Timesys
java.lang.Object
uk.ac.starlink.votable.Timesys
Utility class for working with VOTable TIMESYS elements.
- Since:
- 26 Apr 2019
- Author:
- Mark Taylor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic double
decodeTimeorigin
(String txt) Turns the value string found in the TIMESYS/@timeorigin attribute into a numeric value giving JD offset in days.Returns the reference position identifier.double
Returns the numeric value of time origin.Returns the timescale identifier.static Timesys
getTimesys
(uk.ac.starlink.table.ValueInfo info) Extracts a Timesys instance from a ValueInfo.toString()
-
Constructor Details
-
Timesys
Constructor.- Parameters:
timeorigin
- numeric value of time origin (JD offset); if the timeys doesn't have one, use NaNtimescale
- timescale valuerefposition
- refposition value
-
-
Method Details
-
getTimeorigin
public double getTimeorigin()Returns the numeric value of time origin.- Returns:
- JD offset in days, or NaN if no time origin
-
getTimescale
Returns the timescale identifier.- Returns:
- timescale
-
getRefposition
Returns the reference position identifier.- Returns:
- refposition
-
toString
-
decodeTimeorigin
Turns the value string found in the TIMESYS/@timeorigin attribute into a numeric value giving JD offset in days. If the text is not legal for the timeorigin attribute, a NumberFormatException will be thrown.- Parameters:
txt
- timeorigin attribute value- Returns:
- numeric offset value
- Throws:
NumberFormatException
- if the value is not one of the magic strings and is not a valid numerical representation
-
getTimesys
Extracts a Timesys instance from a ValueInfo. If the metadata contains insufficient or incorrect information to define a Timesys, null is returned.- Parameters:
info
- value metadata- Returns:
- timesys instance or null
-