#246 closed defect (invalid)
psSphereTransformEclipticToICRS()
| Reported by: | Owned by: | Paul Price | |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | PSLib ADD | Version: | unspecified |
| Severity: | normal | Keywords: | |
| Cc: |
Description
In the ADD, the value "T" is specified as the time in Julian centuries since 1900.
How should T be calculated? I currently have this coded:
struct tm *tmTime = psTimeToTM(&time);
psF64 year = (psF64)(1900 + tmTime->tm_year);
psF64 T = year / 100.0;
Is that correct? Or should I include months and days in this calculation?
Change History (7)
comment:1 by , 22 years ago
| Resolution: | → invalid |
|---|---|
| Status: | new → closed |
comment:2 by , 22 years ago
Your response ignores the tmTime->tm_year component. Can I verify that?
Which is correct:
(1900 - MJD) / 100
or
(1900 + tmTime->tm_year - MJD) / 100
comment:4 by , 22 years ago
Okay.
And let me verify my formula for the mean Julian date:
((ctime)->sec/86400.0 + (ctime)->usec/86400000000.0 + 40587.0)
where ctime is a psTime pointer. Does that sound correct?
comment:5 by , 22 years ago
No. The correct implementation involves the use of psTimeToMJD (or psTimeToJD).
comment:6 by , 22 years ago
I will use psTimeToMJD(). The EclipticToICRS sections in the current ADD/SDR do
not specify the Mean Julian Date, or how to produce it. I dug through the
documentation and found a formula for Mean Julian Date in the ADD, so I used
that. I was not aware of the psTimeToMJD() function, or any requirement to use it.
comment:7 by , 22 years ago
MJD is "Modified Julian Date". It is a Julian Date with a constant offset, so
as long as you use MJDs for both 1900.0 and the date of interest, it doesn't
matter that you use that instead of JD.
If there exists a function that does the job you want, you should use that
instead of reinventing the wheel. Please use either psTimeToMJD or psTimeToJD.

Yes, the month and day (in addition to the hour, minute, second and fraction
thereof) should be included. The simplest way to do this would be to calculate
the MJD for the given time, subtract the MJD for 1900.0, and divide by 100.0.