IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 13937 for trunk/ippdb


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).

Location:
trunk/ippdb
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippdb/configure.ac

    r13739 r13937  
    77AC_PREREQ(2.59)
    88
    9 AC_INIT([ippdb], [1.1.22], [pan-starrs.ifa.hawaii.edu])
     9AC_INIT([ippdb], [1.1.23], [pan-starrs.ifa.hawaii.edu])
    1010AC_CONFIG_SRCDIR([ippdb.pc.in])
    1111
  • trunk/ippdb/src/ippdb.c

    r13739 r13937  
    55415541static void chipPendingExpRowFree(chipPendingExpRow *object);
    55425542
    5543 chipPendingExpRow *chipPendingExpRowAlloc(psS64 chip_id, const char *exp_tag, psS64 guide_id, const char *workdir, const char *label, const char *recipe, const char *expgroup, const char *dvodb)
     5543chipPendingExpRow *chipPendingExpRowAlloc(psS64 chip_id, const char *exp_tag, psS64 guide_id, const char *workdir, const char *label, const char *reduction, const char *expgroup, const char *dvodb)
    55445544{
    55455545    chipPendingExpRow *_object;
     
    55535553    _object->workdir = psStringCopy(workdir);
    55545554    _object->label = psStringCopy(label);
    5555     _object->recipe = psStringCopy(recipe);
     5555    _object->reduction = psStringCopy(reduction);
    55565556    _object->expgroup = psStringCopy(expgroup);
    55575557    _object->dvodb = psStringCopy(dvodb);
     
    55655565    psFree(object->workdir);
    55665566    psFree(object->label);
    5567     psFree(object->recipe);
     5567    psFree(object->reduction);
    55685568    psFree(object->expgroup);
    55695569    psFree(object->dvodb);
     
    55985598        return false;
    55995599    }
    5600     if (!psMetadataAdd(md, PS_LIST_TAIL, "recipe", PS_DATA_STRING, NULL, "64")) {
    5601         psError(PS_ERR_UNKNOWN, false, "failed to add item recipe");
     5600    if (!psMetadataAdd(md, PS_LIST_TAIL, "reduction", PS_DATA_STRING, "Reduction class", "64")) {
     5601        psError(PS_ERR_UNKNOWN, false, "failed to add item reduction");
    56025602        psFree(md);
    56035603        return false;
     
    56265626}
    56275627
    5628 bool chipPendingExpInsert(psDB * dbh, psS64 chip_id, const char *exp_tag, psS64 guide_id, const char *workdir, const char *label, const char *recipe, const char *expgroup, const char *dvodb)
     5628bool chipPendingExpInsert(psDB * dbh, psS64 chip_id, const char *exp_tag, psS64 guide_id, const char *workdir, const char *label, const char *reduction, const char *expgroup, const char *dvodb)
    56295629{
    56305630    psMetadata *md = psMetadataAlloc();
     
    56545654        return false;
    56555655    }
    5656     if (!psMetadataAdd(md, PS_LIST_TAIL, "recipe", PS_DATA_STRING, NULL, recipe)) {
    5657         psError(PS_ERR_UNKNOWN, false, "failed to add item recipe");
     5656    if (!psMetadataAdd(md, PS_LIST_TAIL, "reduction", PS_DATA_STRING, NULL, reduction)) {
     5657        psError(PS_ERR_UNKNOWN, false, "failed to add item reduction");
    56585658        psFree(md);
    56595659        return false;
     
    56925692bool chipPendingExpInsertObject(psDB *dbh, chipPendingExpRow *object)
    56935693{
    5694     return chipPendingExpInsert(dbh, object->chip_id, object->exp_tag, object->guide_id, object->workdir, object->label, object->recipe, object->expgroup, object->dvodb);
     5694    return chipPendingExpInsert(dbh, object->chip_id, object->exp_tag, object->guide_id, object->workdir, object->label, object->reduction, object->expgroup, object->dvodb);
    56955695}
    56965696
     
    57905790        return false;
    57915791    }
    5792     if (!psMetadataAdd(md, PS_LIST_TAIL, "recipe", PS_DATA_STRING, NULL, object->recipe)) {
    5793         psError(PS_ERR_UNKNOWN, false, "failed to add item recipe");
     5792    if (!psMetadataAdd(md, PS_LIST_TAIL, "reduction", PS_DATA_STRING, NULL, object->reduction)) {
     5793        psError(PS_ERR_UNKNOWN, false, "failed to add item reduction");
    57945794        psFree(md);
    57955795        return false;
     
    58395839        return false;
    58405840    }
    5841     char* recipe = psMetadataLookupPtr(&status, md, "recipe");
    5842     if (!status) {
    5843         psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item recipe");
     5841    char* reduction = psMetadataLookupPtr(&status, md, "reduction");
     5842    if (!status) {
     5843        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item reduction");
    58445844        return false;
    58455845    }
     
    58555855    }
    58565856
    5857     return chipPendingExpRowAlloc(chip_id, exp_tag, guide_id, workdir, label, recipe, expgroup, dvodb);
     5857    return chipPendingExpRowAlloc(chip_id, exp_tag, guide_id, workdir, label, reduction, expgroup, dvodb);
    58585858}
    58595859psArray *chipPendingExpSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
     
    62846284static void chipProcessedExpRowFree(chipProcessedExpRow *object);
    62856285
    6286 chipProcessedExpRow *chipProcessedExpRowAlloc(psS64 chip_id, const char *exp_tag, psS64 guide_id, const char *workdir, const char *label, const char *recipe, const char *expgroup, const char *dvodb)
     6286chipProcessedExpRow *chipProcessedExpRowAlloc(psS64 chip_id, const char *exp_tag, psS64 guide_id, const char *workdir, const char *label, const char *reduction, const char *expgroup, const char *dvodb)
    62876287{
    62886288    chipProcessedExpRow *_object;
     
    62966296    _object->workdir = psStringCopy(workdir);
    62976297    _object->label = psStringCopy(label);
    6298     _object->recipe = psStringCopy(recipe);
     6298    _object->reduction = psStringCopy(reduction);
    62996299    _object->expgroup = psStringCopy(expgroup);
    63006300    _object->dvodb = psStringCopy(dvodb);
     
    63086308    psFree(object->workdir);
    63096309    psFree(object->label);
    6310     psFree(object->recipe);
     6310    psFree(object->reduction);
    63116311    psFree(object->expgroup);
    63126312    psFree(object->dvodb);
     
    63416341        return false;
    63426342    }
    6343     if (!psMetadataAdd(md, PS_LIST_TAIL, "recipe", PS_DATA_STRING, NULL, "64")) {
    6344         psError(PS_ERR_UNKNOWN, false, "failed to add item recipe");
     6343    if (!psMetadataAdd(md, PS_LIST_TAIL, "reduction", PS_DATA_STRING, NULL, "64")) {
     6344        psError(PS_ERR_UNKNOWN, false, "failed to add item reduction");
    63456345        psFree(md);
    63466346        return false;
     
    63696369}
    63706370
    6371 bool chipProcessedExpInsert(psDB * dbh, psS64 chip_id, const char *exp_tag, psS64 guide_id, const char *workdir, const char *label, const char *recipe, const char *expgroup, const char *dvodb)
     6371bool chipProcessedExpInsert(psDB * dbh, psS64 chip_id, const char *exp_tag, psS64 guide_id, const char *workdir, const char *label, const char *reduction, const char *expgroup, const char *dvodb)
    63726372{
    63736373    psMetadata *md = psMetadataAlloc();
     
    63976397        return false;
    63986398    }
    6399     if (!psMetadataAdd(md, PS_LIST_TAIL, "recipe", PS_DATA_STRING, NULL, recipe)) {
    6400         psError(PS_ERR_UNKNOWN, false, "failed to add item recipe");
     6399    if (!psMetadataAdd(md, PS_LIST_TAIL, "reduction", PS_DATA_STRING, NULL, reduction)) {
     6400        psError(PS_ERR_UNKNOWN, false, "failed to add item reduction");
    64016401        psFree(md);
    64026402        return false;
     
    64356435bool chipProcessedExpInsertObject(psDB *dbh, chipProcessedExpRow *object)
    64366436{
    6437     return chipProcessedExpInsert(dbh, object->chip_id, object->exp_tag, object->guide_id, object->workdir, object->label, object->recipe, object->expgroup, object->dvodb);
     6437    return chipProcessedExpInsert(dbh, object->chip_id, object->exp_tag, object->guide_id, object->workdir, object->label, object->reduction, object->expgroup, object->dvodb);
    64386438}
    64396439
     
    65336533        return false;
    65346534    }
    6535     if (!psMetadataAdd(md, PS_LIST_TAIL, "recipe", PS_DATA_STRING, NULL, object->recipe)) {
    6536         psError(PS_ERR_UNKNOWN, false, "failed to add item recipe");
     6535    if (!psMetadataAdd(md, PS_LIST_TAIL, "reduction", PS_DATA_STRING, NULL, object->reduction)) {
     6536        psError(PS_ERR_UNKNOWN, false, "failed to add item reduction");
    65376537        psFree(md);
    65386538        return false;
     
    65826582        return false;
    65836583    }
    6584     char* recipe = psMetadataLookupPtr(&status, md, "recipe");
    6585     if (!status) {
    6586         psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item recipe");
     6584    char* reduction = psMetadataLookupPtr(&status, md, "reduction");
     6585    if (!status) {
     6586        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item reduction");
    65876587        return false;
    65886588    }
     
    65986598    }
    65996599
    6600     return chipProcessedExpRowAlloc(chip_id, exp_tag, guide_id, workdir, label, recipe, expgroup, dvodb);
     6600    return chipProcessedExpRowAlloc(chip_id, exp_tag, guide_id, workdir, label, reduction, expgroup, dvodb);
    66016601}
    66026602psArray *chipProcessedExpSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
     
    77227722static void camPendingExpRowFree(camPendingExpRow *object);
    77237723
    7724 camPendingExpRow *camPendingExpRowAlloc(psS64 cam_id, psS64 chip_id, const char *workdir, const char *label, const char *recipe, const char *expgroup, const char *dvodb)
     7724camPendingExpRow *camPendingExpRowAlloc(psS64 cam_id, psS64 chip_id, const char *workdir, const char *label, const char *reduction, const char *expgroup, const char *dvodb)
    77257725{
    77267726    camPendingExpRow *_object;
     
    77337733    _object->workdir = psStringCopy(workdir);
    77347734    _object->label = psStringCopy(label);
    7735     _object->recipe = psStringCopy(recipe);
     7735    _object->reduction = psStringCopy(reduction);
    77367736    _object->expgroup = psStringCopy(expgroup);
    77377737    _object->dvodb = psStringCopy(dvodb);
     
    77447744    psFree(object->workdir);
    77457745    psFree(object->label);
    7746     psFree(object->recipe);
     7746    psFree(object->reduction);
    77477747    psFree(object->expgroup);
    77487748    psFree(object->dvodb);
     
    77727772        return false;
    77737773    }
    7774     if (!psMetadataAdd(md, PS_LIST_TAIL, "recipe", PS_DATA_STRING, NULL, "64")) {
    7775         psError(PS_ERR_UNKNOWN, false, "failed to add item recipe");
     7774    if (!psMetadataAdd(md, PS_LIST_TAIL, "reduction", PS_DATA_STRING, NULL, "64")) {
     7775        psError(PS_ERR_UNKNOWN, false, "failed to add item reduction");
    77767776        psFree(md);
    77777777        return false;
     
    78007800}
    78017801
    7802 bool camPendingExpInsert(psDB * dbh, psS64 cam_id, psS64 chip_id, const char *workdir, const char *label, const char *recipe, const char *expgroup, const char *dvodb)
     7802bool camPendingExpInsert(psDB * dbh, psS64 cam_id, psS64 chip_id, const char *workdir, const char *label, const char *reduction, const char *expgroup, const char *dvodb)
    78037803{
    78047804    psMetadata *md = psMetadataAlloc();
     
    78237823        return false;
    78247824    }
    7825     if (!psMetadataAdd(md, PS_LIST_TAIL, "recipe", PS_DATA_STRING, NULL, recipe)) {
    7826         psError(PS_ERR_UNKNOWN, false, "failed to add item recipe");
     7825    if (!psMetadataAdd(md, PS_LIST_TAIL, "reduction", PS_DATA_STRING, NULL, reduction)) {
     7826        psError(PS_ERR_UNKNOWN, false, "failed to add item reduction");
    78277827        psFree(md);
    78287828        return false;
     
    78617861bool camPendingExpInsertObject(psDB *dbh, camPendingExpRow *object)
    78627862{
    7863     return camPendingExpInsert(dbh, object->cam_id, object->chip_id, object->workdir, object->label, object->recipe, object->expgroup, object->dvodb);
     7863    return camPendingExpInsert(dbh, object->cam_id, object->chip_id, object->workdir, object->label, object->reduction, object->expgroup, object->dvodb);
    78647864}
    78657865
     
    79547954        return false;
    79557955    }
    7956     if (!psMetadataAdd(md, PS_LIST_TAIL, "recipe", PS_DATA_STRING, NULL, object->recipe)) {
    7957         psError(PS_ERR_UNKNOWN, false, "failed to add item recipe");
     7956    if (!psMetadataAdd(md, PS_LIST_TAIL, "reduction", PS_DATA_STRING, NULL, object->reduction)) {
     7957        psError(PS_ERR_UNKNOWN, false, "failed to add item reduction");
    79587958        psFree(md);
    79597959        return false;
     
    79987998        return false;
    79997999    }
    8000     char* recipe = psMetadataLookupPtr(&status, md, "recipe");
    8001     if (!status) {
    8002         psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item recipe");
     8000    char* reduction = psMetadataLookupPtr(&status, md, "reduction");
     8001    if (!status) {
     8002        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item reduction");
    80038003        return false;
    80048004    }
     
    80148014    }
    80158015
    8016     return camPendingExpRowAlloc(cam_id, chip_id, workdir, label, recipe, expgroup, dvodb);
     8016    return camPendingExpRowAlloc(cam_id, chip_id, workdir, label, reduction, expgroup, dvodb);
    80178017}
    80188018psArray *camPendingExpSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
     
    81268126static void camProcessedExpRowFree(camProcessedExpRow *object);
    81278127
    8128 camProcessedExpRow *camProcessedExpRowAlloc(psS64 cam_id, psS64 chip_id, const char *workdir, const char *label, const char *recipe, const char *expgroup, const char *dvodb, const char *uri, psF32 bg, psF32 bg_stdev, psF32 bg_mean_stdev, psF32 sigma_ra, psF32 sigma_dec, psF32 zp_mean, psF32 zp_stdev, psF32 fwhm, psF32 fwhm_range, psS32 n_stars, psS32 n_extended, psS32 n_cr, psS32 n_astrom, const char *path_base, psS16 fault)
     8128camProcessedExpRow *camProcessedExpRowAlloc(psS64 cam_id, psS64 chip_id, const char *workdir, const char *label, const char *reduction, const char *expgroup, const char *dvodb, const char *uri, psF32 bg, psF32 bg_stdev, psF32 bg_mean_stdev, psF32 sigma_ra, psF32 sigma_dec, psF32 zp_mean, psF32 zp_stdev, psF32 fwhm, psF32 fwhm_range, psS32 n_stars, psS32 n_extended, psS32 n_cr, psS32 n_astrom, const char *path_base, psS16 fault)
    81298129{
    81308130    camProcessedExpRow *_object;
     
    81378137    _object->workdir = psStringCopy(workdir);
    81388138    _object->label = psStringCopy(label);
    8139     _object->recipe = psStringCopy(recipe);
     8139    _object->reduction = psStringCopy(reduction);
    81408140    _object->expgroup = psStringCopy(expgroup);
    81418141    _object->dvodb = psStringCopy(dvodb);
     
    81648164    psFree(object->workdir);
    81658165    psFree(object->label);
    8166     psFree(object->recipe);
     8166    psFree(object->reduction);
    81678167    psFree(object->expgroup);
    81688168    psFree(object->dvodb);
     
    81948194        return false;
    81958195    }
    8196     if (!psMetadataAdd(md, PS_LIST_TAIL, "recipe", PS_DATA_STRING, NULL, "64")) {
    8197         psError(PS_ERR_UNKNOWN, false, "failed to add item recipe");
     8196    if (!psMetadataAdd(md, PS_LIST_TAIL, "reduction", PS_DATA_STRING, NULL, "64")) {
     8197        psError(PS_ERR_UNKNOWN, false, "failed to add item reduction");
    81988198        psFree(md);
    81998199        return false;
     
    83028302}
    83038303
    8304 bool camProcessedExpInsert(psDB * dbh, psS64 cam_id, psS64 chip_id, const char *workdir, const char *label, const char *recipe, const char *expgroup, const char *dvodb, const char *uri, psF32 bg, psF32 bg_stdev, psF32 bg_mean_stdev, psF32 sigma_ra, psF32 sigma_dec, psF32 zp_mean, psF32 zp_stdev, psF32 fwhm, psF32 fwhm_range, psS32 n_stars, psS32 n_extended, psS32 n_cr, psS32 n_astrom, const char *path_base, psS16 fault)
     8304bool camProcessedExpInsert(psDB * dbh, psS64 cam_id, psS64 chip_id, const char *workdir, const char *label, const char *reduction, const char *expgroup, const char *dvodb, const char *uri, psF32 bg, psF32 bg_stdev, psF32 bg_mean_stdev, psF32 sigma_ra, psF32 sigma_dec, psF32 zp_mean, psF32 zp_stdev, psF32 fwhm, psF32 fwhm_range, psS32 n_stars, psS32 n_extended, psS32 n_cr, psS32 n_astrom, const char *path_base, psS16 fault)
    83058305{
    83068306    psMetadata *md = psMetadataAlloc();
     
    83258325        return false;
    83268326    }
    8327     if (!psMetadataAdd(md, PS_LIST_TAIL, "recipe", PS_DATA_STRING, NULL, recipe)) {
    8328         psError(PS_ERR_UNKNOWN, false, "failed to add item recipe");
     8327    if (!psMetadataAdd(md, PS_LIST_TAIL, "reduction", PS_DATA_STRING, NULL, reduction)) {
     8328        psError(PS_ERR_UNKNOWN, false, "failed to add item reduction");
    83298329        psFree(md);
    83308330        return false;
     
    84438443bool camProcessedExpInsertObject(psDB *dbh, camProcessedExpRow *object)
    84448444{
    8445     return camProcessedExpInsert(dbh, object->cam_id, object->chip_id, object->workdir, object->label, object->recipe, object->expgroup, object->dvodb, object->uri, object->bg, object->bg_stdev, object->bg_mean_stdev, object->sigma_ra, object->sigma_dec, object->zp_mean, object->zp_stdev, object->fwhm, object->fwhm_range, object->n_stars, object->n_extended, object->n_cr, object->n_astrom, object->path_base, object->fault);
     8445    return camProcessedExpInsert(dbh, object->cam_id, object->chip_id, object->workdir, object->label, object->reduction, object->expgroup, object->dvodb, object->uri, object->bg, object->bg_stdev, object->bg_mean_stdev, object->sigma_ra, object->sigma_dec, object->zp_mean, object->zp_stdev, object->fwhm, object->fwhm_range, object->n_stars, object->n_extended, object->n_cr, object->n_astrom, object->path_base, object->fault);
    84468446}
    84478447
     
    85368536        return false;
    85378537    }
    8538     if (!psMetadataAdd(md, PS_LIST_TAIL, "recipe", PS_DATA_STRING, NULL, object->recipe)) {
    8539         psError(PS_ERR_UNKNOWN, false, "failed to add item recipe");
     8538    if (!psMetadataAdd(md, PS_LIST_TAIL, "reduction", PS_DATA_STRING, NULL, object->reduction)) {
     8539        psError(PS_ERR_UNKNOWN, false, "failed to add item reduction");
    85408540        psFree(md);
    85418541        return false;
     
    86608660        return false;
    86618661    }
    8662     char* recipe = psMetadataLookupPtr(&status, md, "recipe");
    8663     if (!status) {
    8664         psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item recipe");
     8662    char* reduction = psMetadataLookupPtr(&status, md, "reduction");
     8663    if (!status) {
     8664        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item reduction");
    86658665        return false;
    86668666    }
     
    87568756    }
    87578757
    8758     return camProcessedExpRowAlloc(cam_id, chip_id, workdir, label, recipe, expgroup, dvodb, uri, bg, bg_stdev, bg_mean_stdev, sigma_ra, sigma_dec, zp_mean, zp_stdev, fwhm, fwhm_range, n_stars, n_extended, n_cr, n_astrom, path_base, fault);
     8758    return camProcessedExpRowAlloc(cam_id, chip_id, workdir, label, reduction, expgroup, dvodb, uri, bg, bg_stdev, bg_mean_stdev, sigma_ra, sigma_dec, zp_mean, zp_stdev, fwhm, fwhm_range, n_stars, n_extended, n_cr, n_astrom, path_base, fault);
    87598759}
    87608760psArray *camProcessedExpSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
     
    1282712827static void detRunRowFree(detRunRow *object);
    1282812828
    12829 detRunRow *detRunRowAlloc(psS64 det_id, psS32 iteration, const char *det_type, const char *mode, const char *state, const char *filelevel, const char *workdir, const char *camera, const char *telescope, const char *exp_type, const char *filter, psF32 airmass_min, psF32 airmass_max, psF32 exp_time_min, psF32 exp_time_max, psF32 ccd_temp_min, psF32 ccd_temp_max, psF64 posang_min, psF64 posang_max, psTime* registered, psTime* time_begin, psTime* time_end, psTime* use_begin, psTime* use_end, psF32 solang_min, psF32 solang_max, const char *label, psS32 parent)
     12829detRunRow *detRunRowAlloc(psS64 det_id, psS32 iteration, const char *det_type, const char *mode, const char *state, const char *filelevel, const char *workdir, const char *camera, const char *telescope, const char *exp_type, const char *reduction, const char *filter, psF32 airmass_min, psF32 airmass_max, psF32 exp_time_min, psF32 exp_time_max, psF32 ccd_temp_min, psF32 ccd_temp_max, psF64 posang_min, psF64 posang_max, psTime* registered, psTime* time_begin, psTime* time_end, psTime* use_begin, psTime* use_end, psF32 solang_min, psF32 solang_max, const char *label, psS32 parent)
    1283012830{
    1283112831    detRunRow       *_object;
     
    1284412844    _object->telescope = psStringCopy(telescope);
    1284512845    _object->exp_type = psStringCopy(exp_type);
     12846    _object->reduction = psStringCopy(reduction);
    1284612847    _object->filter = psStringCopy(filter);
    1284712848    _object->airmass_min = airmass_min;
     
    1287612877    psFree(object->telescope);
    1287712878    psFree(object->exp_type);
     12879    psFree(object->reduction);
    1287812880    psFree(object->filter);
    1287912881    psFree(object->registered);
     
    1293812940        return false;
    1293912941    }
     12942    if (!psMetadataAdd(md, PS_LIST_TAIL, "reduction", PS_DATA_STRING, "Reduction clas", "64")) {
     12943        psError(PS_ERR_UNKNOWN, false, "failed to add item reduction");
     12944        psFree(md);
     12945        return false;
     12946    }
    1294012947    if (!psMetadataAdd(md, PS_LIST_TAIL, "filter", PS_DATA_STRING, NULL, "64")) {
    1294112948        psError(PS_ERR_UNKNOWN, false, "failed to add item filter");
     
    1304113048}
    1304213049
    13043 bool detRunInsert(psDB * dbh, psS64 det_id, psS32 iteration, const char *det_type, const char *mode, const char *state, const char *filelevel, const char *workdir, const char *camera, const char *telescope, const char *exp_type, const char *filter, psF32 airmass_min, psF32 airmass_max, psF32 exp_time_min, psF32 exp_time_max, psF32 ccd_temp_min, psF32 ccd_temp_max, psF64 posang_min, psF64 posang_max, psTime* registered, psTime* time_begin, psTime* time_end, psTime* use_begin, psTime* use_end, psF32 solang_min, psF32 solang_max, const char *label, psS32 parent)
     13050bool detRunInsert(psDB * dbh, psS64 det_id, psS32 iteration, const char *det_type, const char *mode, const char *state, const char *filelevel, const char *workdir, const char *camera, const char *telescope, const char *exp_type, const char *reduction, const char *filter, psF32 airmass_min, psF32 airmass_max, psF32 exp_time_min, psF32 exp_time_max, psF32 ccd_temp_min, psF32 ccd_temp_max, psF64 posang_min, psF64 posang_max, psTime* registered, psTime* time_begin, psTime* time_end, psTime* use_begin, psTime* use_end, psF32 solang_min, psF32 solang_max, const char *label, psS32 parent)
    1304413051{
    1304513052    psMetadata *md = psMetadataAlloc();
     
    1309113098    if (!psMetadataAdd(md, PS_LIST_TAIL, "exp_type", PS_DATA_STRING, NULL, exp_type)) {
    1309213099        psError(PS_ERR_UNKNOWN, false, "failed to add item exp_type");
     13100        psFree(md);
     13101        return false;
     13102    }
     13103    if (!psMetadataAdd(md, PS_LIST_TAIL, "reduction", PS_DATA_STRING, NULL, reduction)) {
     13104        psError(PS_ERR_UNKNOWN, false, "failed to add item reduction");
    1309313105        psFree(md);
    1309413106        return false;
     
    1320713219bool detRunInsertObject(psDB *dbh, detRunRow *object)
    1320813220{
    13209     return detRunInsert(dbh, object->det_id, object->iteration, object->det_type, object->mode, object->state, object->filelevel, object->workdir, object->camera, object->telescope, object->exp_type, object->filter, object->airmass_min, object->airmass_max, object->exp_time_min, object->exp_time_max, object->ccd_temp_min, object->ccd_temp_max, object->posang_min, object->posang_max, object->registered, object->time_begin, object->time_end, object->use_begin, object->use_end, object->solang_min, object->solang_max, object->label, object->parent);
     13221    return detRunInsert(dbh, object->det_id, object->iteration, object->det_type, object->mode, object->state, object->filelevel, object->workdir, object->camera, object->telescope, object->exp_type, object->reduction, object->filter, object->airmass_min, object->airmass_max, object->exp_time_min, object->exp_time_max, object->ccd_temp_min, object->ccd_temp_max, object->posang_min, object->posang_max, object->registered, object->time_begin, object->time_end, object->use_begin, object->use_end, object->solang_min, object->solang_max, object->label, object->parent);
    1321013222}
    1321113223
     
    1333013342        return false;
    1333113343    }
     13344    if (!psMetadataAdd(md, PS_LIST_TAIL, "reduction", PS_DATA_STRING, NULL, object->reduction)) {
     13345        psError(PS_ERR_UNKNOWN, false, "failed to add item reduction");
     13346        psFree(md);
     13347        return false;
     13348    }
    1333213349    if (!psMetadataAdd(md, PS_LIST_TAIL, "filter", PS_DATA_STRING, NULL, object->filter)) {
    1333313350        psError(PS_ERR_UNKNOWN, false, "failed to add item filter");
     
    1347913496        return false;
    1348013497    }
     13498    char* reduction = psMetadataLookupPtr(&status, md, "reduction");
     13499    if (!status) {
     13500        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item reduction");
     13501        return false;
     13502    }
    1348113503    char* filter = psMetadataLookupPtr(&status, md, "filter");
    1348213504    if (!status) {
     
    1357013592    }
    1357113593
    13572     return detRunRowAlloc(det_id, iteration, det_type, mode, state, filelevel, workdir, camera, telescope, exp_type, filter, airmass_min, airmass_max, exp_time_min, exp_time_max, ccd_temp_min, ccd_temp_max, posang_min, posang_max, registered, time_begin, time_end, use_begin, use_end, solang_min, solang_max, label, parent);
     13594    return detRunRowAlloc(det_id, iteration, det_type, mode, state, filelevel, workdir, camera, telescope, exp_type, reduction, filter, airmass_min, airmass_max, exp_time_min, exp_time_max, ccd_temp_min, ccd_temp_max, posang_min, posang_max, registered, time_begin, time_end, use_begin, use_end, solang_min, solang_max, label, parent);
    1357313595}
    1357413596psArray *detRunSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
  • trunk/ippdb/src/ippdb.h

    r13739 r13937  
    27552755    char            *workdir;
    27562756    char            *label;
    2757     char            *recipe;
     2757    char            *reduction;
    27582758    char            *expgroup;
    27592759    char            *dvodb;
     
    27712771    const char      *workdir,
    27722772    const char      *label,
    2773     const char      *recipe,
     2773    const char      *reduction,
    27742774    const char      *expgroup,
    27752775    const char      *dvodb
     
    28082808    const char      *workdir,
    28092809    const char      *label,
    2810     const char      *recipe,
     2810    const char      *reduction,
    28112811    const char      *expgroup,
    28122812    const char      *dvodb
     
    31723172    char            *workdir;
    31733173    char            *label;
    3174     char            *recipe;
     3174    char            *reduction;
    31753175    char            *expgroup;
    31763176    char            *dvodb;
     
    31883188    const char      *workdir,
    31893189    const char      *label,
    3190     const char      *recipe,
     3190    const char      *reduction,
    31913191    const char      *expgroup,
    31923192    const char      *dvodb
     
    32253225    const char      *workdir,
    32263226    const char      *label,
    3227     const char      *recipe,
     3227    const char      *reduction,
    32283228    const char      *expgroup,
    32293229    const char      *dvodb
     
    38433843    char            *workdir;
    38443844    char            *label;
    3845     char            *recipe;
     3845    char            *reduction;
    38463846    char            *expgroup;
    38473847    char            *dvodb;
     
    38583858    const char      *workdir,
    38593859    const char      *label,
    3860     const char      *recipe,
     3860    const char      *reduction,
    38613861    const char      *expgroup,
    38623862    const char      *dvodb
     
    38943894    const char      *workdir,
    38953895    const char      *label,
    3896     const char      *recipe,
     3896    const char      *reduction,
    38973897    const char      *expgroup,
    38983898    const char      *dvodb
     
    40564056    char            *workdir;
    40574057    char            *label;
    4058     char            *recipe;
     4058    char            *reduction;
    40594059    char            *expgroup;
    40604060    char            *dvodb;
     
    40874087    const char      *workdir,
    40884088    const char      *label,
    4089     const char      *recipe,
     4089    const char      *reduction,
    40904090    const char      *expgroup,
    40914091    const char      *dvodb,
     
    41394139    const char      *workdir,
    41404140    const char      *label,
    4141     const char      *recipe,
     4141    const char      *reduction,
    41424142    const char      *expgroup,
    41434143    const char      *dvodb,
     
    66006600    char            *telescope;
    66016601    char            *exp_type;
     6602    char            *reduction;
    66026603    char            *filter;
    66036604    psF32           airmass_min;
     
    66366637    const char      *telescope,
    66376638    const char      *exp_type,
     6639    const char      *reduction,
    66386640    const char      *filter,
    66396641    psF32           airmass_min,
     
    66936695    const char      *telescope,
    66946696    const char      *exp_type,
     6697    const char      *reduction,
    66956698    const char      *filter,
    66966699    psF32           airmass_min,
  • trunk/ippdb/tests/alloc.c

    r13739 r13937  
    610610            exit(EXIT_FAILURE);
    611611        }
    612         if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
     612        if (strncmp(object->reduction, "a string", MAX_STRING_LENGTH)) {
    613613            psFree(object);
    614614            exit(EXIT_FAILURE);
     
    680680            exit(EXIT_FAILURE);
    681681        }
    682         if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
     682        if (strncmp(object->reduction, "a string", MAX_STRING_LENGTH)) {
    683683            psFree(object);
    684684            exit(EXIT_FAILURE);
     
    843843            exit(EXIT_FAILURE);
    844844        }
    845         if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
     845        if (strncmp(object->reduction, "a string", MAX_STRING_LENGTH)) {
    846846            psFree(object);
    847847            exit(EXIT_FAILURE);
     
    884884            exit(EXIT_FAILURE);
    885885        }
    886         if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
     886        if (strncmp(object->reduction, "a string", MAX_STRING_LENGTH)) {
    887887            psFree(object);
    888888            exit(EXIT_FAILURE);
     
    13271327        detRunRow       *object;
    13281328
    1329         object = detRunRowAlloc(-64, -32, "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", 32.32, 32.32, "a string", -32    );
     1329        object = detRunRowAlloc(-64, -32, "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", 32.32, 32.32, "a string", -32    );
    13301330
    13311331        if (!object) {
     
    13701370        }
    13711371        if (strncmp(object->exp_type, "a string", MAX_STRING_LENGTH)) {
     1372            psFree(object);
     1373            exit(EXIT_FAILURE);
     1374        }
     1375        if (strncmp(object->reduction, "a string", MAX_STRING_LENGTH)) {
    13721376            psFree(object);
    13731377            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/insert.c

    r13739 r13937  
    463463        }
    464464
    465         if (!detRunInsert(dbh, -64, -32, "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", 32.32, 32.32, "a string", -32)) {
     465        if (!detRunInsert(dbh, -64, -32, "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", 32.32, 32.32, "a string", -32)) {
    466466            exit(EXIT_FAILURE);
    467467        }
  • trunk/ippdb/tests/insertobject.c

    r13739 r13937  
    674674        }
    675675
    676         object = detRunRowAlloc(-64, -32, "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", 32.32, 32.32, "a string", -32);
     676        object = detRunRowAlloc(-64, -32, "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", 32.32, 32.32, "a string", -32);
    677677        if (!object) {
    678678            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/metadatafromobject.c

    r13739 r13937  
    708708            exit(EXIT_FAILURE);
    709709        }
    710         if (strncmp(psMetadataLookupPtr(&status, md, "recipe"), "a string", MAX_STRING_LENGTH)) {
     710        if (strncmp(psMetadataLookupPtr(&status, md, "reduction"), "a string", MAX_STRING_LENGTH)) {
    711711            psFree(md);
    712712            exit(EXIT_FAILURE);
     
    791791            exit(EXIT_FAILURE);
    792792        }
    793         if (strncmp(psMetadataLookupPtr(&status, md, "recipe"), "a string", MAX_STRING_LENGTH)) {
     793        if (strncmp(psMetadataLookupPtr(&status, md, "reduction"), "a string", MAX_STRING_LENGTH)) {
    794794            psFree(md);
    795795            exit(EXIT_FAILURE);
     
    974974            exit(EXIT_FAILURE);
    975975        }
    976         if (strncmp(psMetadataLookupPtr(&status, md, "recipe"), "a string", MAX_STRING_LENGTH)) {
     976        if (strncmp(psMetadataLookupPtr(&status, md, "reduction"), "a string", MAX_STRING_LENGTH)) {
    977977            psFree(md);
    978978            exit(EXIT_FAILURE);
     
    10211021            exit(EXIT_FAILURE);
    10221022        }
    1023         if (strncmp(psMetadataLookupPtr(&status, md, "recipe"), "a string", MAX_STRING_LENGTH)) {
     1023        if (strncmp(psMetadataLookupPtr(&status, md, "reduction"), "a string", MAX_STRING_LENGTH)) {
    10241024            psFree(md);
    10251025            exit(EXIT_FAILURE);
     
    15381538        bool            status;
    15391539
    1540         object = detRunRowAlloc(-64, -32, "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", 32.32, 32.32, "a string", -32);
     1540        object = detRunRowAlloc(-64, -32, "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", "0001-01-01T00:00:00Z", 32.32, 32.32, "a string", -32);
    15411541        if (!object) {
    15421542            exit(EXIT_FAILURE);
     
    15861586        }
    15871587        if (strncmp(psMetadataLookupPtr(&status, md, "exp_type"), "a string", MAX_STRING_LENGTH)) {
     1588            psFree(md);
     1589            exit(EXIT_FAILURE);
     1590        }
     1591        if (strncmp(psMetadataLookupPtr(&status, md, "reduction"), "a string", MAX_STRING_LENGTH)) {
    15881592            psFree(md);
    15891593            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/objectfrommetadata.c

    r13739 r13937  
    10731073            exit(EXIT_FAILURE);
    10741074        }
    1075         if (!psMetadataAddStr(md, PS_LIST_TAIL, "recipe", 0, NULL, "a string")) {
     1075        if (!psMetadataAddStr(md, PS_LIST_TAIL, "reduction", 0, NULL, "a string")) {
    10761076            psFree(md);
    10771077            exit(EXIT_FAILURE);
     
    11121112            exit(EXIT_FAILURE);
    11131113        }
    1114         if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
     1114        if (strncmp(object->reduction, "a string", MAX_STRING_LENGTH)) {
    11151115            psFree(object);
    11161116            exit(EXIT_FAILURE);
     
    11911191            exit(EXIT_FAILURE);
    11921192        }
    1193         if (!psMetadataAddStr(md, PS_LIST_TAIL, "recipe", 0, NULL, "a string")) {
     1193        if (!psMetadataAddStr(md, PS_LIST_TAIL, "reduction", 0, NULL, "a string")) {
    11941194            psFree(md);
    11951195            exit(EXIT_FAILURE);
     
    12301230            exit(EXIT_FAILURE);
    12311231        }
    1232         if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
     1232        if (strncmp(object->reduction, "a string", MAX_STRING_LENGTH)) {
    12331233            psFree(object);
    12341234            exit(EXIT_FAILURE);
     
    14891489            exit(EXIT_FAILURE);
    14901490        }
    1491         if (!psMetadataAddStr(md, PS_LIST_TAIL, "recipe", 0, NULL, "a string")) {
     1491        if (!psMetadataAddStr(md, PS_LIST_TAIL, "reduction", 0, NULL, "a string")) {
    14921492            psFree(md);
    14931493            exit(EXIT_FAILURE);
     
    15241524            exit(EXIT_FAILURE);
    15251525        }
    1526         if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
     1526        if (strncmp(object->reduction, "a string", MAX_STRING_LENGTH)) {
    15271527            psFree(object);
    15281528            exit(EXIT_FAILURE);
     
    15591559            exit(EXIT_FAILURE);
    15601560        }
    1561         if (!psMetadataAddStr(md, PS_LIST_TAIL, "recipe", 0, NULL, "a string")) {
     1561        if (!psMetadataAddStr(md, PS_LIST_TAIL, "reduction", 0, NULL, "a string")) {
    15621562            psFree(md);
    15631563            exit(EXIT_FAILURE);
     
    16571657            exit(EXIT_FAILURE);
    16581658        }
    1659         if (strncmp(object->recipe, "a string", MAX_STRING_LENGTH)) {
     1659        if (strncmp(object->reduction, "a string", MAX_STRING_LENGTH)) {
    16601660            psFree(object);
    16611661            exit(EXIT_FAILURE);
     
    23822382            exit(EXIT_FAILURE);
    23832383        }
     2384        if (!psMetadataAddStr(md, PS_LIST_TAIL, "reduction", 0, NULL, "a string")) {
     2385            psFree(md);
     2386            exit(EXIT_FAILURE);
     2387        }
    23842388        if (!psMetadataAddStr(md, PS_LIST_TAIL, "filter", 0, NULL, "a string")) {
    23852389            psFree(md);
     
    24942498        }
    24952499        if (strncmp(object->exp_type, "a string", MAX_STRING_LENGTH)) {
     2500            psFree(object);
     2501            exit(EXIT_FAILURE);
     2502        }
     2503        if (strncmp(object->reduction, "a string", MAX_STRING_LENGTH)) {
    24962504            psFree(object);
    24972505            exit(EXIT_FAILURE);
Note: See TracChangeset for help on using the changeset viewer.