IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 25418


Ignore:
Timestamp:
Sep 16, 2009, 9:44:29 AM (17 years ago)
Author:
bills
Message:

Store the size in bytes and md5sum of the Compressed raw image files
in pzDownloadImfile. Propagate the values to rawImfile so that they are
available for checking.
(summitImfile has the parameters of the files before they are compressed)

Location:
trunk
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/dbconfig/changes.txt

    r25299 r25418  
    12481248    PRIMARY KEY(label)
    12491249) ENGINE=innodb DEFAULT CHARSET=latin1;
     1250
     1251
     1252ALTER TABLE pzDownloadImfile ADD COLUMN bytes INT;
     1253ALTER TABLE pzDownloadImfile ADD COLUMN md5sum VARCHAR(32);
     1254ALTER TABLE newImfile ADD COLUMN bytes INT;
     1255ALTER TABLE newImfile ADD COLUMN md5sum VARCHAR(32);
     1256ALTER TABLE rawImfile ADD COLUMN bytes INT;
     1257ALTER TABLE rawImfile ADD COLUMN md5sum VARCHAR(32);
     1258
  • trunk/dbconfig/new.md

    r23688 r25418  
    2222    uri         STR         255
    2323    epoch       UTC         0001-01-01T00:00:00Z
     24    bytes       S32         0
     25    md5sum      STR         32
    2426END
    2527
  • trunk/dbconfig/raw.md

    r24552 r25418  
    136136    epoch       UTC         0001-01-01T00:00:00Z
    137137    magicked    S64         0
     138    bytes       S32         0
     139    md5sum      STR         32
    138140END
  • trunk/dbconfig/summitcopy.md

    r23688 r25418  
    5757    epoch       UTC         0001-01-01T00:00:00Z
    5858    hostname    STR         64
     59    bytes       S32         0
     60    md5sum      STR         32
    5961END
    6062
  • trunk/ippScripts/scripts/register_imfile.pl

    r23831 r25418  
    3434my $ppStatsFromMetadata = can_run( 'ppStatsFromMetadata' ) or (warn "Can't find ppStatsFromMetadata" and $missing_tools = 1);
    3535
    36 my ($cache, $exp_id, $tmp_class_id, $tmp_exp_name, $uri, $dbname, $verbose, $no_update, $no_op, $logfile);
     36my ($cache, $exp_id, $tmp_class_id, $tmp_exp_name, $uri, $bytes, $md5sum, $dbname, $verbose, $no_update, $no_op, $logfile);
    3737GetOptions(
    3838    'caches'           => \$cache,
     
    4141    'tmp_exp_name|n=s' => \$tmp_exp_name,
    4242    'uri|u=s'          => \$uri,
     43    'bytes=s'          => \$bytes,
     44    'md5sum=s'         => \$md5sum,
    4345    'dbname|d=s'       => \$dbname,    # Database name
    4446    'verbose'          => \$verbose,   # Print to stdout
     
    123125$command .= " -tmp_class_id $tmp_class_id"; # the original class_id supplied by the user, replace by ppStats CLASS.ID
    124126$command .= " -uri $uri ";
     127$command .= " -bytes $bytes" if $bytes;
     128$command .= " -md5sum $md5sum" if $md5sum and ($md5sum ne 'NULL');
    125129$command .= " -hostname $host" if defined $host;
    126130$command .= " -dbname $dbname" if defined $dbname;
  • trunk/ippScripts/scripts/summit_copy.pl

    r25371 r25418  
    105105# if so pass the results to pztool to the results in pzDownloadImfile.
    106106# uncomment this to turn on
    107 # my ($new_bytes, $new_md5) = check_instances($filename, $nebulous, $compress);
     107my ($new_bytes, $new_md5) = check_instances($filename, $nebulous, $compress);
    108108
    109109# command to update database
     
    121121# XXX: TODO: see above. Don't do this until pztool and the DB have
    122122# been updated
    123 # $command .= " -md5sum $new_md5 -bytes $new_bytes";
     123$command .= " -md5sum $new_md5 -bytes $new_bytes";
    124124
    125125# update the database
     
    198198        if ($b ne $new_bytes) {
    199199            $error = "size of $instances[$i] does not match $instances[0]";
    200         } elsif ($m != $new_md5) {
     200        } elsif ($m ne $new_md5) {
    201201            $error = "md5sum of $instances[$i] does not match $instances[0]";
    202202        }
  • trunk/ippTasks/register.pro

    r24055 r25418  
    217217    book getword regPendingImfile $pageName tmp_class_id -var TMP_CLASS_ID
    218218    book getword regPendingImfile $pageName uri          -var URI
     219    book getword regPendingImfile $pageName bytes        -var BYTES
     220    book getword regPendingImfile $pageName md5sum       -var MD5SUM
    219221    book getword regPendingImfile $pageName workdir      -var WORKDIR_TEMPLATE
    220222    book getword regPendingImfile $pageName dbname       -var DBNAME
     
    244246
    245247    # XXX register_imfile.pl differs from the standard script : it does not have an 'outroot' argument, and it does not take '--redirect'
    246     $run = register_imfile.pl --exp_id $EXP_ID --tmp_class_id $TMP_CLASS_ID --tmp_exp_name $TMP_EXP_NAME --uri $URI --logfile $logfile
     248    $run = register_imfile.pl --exp_id $EXP_ID --tmp_class_id $TMP_CLASS_ID --tmp_exp_name $TMP_EXP_NAME --uri $URI --logfile $logfile --bytes $BYTES --md5sum $MD5SUM
    247249    add_standard_args run
    248250
  • trunk/ippTools/share/pxadmin_create_tables.sql

    r25382 r25418  
    5858    epoch TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    5959    hostname VARCHAR(64),
     60    bytes INT,
     61    md5sum VARCHAR(32),
    6062    PRIMARY KEY(exp_name, camera, telescope, class, class_id),
    6163    KEY(fault),
     
    9496    uri VARCHAR(255),
    9597    epoch TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
     98    bytes INT,
     99    md5sum VARCHAR(32),
    96100    PRIMARY KEY(exp_id, tmp_class_id),
    97101    FOREIGN KEY(exp_id) REFERENCES newExp(exp_id)
     
    237241    raw_image_id BIGINT AUTO_INCREMENT,
    238242    magicked BIGINT,
     243    bytes INT,
     244    md5sum VARCHAR(32),
    239245    PRIMARY KEY(exp_id, class_id),
    240246    KEY(tmp_class_id),
  • trunk/ippTools/share/regtool_pendingimfile.sql

    r17573 r25418  
    66    newExp.workdir,
    77    newImfile.tmp_class_id,
    8     newImfile.uri
     8    newImfile.uri,
     9    newImfile.bytes,
     10    newImfile.md5sum
    911FROM newImfile
    1012JOIN newExp
  • trunk/ippTools/src/pxinject.c

    r18336 r25418  
    137137    PXOPT_LOOKUP_STR(tmp_class_id, config->args, "-tmp_class_id", true, false);
    138138    PXOPT_LOOKUP_STR(uri, config->args, "-uri", true, false);
     139    PXOPT_LOOKUP_S32(bytes, config->args, "-bytes", false, false);
     140    PXOPT_LOOKUP_STR(md5sum, config->args, "-md5sum", false, false);
    139141
    140142    // insert with error flag state set to 0 (no errors)
    141     if (!newImfileInsert(config->dbh, exp_id, tmp_class_id, uri, NULL)) {
     143    if (!newImfileInsert(config->dbh, exp_id, tmp_class_id, uri, NULL, bytes, md5sum)) {
    142144        psError(PS_ERR_UNKNOWN, false, "database error");
    143145        return false;
  • trunk/ippTools/src/pxinjectConfig.c

    r18561 r25418  
    6161    psMetadataAddStr(newImfileArgs, PS_LIST_TAIL, "-tmp_class_id",  0,            "define the class ID (required)", NULL);
    6262    psMetadataAddStr(newImfileArgs, PS_LIST_TAIL, "-uri",  0,            "define the URI (required)", NULL);
     63    psMetadataAddS32(newImfileArgs, PS_LIST_TAIL, "-bytes",  0,            "define the size of the file", 0);
     64    psMetadataAddStr(newImfileArgs, PS_LIST_TAIL, "-md5sum",  0,            "define the size of the file", NULL);
    6365
    6466    // -updatenewExp
  • trunk/ippTools/src/pztool.c

    r23688 r25418  
    401401    PXOPT_LOOKUP_STR(hostname, config->args, "-hostname", false, false);
    402402    PXOPT_LOOKUP_BOOL(row_lock, config->args, "-row_lock", false);
     403    PXOPT_LOOKUP_S32(bytes, config->args, "-bytes", false, false);
     404    PXOPT_LOOKUP_STR(md5sum, config->args, "-md5sum", false, false);
    403405
    404406    // default values
     
    457459            fault,
    458460            NULL,    // epoch
    459             hostname
     461            hostname,
     462            bytes,
     463            md5sum
    460464    )) {
    461465        psError(PS_ERR_UNKNOWN, false, "database error");
     
    595599                "       pzDownloadImfile.class_id," // tmp_class_id
    596600                "       pzDownloadImfile.uri,"      // uri
    597                 "       NULL"                       // epoch
     601                "       NULL,"                       // epoch
     602                "       pzDownloadImfile.bytes,"    // bytes
     603                "       pzDownloadImfile.md5sum"    // md5sum
    598604                "   FROM pzDownloadImfile"
    599605                "   WHERE"
  • trunk/ippTools/src/pztoolConfig.c

    r23688 r25418  
    9595    psMetadataAddStr(copydoneArgs, PS_LIST_TAIL, "-label",  0,        "define the label for the chip stage", NULL);
    9696    psMetadataAddStr(copydoneArgs, PS_LIST_TAIL, "-hostname",  0,     "define the host that copied the image", NULL);
     97    psMetadataAddS32(copydoneArgs, PS_LIST_TAIL, "-bytes",  0,     "define the size in bytes for the copied image", 0);
     98    psMetadataAddStr(copydoneArgs, PS_LIST_TAIL, "-md5sum",  0,     "define the md5 sum for the copied image", NULL);
    9799    psMetadataAddS16(copydoneArgs, PS_LIST_TAIL, "-fault",  0,            "set fault code", 0);
    98100    psMetadataAddBool(copydoneArgs, PS_LIST_TAIL, "-row_lock", 0,     "lock pzDownImfile rows while advancing an exposure", false);
  • trunk/ippTools/src/regtool.c

    r25324 r25418  
    238238    PXOPT_LOOKUP_TIME(dateobs, config->args, "-dateobs", false, false);
    239239    PXOPT_LOOKUP_STR(hostname, config->args, "-hostname", false, false);
     240    PXOPT_LOOKUP_S32(bytes, config->args,  "-bytes", false, false);
     241    PXOPT_LOOKUP_STR(md5sum, config->args, "-md5sum", false, false);
    240242
    241243    PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false);
     
    307309        quality,
    308310        NULL,
    309         0
     311        0,
     312        bytes,
     313        md5sum
    310314    )) {
    311315        psError(PS_ERR_UNKNOWN, false, "database error");
  • trunk/ippTools/src/regtoolConfig.c

    r24922 r25418  
    125125    ADD_OPT(Time, addprocessedimfileArgs, "-dateobs",        "define observation time",         NULL);
    126126    ADD_OPT(Str,  addprocessedimfileArgs, "-hostname",       "define host name",                NULL);
     127    ADD_OPT(Str,  addprocessedimfileArgs, "-md5sum",         "define md5sum",                NULL);
     128    ADD_OPT(S32,  addprocessedimfileArgs, "-bytes",          "define bytes",                0);
    127129    ADD_OPT(S16,  addprocessedimfileArgs, "-fault",           "set fault code",                  0);
    128130    ADD_OPT(S16,  addprocessedimfileArgs, "-quality",        "set quality flag", 0);
Note: See TracChangeset for help on using the changeset viewer.