IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 25, 2005, 10:26:55 AM (21 years ago)
Author:
gusciora
Message:

I renamed many of the PS_CHECK macros to PS_ASSERT...

File:
1 edited

Legend:

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

    r3708 r4029  
    88 *  @author GLG, MHPCC
    99 *
    10  *  @version $Revision: 1.65 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2005-04-19 00:17:05 $
     10 *  @version $Revision: 1.66 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2005-05-25 20:26:55 $
    1212 *
    1313 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    4141                                   psImage* tmpImage)
    4242{
    43     PS_IMAGE_CHECK_NULL(tmpImage, 0);
     43    PS_ASSERT_IMAGE_NON_NULL(tmpImage, 0);
    4444
    4545    if ((x < 0.0) || (x > (double)tmpImage->numCols) ||
     
    154154    psS32 j;
    155155
    156     PS_IMAGE_CHECK_NULL(x, NULL);
    157     PS_IMAGE_CHECK_NULL(y, NULL);
    158     PS_IMAGE_CHECK_TYPE(x, PS_TYPE_F64, NULL);
    159     PS_IMAGE_CHECK_TYPE(y, PS_TYPE_F64, NULL);
     156    PS_ASSERT_IMAGE_NON_NULL(x, NULL);
     157    PS_ASSERT_IMAGE_NON_NULL(y, NULL);
     158    PS_ASSERT_IMAGE_TYPE(x, PS_TYPE_F64, NULL);
     159    PS_ASSERT_IMAGE_TYPE(y, PS_TYPE_F64, NULL);
    160160
    161161    tmp = (psFixedPattern *) psAlloc(sizeof(psFixedPattern));
     
    211211                            const psObservatory* observatory)
    212212{
    213     PS_PTR_CHECK_NULL(observatory, NULL);
     213    PS_ASSERT_PTR_NON_NULL(observatory, NULL);
    214214
    215215    psExposure* exp = psAlloc(sizeof(psExposure));
     
    271271                  const psExposure* exp)
    272272{
    273     PS_INT_CHECK_NON_NEGATIVE(nChips, NULL);
     273    PS_ASSERT_INT_NONNEGATIVE(nChips, NULL);
    274274
    275275    psFPA* newFPA = psAlloc(sizeof(psFPA));
     
    315315                    psFPA *parentFPA)
    316316{
    317     PS_INT_CHECK_NON_NEGATIVE(nCells, NULL);
     317    PS_ASSERT_INT_NONNEGATIVE(nCells, NULL);
    318318
    319319    psChip* chip = psAlloc(sizeof(psChip));
     
    350350                    psChip* parentChip)
    351351{
    352     PS_INT_CHECK_NON_NEGATIVE(nReadouts, NULL);
     352    PS_ASSERT_INT_NONNEGATIVE(nReadouts, NULL);
    353353
    354354    psCell* cell = psAlloc(sizeof(psCell));
     
    406406psGrommit* psGrommitAlloc(const psExposure* exp)
    407407{
    408     PS_PTR_CHECK_NULL(exp, NULL);
     408    PS_ASSERT_PTR_NON_NULL(exp, NULL);
    409409
    410410    double date = psTimeToMJD(exp->time);
     
    436436                    const psFPA* FPA)
    437437{
    438     PS_PTR_CHECK_NULL(fpaCoord, NULL);
    439     PS_PTR_CHECK_NULL(FPA, NULL);
     438    PS_ASSERT_PTR_NON_NULL(fpaCoord, NULL);
     439    PS_ASSERT_PTR_NON_NULL(FPA, NULL);
    440440
    441441    psChip* tmpChip = NULL;
     
    461461                    const psFPA* FPA)
    462462{
    463     PS_PTR_CHECK_NULL(fpaCoord, NULL);
    464     PS_PTR_CHECK_NULL(FPA, NULL);
    465     PS_PTR_CHECK_NULL(FPA->chips, NULL);
     463    PS_ASSERT_PTR_NON_NULL(fpaCoord, NULL);
     464    PS_ASSERT_PTR_NON_NULL(FPA, NULL);
     465    PS_ASSERT_PTR_NON_NULL(FPA->chips, NULL);
    466466
    467467    psArray* chips = FPA->chips;
     
    476476    for (psS32 i = 0; i < nChips; i++) {
    477477        psChip* tmpChip = chips->data[i];
    478         PS_PTR_CHECK_NULL(tmpChip, NULL);
    479         PS_PTR_CHECK_NULL(tmpChip->fromFPA, NULL);
     478        PS_ASSERT_PTR_NON_NULL(tmpChip, NULL);
     479        PS_ASSERT_PTR_NON_NULL(tmpChip->fromFPA, NULL);
    480480
    481481        psPlaneTransformApply(&chipCoord, tmpChip->fromFPA, fpaCoord);
     
    494494                     const psChip* chip)
    495495{
    496     PS_PTR_CHECK_NULL(chipCoord, NULL);
    497     PS_PTR_CHECK_NULL(chip, NULL);
     496    PS_ASSERT_PTR_NON_NULL(chipCoord, NULL);
     497    PS_ASSERT_PTR_NON_NULL(chip, NULL);
    498498
    499499    psPlane cellCoord;
     
    511511    for (psS32 i = 0; i < cells->n; i++) {
    512512        psCell* tmpCell = (psCell* ) cells->data[i];
    513         PS_PTR_CHECK_NULL(tmpCell, NULL);
    514         PS_PTR_CHECK_NULL(tmpCell->fromChip, NULL);
     513        PS_ASSERT_PTR_NON_NULL(tmpCell, NULL);
     514        PS_ASSERT_PTR_NON_NULL(tmpCell->fromChip, NULL);
    515515        psArray* readouts = tmpCell->readouts;
    516516
     
    518518            for (psS32 j = 0; j < readouts->n; j++) {
    519519                psReadout* tmpReadout = readouts->data[j];
    520                 PS_READOUT_CHECK_NULL(tmpReadout, NULL);
     520                PS_ASSERT_READOUT_NON_NULL(tmpReadout, NULL);
    521521
    522522                psPlaneTransformApply(&cellCoord,
     
    540540                           const psCell* cell)
    541541{
    542     PS_PTR_CHECK_NULL(inCoord, NULL);
    543     PS_PTR_CHECK_NULL(cell, NULL);
     542    PS_ASSERT_PTR_NON_NULL(inCoord, NULL);
     543    PS_ASSERT_PTR_NON_NULL(cell, NULL);
    544544
    545545    return (psPlaneTransformApply(outCoord, cell->toChip, inCoord));
     
    550550                          const psChip* chip)
    551551{
    552     PS_PTR_CHECK_NULL(inCoord, NULL);
    553     PS_PTR_CHECK_NULL(chip, NULL);
     552    PS_ASSERT_PTR_NON_NULL(inCoord, NULL);
     553    PS_ASSERT_PTR_NON_NULL(chip, NULL);
    554554
    555555    return (psPlaneTransformApply(outCoord, chip->toFPA, inCoord));
     
    562562                        const psFPA* fpa)
    563563{
    564     PS_PTR_CHECK_NULL(inCoord, NULL);
    565     PS_PTR_CHECK_NULL(fpa, NULL);
     564    PS_ASSERT_PTR_NON_NULL(inCoord, NULL);
     565    PS_ASSERT_PTR_NON_NULL(fpa, NULL);
    566566
    567567    return(psPlaneDistortApply(outCoord, fpa->toTangentPlane, inCoord,
     
    576576                         const psGrommit* grommit)
    577577{
    578     PS_PTR_CHECK_NULL(tpCoord, NULL);
    579     PS_PTR_CHECK_NULL(grommit, NULL);
     578    PS_ASSERT_PTR_NON_NULL(tpCoord, NULL);
     579    PS_ASSERT_PTR_NON_NULL(grommit, NULL);
    580580
    581581    double AOB = 0.0;
     
    596596                          const psCell* cell)
    597597{
    598     PS_PTR_CHECK_NULL(cellCoord, NULL);
    599     PS_PTR_CHECK_NULL(cell, NULL);
     598    PS_ASSERT_PTR_NON_NULL(cellCoord, NULL);
     599    PS_ASSERT_PTR_NON_NULL(cell, NULL);
    600600
    601601    return (psPlaneTransformApply(fpaCoord, cell->toFPA, cellCoord));
     
    608608                           const psCell* cell)
    609609{
    610     PS_PTR_CHECK_NULL(cellCoord, NULL);
    611     PS_PTR_CHECK_NULL(cell, NULL);
    612     PS_PTR_CHECK_NULL(cell->toFPA, NULL);
    613     PS_PTR_CHECK_NULL(cell->parent, NULL);
    614     PS_PTR_CHECK_NULL(cell->parent->parent, NULL);
    615     PS_PTR_CHECK_NULL(cell->parent->parent->toTangentPlane, NULL);
    616     PS_PTR_CHECK_NULL(cell->parent->parent->exposure, NULL);
     610    PS_ASSERT_PTR_NON_NULL(cellCoord, NULL);
     611    PS_ASSERT_PTR_NON_NULL(cell, NULL);
     612    PS_ASSERT_PTR_NON_NULL(cell->toFPA, NULL);
     613    PS_ASSERT_PTR_NON_NULL(cell->parent, NULL);
     614    PS_ASSERT_PTR_NON_NULL(cell->parent->parent, NULL);
     615    PS_ASSERT_PTR_NON_NULL(cell->parent->parent->toTangentPlane, NULL);
     616    PS_ASSERT_PTR_NON_NULL(cell->parent->parent->exposure, NULL);
    617617
    618618    psPlane* fpaCoord = NULL;
     
    645645                                const psCell* cell)
    646646{
    647     PS_PTR_CHECK_NULL(cellCoord, NULL);
    648     PS_PTR_CHECK_NULL(cell, NULL);
    649     PS_PTR_CHECK_NULL(cell->toSky, NULL);
    650     PS_PTR_CHECK_NULL(cell->parent, NULL);
    651     PS_PTR_CHECK_NULL(cell->parent->parent, NULL);
    652     PS_PTR_CHECK_NULL(cell->parent->parent->projection, NULL);
     647    PS_ASSERT_PTR_NON_NULL(cellCoord, NULL);
     648    PS_ASSERT_PTR_NON_NULL(cell, NULL);
     649    PS_ASSERT_PTR_NON_NULL(cell->toSky, NULL);
     650    PS_ASSERT_PTR_NON_NULL(cell->parent, NULL);
     651    PS_ASSERT_PTR_NON_NULL(cell->parent->parent, NULL);
     652    PS_ASSERT_PTR_NON_NULL(cell->parent->parent->projection, NULL);
    653653    if (cell->toSky) {
    654654        // XXX: Should we use toTP or toSky?
     
    690690                        const psGrommit* grommit)
    691691{
    692     PS_PTR_CHECK_NULL(in, NULL);
    693     PS_PTR_CHECK_NULL(grommit, NULL);
     692    PS_ASSERT_PTR_NON_NULL(in, NULL);
     693    PS_ASSERT_PTR_NON_NULL(grommit, NULL);
    694694
    695695    char* type = "RA";
     
    711711                        const psFPA* fpa)
    712712{
    713     PS_PTR_CHECK_NULL(tpCoord, NULL);
    714     PS_PTR_CHECK_NULL(fpa, NULL);
    715     PS_PTR_CHECK_NULL(fpa->fromTangentPlane, NULL);
     713    PS_ASSERT_PTR_NON_NULL(tpCoord, NULL);
     714    PS_ASSERT_PTR_NON_NULL(fpa, NULL);
     715    PS_ASSERT_PTR_NON_NULL(fpa->fromTangentPlane, NULL);
    716716
    717717    return (psPlaneDistortApply(fpaCoord, fpa->fromTangentPlane,
     
    723723                          const psChip* chip)
    724724{
    725     PS_PTR_CHECK_NULL(fpaCoord, NULL);
    726     PS_PTR_CHECK_NULL(chip, NULL);
    727     PS_PTR_CHECK_NULL(chip->fromFPA, NULL);
     725    PS_ASSERT_PTR_NON_NULL(fpaCoord, NULL);
     726    PS_ASSERT_PTR_NON_NULL(chip, NULL);
     727    PS_ASSERT_PTR_NON_NULL(chip->fromFPA, NULL);
    728728
    729729    chipCoord = psPlaneTransformApply(chipCoord, chip->fromFPA, fpaCoord);
     
    735735                           const psCell* cell)
    736736{
    737     PS_PTR_CHECK_NULL(chipCoord, NULL);
    738     PS_PTR_CHECK_NULL(cell, NULL);
    739     PS_PTR_CHECK_NULL(cell->fromChip, NULL);
     737    PS_ASSERT_PTR_NON_NULL(chipCoord, NULL);
     738    PS_ASSERT_PTR_NON_NULL(cell, NULL);
     739    PS_ASSERT_PTR_NON_NULL(cell->fromChip, NULL);
    740740
    741741    cellCoord = psPlaneTransformApply(cellCoord, cell->fromChip, chipCoord);
     
    749749                          const psCell* cell)
    750750{
    751     PS_PTR_CHECK_NULL(skyCoord, NULL);
    752     PS_PTR_CHECK_NULL(cell, NULL);
    753     PS_PTR_CHECK_NULL(cell->parent, NULL);
    754     PS_PTR_CHECK_NULL(cell->parent->parent, NULL);
    755     PS_PTR_CHECK_NULL(cell->parent->parent->grommit, NULL);
     751    PS_ASSERT_PTR_NON_NULL(skyCoord, NULL);
     752    PS_ASSERT_PTR_NON_NULL(cell, NULL);
     753    PS_ASSERT_PTR_NON_NULL(cell->parent, NULL);
     754    PS_ASSERT_PTR_NON_NULL(cell->parent->parent, NULL);
     755    PS_ASSERT_PTR_NON_NULL(cell->parent->parent->grommit, NULL);
    756756
    757757    psChip *parChip = cell->parent;
     
    783783                               const psCell* cell)
    784784{
    785     PS_PTR_CHECK_NULL(skyCoord, NULL);
    786     PS_PTR_CHECK_NULL(cell, NULL);
    787     PS_PTR_CHECK_NULL(cell->parent, NULL);
    788     PS_PTR_CHECK_NULL(cell->parent->parent, NULL);
    789     PS_PTR_CHECK_NULL(cell->parent->parent->projection, NULL);
    790     PS_PTR_CHECK_NULL(cell->toTP, NULL);
     785    PS_ASSERT_PTR_NON_NULL(skyCoord, NULL);
     786    PS_ASSERT_PTR_NON_NULL(cell, NULL);
     787    PS_ASSERT_PTR_NON_NULL(cell->parent, NULL);
     788    PS_ASSERT_PTR_NON_NULL(cell->parent->parent, NULL);
     789    PS_ASSERT_PTR_NON_NULL(cell->parent->parent->projection, NULL);
     790    PS_ASSERT_PTR_NON_NULL(cell->toTP, NULL);
    791791    if (cell->toSky) {
    792792        // XXX: Should we use toTP or toSky?
Note: See TracChangeset for help on using the changeset viewer.