IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 6911


Ignore:
Timestamp:
Apr 19, 2006, 10:51:44 AM (20 years ago)
Author:
eugene
Message:

adding file concepts

Location:
trunk/psastro/src
Files:
3 edited

Legend:

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

    r6792 r6911  
    3434    // save these recipe options until we have loaded the options
    3535    psMetadataAddPtr (config->arguments, PS_LIST_TAIL, "PSASTRO.OPTIONS",  PS_DATA_METADATA, "", options);
     36    psFree (options);
     37
     38    // chip selection is used to limit chips to be processed
     39    if ((N = psArgumentGet (*argc, argv, "-chip"))) {
     40        psArgumentRemove (N, argc, argv);
     41        psMetadataAddStr (config->arguments, PS_LIST_TAIL, "CHIP_SELECTION", PS_DATA_STRING, "", psStringCopy(argv[N]));
     42        psArgumentRemove (N, argc, argv);
     43    }
    3644
    3745    status = pmConfigFileSetsMD (config->arguments, "INPUT", "-file", "-list");
     
    4351    psMetadataAddStr (config->arguments, PS_LIST_TAIL, "OUTPUT", 0, "", argv[2]);
    4452
    45     psTrace(__func__, 1, "Done with psphotArguments...\n");
     53    psTrace(__func__, 1, "Done with psastroArguments...\n");
    4654    return (config);
    4755}
  • trunk/psastro/src/psastroDataLoop.c

    r6792 r6911  
    11# include "psastro.h"
    22
    3 // load the data from the files in this loop.
    4 // we write out the result in a second loop
     3// this loop just loads the data from the input files.
    54// at the end of this function, the complete stellar data is loaded
    65// into the correct fpa structure locations (readout.analysis:PSPHOT.SOURCES)
     6// all of the different astrometry analysis modes use the same data load loop
    77bool psastroDataLoop (pmConfig *config) {
    88
     
    1212        exit(EXIT_FAILURE);
    1313    }
     14    // de-activate all files except PSASTRO.INPUT
     15    psFPAfileActivate (config->files, false, NULL);
     16    psFPAfileActivate (config->files, true, "PSASTRO.INPUT");
    1417
    1518    pmFPAview *view = pmFPAviewAlloc (0);
     
    4245    return true;
    4346}
     47
     48// we need to suppress other IO files.  we need a function with toggles the mode/state of the
     49// pmFPAfiles so the ones of interest are active.
  • trunk/psastro/src/psastroParseCamera.c

    r6792 r6911  
    77    // the input image(s) are required arguments; they define the camera
    88    input = pmFPAfileAddSource (config, "INPUT", "PSASTRO.INPUT", true);
    9     if (input == NULL) {
    10         psAbort (__func__, "missing INPUT entry");
    11     }
     9    if (!status) { psAbort (__func__, "missing INPUT entry"); }
     10
     11    // select recipe options supplied on command line
     12    psMetadata *recipe  = psMetadataLookupPtr (&status, config->recipes,   "PSASTRO");
     13    psMetadata *options = psMetadataLookupPtr (&status, config->arguments, "PSASTRO.OPTIONS");
     14    psMetadataCopy (recipe, options);
    1215
    1316    // set default recipe values here
     
    1518    psMetadataAddStr (recipe, PS_LIST_TAIL, "BREAK_POINT", PS_META_NO_REPLACE, "default fitting mode", "NONE");
    1619
     20    // these calls bind the I/O handle to the specified fpa
     21    pmFPAfileDefine (config->files, config->camera, input->fpa, "PSASTRO.OUTPUT");
     22
     23    // supply the output name (from cmd-line) to all output (WRITE) files
     24    char *output = psMetadataLookupPtr(&status, config->arguments, "OUTPUT");
     25    pmFPAfileAddFileNames (config->files, "OUTPUT", output, PM_FPA_MODE_WRITE);
     26
     27    // Chip selection: turn on only the chips specified
     28    char *chipLine = psMetadataLookupStr(NULL, config->arguments, "CHIP_SELECTIONS");
     29    psArray *chips = psStringSplitArray (chipLine, ",");
     30    if (chips->n > 0) {
     31        pmFPASelectChip (input->fpa, -1, true); // deselect all chips
     32        for (int i = 0; i < chips->n; i++) {
     33            int chipNum = atoi(chips->data[i]);
     34            if (! pmFPASelectChip(input->fpa, chipNum, false)) {
     35                psErrorStackPrint(stderr, "Chip number %d doesn't exist in camera.\n", chipNum);
     36                exit(EXIT_FAILURE);
     37            }
     38        }
     39    }
     40
    1741    psTrace(__func__, 1, "Done with psastroParseCamera...\n");
    1842    return true;
Note: See TracChangeset for help on using the changeset viewer.