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

    r19080 r19315  
    11# include "ppSimSequence.h"
    22
    3 bool ppSimSequenceFlat (FILE *simfile, FILE *inject, psMetadata *sequence, int nSeq, psRandom *rng, const char *path, const char *basename, char *camera, const char *injectCommand) {
     3bool ppSimSequenceFlat (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;
    6 
    7     if (camera == NULL) {
    8         camera = psMetadataLookupStr (&status, sequence, "CAMERA");
    9     }
    106
    117    // determine the filters & exposure times
     
    2824    for (int i = 0; i < filters->n; i++) {
    2925           
    30       // loop over the filters & exposure times
    31       for (int j = 0; j < nSetup; j++) {
     26        // loop over the filters & exposure times
     27        for (int j = 0; j < nSetup; j++) {
    3228           
    33         psString command = NULL;
     29            // define the 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            }
    3436
    35         psStringAppend (&command, "ppSim -type FLAT");
    36         psStringAppend (&command, " -camera %s", camera);
     37            // define the ppSim comand
     38            psString command = NULL;
    3739
    38         psStringAppend (&command, " -filter %s", (char *) filters->data[i]);
    39         psStringAppend (&command, " -exptime %f", exptimes->data.F32[i]);
     40            psStringAppend (&command, "%s -type FLAT", ppSimCommand);
    4041
    41         // XXX need to add output filename
    42         psString filename = NULL;
    43         if (path) {
    44           psStringAppend (&filename, "%s/%s.%03d.%03d", path, basename, nSeq, nImage);
    45         } else {
    46           psStringAppend (&filename, "%s.%03d.%03d", basename, nSeq, nImage);
     42            psStringAppend (&command, " -filter %s", (char *) filters->data[i]);
     43            psStringAppend (&command, " -exptime %f", exptimes->data.F32[i]);
     44
     45            psStringAppend (&command, " %s", filename);
     46
     47            fprintf (simfile, "%s\n", command);
     48            psFree (command);
     49
     50            // define the inject command
     51            // path should be dirname/filename
     52            command = psStringCopy (injectCommand);
     53            psStringAppend (&command, " %s*.fits",    filename);
     54            fprintf (inject, "%s\n", command);
     55            psFree (command);
     56            psFree (filename);
     57
     58            nImage ++;
    4759        }
    48         psStringAppend (&command, " %s", filename);
    49 
    50 
    51         fprintf (simfile, "%s\n", command);
    52         psFree (command);
    53 
    54         // path should be dirname/filename
    55         command = psStringCopy (injectCommand);
    56         psStringAppend (&command, " --camera %s", camera);
    57         psStringAppend (&command, " %s*.fits",    filename);
    58         fprintf (inject, "%s\n", command);
    59         psFree (command);
    60         psFree (filename);
    61 
    62         nImage ++;
    63       }
    6460    }
    6561    return true;
Note: See TracChangeset for help on using the changeset viewer.