IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 3, 2006, 8:48:10 AM (19 years ago)
Author:
magnier
Message:

defined pmConfigConvertFilename, added to all I/O functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/objects/pmPSF_IO.c

    r9770 r10421  
    66 *  @author EAM, IfA
    77 *
    8  *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2006-10-28 20:23:51 $
     8 *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2006-12-03 18:48:10 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    117117}
    118118
    119 bool pmFPAviewWritePSFmodel (const pmFPAview *view, pmFPAfile *file)
     119bool pmFPAviewWritePSFmodel (const pmFPAview *view, pmFPAfile *file, pmConfig *config)
    120120{
    121121
     
    123123
    124124    if (view->chip == -1) {
    125         pmFPAWritePSFmodel (fpa, view, file);
     125        pmFPAWritePSFmodel (fpa, view, file, config);
    126126        return true;
    127127    }
     
    133133
    134134    if (view->cell == -1) {
    135         pmChipWritePSFmodel (chip, view, file);
     135        pmChipWritePSFmodel (chip, view, file, config);
    136136        return true;
    137137    }
     
    143143
    144144    if (view->readout == -1) {
    145         pmCellWritePSFmodel (cell, view, file);
     145        pmCellWritePSFmodel (cell, view, file, config);
    146146        return true;
    147147    }
     
    152152    pmReadout *readout = cell->readouts->data[view->readout];
    153153
    154     pmReadoutWritePSFmodel (readout, view, file);
     154    pmReadoutWritePSFmodel (readout, view, file, config);
    155155    return true;
    156156}
    157157
    158158// read in all chip-level PSFmodel files for this FPA
    159 bool pmFPAWritePSFmodel (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file)
     159bool pmFPAWritePSFmodel (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, pmConfig *config)
    160160{
    161161
     
    163163
    164164        pmChip *chip = fpa->chips->data[i];
    165         pmChipWritePSFmodel (chip, view, file);
     165        pmChipWritePSFmodel (chip, view, file, config);
    166166    }
    167167    return true;
     
    169169
    170170// read in all cell-level PSFmodel files for this chip
    171 bool pmChipWritePSFmodel (pmChip *chip, const pmFPAview *view, pmFPAfile *file)
     171bool pmChipWritePSFmodel (pmChip *chip, const pmFPAview *view, pmFPAfile *file, pmConfig *config)
    172172{
    173173
     
    175175
    176176        pmCell *cell = chip->cells->data[i];
    177         pmCellWritePSFmodel (cell, view, file);
     177        pmCellWritePSFmodel (cell, view, file, config);
    178178    }
    179179    return true;
     
    181181
    182182// read in all readout-level PSFmodel files for this cell
    183 bool pmCellWritePSFmodel (pmCell *cell, const pmFPAview *view, pmFPAfile *file)
     183bool pmCellWritePSFmodel (pmCell *cell, const pmFPAview *view, pmFPAfile *file, pmConfig *config)
    184184{
    185185
     
    187187
    188188        pmReadout *readout = cell->readouts->data[i];
    189         pmReadoutWritePSFmodel (readout, view, file);
     189        pmReadoutWritePSFmodel (readout, view, file, config);
    190190    }
    191191    return true;
     
    193193
    194194// read in all readout-level Objects files for this cell
    195 bool pmReadoutWritePSFmodel (pmReadout *readout, const pmFPAview *view, pmFPAfile *file)
     195bool pmReadoutWritePSFmodel (pmReadout *readout, const pmFPAview *view, pmFPAfile *file, pmConfig *config)
    196196{
    197197    bool status;
    198198    char *filename;
     199    char *realname;
    199200
    200201    pmPSF *psf = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.PSF");
     
    203204    case PM_FPA_FILE_PSF:
    204205        filename = pmFPAfileNameFromRule (file->filerule, file, view);
     206        realname = pmConfigConvertFilename (filename, config);
     207
    205208        psMetadata *psfData = pmPSFtoMetadata (NULL, psf);
    206         psMetadataConfigWrite (psfData, filename);
     209        psMetadataConfigWrite (psfData, realname);
    207210        psFree (psfData);
     211        psFree (realname);
    208212        psFree (filename);
    209213        return true;
     
    218222
    219223
    220 bool pmFPAviewReadPSFmodel (const pmFPAview *view, pmFPAfile *file)
     224bool pmFPAviewReadPSFmodel (const pmFPAview *view, pmFPAfile *file, pmConfig *config)
    221225{
    222226
     
    224228
    225229    if (view->chip == -1) {
    226         pmFPAReadPSFmodel (fpa, view, file);
     230        pmFPAReadPSFmodel (fpa, view, file, config);
    227231        return true;
    228232    }
     
    234238
    235239    if (view->cell == -1) {
    236         pmChipReadPSFmodel (chip, view, file);
     240        pmChipReadPSFmodel (chip, view, file, config);
    237241        return true;
    238242    }
     
    244248
    245249    if (view->readout == -1) {
    246         pmCellReadPSFmodel (cell, view, file);
     250        pmCellReadPSFmodel (cell, view, file, config);
    247251        return true;
    248252    }
     
    253257    pmReadout *readout = cell->readouts->data[view->readout];
    254258
    255     pmReadoutReadPSFmodel (readout, view, file);
     259    pmReadoutReadPSFmodel (readout, view, file, config);
    256260    return true;
    257261}
    258262
    259263// read in all chip-level PSFmodel files for this FPA
    260 bool pmFPAReadPSFmodel (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file)
     264bool pmFPAReadPSFmodel (pmFPA *fpa, const pmFPAview *view, pmFPAfile *file, pmConfig *config)
    261265{
    262266
     
    264268
    265269        pmChip *chip = fpa->chips->data[i];
    266         pmChipReadPSFmodel (chip, view, file);
     270        pmChipReadPSFmodel (chip, view, file, config);
    267271    }
    268272    return true;
     
    270274
    271275// read in all cell-level PSFmodel files for this chip
    272 bool pmChipReadPSFmodel (pmChip *chip, const pmFPAview *view, pmFPAfile *file)
     276bool pmChipReadPSFmodel (pmChip *chip, const pmFPAview *view, pmFPAfile *file, pmConfig *config)
    273277{
    274278
     
    276280
    277281        pmCell *cell = chip->cells->data[i];
    278         pmCellReadPSFmodel (cell, view, file);
     282        pmCellReadPSFmodel (cell, view, file, config);
    279283    }
    280284    return true;
     
    282286
    283287// read in all readout-level PSFmodel files for this cell
    284 bool pmCellReadPSFmodel (pmCell *cell, const pmFPAview *view, pmFPAfile *file)
     288bool pmCellReadPSFmodel (pmCell *cell, const pmFPAview *view, pmFPAfile *file, pmConfig *config)
    285289{
    286290
     
    288292
    289293        pmReadout *readout = cell->readouts->data[i];
    290         pmReadoutReadPSFmodel (readout, view, file);
     294        pmReadoutReadPSFmodel (readout, view, file, config);
    291295    }
    292296    return true;
     
    294298
    295299// read in all readout-level Objects files for this cell
    296 bool pmReadoutReadPSFmodel (pmReadout *readout, const pmFPAview *view, pmFPAfile *file)
     300bool pmReadoutReadPSFmodel (pmReadout *readout, const pmFPAview *view, pmFPAfile *file, pmConfig *config)
    297301{
    298302
    299303    unsigned int Nfail;
    300304    char *filename;
     305    char *realname;
    301306
    302307    switch (file->type) {
    303308    case PM_FPA_FILE_PSF:
    304309        filename = pmFPAfileNameFromRule (file->filerule, file, view);
    305 
    306         psMetadata *psfData = psMetadataConfigRead(NULL, &Nfail, filename, FALSE);
     310        realname = pmConfigConvertFilename (filename, config);
     311
     312        psMetadata *psfData = psMetadataConfigRead(NULL, &Nfail, realname, FALSE);
    307313        pmPSF *psf = pmPSFfromMetadata (psfData);
    308314        psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.PSF", PS_DATA_UNKNOWN, "psphot psf", psf);
     
    310316        psFree (psf);
    311317        psFree (psfData);
     318        psFree (realname);
    312319        psFree (filename);
    313320
Note: See TracChangeset for help on using the changeset viewer.