IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 15401


Ignore:
Timestamp:
Oct 28, 2007, 3:42:03 PM (19 years ago)
Author:
eugene
Message:

fix chip mode

Location:
branches/eam_branch_20071023/psastro/src
Files:
1 added
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20071023/psastro/src/Makefile.am

    r12806 r15401  
    3333        psastroLuminosityFunction.c \
    3434        psastroRefstarSubset.c      \
     35        psastroEnforceChips.c       \
    3536        psastroMosaicAstrom.c       \
    3637        psastroMosaicGradients.c    \
  • branches/eam_branch_20071023/psastro/src/psastro.h

    r15195 r15401  
    2727bool              psastroDataSave (pmConfig *config);
    2828bool              psastroDefineFiles (pmConfig *config, pmFPAfile *input);
     29bool              psastroDefineFile (pmConfig *config, pmFPA *input, char *filerule, char *argname, pmFPAfileType fileType, pmDetrendType detrendType);
    2930bool              psastroAnalysis (pmConfig *config);
    3031
     
    7879int               psastroSortByMag (const void *a, const void *b);
    7980
     81bool              psastroEnforceChips (pmConfig *config, pmFPA *fpa, psMetadata *recipe);
     82
    8083# endif /* PSASTRO_H */
  • branches/eam_branch_20071023/psastro/src/psastroArguments.c

    r12992 r15401  
    3636        psMetadataAddStr (config->arguments, PS_LIST_TAIL, "CHIP_SELECTIONS", PS_META_REPLACE, "", argv[N]);
    3737        psArgumentRemove (N, &argc, argv);
     38    }
     39   
     40    // apply the chip correction based on the reference astrometry?
     41    if ((N = psArgumentGet (argc, argv, "-fixchips"))) {
     42        psArgumentRemove (N, &argc, argv);
     43        psMetadataAddBool (config->arguments, PS_LIST_TAIL, "PSASTRO.FIX.CHIPS", PS_META_REPLACE, "", true);
     44    }
     45    // define the reference astrometry file
     46    status = pmConfigFileSetsMD (config->arguments, &argc, argv, "REF.ASTROM", "-refastrom", "-refastromlist");
     47    if (status) {
     48        // if supplied, assume -fixchips is desired
     49        psMetadataAddBool (config->arguments, PS_LIST_TAIL, "PSASTRO.FIX.CHIPS", PS_META_REPLACE, "", true);
    3850    }
    3951
  • branches/eam_branch_20071023/psastro/src/psastroDefineFiles.c

    r15359 r15401  
    44
    55    // these calls bind the I/O handle to the specified fpa
     6    bool status;
     7
     8    // select the current recipe
     9    psMetadata *recipe  = psMetadataLookupPtr (&status, config->recipes, PSASTRO_RECIPE);
     10    if (!recipe) {
     11        psError(PSASTRO_ERR_CONFIG, false, "Can't find PSASTRO recipe!\n");
     12        return false;
     13    }
    614
    715    pmFPAfile *output = pmFPAfileDefineOutput (config, input->fpa, "PSASTRO.OUTPUT");
     
    1220    output->save = true;
    1321
    14     // XXX not sure of this: should this be bind from args?
    15     pmFPAfile *refAstrom = pmFPAfileDefineFromConf (&status, config, "PSASTRO.REF.ASTROM");
    16     if (!refAstrom) {
    17         psError(PSASTRO_ERR_CONFIG, false, "Failed to load ref astrometry");
    18         return false;
     22    bool fixChips = psMetadataLookupBool (&status, recipe, "PSASTRO.FIX.CHIPS");
     23
     24    if (fixChips) {
     25        if (!psastroDefineFile (config, input->fpa, "PSASTRO.REF.ASTROM", "REF.ASTROM", PM_FPA_FILE_ASTROM, PM_DETREND_TYPE_ASTROM)) {
     26            psError (PS_ERR_IO, false, "Can't find a reference astrometry file");
     27            return NULL;
     28        }
    1929    }
    2030
     
    3141    return true;
    3242}
     43
     44bool psastroDefineFile (pmConfig *config, pmFPA *input, char *filerule, char *argname, pmFPAfileType fileType, pmDetrendType detrendType) {
     45
     46    bool status;
     47    pmFPAfile *file;
     48
     49    // look for the file on the argument list
     50    file = pmFPAfileDefineFromArgs  (&status, config, filerule, argname);
     51    if (!status) {
     52        psError (PS_ERR_UNKNOWN, false, "failed to load find definition");
     53        return false;
     54    }
     55    if (file) {
     56        if (file->type != fileType) {
     57            psError(PS_ERR_IO, true, "%s is not of type %s", filerule, pmFPAfileStringFromType (fileType));
     58            return false;
     59        }
     60        return true;
     61    }
     62
     63    // look for the file in the camera config table
     64    file = pmFPAfileDefineFromConf  (&status, config, filerule);
     65    if (!status) {
     66        psError (PS_ERR_UNKNOWN, false, "failed to load find definition");
     67        return false;
     68    }
     69    if (file) {
     70        if (file->type != fileType) {
     71            psError(PS_ERR_IO, true, "%s is not of type %s", filerule, pmFPAfileStringFromType (fileType));
     72            return false;
     73        }
     74        return true;
     75    }
     76
     77    // look for the file to be loaded from the detrend database
     78    file = pmFPAfileDefineFromDetDB (&status, config, filerule, input, detrendType);
     79    if (!status) {
     80        psError (PS_ERR_UNKNOWN, false, "failed to load file definition");
     81        return false;
     82    }
     83    if (file) {
     84        if (file->type != fileType) {
     85            psError(PS_ERR_IO, true, "%s is not of type %s", filerule, pmFPAfileStringFromType (fileType));
     86            return false;
     87        }
     88        return true;
     89    }
     90    return false;
     91}
     92
  • branches/eam_branch_20071023/psastro/src/psastroMosaicAstrom.c

    r15359 r15401  
    2121    pmFPA *fpa = input->fpa;
    2222
    23     // XXX before we do object matches, we need to fix failed chips
    24     // compare chips with supplied mosaic model
    25     // adjust significant outliers to match model
    26 
    27     if (!psastroEnforceChips (fpa, recipe) {
     23    // before we do object matches, we need to (optionally) fix failed chips.  We compare chips with
     24    // the supplied mosaic model.  Adjust significant outliers to match model. 
     25    if (!psastroEnforceChips (config, fpa, recipe)) {
    2826        psError(PSASTRO_ERR_UNKNOWN, false, "failed to align problematic chips");
    2927        return false;
Note: See TracChangeset for help on using the changeset viewer.