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/ppSimSequenceBias.c

    r19080 r19315  
    11# include "ppSimSequence.h"
    22
    3 bool ppSimSequenceBias (FILE *simfile, FILE *inject, psMetadata *sequence, int nSeq, psRandom *rng, const char *path, const char *basename, char *camera, const char *injectCommand) {
     3bool ppSimSequenceBias (FILE *simfile, FILE *inject, psMetadata *sequence, int nSeq, psRandom *rng, const char *path, const char *basename, const char *ppSimCommand, const char *injectCommand) {
    44
    55    bool status, setLevel, setRange;
    6 
    7     if (camera == NULL) {
    8         camera = psMetadataLookupStr (&status, sequence, "CAMERA");
    9     }
    106
    117    // optional details
     
    1915    for (int i = 0; i < nImages; i++) {
    2016           
    21       psString command = NULL;
     17        // define the output filename
     18        psString filename = NULL;
     19        if (path) {
     20            psStringAppend (&filename, "%s/%s.%03d.%03d", path, basename, nSeq, nImage);
     21        } else {
     22            psStringAppend (&filename, "%s.%03d.%03d", basename, nSeq, nImage);
     23        }
    2224
    23       psStringAppend (&command, "ppSim -type BIAS");
    24       psStringAppend (&command, " -camera %s", camera);
     25        // define the ppSim command
     26        psString command = NULL;
    2527
    26       if (setLevel) psStringAppend (&command, " -biaslevel %f", level);
    27       if (setRange) psStringAppend (&command, " -biasrange %f", range);
     28        psStringAppend (&command, "%s -type BIAS", ppSimCommand);
    2829
    29       // XXX need to add output filename
    30       psString filename = NULL;
    31       if (path) {
    32         psStringAppend (&filename, "%s/%s.%03d.%03d", path, basename, nSeq, nImage);
    33       } else {
    34         psStringAppend (&filename, "%s.%03d.%03d", basename, nSeq, nImage);
    35       }
    36       psStringAppend (&command, " %s", filename);
     30        if (setLevel) psStringAppend (&command, " -biaslevel %f", level);
     31        if (setRange) psStringAppend (&command, " -biasrange %f", range);
     32     
     33        psStringAppend (&command, " %s", filename);
    3734
    38       fprintf (simfile, "%s\n", command);
    39       psFree (command);
     35        fprintf (simfile, "%s\n", command);
     36        psFree (command);
    4037                           
    41       // path should be dirname/filename
    42       command = psStringCopy (injectCommand);
    43       psStringAppend (&command, " --camera %s", camera);
    44       psStringAppend (&command, " %s*.fits",    filename);
    45       fprintf (inject, "%s\n", command);
    46       psFree (command);
    47       psFree (filename);
     38        // define the inject command
     39        // path should be dirname/filename
     40        command = psStringCopy (injectCommand);
     41        psStringAppend (&command, " %s*.fits",    filename);
     42        fprintf (inject, "%s\n", command);
     43        psFree (command);
     44        psFree (filename);
    4845
    49       nImage ++;
     46        nImage ++;
    5047    }
    5148    return true;
Note: See TracChangeset for help on using the changeset viewer.