public class TimeFrame extends Frame
A TimeFrame represents a moment in time as either an Modified Julian Date (MJD), a Julian Date (JD), a Besselian epoch or a Julian epoch, as determined by the System attribute. Optionally, a zero point can be specified (using attribute TimeOrigin) which results in the TimeFrame representing time offsets from the specified zero point.
Even though JD and MJD are defined as being in units of days, the TimeFrame class allows other units to be used (via the Unit attribute) on the basis of simple scalings (60 seconds = 1 minute, 60 minutes = 1 hour, 24 hours = 1 day, 365.25 days = 1 year). Likewise, Julian epochs can be described in units other than the usual years. Besselian epoch are always represented in units of (tropical) years.
The TimeScale attribute allows the time scale to be specified (that is, the physical process used to define the rate of flow of time). MJD, JD and Julian epoch can be used to represent a time in any supported time scale. However, Besselian epoch may only be used with the "TT" (Terrestrial Time) time scale. The list of supported time scales includes universal time and siderial time. Strictly, these represent angles rather than time scales, but are included in the list since they are in common use and are often thought of as time scales.
When a time value is formatted it can be formated either as a simple floating point value, or as a Gregorian date (see the Format attribute).
This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public Licence for more details.
You should have received a copy of the GNU General Public Licence along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street,Fifth Floor, Boston, MA 02110-1301, USA
Mapping.Interpolator, Mapping.Spreader
LINEAR_INTERPOLATOR, LINEAR_SPREADER, NEAREST_INTERPOLATOR, NEAREST_SPREADER
AST__BAD, AST__TUNULL, pointer
Constructor and Description |
---|
TimeFrame()
Create a TimeFrame.
|
Modifier and Type | Method and Description |
---|---|
double |
currentTime()
Return the current system time.
|
String |
getAlignTimeScale()
Get
time scale to use when aligning TimeFrames.
|
String |
getClockLat()
Synonym for
Frame.getObsLat() . |
String |
getClockLon()
Synonym for
Frame.getObsLon() . |
double |
getLtOffset()
Get
the offset from UTC to Local Time, in hours.
|
double |
getTimeOrigin()
Get
the zero point for TimeFrame axis values.
|
String |
getTimeScale()
Get
time scale.
|
void |
setAlignTimeScale(String alignTimeScale)
Set
time scale to use when aligning TimeFrames.
|
void |
setClockLat(String clockLat)
Synonym for
Frame.setObsLat(java.lang.String) . |
void |
setClockLon(String clockLon)
Synonym for
Frame.setObsLon(java.lang.String) . |
void |
setLtOffset(double ltOffset)
Set
the offset from UTC to Local Time, in hours.
|
void |
setTimeOrigin(double timeOrigin)
Set
the zero point for TimeFrame axis values.
|
void |
setTimeOrigin(String timeOrigin)
Set
the zero point for TimeFrame axis values.
|
void |
setTimeScale(String timeScale)
Set
time scale.
|
angle, axAngle, axDistance, axOffset, convert, distance, findFrame, format, getActiveUnit, getAlignSystem, getBottom, getDigits, getDigits, getDirection, getDomain, getDut1, getEpoch, getFormat, getLabel, getMatchEnd, getMaxAxes, getMinAxes, getNaxes, getNormUnit, getObsLat, getObsLon, getPermute, getPreserveAxes, getSymbol, getSystem, getTitle, getTop, getUnit, intersect, norm, offset, offset2, permAxes, pickAxes, resolve, setActiveUnit, setAlignSystem, setBottom, setDigits, setDigits, setDirection, setDomain, setDut1, setEpoch, setEpoch, setFormat, setLabel, setMatchEnd, setMaxAxes, setMinAxes, setObsLat, setObsLon, setPermute, setPreserveAxes, setSymbol, setSystem, setTitle, setTop, setUnit, unformat
decompose, getInvert, getNin, getNout, getReport, getTranForward, getTranInverse, invert, linearApprox, mapBox, mapSplit, rate, rebin, rebinD, rebinF, rebinI, resample, resampleB, resampleD, resampleF, resampleI, resampleL, resampleS, setInvert, setReport, simplify, tran1, tran2, tranGrid, tranN, tranP
annul, clear, copy, delete, equals, finalize, getAstConstantI, getB, getC, getD, getF, getI, getID, getIdent, getL, getNobject, getObjSize, getRefCount, hashCode, isThreaded, reportVersions, sameObject, set, setB, setC, setD, setF, setI, setID, setIdent, setL, show, test, tune
public TimeFrame()
A TimeFrame is a specialised form of one-dimensional Frame which represents various coordinate systems used to describe positions in time.
A TimeFrame represents a moment in time as either an Modified Julian Date (MJD), a Julian Date (JD), a Besselian epoch or a Julian epoch, as determined by the System attribute. Optionally, a zero point can be specified (using attribute TimeOrigin) which results in the TimeFrame representing time offsets from the specified zero point.
Even though JD and MJD are defined as being in units of days, the TimeFrame class allows other units to be used (via the Unit attribute) on the basis of simple scalings (60 seconds = 1 minute, 60 minutes = 1 hour, 24 hours = 1 day, 365.25 days = 1 year). Likewise, Julian epochs can be described in units other than the usual years. Besselian epoch are always represented in units of (tropical) years.
The TimeScale attribute allows the time scale to be specified (that is, the physical proces used to define the rate of flow of time). MJD, JD and Julian epoch can be used to represent a time in any supported time scale. However, Besselian epoch may only be used with the "TT" (Terrestrial Time) time scale. The list of supported time scales includes universal time and siderial time. Strictly, these represent angles rather than time scales, but are included in the list since they are in common use and are often thought of as time scales.
When a time value is formatted it can be formated either as a simple floating point value, or as a Gregorian date (see the Format attribute).
AstException
- if an error occurred in the AST librarypublic double currentTime()
AstException
- if an error occurred in the AST librarypublic String getAlignTimeScale()
When astFindFrame or astConvert is used on two TimeFrames (potentially describing different time coordinate systems), it returns a Mapping which can be used to transform a position in one TimeFrame into the corresponding position in the other. The Mapping is made up of the following steps in the indicated order:
- Map values from the system used by the target (MJD, JD, etc) to the
system specified by the AlignSystem attribute.
- Map these values from the target's time scale to the time scale
specified by the AlignTimeScale attribute.
- Map these values from the time scale specified by the AlignTimeScale
attribute, to the template's time scale.
- Map these values from the system specified by the AlignSystem
attribute, to the system used by the template.
public void setAlignTimeScale(String alignTimeScale)
When astFindFrame or astConvert is used on two TimeFrames (potentially describing different time coordinate systems), it returns a Mapping which can be used to transform a position in one TimeFrame into the corresponding position in the other. The Mapping is made up of the following steps in the indicated order:
- Map values from the system used by the target (MJD, JD, etc) to the
system specified by the AlignSystem attribute.
- Map these values from the target's time scale to the time scale
specified by the AlignTimeScale attribute.
- Map these values from the time scale specified by the AlignTimeScale
attribute, to the template's time scale.
- Map these values from the system specified by the AlignSystem
attribute, to the system used by the template.
alignTimeScale
- the AlignTimeScale attribute of this objectpublic double getLtOffset()
public void setLtOffset(double ltOffset)
ltOffset
- the LtOffset attribute of this objectpublic double getTimeOrigin()
- Besselian Epoch: Expressed in decimal years, with or without
decimal places ("B1950" or "B1976.13" for example).
- Julian Epoch: Expressed in decimal years, with or without
decimal places ("J2000" or "J2100.9" for example).
- Units: An unqualified decimal value is interpreted as a value in
the system specified by the TimeFrame's System attribute, in the
units given by the TimeFrame's Unit attribute. Alternatively, an
appropriate unit string can be appended to the end of the floating
point value ("123.4 d" for example), in which case the supplied value
is scaled into the units specified by the Unit attribute.
- Julian Date: With or without decimal places ("JD 2454321.9" for
example).
- Modified Julian Date: With or without decimal places
("MJD 54321.4" for example).
- Gregorian Calendar Date: With the month expressed either as an
integer or a 3-character abbreviation, and with optional decimal
places to represent a fraction of a day ("1996-10-2" or
"1996-Oct-2.6" for example). If no fractional part of a day is
given, the time refers to the start of the day (zero hours).
- Gregorian Date and Time: Any calendar date (as above) but with
a fraction of a day expressed as hours, minutes and seconds
("1996-Oct-2 12:13:56.985" for example). The date and time can be
separated by a space or by a "T" (as used by ISO8601 format).
public void setTimeOrigin(double timeOrigin)
- Besselian Epoch: Expressed in decimal years, with or without
decimal places ("B1950" or "B1976.13" for example).
- Julian Epoch: Expressed in decimal years, with or without
decimal places ("J2000" or "J2100.9" for example).
- Units: An unqualified decimal value is interpreted as a value in
the system specified by the TimeFrame's System attribute, in the
units given by the TimeFrame's Unit attribute. Alternatively, an
appropriate unit string can be appended to the end of the floating
point value ("123.4 d" for example), in which case the supplied value
is scaled into the units specified by the Unit attribute.
- Julian Date: With or without decimal places ("JD 2454321.9" for
example).
- Modified Julian Date: With or without decimal places
("MJD 54321.4" for example).
- Gregorian Calendar Date: With the month expressed either as an
integer or a 3-character abbreviation, and with optional decimal
places to represent a fraction of a day ("1996-10-2" or
"1996-Oct-2.6" for example). If no fractional part of a day is
given, the time refers to the start of the day (zero hours).
- Gregorian Date and Time: Any calendar date (as above) but with
a fraction of a day expressed as hours, minutes and seconds
("1996-Oct-2 12:13:56.985" for example). The date and time can be
separated by a space or by a "T" (as used by ISO8601 format).
timeOrigin
- the TimeOrigin attribute of this objectpublic void setTimeOrigin(String timeOrigin)
- Besselian Epoch: Expressed in decimal years, with or without
decimal places ("B1950" or "B1976.13" for example).
- Julian Epoch: Expressed in decimal years, with or without
decimal places ("J2000" or "J2100.9" for example).
- Units: An unqualified decimal value is interpreted as a value in
the system specified by the TimeFrame's System attribute, in the
units given by the TimeFrame's Unit attribute. Alternatively, an
appropriate unit string can be appended to the end of the floating
point value ("123.4 d" for example), in which case the supplied value
is scaled into the units specified by the Unit attribute.
- Julian Date: With or without decimal places ("JD 2454321.9" for
example).
- Modified Julian Date: With or without decimal places
("MJD 54321.4" for example).
- Gregorian Calendar Date: With the month expressed either as an
integer or a 3-character abbreviation, and with optional decimal
places to represent a fraction of a day ("1996-10-2" or
"1996-Oct-2.6" for example). If no fractional part of a day is
given, the time refers to the start of the day (zero hours).
- Gregorian Date and Time: Any calendar date (as above) but with
a fraction of a day expressed as hours, minutes and seconds
("1996-Oct-2 12:13:56.985" for example). The date and time can be
separated by a space or by a "T" (as used by ISO8601 format).
timeOrigin
- formatted string giving the TimeOrigin
attribute of this objectpublic String getTimeScale()
The default TimeScale value depends on the current System value; if the current TimeFrame system is "Besselian epoch" the default is "TT", otherwise it is "TAI". Note, if the System attribute is set so that the TimeFrame represents Besselian Epoch, then an error will be reported if an attempt is made to set the TimeScale to anything other than TT.
Note, the supported time scales fall into two groups. The first group containing UT1, GMST, LAST and LMST define time in terms of the orientation of the earth. The second group (containing all the remaining time scales) define time in terms of an atomic process. Since the rate of rotation of the earth varies in an unpredictable way, conversion between two timescales in different groups relies on a value being supplied for the Dut1 attribute (defined by the parent Frame class). This attribute specifies the difference between the UT1 and UTC time scales, in seconds, and defaults to zero. See the documentation for the Dut1 attribute for further details.
- "TAI" - International Atomic Time
- "UTC" - Coordinated Universal Time
- "UT1" - Universal Time
- "GMST" - Greenwich Mean Sidereal Time
- "LAST" - Local Apparent Sidereal Time
- "LMST" - Local Mean Sidereal Time
- "TT" - Terrestrial Time
- "TDB" - Barycentric Dynamical Time
- "TCB" - Barycentric Coordinate Time
- "TCG" - Geocentric Coordinate Time
- "LT" - Local Time (the offset from UTC is given by attribute LTOffset)
An very informative description of these and other time scales is available at http://www.ucolick.org/~sla/leapsecs/timescales.html.
public void setTimeScale(String timeScale)
The default TimeScale value depends on the current System value; if the current TimeFrame system is "Besselian epoch" the default is "TT", otherwise it is "TAI". Note, if the System attribute is set so that the TimeFrame represents Besselian Epoch, then an error will be reported if an attempt is made to set the TimeScale to anything other than TT.
Note, the supported time scales fall into two groups. The first group containing UT1, GMST, LAST and LMST define time in terms of the orientation of the earth. The second group (containing all the remaining time scales) define time in terms of an atomic process. Since the rate of rotation of the earth varies in an unpredictable way, conversion between two timescales in different groups relies on a value being supplied for the Dut1 attribute (defined by the parent Frame class). This attribute specifies the difference between the UT1 and UTC time scales, in seconds, and defaults to zero. See the documentation for the Dut1 attribute for further details.
- "TAI" - International Atomic Time
- "UTC" - Coordinated Universal Time
- "UT1" - Universal Time
- "GMST" - Greenwich Mean Sidereal Time
- "LAST" - Local Apparent Sidereal Time
- "LMST" - Local Mean Sidereal Time
- "TT" - Terrestrial Time
- "TDB" - Barycentric Dynamical Time
- "TCB" - Barycentric Coordinate Time
- "TCG" - Geocentric Coordinate Time
- "LT" - Local Time (the offset from UTC is given by attribute LTOffset)
An very informative description of these and other time scales is available at http://www.ucolick.org/~sla/leapsecs/timescales.html.
timeScale
- the TimeScale attribute of this objectpublic void setClockLat(String clockLat)
Frame.setObsLat(java.lang.String)
.public String getClockLat()
Frame.getObsLat()
.public void setClockLon(String clockLon)
Frame.setObsLon(java.lang.String)
.public String getClockLon()
Frame.getObsLon()
.Copyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.