IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 24, 2005, 4:49:00 PM (21 years ago)
Author:
evanalst
Message:

Update computations for psSphereTransformICRSToEcliptic.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/astronomy/psCoord.c

    r3292 r3325  
    1010*  @author GLG, MHPCC
    1111*
    12 *  @version $Revision: 1.52 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2005-02-19 02:43:11 $
     12*  @version $Revision: 1.53 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2005-02-25 02:49:00 $
    1414*
    1515*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    3232/******************************************************************************/
    3333
    34 // None
     34// Modified Julian Day 01/01/1900 00:00:00
     35#define MJD_1900 15021.0
     36
     37// Days in Julian century
     38#define JULIAN_CENTURY 36525.0
    3539
    3640/******************************************************************************/
     
    315319psSphereTransform* psSphereTransformICRSToEcliptic(psTime *time)
    316320{
     321    psF64 T;
     322
     323    // Check for null parameter
    317324    PS_PTR_CHECK_NULL(time, NULL);
     325
     326    // Convert psTime to MJD
    318327    psF64 MJD = psTimeToMJD(time);
    319     struct tm *tmTime = psTimeToTM(time);
    320     psF64 year = (psF64)(1900 - MJD + tmTime->tm_year);
    321     psF64 T = year / 100.0;
     328
     329    // Check the specified MJD is greater than 1900
     330    if ( MJD < MJD_1900 ) {
     331        psError(PS_ERR_BAD_PARAMETER_TYPE,true,PS_ERRORTEXT_psCoord_INVALID_MJD);
     332        return NULL;
     333    }
     334
     335    // Calculate number of Julian centuries since 1900
     336    T = ( MJD - MJD_1900 ) / JULIAN_CENTURY;
     337
    322338    psF64 alphaP = 0.0;
    323339    psF64 deltaP = DEG_TO_RAD(23.0) +
    324                    SEC_TO_RAD(27.0) +
    325                    MIN_TO_RAD(8.0) -
     340                   MIN_TO_RAD(27.0) +
     341                   SEC_TO_RAD(8.26) -
    326342                   (SEC_TO_RAD(46.845) * T) -
    327343                   (SEC_TO_RAD(0.0059) * T * T) +
    328344                   (SEC_TO_RAD(0.00181) * T * T * T);
    329345    psF64 phiP = 0.0;
    330 
    331     psFree(tmTime);
    332346
    333347    // Don't neglect the minus sign on deltaP (bug 244):
Note: See TracChangeset for help on using the changeset viewer.