IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 12, 2004, 9:10:00 AM (22 years ago)
Author:
desonia
Message:

fixed psGrommitAlloc, SLALIB calls, added tests for psFPAAlloc and psChipAlloc.

File:
1 edited

Legend:

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

    r2048 r2052  
    88 *  @author George Gusciora, MHPCC
    99 *
    10  *  @version $Revision: 1.33 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2004-10-12 01:34:09 $
     10 *  @version $Revision: 1.34 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2004-10-12 19:10:00 $
    1212 *
    1313 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    352352    newFPA->toTangentPlane = NULL;
    353353    newFPA->pattern = NULL;
    354     newFPA->exposure = psMemIncrRefCounter((psExposure*)exp);
    355     newFPA->grommit = psGrommitAlloc(exp);
     354
     355    if (exp != NULL) {
     356        newFPA->exposure = psMemIncrRefCounter((psExposure*)exp);
     357        newFPA->grommit = psGrommitAlloc(exp);
     358    } else {
     359        newFPA->exposure = NULL;
     360        newFPA->grommit = NULL;
     361    }
    356362
    357363    newFPA->colorPlus = NULL;
     
    455461psGrommit* psGrommitAlloc(const psExposure* exp)
    456462{
    457     double* AOPRMS = psAlloc(sizeof(double)*14);
    458 
    459463    if (exp == NULL) {
    460464        psAbort(__func__, "the 'exp' parameter is NULL\n");
     
    478482    double tlr = exp->observatory->tlr;
    479483
     484    psGrommit* grommit = (psGrommit* ) psAlloc(sizeof(psGrommit));
     485
    480486    slaAoppa(date, dut, elongm, phim, hm, xp, yp,
    481              tdk, pmb, rh, wl, tlr, AOPRMS);
    482 
    483     psGrommit* grommit = (psGrommit* ) psAlloc(sizeof(psGrommit));
    484     *(double *)&grommit->latitude = AOPRMS[0];
    485     *(double *)&grommit->sinLat = AOPRMS[1];
    486     *(double *)&grommit->cosLat = AOPRMS[2];
    487     *(double *)&grommit->height = AOPRMS[3];
    488     *(double *)&grommit->abberationMag = AOPRMS[4];
    489     *(double *)&grommit->temperature = AOPRMS[5];
    490     *(double *)&grommit->pressure = AOPRMS[6];
    491     *(double *)&grommit->humidity = AOPRMS[7];
    492     *(double *)&grommit->wavelength = AOPRMS[8];
    493     *(double *)&grommit->lapseRate = AOPRMS[9];
    494     *(double *)&grommit->refractA = AOPRMS[10];
    495     *(double *)&grommit->refractB = AOPRMS[11];
    496     *(double *)&grommit->longitudeOffset = AOPRMS[12];
    497     *(double *)&grommit->siderealTime = AOPRMS[13];
    498 
    499     psFree(AOPRMS);
     487             tdk, pmb, rh, wl, tlr, (double*)grommit);
    500488
    501489    return (grommit);
     
    680668    }
    681669
    682     slaAopqk(tpCoord->x, tpCoord->y, (double *) grommit,
     670    slaAopqk(tpCoord->x, tpCoord->y, (double*)grommit,
    683671             &AOB, &ZOB, &HOB, &outSphere->r, &outSphere->d);
    684672
     
    782770                        const psGrommit* grommit)
    783771{
     772    char* type = "RA";
     773
    784774    if (in == NULL) {
    785775        psAbort(__func__, "input parameter in is NULL.");
     
    792782    }
    793783
    794     slaOapqk("RA", in->r, in->d, (double *) grommit, &tpCoord->x, &tpCoord->y);
     784    slaOapqk(type, in->r, in->d, (double*)grommit, &tpCoord->x, &tpCoord->y);
    795785
    796786    return(tpCoord);
Note: See TracChangeset for help on using the changeset viewer.