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

    r19080 r19315  
    11# include "ppSimSequence.h"
    22
    3 bool ppSimSequenceObject (FILE *simfile, FILE *inject, psMetadata *sequence, int nSeq, psRandom *rng, const char *path, const char *basename, char *camera, const char *injectCommand) {
     3bool ppSimSequenceObject (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;
     
    88    // ppSim -camera $camera -type OBJECT -filter $filter -exptime $exptime
    99    //       -skyrate $sky -ra $ra -dec $dec -pa $pa -scale $scale -zp $zp -seeing $seeing $filename",
    10 
    11     if (camera == NULL) {
    12         camera = psMetadataLookupStr (&status, sequence, "CAMERA");
    13     }
    1410
    1511    // sequence reference coordinate
     
    8076                        for (float pos = pos_min; pos <= pos_max; pos += pos_delta) {
    8177             
     78                            // define the output filename
     79                            psString filename = NULL;
     80                            if (path) {
     81                                psStringAppend (&filename, "%s/%s.%03d.%03d", path, basename, nSeq, nImage);
     82                            } else {
     83                                psStringAppend (&filename, "%s.%03d.%03d", basename, nSeq, nImage);
     84                            }
     85
     86                            // define the ppSim command
    8287                            psString command = NULL;
    8388
    84                             psStringAppend (&command, "ppSim -type OBJECT");
    85                             psStringAppend (&command, " -camera %s", camera);
     89                            psStringAppend (&command, "%s -type OBJECT", ppSimCommand);
    8690                            psStringAppend (&command, " -filter %s", (char *) filters->data[i]);
    8791                            psStringAppend (&command, " -exptime %f", exptimes->data.F32[i]);
     
    97101                            psStringAppend (&command, " -seeing %f", seeing);
    98102
    99                             // XXX need to add output filename
    100                             psString filename = NULL;
    101                             if (path) {
    102                                 psStringAppend (&filename, "%s/%s.%03d.%03d", path, basename, nSeq, nImage);
    103                             } else {
    104                                 psStringAppend (&filename, "%s.%03d.%03d", basename, nSeq, nImage);
    105                             }
    106103                            psStringAppend (&command, " %s", filename);
    107104
     
    109106                            psFree (command);
    110107                           
     108                            // define the inject command
    111109                            // path should be dirname/filename
    112110                            command = psStringCopy (injectCommand);
    113                             psStringAppend (&command, " --camera %s", camera);
    114111                            psStringAppend (&command, " %s*.fits",    filename);
    115112                            fprintf (inject, "%s\n", command);
Note: See TracChangeset for help on using the changeset viewer.