IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 7, 2026, 4:51:13 PM (3 weeks ago)
Author:
eugene
Message:

add option to pass expname to ipp_inject_fileset.pl, small code refactor

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-pstamp-20260421/ppSim/src/ppSimSequenceBias.c

    r27967 r43081  
    1515    for (int i = 0; i < nImages; i++) {
    1616               
    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         }
    24 
    2517        // define the ppSim command
    2618        psString command = NULL;
    … …  
    3022        if (setLevel) psStringAppend (&command, " -biaslevel %f", level);
    3123        if (setRange) psStringAppend (&command, " -biasrange %f", range);
    32          
     24
     25        // define the exposure name and output filename
     26        psString expname = ppSimDefineExpname (basename, nSeq, nImage);
     27        psString filename = ppSimDefineFilename (path, expname);
     28
     29        // add output filename to the end of the full command
    3330        psStringAppend (&command, " %s", filename);
    3431
    … …  
    4239        for (int i = 0; i < files->n; i++) {
    4340            command = psStringCopy (injectCommand);
    44             psStringAppend (&command, " %s.%s", filename, (char *) files->data[i]);
     41            psStringAppend (&command, " --exp_name %s %s.%s", expname, filename, (char *) files->data[i]);
    4542            fprintf (inject, "%s\n", command);
    4643            psFree (command);
    4744        }
    4845
     46        psFree (expname);
    4947        psFree (filename);
    5048        nImage ++;
    … …  
    5250    return true;
    5351}
     52
     53psString ppSimDefineExpname (const char *basename, int nSeq, int nImage) {
     54 
     55  // define the exposure name
     56  psString expname = NULL;
     57  psStringAppend (&expname, "%s.%03d.%03d", basename, nSeq, nImage);
     58  return expname;
     59}
     60 
     61psString ppSimDefineFilename (const char *path, const char *expname) {
     62
     63  // define the output filename
     64  psString filename = NULL;
     65  if (path) {
     66    psStringAppend (&filename, "%s/%s", path, expname);
     67  } else {
     68    psStringAppend (&filename, "%s", expname);
     69  }
     70  return filename;
     71}
Note: See TracChangeset for help on using the changeset viewer.