IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 15, 2008, 5:51:49 PM (18 years ago)
Author:
eugene
Message:

extensive fixes to make these two programs actually work

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dvoTools/src/dvoApplyCorrParseCamera.c

    r11862 r20180  
    44
    55# include "dvoApplyCorr.h"
     6bool dvoApplyCorrSelectCorrFile (pmConfig *config, pmFPA *input);
    67
    78dvoApplyCorrOptions *dvoApplyCorrParseCamera (pmConfig *config) {
     
    2930        return NULL;
    3031    }
     32    output->save = TRUE;
    3133
    3234    // find the flat-field correction image (from command-line, config file, or detrend db)
    33     status = false;
    34     pmFPAfileDefineFromArgs  (&status, config, "DVOFLAT.CORR", "CORR");
    35     psErrorClear();
    36     pmFPAfileDefineFromConf  (&status, config, "DVOFLAT.CORR");
    37     psErrorClear();
    38     pmFPAfileDefineFromDetDB (&status, config, "DVOFLAT.CORR", input->fpa, PM_DETREND_TYPE_FLAT_CORRECTION);
     35    status = dvoApplyCorrSelectCorrFile (config, input->fpa);
    3936    if (!status) {
    4037        psError (PS_ERR_IO, false, "can't find a flat-field correction image source");
     
    5249            if (! pmFPASelectChip(output->fpa, chipNum, false)) {
    5350                psError(PS_ERR_IO, false, "Chip number %d doesn't exist in camera.\n", chipNum);
    54                 return false;
     51                return NULL;
    5552            }
    5653        }
     
    5956    return (options);
    6057}
     58
     59bool dvoApplyCorrSelectCorrFile (pmConfig *config, pmFPA *input) {
     60
     61    bool status;
     62    pmFPAfile *file = NULL;
     63
     64    file = pmFPAfileDefineFromArgs  (&status, config, "DVOFLAT.CORR", "CORR");
     65    if (!status) {
     66        psError (PS_ERR_UNKNOWN, false, "failed to load file definition");
     67        return false;
     68    }
     69    if (file) {
     70        if (file->type != PM_FPA_FILE_IMAGE) {
     71            psError(PS_ERR_IO, true, "DVOFLAT.CORR is not of type IMAGE");
     72            return false;
     73        }
     74        return true;
     75    }
     76
     77    file = pmFPAfileDefineFromConf  (&status, config, "DVOFLAT.CORR");
     78    if (!status) {
     79        psError (PS_ERR_UNKNOWN, false, "failed to load file definition");
     80        return false;
     81    }
     82    if (file) {
     83        if (file->type != PM_FPA_FILE_IMAGE) {
     84            psError(PS_ERR_IO, true, "DVOFLAT.CORR is not of type IMAGE");
     85            return false;
     86        }
     87        return true;
     88    }
     89
     90    file = pmFPAfileDefineFromDetDB (&status, config, "DVOFLAT.CORR", input, PM_DETREND_TYPE_FLAT_CORRECTION);
     91    if (!status) {
     92        psError (PS_ERR_UNKNOWN, false, "failed to load file definition");
     93        return false;
     94    }
     95    if (file) {
     96        if (file->type != PM_FPA_FILE_IMAGE) {
     97            psError(PS_ERR_IO, true, "DVOFLAT.CORR is not of type IMAGE");
     98            return false;
     99        }
     100        return true;
     101    }
     102    return false;
     103}
Note: See TracChangeset for help on using the changeset viewer.