IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 21, 2007, 2:10:11 PM (19 years ago)
Author:
Paul Price
Message:

Changes to multiple packages in order to use "reduction classes" to
specify recipe names. The idea is to give a group of recipes a
symbolic name, which distinguish how the reduction is to be performed,
without going to all the trouble of changing the recipes themselves.

For example, we might want to turn off the usual
overscan/bias/dark/shutter/flat processing and only do photometry if
we have pre-processed data. Gene also wants a similar ability for
building the flat-field correction.

Added a REDUCTION metadata to the camera configuration that contains
multiple METADATA entries that have recipes for different processing
steps. PS::IPP::Config has a 'reduction' function to return the
appropriate recipe, and this is now used in the scripts. Updated
ippTasks to use these where appropriate.

This necessitated changing the database, so that the desired reduction
class can be specified in the right places. Instructions on converting
an extant database are in dbconfig/changes.txt.

Tested with the SIMTEST, and it works.

There is currently no way of specifying the reduction class when an
exposure proceeds from 'register' to 'chip' (it has to be hacked in
the database directly: "update chipPendingExp set reduction =
'SOME_CLASS' where ..."), but it can be specified when adding a
detrend run or queuing chips with 'chiptool -queue' (the '-reduction'
option). Also, the 'recipe' columns remain throughout the detrend
tables, and they continue to be populated with the actual recipe used
(rather than the reduction class; but that is contained in the
detRun).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/src/dettool.c

    r13849 r13937  
    449449    }
    450450
     451    psString reduction = psMetadataLookupStr(&status, config->args, "-reduction");
     452    if (!status) {
     453        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -reduction");
     454        return false;
     455    }
     456
    451457    psString label = psMetadataLookupStr(&status, config->args, "-label");
    452458    if (!status) {
     
    528534    // XXX det_id
    529535    detRunInsert(config->dbh,
    530             0,
    531             0,
    532             det_type,
    533             mode,
    534             "run",
    535             filelevel,
    536             workdir,
    537             camera,
    538             telescope,
    539             exp_type,
    540             filter,
    541             airmass_min,
    542             airmass_max,
    543             exp_time_min,
    544             exp_time_max,
    545             ccd_temp_min,
    546             ccd_temp_max,
    547             posang_min,
    548             posang_max,
    549             registered,
    550             time_begin,
    551             time_end,
    552             use_begin,
    553             use_end,
    554             solang_min,
    555             solang_max,
    556             label,
    557             0       // parent
     536                 0,
     537                 0,
     538                 det_type,
     539                 mode,
     540                 "run",
     541                 filelevel,
     542                 workdir,
     543                 camera,
     544                 telescope,
     545                 exp_type,
     546                 reduction,
     547                 filter,
     548                 airmass_min,
     549                 airmass_max,
     550                 exp_time_min,
     551                 exp_time_max,
     552                 ccd_temp_min,
     553                 ccd_temp_max,
     554                 posang_min,
     555                 posang_max,
     556                 registered,
     557                 time_begin,
     558                 time_end,
     559                 use_begin,
     560                 use_end,
     561                 solang_min,
     562                 solang_max,
     563                 label,
     564                 0       // parent
    558565        );
    559566    psFree(registered);
     
    11721179    }
    11731180
     1181    psString reduction = psMetadataLookupStr(&status, config->args, "-reduction");
     1182    if (!status) {
     1183        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -reduction");
     1184        return false;
     1185    }
     1186
    11741187    psString label = psMetadataLookupStr(&status, config->args, "-label");
    11751188    if (!status) {
     
    12511264    // XXX det_id
    12521265    detRunInsert(config->dbh,
    1253             0,      // det_id
    1254             0,      // iteration
    1255             det_type,
    1256             mode,
    1257             "run",  // state
    1258             filelevel,
    1259             workdir,
    1260             camera,
    1261             telescope,
    1262             "NA",
    1263             filter,
    1264             airmass_min,
    1265             airmass_max,
    1266             exp_time_min,
    1267             exp_time_max,
    1268             ccd_temp_min,
    1269             ccd_temp_max,
    1270             posang_min,
    1271             posang_max,
    1272             registered,
    1273             time_begin,
    1274             time_end,
    1275             use_begin,
    1276             use_end,
    1277             solang_min,
    1278             solang_max,
    1279             label,
    1280             0       // parent
     1266                 0,      // det_id
     1267                 0,      // iteration
     1268                 det_type,
     1269                 mode,
     1270                 "run",  // state
     1271                 filelevel,
     1272                 workdir,
     1273                 camera,
     1274                 telescope,
     1275                 "NA",
     1276                 reduction,
     1277                 filter,
     1278                 airmass_min,
     1279                 airmass_max,
     1280                 exp_time_min,
     1281                 exp_time_max,
     1282                 ccd_temp_min,
     1283                 ccd_temp_max,
     1284                 posang_min,
     1285                 posang_max,
     1286                 registered,
     1287                 time_begin,
     1288                 time_end,
     1289                 use_begin,
     1290                 use_end,
     1291                 solang_min,
     1292                 solang_max,
     1293                 label,
     1294                 0       // parent
    12811295        );
    12821296    psFree(registered);
     
    16711685            psFree(use_end);
    16721686        }
     1687    }
     1688
     1689    psString reduction = psMetadataLookupStr(&status, config->args, "-set_reduction");
     1690    if (!status) {
     1691        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -set_reduction");
     1692        return false;
     1693    }
     1694    if (reduction) {
     1695        psFree(detRun->reduction);
     1696        detRun->reduction = psStringCopy(reduction);
    16731697    }
    16741698
     
    21152139            "   detRun.det_type,"
    21162140            "   detRun.workdir,"
     2141            "   detRun.reduction,"
    21172142            "   rawImfile.*,"
    21182143            "   rawExp.camera"
     
    28622887        "    detRun.det_type,\n"
    28632888        "    detRun.workdir,\n"
     2889        "    detRun.reduction,\n"
    28642890        "    detProcessedImfile.class_id,\n"
    28652891        "    rawExp.camera\n"
     
    29873013    // add the two required restrictions: detRun.state and detRun.mode
    29883014    if ((value = psMetadataLookupStr(&status, config->args, "-select_state"))) {
    2989         psStringAppend(&query, " detRun.state = '%s'", value);
     3015        psStringAppend(&query, " detRun.state = '%s'", value);
    29903016    } else {
    2991         psStringAppend(&query, " detRun.state = 'run'");
     3017        psStringAppend(&query, " detRun.state = 'run'");
    29923018    }
    29933019    if ((value = psMetadataLookupStr(&status, config->args, "-select_mode"))) {
    2994         psStringAppend(&query, " AND detRun.mode = '%s'", value);
     3020        psStringAppend(&query, " AND detRun.mode = '%s'", value);
    29953021    } else {
    2996         psStringAppend(&query, " AND detRun.mode = 'master'");
     3022        psStringAppend(&query, " AND detRun.mode = 'master'");
    29973023    }
    29983024
     
    44074433        "   detRun.mode,\n"
    44084434        "   detRun.workdir,\n"
     4435        "   detRun.reduction,\n"
    44094436        "   detProcessedImfile.exp_tag,\n"
    44104437        "   detProcessedImfile.class_id,\n"
     
    44444471        "   detRun.mode,\n"
    44454472        "   detRun.workdir,\n"
     4473        "   detRun.reduction,\n"
    44464474        "   rawImfile.exp_tag,\n"
    44474475        "   rawImfile.class_id,\n"
     
    67746802
    67756803    if (!detRunInsert(config->dbh,
    6776             0,          // det_id
    6777             0,          // the iteration is fixed at 0
    6778             det_type,
    6779             mode,
    6780             "reg",      // state
    6781             filelevel,
    6782             workdir,
    6783             camera,
    6784             telescope,
    6785             exp_type,
    6786             filter,
    6787             airmass_min,
    6788             airmass_max,
    6789             exp_time_min,
    6790             exp_time_max,
    6791             ccd_temp_min,
    6792             ccd_temp_max,
    6793             posang_min,
    6794             posang_max,
    6795             registered,
    6796             time_begin,
    6797             time_end,
    6798             use_begin,
    6799             use_end,
    6800             solang_min,
    6801             solang_max,
    6802             label,      // label
    6803             parent ? (psS64)atoll(parent) : 0
    6804     )) {
     6804                      0,          // det_id
     6805                      0,          // the iteration is fixed at 0
     6806                      det_type,
     6807                      mode,
     6808                      "reg",      // state
     6809                      filelevel,
     6810                      workdir,
     6811                      camera,
     6812                      telescope,
     6813                      exp_type,
     6814                      NULL,
     6815                      filter,
     6816                      airmass_min,
     6817                      airmass_max,
     6818                      exp_time_min,
     6819                      exp_time_max,
     6820                      ccd_temp_min,
     6821                      ccd_temp_max,
     6822                      posang_min,
     6823                      posang_max,
     6824                      registered,
     6825                      time_begin,
     6826                      time_end,
     6827                      use_begin,
     6828                      use_end,
     6829                      solang_min,
     6830                      solang_max,
     6831                      label,      // label
     6832                      parent ? (psS64)atoll(parent) : 0
     6833            )) {
    68056834        psError(PS_ERR_UNKNOWN, false, "database error");
    68066835        // rollback
Note: See TracChangeset for help on using the changeset viewer.