IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 11862 for trunk/dvoTools


Ignore:
Timestamp:
Feb 16, 2007, 1:46:31 PM (19 years ago)
Author:
eugene
Message:

fixed up basic operations

Location:
trunk/dvoTools/src
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/dvoTools/src/Makefile.am

    r11804 r11862  
    2424        dvoApplyCorrParseCamera.c \
    2525        dvoApplyCorrLoop.c \
     26        dvoApplyCorrReadout.c \
    2627        dvoApplyCorrCleanup.c \
    2728        dvoApplyCorrOptions.c \
  • trunk/dvoTools/src/dvoApplyCorr.h

    r11804 r11862  
    3131bool dvoApplyCorrLoop(pmConfig *config, dvoApplyCorrOptions *options);
    3232
     33// apply the correction factor pixel-by-pixel
     34bool dvoApplyCorrReadout (pmConfig *config, pmFPAview *view, char *inName, char *corrName);
     35
    3336// free memory, check for leaks
    3437void dvoApplyCorrCleanup (pmConfig *config, dvoApplyCorrOptions *options);
  • trunk/dvoTools/src/dvoApplyCorrArguments.c

    r11804 r11862  
    66
    77static void usage (void) {
    8     fprintf(stderr, "USAGE: dvoApplyCorr MOSAIC.fits OUTPUT\n\n");
     8    fprintf(stderr, "USAGE: dvoApplyCorr -file INPUT.fits OUTPUT\n\n");
    99    exit (2);
    1010}
     
    5050    }
    5151
    52     if (argc != 2) usage ();
    53 
    5452    // the input file is a required argument; if not found, we will exit
    5553    bool status = pmConfigFileSetsMD (config->arguments, config, "INPUT", "-file", "-list");
     
    5856    }
    5957
     58    pmConfigFileSetsMD (config->arguments, config, "CORR", "-corr", "-corrlist");
     59
     60    if (argc != 2) usage ();
     61
    6062    // Add the output image (which remain on the command-line) to the arguments list
    6163    psMetadataAddStr(config->arguments, PS_LIST_TAIL, "OUTPUT", 0, "Name of the output image", argv[1]);
  • trunk/dvoTools/src/dvoApplyCorrLoop.c

    r11804 r11862  
    1414    // psMetadata *recipe = psMetadataLookupMetadata(&status, config->recipes, RECIPE_NAME);
    1515
    16     pmFPAfile *input = psMetadataLookupPtr(&status, config->files, "DVOCORR.INPUT");
     16    pmFPAfile *input = psMetadataLookupPtr(&status, config->files, "DVOFLAT.INPUT");
    1717    if (!status) {
    1818        psErrorStackPrint(stderr, "Can't find input data!\n");
     
    5858            if (!readout->data_exists) continue;
    5959
    60             // XXX put the function here which unbins the input image
     60            // XXX put the function here which multiplies the input image and the correction image
     61            dvoApplyCorrReadout (config, view, "DVOFLAT.INPUT", "DVOFLAT.CORR");
    6162
    6263            if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) {
  • trunk/dvoTools/src/dvoApplyCorrParseCamera.c

    r11804 r11862  
    1010
    1111    // the input image defines the camera, and all recipes and options the follow
    12     // XXX we need to change this: mosaic.fits is not in pmFPA format??
    13     // - determine the camera from the header keywords
    14     pmFPAfile *input = pmFPAfileDefineFromArgs (&status, config, "DVOCORR.INPUT", "INPUT");
    15     if (!status || !input) {
    16         psError(PS_ERR_IO, false, "Failed to build FPA from DVOCORR.INPUT");
     12    pmFPAfile *input = pmFPAfileDefineFromArgs (NULL, config, "DVOFLAT.INPUT", "INPUT");
     13    if (!input) {
     14        psError(PS_ERR_IO, false, "Failed to build FPA from DVOFLAT.INPUT");
    1715        return NULL;
    1816    }
     
    2523
    2624    // the following files are output targets
    27     pmFPAfile *output = pmFPAfileDefineOutput(config, input->fpa, "DVOCORR.OUTPUT");
     25    pmFPAfile *output = pmFPAfileDefineOutput(config, input->fpa, "DVOFLAT.OUTPUT");
    2826    if (!output) {
    29         psError(PS_ERR_IO, false, _("Unable to generate output file from DVOCORR.OUTPUT"));
     27        psError(PS_ERR_IO, false, _("Unable to generate output file from DVOFLAT.OUTPUT"));
    3028        psFree(options);
    3129        return NULL;
    3230    }
    3331
     32    // 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);
     39    if (!status) {
     40        psError (PS_ERR_IO, false, "can't find a flat-field correction image source");
     41        return NULL;
     42    }
     43   
    3444    // Chip selection: turn on only the chips specified (pass status to suppress missing-key log msg)
     45    status = false;
    3546    char *chipLine = psMetadataLookupStr(&status, config->arguments, "CHIP_SELECTIONS");
    3647    psArray *chips = psStringSplitArray (chipLine, ",", false);
Note: See TracChangeset for help on using the changeset viewer.