IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 5, 2008, 10:31:08 AM (18 years ago)
Author:
jhoblitt
Message:

fwv

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/faketool/ippTools/src/faketool.c

    r17357 r17938  
    3232
    3333#include "faketool.h"
    34 #include "camtool.h"
    3534
    3635static bool queueMode(pxConfig *config);
     
    171170
    172171    // find the exp_id of all the exposures that we want to queue up.
    173     psString query = pxDataGet("faketool_find_rawexp.sql");
     172    psString query = pxDataGet("faketool_find_camrun.sql");
    174173    if (!query) {
    175174        psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement");
     
    179178
    180179    if (where && psListLength(where->list)) {
    181         psString whereClause = psDBGenerateWhereConditionSQL(where, "rawExp");
     180        psString whereClause = psDBGenerateWhereConditionSQL(where, "camRun");
    182181        psStringAppend(&query, " AND %s", whereClause);
    183182        psFree(whereClause);
     
    219218    }
    220219
    221     // loop over our list of exp_ids
     220    // loop over our list of cam_ids
    222221    for (long i = 0; i < psArrayLength(output); i++) {
    223222        psMetadata *md = output->data[i];
    224223
    225224        bool status;
    226         psS64 exp_id = psMetadataLookupS64(&status, md, "exp_id");
     225        psS64 cam_id = psMetadataLookupS64(&status, md, "cam_id");
    227226        if (!status) {
    228             psError(PS_ERR_UNKNOWN, false, "failed to lookup value for exp_id");
     227            psError(PS_ERR_UNKNOWN, false, "failed to lookup value for cam_id");
    229228            psFree(output);
    230229            return false;
     
    232231
    233232        // queue the exp
    234         if (!pxfakeQueueByExpTag(config, exp_id, workdir, label, reduction, expgroup, dvodb, tess_id, end_stage)) {
     233        if (!pxfakeQueueByCamID(config, cam_id, workdir, label, reduction, expgroup, dvodb, tess_id, end_stage)) {
    235234            if (!psDBRollback(config->dbh)) {
    236235                psError(PS_ERR_UNKNOWN, false, "database error");
    237236            }
    238237            psError(PS_ERR_UNKNOWN, false,
    239                     "failed to trying to queue exp_id: %" PRId64, exp_id);
     238                    "failed to trying to queue cam_id: %" PRId64, cam_id);
    240239            psFree(output);
    241240            return false;
     
    448447
    449448    // fake_id, ext_tag, class_id are required
    450     PXOPT_LOOKUP_STR(fake_id, config->args, "-fake_id", true, false);
    451     PXOPT_LOOKUP_STR(exp_id, config->args, "-exp_id", true, false);
    452     PXOPT_LOOKUP_STR(class_id, config->args, "-class_id", true, false);
     449    PXOPT_LOOKUP_STR(fake_id, config->args,     "-fake_id", true, false);
     450    PXOPT_LOOKUP_STR(exp_id, config->args,      "-exp_id", true, false);
     451    PXOPT_LOOKUP_STR(class_id, config->args,    "-class_id", true, false);
    453452
    454453    // optional
    455     PXOPT_LOOKUP_STR(uri, config->args,            "-uri", false, false);
    456     PXOPT_LOOKUP_F32(bg, config->args,             "-bg", false, false);
    457     PXOPT_LOOKUP_F32(bg_stdev, config->args,       "-bg_stdev", false, false);
    458     PXOPT_LOOKUP_F32(bg_mean_stdev, config->args,  "-bg_mean_stdev", false, false);
    459     PXOPT_LOOKUP_F32(bias, config->args,           "-bias", false, false);
    460     PXOPT_LOOKUP_F32(bias_stdev, config->args,     "-bias_stdev", false, false);
    461     PXOPT_LOOKUP_F32(fringe_0, config->args,       "-fringe_0", false, false);
    462     PXOPT_LOOKUP_F32(fringe_1, config->args,       "-fringe_1", false, false);
    463     PXOPT_LOOKUP_F32(fringe_2, config->args,       "-fringe_2", false, false);
    464     PXOPT_LOOKUP_F32(sigma_ra, config->args,       "-sigma_ra", false, false);
    465     PXOPT_LOOKUP_F32(sigma_dec, config->args,      "-sigma_dec", false, false);
    466     PXOPT_LOOKUP_F32(ap_resid, config->args,       "-ap_resid", false, false);
    467     PXOPT_LOOKUP_F32(ap_resid_stdev, config->args, "-ap_resid_stdev", false, false);
    468     PXOPT_LOOKUP_F32(zp_mean, config->args,        "-zp_mean", false, false);
    469     PXOPT_LOOKUP_F32(zp_stdev, config->args,       "-zp_stdev", false, false);
    470     PXOPT_LOOKUP_F32(fwhm_major, config->args,     "-fwhm_major", false, false);
    471     PXOPT_LOOKUP_F32(fwhm_minor, config->args,     "-fwhm_minor", false, false);
    472     PXOPT_LOOKUP_F32(dtime_detrend, config->args,  "-dtime_detrend", false, false);
    473     PXOPT_LOOKUP_F32(dtime_photom,  config->args,  "-dtime_photom",  false, false);
    474     PXOPT_LOOKUP_F32(dtime_astrom,  config->args,  "-dtime_astrom",  false, false);
    475     PXOPT_LOOKUP_STR(hostname, config->args,       "-hostname", false, false);
    476     PXOPT_LOOKUP_F32(n_stars, config->args, "-n_stars", false, false);
    477     PXOPT_LOOKUP_F32(n_extended, config->args, "-n_extended", false, false);
    478     PXOPT_LOOKUP_F32(n_cr, config->args, "-n_cr", false, false);
    479     PXOPT_LOOKUP_F32(n_astrom, config->args, "-n_astrom", false, false);
    480     PXOPT_LOOKUP_STR(path_base, config->args, "-path_base", false, false);
     454    PXOPT_LOOKUP_STR(uri, config->args,         "-uri", false, false);
     455
     456    PXOPT_LOOKUP_F32(dtime_fake, config->args,  "-dtime_fake", false, false);
     457    PXOPT_LOOKUP_STR(hostname, config->args,    "-hostname", false, false);
     458    PXOPT_LOOKUP_STR(path_base, config->args,   "-path_base", false, false);
    481459
    482460    // default values
    483     PXOPT_LOOKUP_S16(code, config->args, "-code", false, false);
     461    PXOPT_LOOKUP_S16(code, config->args,        "-code", false, false);
    484462
    485463    if (!psDBTransaction(config->dbh)) {
     
    493471                                   class_id,
    494472                                   uri,
    495                                    bg,
    496                                    bg_stdev,
    497                                    bg_mean_stdev,
    498                                    bias,
    499                                    bias_stdev,
    500                                    fringe_0,
    501                                    fringe_1,
    502                                    fringe_2,
    503                                    sigma_ra,
    504                                    sigma_dec,
    505                                    ap_resid,
    506                                    ap_resid_stdev,
    507                                    zp_mean,
    508                                    zp_stdev,
    509                                    fwhm_major,
    510                                    fwhm_minor,
    511                                    dtime_detrend,
    512                                    dtime_photom,
    513                                    dtime_astrom,
     473                                   dtime_fake,
    514474                                   hostname,
    515                                    n_stars,
    516                                    n_extended,
    517                                    n_cr,
    518                                    n_astrom,
    519475                                   path_base,
    520                                    code
     476                                   code,
     477                                   NULL         // epoch
    521478            )) {
    522479        // rollback
     
    984941        // camQueueFakeID() can only be run after fakeRun.state has been set to
    985942        // stop
    986         if (!pxcamQueueByFakeID(config,
     943        if (!pxwarpQueueByFakeID(config,
    987944                    fakeRun->fake_id,
    988945                    fakeRun->workdir,
    989946                    fakeRun->label,
    990                     fakeRun->reduction,
    991                     fakeRun->expgroup,
    992947                    fakeRun->dvodb,
    993948                    fakeRun->tess_id,
Note: See TracChangeset for help on using the changeset viewer.