|
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Objectswisseph.SweDate
public class SweDate
This class is a date class specialized for the use with the swisseph package. You will like to use it, if you need a Julian Day number or the deltaT for a date or a Julian Day or if like to convert from Gregorian to Julian calendar system or vice versa.
This is a port of the SwissEphemeris package to Java. See Astrodienst Zürich for more infos and the original authors.
You will find the complete documentation for the original SwissEphemeris package at http://www.astro.ch/swisseph/sweph_g.htm. By far most of the information there is directly valid for this port to Java as well.
フィールドの概要 | |
---|---|
static int |
FRIDAY
Constant for weekdays. |
boolean |
init_leapseconds_done
|
static double |
JD0
The Julian day number of 1970 January 1.0. |
static int |
MONDAY
Constant for weekdays. |
static int |
SATURDAY
Constant for weekdays. |
static boolean |
SE_GREG_CAL
|
static boolean |
SE_JUL_CAL
|
static boolean |
SE_KEEP_DATE
|
static boolean |
SE_KEEP_JD
|
static double |
SE_TIDAL_26
Tidal acceleration value in the mean motion of the moon of -26. |
static double |
SE_TIDAL_DE200
Tidal acceleration value in the mean motion of the moon of DE200 (-23.8946). |
static double |
SE_TIDAL_DE403
Tidal acceleration value in the mean motion of the moon of DE403 (-25.8). |
static double |
SE_TIDAL_DE404
Tidal acceleration value in the mean motion of the moon of DE404 (-25.8). |
static double |
SE_TIDAL_DE405
Tidal acceleration value in the mean motion of the moon of DE405 (-25.7376). |
static double |
SE_TIDAL_DE406
Tidal acceleration value in the mean motion of the moon of DE406 (-25.7376). |
static double |
SE_TIDAL_DEFAULT
Default tidal acceleration value in the mean motion of the moon (=SE_TIDAL_DE406). |
static int |
SUNDAY
Constant for weekdays. |
static int |
THURSDAY
Constant for weekdays. |
static int |
TUESDAY
Constant for weekdays. |
static int |
WEDNESDAY
Constant for weekdays. |
コンストラクタの概要 | |
---|---|
SweDate()
This constructs a new SweDate with a default of the current date and current time at GMT. |
|
SweDate(double jd)
This constructs a new SweDate with the given Julian Day number. |
|
SweDate(double jd,
boolean calType)
This constructs a new SweDate with the given Julian Day number. |
|
SweDate(int year,
int month,
int day,
double hour)
This constructs a new SweDate with the given date and time. |
|
SweDate(int year,
int month,
int day,
double hour,
boolean calType)
This constructs a new SweDate with the given date and time. |
メソッドの概要 | |
---|---|
boolean |
checkDate()
Checks the date to see, if it is a valid date. |
boolean |
checkDate(int year,
int month,
int day)
Checks the given date to see, if it is a valid date. |
boolean |
checkDate(int year,
int month,
int day,
double hour)
Checks the given date to see, if it is a valid date. |
boolean |
getCalendarType()
Queries the type of calendar in effect - Gregorian or Julian calendar. |
static java.util.Date |
getDate(double jd)
This will return a java.util.Date object from a julian day number. |
java.util.Date |
getDate(long offset)
This will return a java.util.Date object with the date of this SweDate object. |
int |
getDay()
Queries the day of this SweDate object. |
int |
getDayOfWeekNr()
Queries the day of the week, i.e. |
static int |
getDayOfWeekNr(double jd)
Queries the day of the week of the given Julian Day number (interpreted in the gregorian calendar system!). |
static int |
getDayOfWeekNr(int year,
int month,
int day)
Queries the day of the week of the given date that is interpreted as being a date in the Gregorian or Julian calendar system depending on the date, the switch from Julian to Gregorian calendar system occured. |
static int |
getDayOfWeekNr(int year,
int month,
int day,
boolean calType)
Queries the day of the week of the given date that is interpreted as being a date in the given calendar system. |
double |
getDeltaT()
Queries the delta T value for the date of this object. |
static double |
getDeltaT(double tjd)
Queries the delta T value for the given Julian Day number - this is a static method. |
double |
getGregorianChange()
Returns the julian day number on which the Gregorian calendar system comes to be in effect. |
double |
getHour()
Queries the hour of the day of this SweDate object. |
java.lang.String |
getInvalidUTCDateError(int iyear,
int imonth,
int iday,
int ihour,
int imin,
double dsec,
boolean gregflag)
Returns a String error message, if the year, month, day, hour, minute and second fields do not describe a valid date. |
double[] |
getJDfromUTC(int iyear,
int imonth,
int iday,
int ihour,
int imin,
double dsec,
boolean gregflag,
boolean checkValidInput)
Calculates the julian day numbers (TT (==ET) and UT1) from a given date. |
double |
getJulDay()
Queries the Julian Day number of this object. |
static double |
getJulDay(int year,
int month,
int day,
double hour)
Queries the Julian Day number of the given date in Gregorian calendar system - this is a static method. |
static double |
getJulDay(int year,
int month,
int day,
double hour,
boolean calType)
Queries the Julian Day number of the given date that is interpreted as a date in the given calendar system - this is a static method. |
int |
getMonth()
Queries the month of this SweDate object. |
double |
getTidalAcc()
Returns the tidal acceleration used in calculations of delta T. |
SDate |
getUTCfromJDET(double tjd_et,
boolean gregflag,
int iyear,
int imonth,
int iday,
int ihour,
int imin,
double dsec)
|
SDate |
getUTCfromJDET(double tjd_et,
boolean gregflag,
SDate dt)
|
SDate |
getUTCfromJDUT1(double tjd_ut,
boolean gregflag,
int iyear,
int imonth,
int iday,
int ihour,
int imin,
double dsec)
|
SDate |
getUTCfromJDUT1(double tjd_ut,
boolean gregflag,
SDate dt)
|
int |
getYear()
Queries the year of this SweDate object. |
boolean |
isValidUTCDate(int iyear,
int imonth,
int iday,
int ihour,
int imin,
double dsec,
boolean gregflag)
Determines, if the year, month, day, hour, minute and second fields describe a valid date. |
void |
makeValidDate()
Makes the date to be a valid date. |
void |
setCalendarType(boolean newCalType,
boolean keepDate)
Sets the calendar type for this object. |
boolean |
setDate(int newYear,
int newMonth,
int newDay,
double newHour)
Sets a new date for this object. |
boolean |
setDate(int newYear,
int newMonth,
int newDay,
double newHour,
boolean check)
Sets a new date for this object. |
boolean |
setDay(int newDay)
Sets the day-part of the date. |
boolean |
setDay(int newDay,
boolean check)
Sets the day-part of the date. |
void |
setGregorianChange(double newJDCO)
Changes the date of the start of the Gregorian calendar system. |
void |
setGregorianChange(int year,
int month,
int day)
Changes the date of the start of the Gregorian calendar system. |
boolean |
setHour(double newHour)
Sets a new hour. |
void |
setJulDay(double newJD)
Sets the new Julian Day for this object. |
boolean |
setMonth(int newMonth)
Sets the month-part of the date. |
boolean |
setMonth(int newMonth,
boolean check)
Sets the year-part of the date. |
void |
setTidalAcc(double tid_acc)
Sets the tidal acceleration used in calculations of delta T. |
boolean |
setYear(int newYear)
Sets the year-part of the date. |
boolean |
setYear(int newYear,
boolean check)
Sets the year-part of the date. |
java.lang.String |
toString()
Returns the date, calendar type (gregorian / julian), julian day number and the deltaT value of this object. |
void |
updateCalendarType()
Update the calendar type according to the Gregorian calendar start date and the date of this object. |
クラス java.lang.Object から継承されたメソッド |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
フィールドの詳細 |
---|
public static final int SUNDAY
public static final int MONDAY
public static final int TUESDAY
public static final int WEDNESDAY
public static final int THURSDAY
public static final int FRIDAY
public static final int SATURDAY
public static final boolean SE_JUL_CAL
public static final boolean SE_GREG_CAL
public static final boolean SE_KEEP_DATE
public static final boolean SE_KEEP_JD
public boolean init_leapseconds_done
public static final double SE_TIDAL_DE403
public static final double SE_TIDAL_DE404
public static final double SE_TIDAL_DE405
public static final double SE_TIDAL_DE406
public static final double SE_TIDAL_DE200
public static final double SE_TIDAL_26
public static final double SE_TIDAL_DEFAULT
SE_TIDAL_DE406
,
定数フィールド値public static final double JD0
getDate(long)
,
定数フィールド値コンストラクタの詳細 |
---|
public SweDate()
public SweDate(double jd)
jd
- Julian Day numberpublic SweDate(double jd, boolean calType)
jd
- Julian Day numbercalType
- calendar type (Gregorian or Julian calendar system)SE_GREG_CAL
,
SE_JUL_CAL
public SweDate(int year, int month, int day, double hour)
year
- The year of the datemonth
- The month of the dateday
- The day-number in a month of that datehour
- The hour of the daypublic SweDate(int year, int month, int day, double hour, boolean calType)
year
- The year of the datemonth
- The month of the dateday
- The day-number of the datehour
- The hour of the daycalType
- calendar type (Gregorian or Julian calendar system)SE_GREG_CAL
,
SE_JUL_CAL
メソッドの詳細 |
---|
public double getJulDay()
public static double getJulDay(int year, int month, int day, double hour)
year
- The year of the datemonth
- The month of the dateday
- The day-number of the datehour
- The hour of the day
public static double getJulDay(int year, int month, int day, double hour, boolean calType)
year
- The year of the datemonth
- The month of the dateday
- The day-number of the datehour
- The hour of the daycalType
- calendar type (Gregorian or Julian calendar system)
SE_GREG_CAL
,
SE_JUL_CAL
public int getDayOfWeekNr()
SUNDAY
,
MONDAY
,
TUESDAY
,
WEDNESDAY
,
THURSDAY
,
FRIDAY
,
SATURDAY
public static int getDayOfWeekNr(double jd)
jd
- The Julian Day number of the date
SUNDAY
,
MONDAY
,
TUESDAY
,
WEDNESDAY
,
THURSDAY
,
FRIDAY
,
SATURDAY
public static int getDayOfWeekNr(int year, int month, int day)
year
- The year of the datemonth
- The month of the dateday
- The day-number of the date
SUNDAY
,
MONDAY
,
TUESDAY
,
WEDNESDAY
,
THURSDAY
,
FRIDAY
,
SATURDAY
public static int getDayOfWeekNr(int year, int month, int day, boolean calType)
year
- The year of the datemonth
- The month of the dateday
- The day-number of the datecalType
- calendar type (Gregorian or Julian calendar system)
SE_GREG_CAL
,
SE_JUL_CAL
,
SUNDAY
,
MONDAY
,
TUESDAY
,
WEDNESDAY
,
THURSDAY
,
FRIDAY
,
SATURDAY
public boolean getCalendarType()
SE_GREG_CAL
,
SE_JUL_CAL
public int getYear()
public int getMonth()
public int getDay()
public double getHour()
public double getDeltaT()
public static double getDeltaT(double tjd)
tjd
- Julian Day number
SE_TIDAL_DEFAULT
public java.util.Date getDate(long offset)
offset
- An offset in milliseconds to be added to the current
date and time.public static java.util.Date getDate(double jd)
jd
- The julian day number for which to create a Date object.public void setJulDay(double newJD)
newJD
- Julian Day numberpublic void setCalendarType(boolean newCalType, boolean keepDate)
newCalType
- Calendar type (Greogorian or Julian calendar)keepDate
- Determines, if the date or the julian day should
be fix in this operation.SE_GREG_CAL
,
SE_JUL_CAL
,
SE_KEEP_DATE
,
SE_KEEP_JD
public void updateCalendarType()
public boolean setDate(int newYear, int newMonth, int newDay, double newHour)
newYear
- the year-part of the new datenewMonth
- the month-part of the new date [1-12]newDay
- the day-part of the new date [1-31]newHour
- the hour of the new date
public boolean setDate(int newYear, int newMonth, int newDay, double newHour, boolean check)
newYear
- the year-part of the new datenewMonth
- the month-part of the new date [1-12]newDay
- the day-part of the new date [1-31]newHour
- the hour of the new datecheck
- if true it returns if the date is valid and converts the
the date into a valid date
public boolean setYear(int newYear)
newYear
- The new year
public boolean setYear(int newYear, boolean check)
newYear
- The new yearcheck
- check, if the resulting new date is a valid date and
adjust the values for day, month or year if necessary
public boolean setMonth(int newMonth)
newMonth
- The new month
public boolean setMonth(int newMonth, boolean check)
newMonth
- The new yearcheck
- check, if the resulting new date is a valid date and
adjust the values for day, month or year if necessary
setYear(int, boolean)
public boolean setDay(int newDay)
newDay
- The new day
public boolean setDay(int newDay, boolean check)
newDay
- The new daycheck
- check, if the resulting new date is a valid date and
adjust the values for day, month or year if necessary
setYear(int, boolean)
public boolean setHour(double newHour)
newHour
- The new hour
public boolean checkDate()
public boolean checkDate(int year, int month, int day)
year
- the year, for which is to be checkedmonth
- the month, for which is to be checkedday
- the day, for which is to be checked
public boolean checkDate(int year, int month, int day, double hour)
year
- the year, for which is to be checkedmonth
- the month, for which is to be checkedday
- the day, for which is to be checkedhour
- the hour, for which is to be checked
public void makeValidDate()
public double getGregorianChange()
public void setGregorianChange(int year, int month, int day)
year
- The year (in Gregorian system) for the new start datemonth
- The month (in Gregorian system) for the new start date.
Adversely to java.util.Calendar, the month is to be given in the
range of 1 for January to 12 for December!day
- The day of the month (in Gregorian system, from 1 to 31)
for the new start datepublic void setGregorianChange(double newJDCO)
newJDCO
- The julian day number, on which the Gregorian calendar
came into effect.public double getTidalAcc()
public void setTidalAcc(double tid_acc)
tid_acc
- tidal accelerationSE_TIDAL_DE403
,
SE_TIDAL_DE404
,
SE_TIDAL_DE405
,
SE_TIDAL_DE406
,
SE_TIDAL_DE200
,
SE_TIDAL_26
,
SE_TIDAL_DEFAULT
public java.lang.String toString()
java.lang.Object
内の toString
public boolean isValidUTCDate(int iyear, int imonth, int iday, int ihour, int imin, double dsec, boolean gregflag)
iyear
- Year of the input date (UTC)imonth
- Month of the input date (UTC, 1 to 12)iday
- Day of the input date (UTC, 1 to 31)ihour
- Hour of the input date (UTC, 0 to 23)imin
- Minute of the input date (UTC, 0 to 59)dsec
- Second of the input date (UTC, 1.0 to less than 61.0)gregflag
- true == Gregorian calendar, false == Julian calendar
public java.lang.String getInvalidUTCDateError(int iyear, int imonth, int iday, int ihour, int imin, double dsec, boolean gregflag)
iyear
- Year of the input date (UTC)imonth
- Month of the input date (UTC, 1 to 12)iday
- Day of the input date (UTC, 1 to 31)ihour
- Hour of the input date (UTC, 0 to 23)imin
- Minute of the input date (UTC, 0 to 59)dsec
- Second of the input date (UTC, 1.0 to less than 61.0)gregflag
- true == Gregorian calendar, false == Julian calendar
public double[] getJDfromUTC(int iyear, int imonth, int iday, int ihour, int imin, double dsec, boolean gregflag, boolean checkValidInput) throws SwissephException
iyear
- Year of the input date (UTC)imonth
- Month of the input date (UTC, 1 to 12)iday
- Day of the input date (UTC, 1 to 31)ihour
- Hour of the input date (UTC, 0 to 23)imin
- Minute of the input date (UTC, 0 to 59)dsec
- Second of the input date (UTC, 1.0 to less than 61.0)gregflag
- true == Gregorian calendar, false == Julian calendarcheckValidInput
- if true, throws SwissephException, when any of month,
day, hour, minute or second are out of their valid ranges. If false, it
doesn't care about invalid values (e.g. month = 13 or second = 61, even
though there is no leap second on that date and time).
Note:
- Before 1972, swe_utc_to_jd() treats its input time as UT1. Note: UTC was introduced in 1961. From 1961 - 1971, the length of the UTC second was regularly changed, so that UTC remained very close to UT1. - From 1972 on, input time is treated as UTC. - If delta_t - nleap - 32.184 > 1, the input time is treated as UT1. Note: Like this we avoid errors greater than 1 second in case that the leap seconds table (or the Swiss Ephemeris version) is not updated for a long time.
SwissephException
public SDate getUTCfromJDET(double tjd_et, boolean gregflag, SDate dt)
public SDate getUTCfromJDET(double tjd_et, boolean gregflag, int iyear, int imonth, int iday, int ihour, int imin, double dsec)
public SDate getUTCfromJDUT1(double tjd_ut, boolean gregflag, SDate dt)
public SDate getUTCfromJDUT1(double tjd_ut, boolean gregflag, int iyear, int imonth, int iday, int ihour, int imin, double dsec)
|
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |