IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 14059


Ignore:
Timestamp:
Jul 6, 2007, 4:50:21 PM (19 years ago)
Author:
jhoblitt
Message:

remove use of rawExp.imfiles

Location:
trunk/ippTools
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/scripts/regtest.sh

    r14037 r14059  
    3333$regtool -pendingexp|| exit 1
    3434
    35 $regtool -addprocessedexp -exp_id $exp_id1 -exp_name t10 -imfiles 4 -inst gpc -telescope ps1 -exp_tag batman.t10 -filelevel OTA -filter r -airmass 10 -ra 1 -decl 2 -exp_type bias -exp_time 0 -bg 10 -bg_stdev 1 -bg_mean_stdev 10 -alt 10 -az 10 -ccd_temp 45 -posang 10 -object dog -dateobs "2006-10-20T10:10:10Z" -label foobar $* || exit 1
     35$regtool -addprocessedexp -exp_id $exp_id1 -exp_name t10 -inst gpc -telescope ps1 -exp_tag batman.t10 -filelevel OTA -filter r -airmass 10 -ra 1 -decl 2 -exp_type bias -exp_time 0 -bg 10 -bg_stdev 1 -bg_mean_stdev 10 -alt 10 -az 10 -ccd_temp 45 -posang 10 -object dog -dateobs "2006-10-20T10:10:10Z" -label foobar $* || exit 1
    3636
    3737$regtool -pendingimfile || exit 1
     
    4343$regtool -pendingexp|| exit 1
    4444
    45 $regtool -addprocessedexp -exp_id $exp_id2 -exp_name t11 -imfiles 4 -inst gpc -telescope ps1 -exp_tag batman.t11 -filelevel OTA -filter r -airmass 11 -ra 1 -decl 2 -exp_type bias -exp_time 0 -bg 11 -bg_stdev 1 -bg_mean_stdev 11 -alt 11 -az 11 -ccd_temp 45 -posang 11 -object dog -dateobs 2006-10-20T10:10:10Z -label foobar $* || exit 1
     45$regtool -addprocessedexp -exp_id $exp_id2 -exp_name t11 -inst gpc -telescope ps1 -exp_tag batman.t11 -filelevel OTA -filter r -airmass 11 -ra 1 -decl 2 -exp_type bias -exp_time 0 -bg 11 -bg_stdev 1 -bg_mean_stdev 11 -alt 11 -az 11 -ccd_temp 45 -posang 11 -object dog -dateobs 2006-10-20T10:10:10Z -label foobar $* || exit 1
  • trunk/ippTools/share/Makefile.am

    r14045 r14059  
    1414        dettool_find_completed_runs.sql \
    1515        dettool_raw.sql \
     16        dettool_tonormalizedexp.sql \
     17        dettool_tonormalizedstat.sql \
     18        dettool_toprocessedexp.sql \
    1619    dettool_toprocessedimfile.sql \
    17         dettool_toprocessedexp.sql \
     20        dettool_toresidexp.sql \
     21        dettool_toresidimfile.sql \
    1822        dettool_tostacked.sql \
    19         dettool_toresidimfile.sql \
    20         dettool_toresidexp.sql \
    2123        difftool_inputskyfile.sql \
    2224        difftool_skyfile.sql \
  • trunk/ippTools/share/dettool_toprocessedexp.sql

    r14045 r14059  
    2929        detProcessedImfile.exp_id,
    3030        detProcessedImfile.class_id,
     31        rawImfile.class_id as rawimfile_class_id,
    3132        rawExp.camera,
    3233        rawExp.exp_tag
     
    5657        detRun.det_id
    5758    HAVING
    58         COUNT(detProcessedImfile.class_id) = rawExp.imfiles
     59        COUNT(detProcessedImfile.class_id) = COUNT(rawImfile.class_id)
    5960    ) AS detProcessedExp
    6061
  • trunk/ippTools/share/dettool_toresidexp.sql

    r14045 r14059  
    3636        detInputExp.include,
    3737        rawExp.camera,
    38         rawExp.imfiles,
    3938        rawExp.exp_tag,
    4039        detResidImfile.class_id
     
    4443    JOIN rawExp
    4544        ON detInputExp.exp_id = rawExp.exp_id
    46     JOIN detResidImfile
     45    JOIN rawImfile
     46        on rawExp.exp_id = rawImfile.exp_id
     47    LEFT JOIN detResidImfile
    4748        ON detRun.det_id = detResidImfile.det_id
    4849        AND detRun.iteration = detResidImfile.iteration
    4950        AND detInputExp.exp_id = detResidImfile.exp_id
     51        AND rawImfile.class_id = detResidImfile.class_id
    5052    LEFT JOIN detResidExp
    5153        ON detResidImfile.det_id = detResidExp.det_id
     
    6365        detRun.det_id
    6466    HAVING
    65         rawExp.imfiles = COUNT(detResidImfile.class_id)
     67        COUNT(rawImfile.class_id) = COUNT(detResidImfile.class_id)
    6668    ) AS toresidexp
  • trunk/ippTools/src/dettool.c

    r14047 r14059  
    32283228    }
    32293229
    3230     // select detRun.det_id (det_id)
    3231     // select detRun.iteration
    3232     // by:
    3233     // find the current iteration bassed on det_id
    3234     // find all exp_ids in the current det_id/iteration from detInputExp
    3235     // sort to detInputExp.imfiles to find the largest value per det_id/iter
    3236     // compare imfiles to the number of detStackedImfiles by class_id
    3237     // and:
    3238     // ???
    3239     // det_id is not in detStackedImfile;
    3240     // iteration is not in detStackedImfile;
    3241     // class_id is not in detStackedImfile;
    3242 
    3243     psString query = psStringCopy(
    3244         "SELECT"
    3245         "   det_id,"
    3246         "   det_type,"
    3247         "   iteration,"
    3248         "   camera,"
    3249         "   workdir"
    3250         " FROM"
    3251         "(SELECT DISTINCT"
    3252         "   detRun.det_id,"
    3253         "   detRun.det_type,"
    3254         "   detRun.iteration,"
    3255         "   detRun.workdir,"
    3256         "   rawExp.camera,"
    3257         "   rawExp.imfiles,"
    3258         "   detStackedImfile.class_id"
    3259         " FROM detRun"
    3260         " JOIN detInputExp"
    3261         "   ON detRun.det_id = detInputExp.det_id"
    3262         "   AND detRun.iteration = detInputExp.iteration"
    3263         " JOIN rawExp"
    3264         "   ON detInputExp.exp_id = rawExp.exp_id"
    3265         " JOIN detStackedImfile"
    3266         "   ON detInputExp.det_id = detStackedImfile.det_id"
    3267         "   AND detInputExp.iteration = detStackedImfile.iteration"
    3268         " LEFT JOIN detNormalizedStatImfile"
    3269         "   ON detStackedImfile.det_id = detNormalizedStatImfile.det_id"
    3270         "   AND detStackedImfile.iteration = detNormalizedStatImfile.iteration"
    3271         "   AND detStackedImfile.class_id = detNormalizedStatImfile.class_id"
    3272         " WHERE"
    3273         "   detRun.state = 'run'"
    3274         "   AND detRun.mode = 'master'"
    3275         "   AND detStackedImfile.fault = 0"
    3276         "   AND detNormalizedStatImfile.det_id IS NULL"
    3277         "   AND detNormalizedStatImfile.iteration IS NULL"
    3278         "   AND detNormalizedStatImfile.class_id IS NULL"
    3279         " GROUP BY"
    3280         "   rawExp.exp_id,"
    3281         "   detRun.iteration,"
    3282         "   detRun.det_id"
    3283         " HAVING MAX(rawExp.imfiles) = COUNT(detStackedImfile.class_id)"
    3284         ") as tonormalizedstat"
    3285         );
     3230    psString query = pxDataGet("dettool_tonormalizedstat.sql");
     3231    if (!query) {
     3232        psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement");
     3233        return false;
     3234    }
    32863235
    32873236    // XXX does it make sense to accept any search params?
     
    38033752    }
    38043753
    3805     psString query = psStringCopy(
    3806         " SELECT DISTINCT"
    3807         "    detRun.det_id as det_id,"
    3808         "    detRun.iteration,"
    3809         "    detRun.det_type,"
    3810         "    detRun.workdir,"
    3811         "    rawExp.camera,"
    3812         "    rawExp.telescope,"
    3813         "    rawExp.exp_type,"
    3814         "    rawExp.imfiles"
    3815         " FROM detRun"
    3816         " JOIN detInputExp"
    3817         "    ON detRun.det_id = detInputExp.det_id"
    3818         "    AND detRun.iteration = detInputExp.iteration"
    3819         " JOIN rawExp"
    3820         "    ON detInputExp.exp_id = rawExp.exp_id"
    3821         " JOIN detNormalizedImfile"
    3822         "    ON detInputExp.det_id = detNormalizedImfile.det_id"
    3823         "    AND detInputExp.iteration = detNormalizedImfile.iteration"
    3824         " LEFT JOIN rawImfile"
    3825         "    ON detInputExp.exp_id = rawImfile.exp_id"
    3826         "    AND detNormalizedImfile.class_id = rawImfile.class_id"
    3827         " LEFT JOIN detNormalizedExp"
    3828         "    ON detInputExp.det_id = detNormalizedExp.det_id"
    3829         "    AND detInputExp.iteration = detNormalizedExp.iteration"
    3830         " WHERE"
    3831         "   detRun.state = 'run'"
    3832         "   AND detRun.mode = 'master'"
    3833         "   AND detNormalizedImfile.fault = 0"
    3834         "   AND detNormalizedExp.det_id IS NULL"
    3835         "   AND detNormalizedExp.iteration IS NULL"
    3836         "   AND detInputExp.include = 1"
    3837         " GROUP BY"
    3838         "    detNormalizedImfile.iteration,"
    3839         "    detRun.det_id"
    3840         " HAVING"
    3841         "    COUNT(detNormalizedImfile.class_id) = COUNT(rawImfile.class_id)"
    3842     );
     3754    psString query = pxDataGet("dettool_tonormalizedexp.sql");
     3755    if (!query) {
     3756        psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement");
     3757        return false;
     3758    }
    38433759
    38443760    // XXX does it make sense to accept any search params?
     
    39933909    }
    39943910
    3995     psString query = psStringCopy(
    3996         " SELECT DISTINCT"
    3997         "    detRun.det_id as det_id,"
    3998         "    detRun.iteration,"
    3999         "    detRun.det_type,"
    4000         "    rawExp.camera,"
    4001         "    rawExp.telescope,"
    4002         "    rawExp.exp_type,"
    4003         "    rawExp.imfiles"
    4004         " FROM detRun"
    4005         " JOIN detInputExp"
    4006         "    ON detRun.det_id = detInputExp.det_id"
    4007         "    AND detRun.iteration = detInputExp.iteration"
    4008         " JOIN rawExp"
    4009         "    ON detInputExp.exp_id = rawExp.exp_id"
    4010         " JOIN detNormalizedImfile"
    4011         "    ON detInputExp.det_id = detNormalizedImfile.det_id"
    4012         "    AND detInputExp.iteration = detNormalizedImfile.iteration"
    4013         " LEFT JOIN rawImfile"
    4014         "    ON detInputExp.exp_id = rawImfile.exp_id"
    4015         "    AND detNormalizedImfile.class_id = rawImfile.class_id"
    4016         " LEFT JOIN detNormalizedExp"
    4017         "    ON detInputExp.det_id = detNormalizedExp.det_id"
    4018         "    AND detInputExp.iteration = detNormalizedExp.iteration"
    4019         " WHERE"
    4020         "   detRun.state = 'run'"
    4021         "   AND detRun.mode = 'master'"
    4022         "   AND detNormalizedExp.det_id IS NULL"
    4023         "   AND detNormalizedExp.iteration IS NULL"
    4024         "   AND detInputExp.include = 1"
    4025         "   AND detRun.det_id = %s"
    4026         "   AND detNormalizedImfile.iteration = %d"
    4027         " GROUP BY"
    4028         "    detNormalizedImfile.iteration,"
    4029         "    detRun.det_id"
    4030         " HAVING"
    4031         "    COUNT(detNormalizedImfile.class_id) = COUNT(rawImfile.class_id)"
    4032         );
    4033 
    4034     if (!p_psDBRunQuery(config->dbh, query, det_id, iteration)) {
     3911    psString query = pxDataGet("dettool_tonormalizedexp.sql");
     3912    if (!query) {
     3913        psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement");
     3914        return false;
     3915    }
     3916
     3917    psStringAppend(&query,
     3918            "WHERE det_id = %s"
     3919            " AND iteration = %d", det_id, iteration);
     3920
     3921
     3922    if (!p_psDBRunQuery(config->dbh, query)) {
    40353923        psError(PS_ERR_UNKNOWN, false, "database error");
    40363924        psFree(query);
     
    49934881    // detResidImfile.{det_id, iteration, exp_id} is not in detResidExp
    49944882
    4995     psString query = psStringCopy(
    4996         "SELECT DISTINCT"
    4997         "   det_id,"
    4998         "   iteration,"
    4999         "   exp_id,"
    5000         "   include"
    5001         " FROM"
    5002         "   (SELECT DISTINCT"
    5003         "       detRun.det_id AS det_id,"
    5004         "       detRun.iteration,"
    5005         "       detRun.det_type,"
    5006         "       detInputExp.exp_id,"
    5007         "       detInputExp.include,"
    5008         "       rawExp.imfiles"
    5009         "   FROM detRun"
    5010         "   JOIN detInputExp"
    5011         "       USING(det_id, iteration)"
    5012         "   JOIN rawExp"
    5013         "       ON detInputExp.exp_id = rawExp.exp_id"
    5014         "   JOIN detResidImfile"
    5015         "       ON detRun.det_id = detResidImfile.det_id"
    5016         "       AND detRun.iteration = detResidImfile.iteration"
    5017         "       AND detInputExp.exp_id = detResidImfile.exp_id"
    5018         "   LEFT JOIN detResidExp"
    5019         "       ON detResidImfile.det_id = detResidExp.det_id"
    5020         "       AND detResidImfile.iteration = detResidExp.iteration"
    5021         "       AND detResidImfile.exp_id = detResidExp.exp_id"
    5022         "   WHERE"
    5023         "       detRun.state = 'run'"
    5024         "       AND detResidExp.det_id IS NULL"
    5025         "       AND detResidExp.iteration IS NULL"
    5026         "       AND detResidExp.exp_id IS NULL"
    5027         "   GROUP BY"
    5028         "       detInputExp.exp_id,"
    5029         "       detRun.iteration,"
    5030         "       detRun.det_id"
    5031         "   HAVING"
    5032         "       rawExp.imfiles = COUNT(detResidImfile.class_id)"
    5033         " ) AS toresidexp"
    5034         );
     4883    psString query = pxDataGet("dettool_toresidexp.sql");
     4884    if (!query) {
     4885        psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement");
     4886        return false;
     4887    }
    50354888
    50364889    {
  • trunk/ippTools/src/regtool.c

    r14024 r14059  
    897897    }
    898898
    899     psS32 imfiles = psMetadataLookupS32(&status, config->args, "-imfiles");
    900     if (!status) {
    901         psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -imfiles");
    902         return false;
    903     }
    904     if (!imfiles) {
    905         psError(PS_ERR_UNKNOWN, true, "-imfiles is required");
    906         return false;
    907     }
    908 
    909899    psString exp_tag = psMetadataLookupStr(&status, config->args, "-exp_tag");
    910900    if (!status) {
     
    10741064        exp_tag,
    10751065        exp_type,
    1076         imfiles,
    10771066        filelevel,
    10781067        exp->workdir,
  • trunk/ippTools/src/regtoolConfig.c

    r14023 r14059  
    153153    psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-exp_type",  0,
    154154        "search by exposure type", NULL);
    155     psMetadataAddStr(pendingexpArgs, PS_LIST_TAIL, "-imfiles",  0,
    156         "search for exps with N imfiles", NULL);
    157155    psMetadataAddU64(pendingexpArgs, PS_LIST_TAIL, "-limit",  0,
    158156        "limit result set to N items", 0);
     
    176174    psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-exp_type",  0,
    177175        "define exposure type", NULL);
    178     psMetadataAddS32(addprocessedexpArgs, PS_LIST_TAIL, "-imfiles",  0,
    179         "define the number of imfiles in this exp (required)", 0);
    180176    psMetadataAddStr(addprocessedexpArgs, PS_LIST_TAIL, "-filelevel",  0,
    181177        "define the data partitioning level of this file", NULL);
     
    307303    addWhereStr(telescope);
    308304    addWhereStr(exp_type);
    309     {
    310         int imfiles = 0;
    311         bool status = false;
    312         if ((imfiles = psMetadataLookupS32(&status, config->args, "-imfiles"))) {
    313             if (!psMetadataAddS32(config->where, PS_LIST_TAIL, "imfiles", 0, "==", imfiles)) {
    314                 psError(PXTOOLS_ERR_PROG, false, "failed to add item imfiles");
    315                 psFree(config);
    316                 return NULL;
    317             }
    318         }
    319     }
    320305    addWhereStr(class);
    321306    addWhereStr(class_id);
Note: See TracChangeset for help on using the changeset viewer.