IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 2, 2008, 9:14:17 AM (18 years ago)
Author:
eugene
Message:

adding ppsim_recipe and camera options

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppSim/src/ppSimSequence.c

    r19080 r19315  
    4343        psArgumentRemove(argNum, &argc, argv);
    4444        workdir = psStringCopy (argv[argNum]);
     45        psArgumentRemove(argNum, &argc, argv);
     46    }
     47
     48    char *ppsim_recipe = NULL;
     49    if ((argNum = psArgumentGet (argc, argv, "-ppsim_recipe"))) {
     50        psArgumentRemove(argNum, &argc, argv);
     51        ppsim_recipe = psStringCopy (argv[argNum]);
    4552        psArgumentRemove(argNum, &argc, argv);
    4653    }
     
    8390        fprintf (stderr, " (inject)   : an output file with commands to inject the images into the pipeline\n");
    8491        fprintf (stderr, "options:\n");
     92        fprintf (stderr, " -camera (camera) [otherwise must be set in sequences file]\n");
     93        fprintf (stderr, " -ppsim_recipe (recipe)\n");
    8594        fprintf (stderr, " -dbname (dbname)\n");
    8695        fprintf (stderr, " -path (path)\n");
     
    120129    if (tess_id) psStringAppend (&injectCommand, " --tess_id %s", tess_id);
    121130
     131    // build the base ppSimCommand string
     132    psString ppSimCommand = psStringCopy ("ppSim");
     133    if (ppsim_recipe) psStringAppend (&ppSimCommand, " -recipe PPSIM %s", ppsim_recipe);
     134
    122135    unsigned long seed = psMetadataLookupS32 (&status, config, "RND_SEED");
    123136    if (!status) seed = 0;
     
    157170        }
    158171
     172        // determine the camera for the sequence and define the ppSim command
     173        if (camera == NULL) {
     174            camera = psMetadataLookupStr (&status, sequence, "CAMERA");
     175        }
     176
     177        psString injectCommandReal = NULL;
     178        psString ppSimCommandReal = NULL;
     179
     180        psStringAppend (&injectCommandReal, "%s --camera %s", injectCommand, camera);
     181        psStringAppend (&ppSimCommandReal, "%s -camera %s", ppSimCommand, camera);
     182
    159183        if (!strcasecmp (type, "BIAS")) {
    160             ppSimSequenceBias (simfile, inject, sequence, i, rng, path, basename, camera, injectCommand);
     184            ppSimSequenceBias (simfile, inject, sequence, i, rng, path, basename, ppSimCommandReal, injectCommandReal);
    161185            continue;
    162186        }
    163187        if (!strcasecmp (type, "DARK")) {
    164             ppSimSequenceDark (simfile, inject, sequence, i, rng, path, basename, camera, injectCommand);
     188            ppSimSequenceDark (simfile, inject, sequence, i, rng, path, basename, ppSimCommandReal, injectCommandReal);
    165189            continue;
    166190        }
    167191        if (!strcasecmp (type, "FLAT")) {
    168             ppSimSequenceFlat (simfile, inject, sequence, i, rng, path, basename, camera, injectCommand);
     192            ppSimSequenceFlat (simfile, inject, sequence, i, rng, path, basename, ppSimCommandReal, injectCommandReal);
    169193            continue;
    170194        }
    171195        if (!strcasecmp (type, "OBJECT")) {
    172             ppSimSequenceObject (simfile, inject, sequence, i, rng, path, basename, camera, injectCommand);
     196            ppSimSequenceObject (simfile, inject, sequence, i, rng, path, basename, ppSimCommandReal, injectCommandReal);
    173197            continue;
    174198        }
Note: See TracChangeset for help on using the changeset viewer.