IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 16962


Ignore:
Timestamp:
Mar 12, 2008, 11:55:23 AM (18 years ago)
Author:
Paul Price
Message:

An assertion isn't very nice....

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psastro/src/psastroLoadRefstars.c

    r16618 r16962  
    7979
    8080    // XXX use psPipe: catch stderr, stdout, allow for Nsec timeout...
    81     // use fork to add timeout capability 
     81    // use fork to add timeout capability
    8282    status = system (getstarCommand);
    8383    if (status) {
     
    103103    if (refstars == NULL) {
    104104        psError(PSASTRO_ERR_REFSTARS, true, "error reading reference data\n");
    105         return NULL;
    106     }
    107     assert (refstars->n > 0);
     105        psFitsClose (fits);
     106        return NULL;
     107    }
     108    if (refstars->n == 0) {
     109        psError(PSASTRO_ERR_REFSTARS, true, "no reference stars found");
     110        psFitsClose (fits);
     111        psFree(refstars);
     112        return NULL;
     113    }
    108114
    109115    psLogMsg ("psastro", 3, "loaded %ld reference stars : %f sec\n", refstars->n, psTimerMark ("psastro"));
     
    157163        }
    158164
    159         // XXX VERY temporary hack to avoid M31 bulge
    160         if ((fabs(ref->sky->r - 0.186438) < 0.002) && (fabs(ref->sky->d - 0.720270) < 0.002)) {
    161           psFree (ref);
    162           psFree (row);
    163           continue;
    164         }
     165        // XXX VERY temporary hack to avoid M31 bulge
     166        if ((fabs(ref->sky->r - 0.186438) < 0.002) && (fabs(ref->sky->d - 0.720270) < 0.002)) {
     167          psFree (ref);
     168          psFree (row);
     169          continue;
     170        }
    165171
    166172        psArrayAdd (refstars, 100, ref);
     
    186192        psMetadata *row = psFitsReadTableRow(fits, i); // Table row
    187193
    188         ref->sky->r   = RAD_DEG*psMetadataLookupF32 (&status, row, "RA");
    189         ref->sky->d   = RAD_DEG*psMetadataLookupF32 (&status, row, "DEC");
    190         ref->Mag      = psMetadataLookupF32 (&status, row, "MAG");
    191 
    192         // XXX VERY temporary hack to avoid M31 bulge
    193         if ((fabs(ref->sky->r - 0.186438) < 0.002) && (fabs(ref->sky->d - 0.720270) < 0.002)) {
    194           psFree (ref);
    195           psFree (row);
    196           continue;
    197         }
     194        ref->sky->r   = RAD_DEG*psMetadataLookupF32 (&status, row, "RA");
     195        ref->sky->d   = RAD_DEG*psMetadataLookupF32 (&status, row, "DEC");
     196        ref->Mag      = psMetadataLookupF32 (&status, row, "MAG");
     197
     198        // XXX VERY temporary hack to avoid M31 bulge
     199        if ((fabs(ref->sky->r - 0.186438) < 0.002) && (fabs(ref->sky->d - 0.720270) < 0.002)) {
     200          psFree (ref);
     201          psFree (row);
     202          continue;
     203        }
    198204
    199205        psArrayAdd (refstars, 100, ref);
Note: See TracChangeset for help on using the changeset viewer.