IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 9, 2009, 11:25:34 AM (17 years ago)
Author:
Paul Price
Message:

Merging cnb_branch_20090113. No major conflicts. Compiles, but not tested.

File:
1 edited

Legend:

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

    r21409 r21422  
    66 *
    77 *  @author IfA
    8  *  @version $Revision: 1.35 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2009-02-07 02:03:34 $
     8 *  @version $Revision: 1.36 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2009-02-09 21:25:34 $
    1010 *  Copyright 2009 Institute for Astronomy, University of Hawaii
    1111 */
     
    150150    }
    151151
    152     psastroVisualPlotRefStars (refstars, recipe);
     152    pmAstromVisualPlotRefStars (refstars, recipe);
    153153
    154154    if (psTraceGetLevel("psastro.plot") > 0) {
     
    251251    pmFPAfile *input = psMetadataLookupPtr (NULL, config->files, "PSASTRO.INPUT");
    252252    if (!input) {
    253         psLogMsg ("psastro", PS_LOG_DETAIL, "no supplied reference header data");
    254         photcode = psStringCopy ("NONE");
    255         return photcode;
     253        psLogMsg ("psastro", PS_LOG_DETAIL, "no supplied reference header data");
     254        photcode = psStringCopy ("NONE");
     255        return photcode;
    256256    }
    257257    assert (input->fpa);
     
    259259    *maxRho = psMetadataLookupF32(&status, recipe, "DVO.GETSTAR.MAX.RHO");
    260260    if (!status) {
    261         psError(PSASTRO_ERR_CONFIG, false, "DVO.GETSTAR.MAX.RHO missing from recipe");
    262         return NULL;
     261        psError(PSASTRO_ERR_CONFIG, false, "DVO.GETSTAR.MAX.RHO missing from recipe");
     262        return NULL;
    263263    }
    264264
     
    278278    if (!status) ESCAPE ("missing DVO.GETSTAR.MIN.MAG.INST");
    279279
    280     // PHOTCODE.DATA is a multi of metadata items 
     280    // PHOTCODE.DATA is a multi of metadata items
    281281    psListIterator *iter = psListIteratorAlloc(item->data.list, PS_LIST_HEAD, false);
    282282
    283283    psMetadataItem *refItem = NULL;
    284284    while ((refItem = psListGetAndIncrement (iter))) {
    285         if (refItem->type != PS_DATA_METADATA) ESCAPE ("PHOTCODE.DATA entry is not a metadata folder");
    286    
    287         char *refFilter = psMetadataLookupStr (&status, refItem->data.md, "FILTER");
    288         if (!status) {
    289             psLogMsg ("psastro", PS_LOG_INFO, "a PHOTCODE.DATA recipe folder is missing FILTER");
    290             continue;
    291         }
    292 
    293         // does this entry match the current filter?
    294         if (strcmp (refFilter, filter)) continue;
    295 
    296         psLogMsg ("psastro", PS_LOG_DETAIL, "PHOTCODE.DATA found for filter %s", filter);
    297 
    298         float zeropt = psMetadataLookupF32 (&status, refItem->data.md, "ZEROPT");
    299         if (!status) {
    300             psLogMsg ("psastro", PS_LOG_INFO, "a PHOTCODE.DATA recipe folder is missing FILTER");
    301             continue;
    302         }
    303         photcode = psMetadataLookupStr (&status, refItem->data.md, "PHOTCODE");
    304         if (!status) {
    305             psLogMsg ("psastro", PS_LOG_INFO, "a PHOTCODE.DATA recipe folder is missing FILTER");
    306             continue;
    307         }
    308 
    309         // convert the minInst to a calibrated minimum magnitude
    310         *minMag = minInst + 2.5*log10(exptime) + zeropt;
    311 
    312         psFree (iter);
    313         return photcode;
    314     }   
     285        if (refItem->type != PS_DATA_METADATA) ESCAPE ("PHOTCODE.DATA entry is not a metadata folder");
     286
     287        char *refFilter = psMetadataLookupStr (&status, refItem->data.md, "FILTER");
     288        if (!status) {
     289            psLogMsg ("psastro", PS_LOG_INFO, "a PHOTCODE.DATA recipe folder is missing FILTER");
     290            continue;
     291        }
     292
     293        // does this entry match the current filter?
     294        if (strcmp (refFilter, filter)) continue;
     295
     296        psLogMsg ("psastro", PS_LOG_DETAIL, "PHOTCODE.DATA found for filter %s", filter);
     297
     298        float zeropt = psMetadataLookupF32 (&status, refItem->data.md, "ZEROPT");
     299        if (!status) {
     300            psLogMsg ("psastro", PS_LOG_INFO, "a PHOTCODE.DATA recipe folder is missing FILTER");
     301            continue;
     302        }
     303        photcode = psMetadataLookupStr (&status, refItem->data.md, "PHOTCODE");
     304        if (!status) {
     305            psLogMsg ("psastro", PS_LOG_INFO, "a PHOTCODE.DATA recipe folder is missing FILTER");
     306            continue;
     307        }
     308
     309        // convert the minInst to a calibrated minimum magnitude
     310        *minMag = minInst + 2.5*log10(exptime) + zeropt;
     311
     312        psFree (iter);
     313        return photcode;
     314    }
    315315    psFree (iter);
    316316
     
    318318    photcode = psMetadataLookupStr(NULL, recipe, "DVO.GETSTAR.PHOTCODE");
    319319    PS_ASSERT (photcode, NULL);
    320        
     320
    321321    // give up and use fixed value
    322322    *minMag = psMetadataLookupF32(NULL, recipe, "DVO.GETSTAR.MIN.MAG");
Note: See TracChangeset for help on using the changeset viewer.