IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 30812


Ignore:
Timestamp:
Mar 6, 2011, 2:34:55 PM (15 years ago)
Author:
eugene
Message:

updates from trunk

Location:
branches/eam_branches/ipp-20110213
Files:
50 edited
2 copied

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20110213/Ohana/src/addstar/src/ReadStarsFITS.c

    r30613 r30812  
    4545  }
    4646  if (!strcmp (type, "PS1_V2")) {
     47    if (table.header[0].Naxis[0] == 20) {
     48      // skip the invalid DETEFF tables which were mistakenly labeled as PS1_V2
     49      return (NULL);
     50    }
    4751    stars = Convert_PS1_V2 (&table, &Nstars);
    4852  }
     
    5155  }
    5256  if (stars == NULL) {
    53     fprintf (stderr, "ERROR: invalid table type %s\n", type);
     57    fprintf (stderr, "invalid table type %s\n", type);
    5458    return (NULL);
    5559  }
     
    212216  Stars *stars;
    213217  CMF_PS1_V1 *ps1data;
     218
     219  // CMF_PS1_V1 was modified 2009.05.26 (r24251) to use doubles for ra & dec.  this was a
     220  // mistake in two ways: a new format should have been defined (eg, CMF_PS1_V2), and the
     221  // layout used did not have clean byte-boundaries for the corresponding structure.  The
     222  // former means we have two varieties of CMF_PS1_V1 out there; the latter means that the
     223  // autocode tools do not work to read in the new version, even if we recognize it.  Here we
     224  // test for the existence of the broken version (table[0].headers[0].Naxis[0] == 136), and
     225  // call a special conversion function if it is found.
     226
     227  if (table[0].header[0].Naxis[0] == 136) {
     228      stars = Convert_PS1_V1_Alt (table, nstars);
     229      return (stars);
     230  }
     231
     232  ps1data = gfits_table_get_CMF_PS1_V1 (table, &Nstars, NULL);
     233  if (!ps1data) {
     234    fprintf (stderr, "skipping inconsistent entry\n");
     235    return (NULL);
     236  }
     237  ZeroPt = GetZeroPoint();
     238
     239  ALLOCATE (stars, Stars, Nstars);
     240  for (i = 0; i < Nstars; i++) {
     241    InitStar (&stars[i]);
     242    stars[i].measure.Xccd       = ps1data[i].X;
     243    stars[i].measure.Yccd       = ps1data[i].Y;
     244    stars[i].measure.dXccd      = ToShortPixels(ps1data[i].dX);
     245    stars[i].measure.dYccd      = ToShortPixels(ps1data[i].dY);
     246
     247    stars[i].measure.posangle   = ToShortDegrees(ps1data[i].posangle);
     248    stars[i].measure.pltscale   = ps1data[i].pltscale;
     249
     250    if ((ps1data[i].M >= 0.0) || isnan(ps1data[i].M)) {
     251        stars[i].measure.M      = NAN;
     252    } else {
     253        stars[i].measure.M      = ps1data[i].M + ZeroPt;
     254    }
     255    stars[i].measure.dM         = ps1data[i].dM;
     256    stars[i].measure.dMcal      = ps1data[i].dMcal;
     257    stars[i].measure.Map        = ps1data[i].Map + ZeroPt;
     258                       
     259    stars[i].measure.Sky        = ps1data[i].sky;
     260    stars[i].measure.dSky       = ps1data[i].dSky;
     261                       
     262    stars[i].measure.psfChisq   = ps1data[i].psfChisq;
     263    stars[i].measure.psfQual    = ps1data[i].psfQual;
     264    stars[i].measure.psfNdof    = ps1data[i].psfNdof;
     265    stars[i].measure.psfNpix    = ps1data[i].psfNpix;
     266    stars[i].measure.crNsigma   = ps1data[i].crNsigma;
     267    stars[i].measure.extNsigma  = ps1data[i].extNsigma;
     268
     269    stars[i].measure.FWx        = ToShortPixels(ps1data[i].fx);
     270    stars[i].measure.FWy        = ToShortPixels(ps1data[i].fy);
     271    stars[i].measure.theta      = ToShortDegrees(ps1data[i].df);
     272
     273    stars[i].measure.Mxx        = ToShortPixels(ps1data[i].Mxx);
     274    stars[i].measure.Mxy        = ToShortPixels(ps1data[i].Mxy);
     275    stars[i].measure.Myy        = ToShortPixels(ps1data[i].Myy);
     276                       
     277    stars[i].measure.photFlags  = ps1data[i].flags;
     278
     279    // this is may optionally be replaced by the internal sequence (see FilterStars.c)
     280    stars[i].measure.detID      = ps1data[i].detID;
     281
     282    // the Average fields and the following Measure fields are set in FilterStars after
     283    // the image metadata is in hand:  dR, dD, Mcal, dt, airmass, az, t, imageID, extID,
     284    // averef is set in find_matches, dbFlags is zero on ingest.
     285
     286    // the following fields are currently not being set anywhere: t_msec
     287  }   
     288  *nstars = Nstars;
     289  return (stars);
     290}
     291
     292Stars *Convert_PS1_V1_Alt (FTable *table, unsigned int *nstars) {
     293
     294  off_t Nstars;
     295  unsigned int i;
     296  double ZeroPt;
     297  Stars *stars;
     298  CMF_PS1_V2 *ps1data;
    214299
    215300  // CMF_PS1_V1 was modified 2009.05.26 (r24251) to use doubles for ra & dec.  this was a
     
    221306  // call a special conversion function if it is found.
    222307
    223   if (table[0].header[0].Naxis[0] == 136) {
    224       stars = Convert_PS1_V1_Alt (table, nstars);
    225       return (stars);
    226   }
    227 
    228   ps1data = gfits_table_get_CMF_PS1_V1 (table, &Nstars, NULL);
     308  ps1data = gfits_table_get_CMF_PS1_V1_Alt (table, &Nstars, NULL);
    229309  if (!ps1data) {
    230310    fprintf (stderr, "skipping inconsistent entry\n");
     
    286366}
    287367
    288 Stars *Convert_PS1_V1_Alt (FTable *table, unsigned int *nstars) {
     368Stars *Convert_PS1_V2 (FTable *table, unsigned int *nstars) {
    289369
    290370  off_t Nstars;
     
    294374  CMF_PS1_V2 *ps1data;
    295375
    296   // CMF_PS1_V1 was modified 2009.05.26 (r24251) to use doubles for ra & dec.  this was a
    297   // mistake in two ways: a few format should have been defined (eg, CMF_PS1_V2), and the
    298   // layout used did not have clean byte-boundaries for the corresponding structure.  The
    299   // former means we have two varieties of CMF_PS1_V1 out there; the latter means that the
    300   // autocode tools do not work to read in the new version, even if we recognize it.  Here we
    301   // test for the existence of the broken version (table[0].headers[0].Naxis[0] == 136), and
    302   // call a special conversion function if it is found.
    303 
    304   ps1data = gfits_table_get_CMF_PS1_V1_Alt (table, &Nstars, NULL);
     376  ps1data = gfits_table_get_CMF_PS1_V2 (table, &Nstars, NULL);
    305377  if (!ps1data) {
    306378    fprintf (stderr, "skipping inconsistent entry\n");
     
    362434}
    363435
    364 Stars *Convert_PS1_V2 (FTable *table, unsigned int *nstars) {
     436Stars *Convert_PS1_V3 (FTable *table, unsigned int *nstars) {
    365437
    366438  off_t Nstars;
     
    368440  double ZeroPt;
    369441  Stars *stars;
    370   CMF_PS1_V2 *ps1data;
    371 
    372   ps1data = gfits_table_get_CMF_PS1_V2 (table, &Nstars, NULL);
     442  CMF_PS1_V3 *ps1data;
     443
     444  ps1data = gfits_table_get_CMF_PS1_V3 (table, &Nstars, NULL);
    373445  if (!ps1data) {
    374446    fprintf (stderr, "skipping inconsistent entry\n");
     
    429501  return (stars);
    430502}
    431 
    432 Stars *Convert_PS1_V3 (FTable *table, unsigned int *nstars) {
    433 
    434   off_t Nstars;
    435   unsigned int i;
    436   double ZeroPt;
    437   Stars *stars;
    438   CMF_PS1_V3 *ps1data;
    439 
    440   ps1data = gfits_table_get_CMF_PS1_V3 (table, &Nstars, NULL);
    441   if (!ps1data) {
    442     fprintf (stderr, "skipping inconsistent entry\n");
    443     return (NULL);
    444   }
    445   ZeroPt = GetZeroPoint();
    446 
    447   ALLOCATE (stars, Stars, Nstars);
    448   for (i = 0; i < Nstars; i++) {
    449     InitStar (&stars[i]);
    450     stars[i].measure.Xccd       = ps1data[i].X;
    451     stars[i].measure.Yccd       = ps1data[i].Y;
    452     stars[i].measure.dXccd      = ToShortPixels(ps1data[i].dX);
    453     stars[i].measure.dYccd      = ToShortPixels(ps1data[i].dY);
    454 
    455     stars[i].measure.posangle   = ToShortDegrees(ps1data[i].posangle);
    456     stars[i].measure.pltscale   = ps1data[i].pltscale;
    457 
    458     if ((ps1data[i].M >= 0.0) || isnan(ps1data[i].M)) {
    459         stars[i].measure.M      = NAN;
    460     } else {
    461         stars[i].measure.M      = ps1data[i].M + ZeroPt;
    462     }
    463     stars[i].measure.dM         = ps1data[i].dM;
    464     stars[i].measure.dMcal      = ps1data[i].dMcal;
    465     stars[i].measure.Map        = ps1data[i].Map + ZeroPt;
    466                        
    467     stars[i].measure.Sky        = ps1data[i].sky;
    468     stars[i].measure.dSky       = ps1data[i].dSky;
    469                        
    470     stars[i].measure.psfChisq   = ps1data[i].psfChisq;
    471     stars[i].measure.psfQual    = ps1data[i].psfQual;
    472     stars[i].measure.psfNdof    = ps1data[i].psfNdof;
    473     stars[i].measure.psfNpix    = ps1data[i].psfNpix;
    474     stars[i].measure.crNsigma   = ps1data[i].crNsigma;
    475     stars[i].measure.extNsigma  = ps1data[i].extNsigma;
    476 
    477     stars[i].measure.FWx        = ToShortPixels(ps1data[i].fx);
    478     stars[i].measure.FWy        = ToShortPixels(ps1data[i].fy);
    479     stars[i].measure.theta      = ToShortDegrees(ps1data[i].df);
    480 
    481     stars[i].measure.Mxx        = ToShortPixels(ps1data[i].Mxx);
    482     stars[i].measure.Mxy        = ToShortPixels(ps1data[i].Mxy);
    483     stars[i].measure.Myy        = ToShortPixels(ps1data[i].Myy);
    484                        
    485     stars[i].measure.photFlags  = ps1data[i].flags;
    486 
    487     // this is may optionally be replaced by the internal sequence (see FilterStars.c)
    488     stars[i].measure.detID      = ps1data[i].detID;
    489 
    490     // the Average fields and the following Measure fields are set in FilterStars after
    491     // the image metadata is in hand:  dR, dD, Mcal, dt, airmass, az, t, imageID, extID,
    492     // averef is set in find_matches, dbFlags is zero on ingest.
    493 
    494     // the following fields are currently not being set anywhere: t_msec
    495   }   
    496   *nstars = Nstars;
    497   return (stars);
    498 }
  • branches/eam_branches/ipp-20110213/Ohana/src/dvomerge/src/merge_catalogs_old.c

    r29938 r30812  
    219219      }
    220220      if (fabs(output[0].measure[Nmeas].dR) > 10*RADIUS) {
    221         fprintf (stderr, "error: %10.6f,%10.6f vs %10.6f,%10.6f (%f,%f vs %f,%f)\n",
    222                  output[0].average[n].R, output[0].average[n].D, Rin, Din,
    223                  X1[i], X2[Jmin], Y1[i], Y2[Jmin]);
    224         // XXX abort on this? -- this is a bad failure...
     221        // ok take declination into account and check again.
     222        double cosD = cos(RAD_DEG*Din);
     223        if (fabs(output[0].measure[Nmeas].dR*cosD) > 10*RADIUS) {
     224
     225            fprintf (stderr, "error: %10.6f,%10.6f vs %10.6f,%10.6f (%f,%f vs %f,%f)\n",
     226             output[0].average[n].R, output[0].average[n].D, Rin, Din,
     227             X1[i], X2[Jmin], Y1[i], Y2[Jmin]);
     228
     229            // XXX abort on this? -- this is a bad failure...
     230        }
    225231      }
    226232      input[0].found[N] = Nmeas;
  • branches/eam_branches/ipp-20110213/Ohana/src/getstar/src/MatchCoords.c

    r30499 r30812  
    33# define FLT_MAX 1e32
    44# endif
     5int ComputeLMLimits(double xmin, double xmax, double ymin, double ymax,
     6            double *Lmin, double *Lmax, double *Mmin, double *Mmax, Coords *coords);
    57
    68/* given coordinate, find images in list that contain the point */
     
    1214  double Xi[4], Yi[4];  /* image and original corners */
    1315  double xmin, xmax, ymin, ymax;
     16  double Lmin, Lmax, Mmin, Mmax;
    1417
    1518
     
    2023     also define the vtable entries for the images we keep  */
    2124
     25  int haveLimits = 0;
    2226  for (i = 0; i < NdbImages; i++) {
     27      haveLimits = 0;
    2328
    2429    if (!WITH_PHU && !strcmp (&dbImages[i].coords.ctype[4], "-DIS")) continue;
     
    3035    /* define image corners */
    3136    SetImageCorners (Xi, Yi, &dbImages[i]);
    32     // Xi[4] = Xi[0]; Yi[4] = Yi[0];
     37    // Xi[3] = Xi[0]; Yi[3] = Yi[0];
    3338
    3439    ymin = xmin = +FLT_MAX;
     
    5257            continue;
    5358        }
    54 
    5559       
    56         if (VERBOSE) fprintf(stderr, "%ld %8.1f %8.1f %s\n", i, x, y, dbImages[i].name);
     60        if (VERBOSE) fprintf(stderr, OFF_T_FMT" %8.1f %8.1f %s\n", i, x, y, dbImages[i].name);
    5761
    5862        if ((x >= xmin && x <= xmax) && (y >= ymin && y <= ymax)) {
     63            if (VERBOSE) fprintf(stderr, "\tpotential overlap for point %d image %i\n", j, (int) i);
     64
     65            // We may be using the astrometry far outside it's range of validity.
     66            // As a sanity check make sure that the focal plane coords are in bounds.
     67            // See ticket 1381
     68            if (!haveLimits) {
     69                // We defer computing the focal plane limits until we need them
     70                status = ComputeLMLimits(xmin, xmax, ymin, ymax,
     71                    &Lmin, &Lmax, &Mmin, &Mmax, &dbImages[i].coords);
     72                if (!status) {
     73                    continue;
     74                }
     75                haveLimits = 1;
     76            }
     77
     78            double L, M;
     79            status = RD_to_LM(&L, &M, pt->ra, pt->dec, &dbImages[i].coords);
     80            if (!status) {
     81                // This won't happen because RD_to_XY succeeded above
     82                continue;
     83            }
     84
     85            if (VERBOSE) fprintf(stderr, "L: %f M: %f\n", L, M);
     86
     87            if (L < Lmin || L > Lmax || M < Mmin || M > Mmax) {
     88                if (VERBOSE) fprintf(stderr, "\trejecting match for because focal plane coordinates are out of range\n");
     89                continue;
     90            }
     91            if (VERBOSE) fprintf(stderr, "\tmatch confirmed\n");
     92
    5993            totalMatches++;
    6094
     
    88122  }
    89123}
     124
     125// compute bounding box of this image in focal plane coordinates
     126int ComputeLMLimits(double xmin, double xmax, double ymin, double ymax,
     127            double *Lmin, double *Lmax, double *Mmin, double *Mmax, Coords *coords)
     128{
     129    double L0, L1, M0, M1;
     130    int status = XY_to_LM(&L0, &M0, xmin, ymin, coords);
     131    if (!status) {
     132        fprintf(stderr, "failed to transform image corner to LM\n");
     133        return 0;
     134    }
     135    status = XY_to_LM(&L1, &M1, xmax, ymax, coords);
     136    if (!status) {
     137        fprintf(stderr, "failed to transform image corner to LM\n");
     138        return 0;
     139    }
     140
     141    if (L1 > L0) {
     142        *Lmin = L0;
     143        *Lmax = L1;
     144    } else {
     145        *Lmin = L1;
     146        *Lmax = L0;
     147    }
     148    if (M1 > M0) {
     149        *Mmin = M0;
     150        *Mmax = M1;
     151    } else {
     152        *Mmin = M1;
     153        *Mmax = M0;
     154    }
     155    if (VERBOSE) fprintf(stderr, "Lmin: %f Lmax: %f Mmin: %f Mmax: %f\n", *Lmin, *Lmax, *Mmin, *Mmax);
     156    return 1;
     157}
  • branches/eam_branches/ipp-20110213/Ohana/src/libohana/include/ohana_allocate.h

    r30602 r30812  
    4949
    5050# define REALLOCATE(PTR,TYPE,SIZE) {                                    \
    51   PTR = (TYPE *) realloc(PTR,(unsigned)(MAX(((SIZE)*((int)sizeof(TYPE))),1))); \
     51  PTR = (TYPE *) realloc(PTR,(size_t)(MAX(((SIZE)*((int)sizeof(TYPE))),1))); \
    5252  if (PTR == NULL) {                                                    \
    5353    fprintf(stderr,"failed realloc at %d in %s\n", __LINE__, __FILE__); \
     
    5757  if ((NCURR) >= (SIZE)) {                              \
    5858    SIZE += DELTA;                                                      \
    59     PTR = (TYPE *) realloc(PTR,(unsigned)(MAX(((SIZE)*((int)sizeof(TYPE))),1))); \
     59    PTR = (TYPE *) realloc(PTR,(size_t)(MAX(((SIZE)*((int)sizeof(TYPE))),1))); \
    6060    if (PTR == NULL) {                                                  \
    6161      fprintf(stderr,"failed realloc increment at %d in %s\n", __LINE__, __FILE__); \
  • branches/eam_branches/ipp-20110213/PS-IPP-Config/lib/PS/IPP/Config.pm

    r30676 r30812  
    12091209        if ($@) {
    12101210            carp "nebulous delete for $todelete failed. Ignoring.\n";
    1211             return $PS_EXIT_SYS_ERROR;
    12121211        }
    12131212    }
  • branches/eam_branches/ipp-20110213/ippMonitor/raw/czartool_labels.php

    r30393 r30812  
    220220                showReplicationsStatus($REPL_HOST_GPC1, $REPL_USER_GPC1, $REPL_PASSWORD_GPC1, $REPL_DBNAME_GPC1);
    221221                showReplicationsStatus($REPL_HOST_NEBULOUS, $REPL_USER_NEBULOUS, $REPL_PASSWORD_NEBULOUS, $REPL_DBNAME_NEBULOUS);
    222 
     222                showReplicationsStatus($REPL_HOST_PSTAMP, $REPL_USER_PSTAMP, $REPL_PASSWORD_PSTAMP, $REPL_DBNAME_PSTAMP);
    223223              echo "</table>";
    224224            echo "</td>\n";
  • branches/eam_branches/ipp-20110213/ippMonitor/raw/site.php.in

    r30034 r30812  
    3232$REPL_DBNAME_NEBULOUS = "Nebulous";
    3333
     34$REPL_HOST_PSTAMP = "ippc19.IfA.Hawaii.Edu";
     35$REPL_USER_PSTAMP = "ippMonitor";
     36$REPL_PASSWORD_PSTAMP = "ippMonitor";
     37$REPL_DBNAME_PSTAMP = "ippRequestServer";
     38
    3439?>
  • branches/eam_branches/ipp-20110213/ippScripts/scripts/ipp_apply_burntool_single.pl

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/eam_branches/ipp-20110213/ippScripts/scripts/magic_destreak_cleanup.pl

    r30676 r30812  
    102102my $cam_path_base = $run->{cam_path_base};
    103103my $cam_reduction = $run->{cam_reduction};
     104my $replace = $run->{re_place};
    104105$cam_reduction = 'DEFAULT' if !$cam_reduction or ($cam_reduction eq 'NULL');
    105106
     
    111112
    112113&my_die("unexpected run state found: $state", $magic_ds_id, $PS_EXIT_CONFIG_ERROR) if $state ne "goto_cleaned";
    113 &my_die("clean not allowed for raw stage, use goto_restore", $magic_ds_id, $PS_EXIT_CONFIG_ERROR) if $stage eq "raw";
     114&my_die("cleanup not allowed for raw stage, use goto_restore", $magic_ds_id, $PS_EXIT_CONFIG_ERROR) if $stage eq "raw" and $replace;
    114115
    115116my $recipe_psastro;
     
    217218                # $bsources = $ipprc->filename("$name.SOURCES", $backup_path_base);
    218219            }
     220        } elsif ($stage eq "raw") {
     221            if ($backup_path_base) {
     222                if ($backup_path_base =~ /fits/) {
     223                    $bimage = $backup_path_base;
     224                } else {
     225                    $bimage = $backup_path_base . ".fits";
     226                }
     227            }
    219228        }
    220229
  • branches/eam_branches/ipp-20110213/ippScripts/scripts/magic_destreak_revert.pl

    r30700 r30812  
    7878    defined $outroot;
    7979
    80 &my_die("bytes and md5sum are is required for raw stage stage", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR) if ($stage eq 'raw' and (!$bytes or !$md5sum));
     80if (defined($replace) and ($replace eq "T")) {
     81    $replace = 1;
     82} else {
     83    $replace = 0;
     84}
     85
     86my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR ); # IPP configuration
     87
     88$ipprc->redirect_output($logfile) or my_die( "Unable to redirect output", $magic_ds_id, $component, $PS_EXIT_SYS_ERROR ) if $logfile;
     89
     90&my_die("bytes and md5sum are is required for raw stage stage", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR) if ($replace and $stage eq 'raw' and (!$bytes or !$md5sum));
    8191
    8292&my_die("cam_path_base is required for chip stage", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR) if ($stage eq 'chip' and !$cam_path_base);
     
    8494
    8595
    86 my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR ); # IPP configuration
    87 
    88 $ipprc->redirect_output($logfile) or my_die( "Unable to redirect output", $magic_ds_id, $component, $PS_EXIT_SYS_ERROR ) if $logfile;
    8996
    9097$cam_reduction = 'DEFAULT' if !defined $cam_reduction or ($cam_reduction eq "NULL");
     
    118125my $basename = basename($path_base);
    119126my $nebulousInput = inNebulous($dirname);
    120 
    121 if (defined($replace) and ($replace eq "T")) {
    122     $replace = 1;
    123 } else {
    124     $replace = 0;
    125 }
    126127
    127128&my_die("replace not allowed for non-nebulous files", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR)
     
    162163        $image = $path_base . ".fits";
    163164    }
    164     $bimage = $backup_path_base . ".fits";
     165    if ($backup_path_base =~ /.*\.fits$/) {
     166        $bimage = $backup_path_base;
     167    } else {
     168        $bimage = $backup_path_base . ".fits";
     169    }
    165170} elsif ($stage eq "chip") {
    166171    # Check to see if we're using dynamic masks
     
    302307sub revert_files {
    303308    my $replace = shift;
    304     return if !$replace;
     309#    return if !$replace;
    305310
    306311    my $image = shift;
     
    316321
    317322    if ($image) {
    318         revert_file($image, $bimage) or
     323        revert_file($replace, $image, $bimage) or
    319324            &my_die("failed to restore image file", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR);
    320325    }
    321326
    322327    if ($mask) {
    323         if (!revert_file($mask, $bmask)) {
     328        if (!revert_file($replace, $mask, $bmask)) {
    324329            &my_die("failed to restore mask file", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR);
    325330        }
     
    327332
    328333    if ($ch_mask) {
    329         if (!revert_file($ch_mask, $bch_mask)) {
     334        if (!revert_file($replace, $ch_mask, $bch_mask)) {
    330335            &my_die("failed to restore chip mask file", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR);
    331336        }
     
    334339
    335340    if ($weight) {
    336         revert_file($weight, $bweight) or
     341        revert_file($replace, $weight, $bweight) or
    337342            &my_die("failed to restore variance image", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR);
    338343    }
    339344
    340345    if ($sources) {
    341         revert_file($sources, $bsources) or
     346        revert_file($replace, $sources, $bsources) or
    342347            &my_die("failed to restore sources file", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR);
    343348    }
    344349
    345350    if ($astrom) {
    346         revert_file($astrom, $bastrom) or
     351        revert_file($replace, $astrom, $bastrom) or
    347352            &my_die("failed to restore astrometry file", $magic_ds_id, $component, $PS_EXIT_CONFIG_ERROR);
    348353    }
     
    366371sub revert_file
    367372{
     373    my $replace = shift;
    368374    my $original = shift;
    369375    my $backup   = shift;
    370376    my $force = 1; # force deletion of backup files in nebulous
     377
     378    if (!$replace) {
     379        # we don't need to do all of this checking unless the destreak run is
     380        # replace mode just delete the backup
     381        my $error_code = $ipprc->kill_file($backup);
     382        if ($error_code) {
     383            print STDERR "failed to kill $backup: error_code $error_code\n";
     384            return 0;
     385        } else {
     386            return 1;
     387        }
     388    }
    371389
    372390    my $o_path = $ipprc->file_resolve($original);
  • branches/eam_branches/ipp-20110213/ippScripts/scripts/register_imfile.pl

    r30676 r30812  
    181181if (uc(&value_for_flag ($cmdflags, "NULL", "-exp_type"))  eq "NULL") { &my_die_for_add ("exp_type  not found", $exp_id, $tmp_exp_name, $tmp_class_id, $uri, $PS_EXIT_CONFIG_ERROR); }
    182182my $dateobs   = &value_for_flag($cmdflags, 0.0, "-dateobs");
     183my $exp_type  = &value_for_flag($cmdflags, "NULL", "-exp_type");
    183184
    184185my $command = "$regtool -addprocessedimfile";
  • branches/eam_branches/ipp-20110213/ippTasks/destreak.pro

    r30676 r30812  
    204204    book getword magicToDS $pageName dbname -var DBNAME
    205205
    206     sprintf logfile "%s/%s.mds.%s.%s.%s.log" $OUTROOT $EXP_ID $MAGIC_DS_ID $STAGE_ID $COMPONENT
    207206
    208207    substr $COMPONENT 0 3 COMP_HEAD
    209208    if ("$COMP_HEAD" == "sky")
    210209        set.host.for.skycell $COMPONENT
     210        set.workdir.by.skycell $COMPONENT $OUTROOT $default_host WORKDIR
    211211    else
    212212        # assume component is a class_id, if not we will default to anyhost
    213213        set.host.for.camera $CAMERA $COMPONENT
    214     end
     214        set.workdir.by.camera $CAMERA $COMPONENT $OUTROOT $default_host WORKDIR
     215    end
     216
     217    sprintf logfile "%s/%s.mds.%s.%s.%s.log" $WORKDIR $EXP_ID $MAGIC_DS_ID $STAGE_ID $COMPONENT
    215218
    216219    # TODO: do not add recoveryroot or replace if they are null or zero
    217220
    218     $run = magic_destreak.pl --magic_ds_id $MAGIC_DS_ID --camera $CAMERA --exp_id $EXP_ID --streaks_path_base $STREAKS_PATH_BASE --inv_streaks_path_base $INV_STREAKS_PATH_BASE --streaks $STREAKS --inv_streaks $INV_STREAKS --stage $STAGE --stage_id $STAGE_ID --component $COMPONENT --uri $URI --path_base $PATH_BASE --cam_path_base $CAM_PATH_BASE --cam_reduction $CAM_REDUCTION --outroot $OUTROOT --logfile $logfile --recoveryroot $RECROOT --replace $REPLACE --magicked $MAGICKED --run-state $RUN_STATE
     221    $run = magic_destreak.pl --magic_ds_id $MAGIC_DS_ID --camera $CAMERA --exp_id $EXP_ID --streaks_path_base $STREAKS_PATH_BASE --inv_streaks_path_base $INV_STREAKS_PATH_BASE --streaks $STREAKS --inv_streaks $INV_STREAKS --stage $STAGE --stage_id $STAGE_ID --component $COMPONENT --uri $URI --path_base $PATH_BASE --cam_path_base $CAM_PATH_BASE --cam_reduction $CAM_REDUCTION --outroot $WORKDIR --logfile $logfile --recoveryroot $RECROOT --replace $REPLACE --magicked $MAGICKED --run-state $RUN_STATE
    219222
    220223    add_standard_args run
     
    407410    book getword magicDSToRevert $pageName dbname -var DBNAME
    408411
    409     sprintf logfile "%s/%s.mds.revert.%s.%s.%s.log" $OUTROOT $EXP_ID $MAGIC_DS_ID $STAGE_ID $COMPONENT
    410 
    411412    substr $COMPONENT 0 3 COMP_HEAD
    412413    if ("$COMP_HEAD" == "sky")
    413414        set.host.for.skycell $COMPONENT
     415        set.workdir.by.skycell $COMPONENT $OUTROOT $default_host WORKDIR
    414416    else
    415417        # assume component is a class_id, if not we will default to anyhost
    416418        set.host.for.camera $CAMERA $COMPONENT
    417     end
    418 
    419     $run = magic_destreak_revert.pl --magic_ds_id $MAGIC_DS_ID --camera $CAMERA --stage $STAGE --stage_id $STAGE_ID --component $COMPONENT --path_base $PATH_BASE --cam_path_base $CAM_PATH_BASE --cam_reduction $CAM_REDUCTION --outroot $OUTROOT --logfile $logfile --replace $REPLACE --bothways $BOTHWAYS --magicked $MAGICKED --run-state $RUN_STATE --recovery_path_base $RECOVERY_PATH_BASE
     419        set.workdir.by.camera $CAMERA $COMPONENT $OUTROOT $default_host WORKDIR
     420    end
     421    sprintf logfile "%s/%s.mds.revert.%s.%s.%s.log" $WORKDIR $EXP_ID $MAGIC_DS_ID $STAGE_ID $COMPONENT
     422
     423    $run = magic_destreak_revert.pl --magic_ds_id $MAGIC_DS_ID --camera $CAMERA --stage $STAGE --stage_id $STAGE_ID --component $COMPONENT --path_base $PATH_BASE --cam_path_base $CAM_PATH_BASE --cam_reduction $CAM_REDUCTION --outroot $WORKDIR --logfile $logfile --replace $REPLACE --bothways $BOTHWAYS --magicked $MAGICKED --run-state $RUN_STATE --recovery_path_base $RECOVERY_PATH_BASE
    420424
    421425    add_standard_args run
  • branches/eam_branches/ipp-20110213/ippTasks/pstamp.pro

    r30567 r30812  
    1919
    2020# give up on dependents with fault_count >= $PSTAMP_MAX_FAULT_COUNT
    21 $PSTAMP_MAX_FAULT_COUNT = 5
     21$PSTAMP_MAX_FAULT_COUNT = 3
    2222macro set.max.fault.count
    2323    $PSTAMP_MAX_FAULT_COUNT = $1
     
    717717
    718718        $MYLOGFILE = $OUTDIR/checkdep.$DEP_ID.log
    719         stdout $MYLOGFILE
     719        stdout NULL
    720720        stderr $MYLOGFILE
    721721
    722         $run = pstamp_checkdependent.pl --dep_id $DEP_ID --stage_id $STAGE_ID --stage $STAGE --component $COMPONENT --imagedb $IMAGEDB --rlabel $RLABEL $NEED_MAGIC --fault_count $FAULT_COUNT --max_fault_count $PSTAMP_MAX_FAULT_COUNT
     722        $run = pstamp_checkdependent.pl --dep_id $DEP_ID --stage_id $STAGE_ID --stage $STAGE --component $COMPONENT --imagedb $IMAGEDB --rlabel $RLABEL $NEED_MAGIC --fault_count $FAULT_COUNT --max_fault_count $PSTAMP_MAX_FAULT_COUNT --logfile $MYLOGFILE
    723723
    724724        add_standard_args run
     
    928928
    929929    task.exec
     930        stdout $LOGSUBDIR/pstamp.stopfaulted.log
    930931        stderr $LOGSUBDIR/pstamp.stopfaulted.log
    931         stderr $LOGSUBDIR/pstamp.stopfaulted.log
    932         $run = pstampstopfaulted
     932        $run = pstampstopfaulted -fault_count $PSTAMP_MAX_FAULT_COUNT
    933933        if ($DB:n == 0)
    934934            option DEFAULT
  • branches/eam_branches/ipp-20110213/ippTasks/register.pro

    r30472 r30812  
    203203$regRevertImfile_DB = 0
    204204$regPendingExp_DB = 0
    205 
     205$reg_datePAGE = 0
    206206# select images ready for register analysis
    207207# new entries are added to regPendingImfile
  • branches/eam_branches/ipp-20110213/ippToPsps/src/Batch.h

    r30192 r30812  
    1414#include <psmodules.h>
    1515#include <dvo_util.h>
    16 #include "ippToPspsConfig.h"
     16#include "Config.h"
    1717#include <libxml/parser.h>
    1818#include <libxml/tree.h>
  • branches/eam_branches/ipp-20110213/ippToPsps/src/DifferenceBatch.c

    r30147 r30812  
    88
    99#include "ippToPsps.h"
    10 #include "ippToPspsConfig.h"
     10#include "Config.h"
    1111#include "ippToPspsDiffEnums.h"
    1212
  • branches/eam_branches/ipp-20110213/ippTools/share/camtool_find_pendingimfile.sql

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/eam_branches/ipp-20110213/ippTools/share/magicdstool_todestreak_raw.sql

    r29561 r30812  
    2424    re_place,
    2525    remove,
    26     10000 AS priority
     26    IFNULL(Label.priority, 10000) AS priority
    2727FROM magicDSRun
    2828JOIN magicMask USING (magic_id)
     
    3535    ON magicDSRun.magic_ds_id = magicDSFile.magic_ds_id
    3636    AND magicDSFile.component = rawImfile.class_id
     37LEFT JOIN Label ON magicDSRun.label = Label.label
    3738WHERE
    3839    magicDSRun.state = 'new'
    3940    AND magicDSRun.stage = 'raw'
    4041    AND magicDSFile.component IS NULL
     42    AND (Label.active OR Label.active IS NULL)
     43
  • branches/eam_branches/ipp-20110213/ippTools/share/magicdstool_torevert_diff.sql

    r30675 r30812  
    1313    magicDSFile.recovery_path_base,
    1414    "NULL" AS cam_path_base,
    15     recovery_path_base,
    1615    CAST(diffRun.bothways AS SIGNED) AS bothways,
    1716    0 AS bytes,
  • branches/eam_branches/ipp-20110213/ippTools/share/pxadmin_create_tables.sql

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/eam_branches/ipp-20110213/ippTools/src

  • branches/eam_branches/ipp-20110213/ippTools/src/addtool.c

    r29423 r30812  
    324324    // pxUpdateRun gets parameters from config->args and runs the update query
    325325    bool result = pxUpdateRun(config, where, &query, "addRun", "add_id",
    326         "addProcessedExp", false);
     326        "addProcessedExp", false, false);
    327327
    328328    psFree(query);
  • branches/eam_branches/ipp-20110213/ippTools/src/bgtool.c

    r29671 r30812  
    501501    psString query = psStringCopy("UPDATE chipBackgroundRun");
    502502    bool result = pxUpdateRun(config, where, &query, "chipBackgroundRun", "chip_bg_id",
    503                               "chipBackgroundImfile", true);
     503                              "chipBackgroundImfile", true, true);
    504504
    505505    psFree(query);
     
    14711471    psString query = psStringCopy("UPDATE warpBackgroundRun");
    14721472    bool result = pxUpdateRun(config, where, &query, "warpBackgroundRun", "warp_bg_id",
    1473                               "warpBackgroundSkyfile", true);
     1473                              "warpBackgroundSkyfile", true, true);
    14741474
    14751475    psFree(query);
  • branches/eam_branches/ipp-20110213/ippTools/src/camtool.c

    r29902 r30812  
    283283
    284284    // pxUpdateRun gets parameters from config->args and updates
    285     bool result = pxUpdateRun(config, where, &query, "camRun", "cam_id", "camProcessedExp", true);
     285    bool result = pxUpdateRun(config, where, &query, "camRun", "cam_id", "camProcessedExp", true, true);
    286286    if (!result) {
    287287        psError(psErrorCodeLast(), false, "pxUpdateRun failed");
  • branches/eam_branches/ipp-20110213/ippTools/src/camtoolConfig.c

    r29902 r30812  
    8686    psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-set_dist_group", 0,   "define new dist_group", NULL);
    8787    psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-set_note", 0,         "define new note", NULL);
     88    pxmagicAddArguments(updaterunArgs);
    8889
    8990    // -pendingexp
     
    299300    PXOPT_ADD_MODE("-addprocessedexp",      "add a processed exposure",             CAMTOOL_MODE_ADDPROCESSEDEXP, addprocessedexpArgs);
    300301    PXOPT_ADD_MODE("-processedexp",         "show processed exposures",             CAMTOOL_MODE_PROCESSEDEXP,  processedexpArgs);
    301     PXOPT_ADD_MODE("-revertprocessedexp",   "change procesed exp properties",       CAMTOOL_MODE_REVERTPROCESSEDEXP,  revertprocessedexpArgs);
    302     PXOPT_ADD_MODE("-updateprocessedexp",   "undo a processed exposure",            CAMTOOL_MODE_UPDATEPROCESSEDEXP,updateprocessedexpArgs);
     302    PXOPT_ADD_MODE("-revertprocessedexp",   "undo a processed exposure",       CAMTOOL_MODE_REVERTPROCESSEDEXP,  revertprocessedexpArgs);
     303    PXOPT_ADD_MODE("-updateprocessedexp",   "changed processed exp properties",            CAMTOOL_MODE_UPDATEPROCESSEDEXP,updateprocessedexpArgs);
    303304    PXOPT_ADD_MODE("-block",                "set a label block",                    CAMTOOL_MODE_BLOCK,         blockArgs);
    304305    PXOPT_ADD_MODE("-masked",               "show blocked labels",                  CAMTOOL_MODE_MASKED,        maskedArgs);
  • branches/eam_branches/ipp-20110213/ippTools/src/chiptool.c

    r30544 r30812  
    443443
    444444    // pxUpdateRun gets parameters from config->args and updates
    445     bool result = pxUpdateRun(config, where, &query, "chipRun", "chip_id", "chipProcessedImfile", true);
     445    bool result = pxUpdateRun(config, where, &query, "chipRun", "chip_id", "chipProcessedImfile", true, true);
    446446    if (!result) {
    447447        psError(psErrorCodeLast(), false, "pxUpdateRun failed");
  • branches/eam_branches/ipp-20110213/ippTools/src/chiptoolConfig.c

    r30049 r30812  
    9999    psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-set_dist_group", 0,   "set dist group", NULL);
    100100    psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-set_note", 0,         "set note", NULL);
     101    pxmagicAddArguments(updaterunArgs);
    101102
    102103    // -setimfiletoupdate
  • branches/eam_branches/ipp-20110213/ippTools/src/diffphottool.c

    r28488 r30812  
    228228
    229229    // pxUpdateRun gets parameters from config->args and updates
    230     bool result = pxUpdateRun(config, where, &query, "diffPhotRun", "diff_phot_id", "diffPhotSkyfile", true);
     230    bool result = pxUpdateRun(config, where, &query, "diffPhotRun", "diff_phot_id", "diffPhotSkyfile", true, false);
    231231
    232232    psFree(query);
  • branches/eam_branches/ipp-20110213/ippTools/src/difftool.c

    r30594 r30812  
    224224
    225225    // pxUpdateRun gets parameters from config->args and updates
    226     bool result = pxUpdateRun(config, where, &query, "diffRun", "diff_id", "diffSkyfile", true);
     226    bool result = pxUpdateRun(config, where, &query, "diffRun", "diff_id", "diffSkyfile", true, true);
    227227
    228228    psFree(query);
  • branches/eam_branches/ipp-20110213/ippTools/src/difftoolConfig.c

    r30070 r30812  
    7373    psMetadataAddS16(updaterunArgs, PS_LIST_TAIL, "-set_diff_mode", 0,    "specify type of difference (WW=1,WS=2,SW=3,SS=4)", 0);
    7474    psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-set_note", 0,         "define new note", NULL);
     75    pxmagicAddArguments(updaterunArgs);
    7576
    7677    // -addinputskyfile
  • branches/eam_branches/ipp-20110213/ippTools/src/faketool.c

    r27391 r30812  
    348348
    349349    // pxUpdateRun gets parameters from config->args and updates
    350     bool result = pxUpdateRun(config, where, &query, "fakeRun", "fake_id", "fakeProcessedImfile", true);
     350    bool result = pxUpdateRun(config, where, &query, "fakeRun", "fake_id", "fakeProcessedImfile", true, false);
    351351    if (!result) {
    352352        psError(psErrorCodeLast(), false, "pxUpdateRun failed");
  • branches/eam_branches/ipp-20110213/ippTools/src/magicdstool.c

    r30700 r30812  
    13951395          (strcmp(state, "full") == 0) ||
    13961396          (strcmp(state, "drop") == 0) ||
     1397          (strcmp(state, "wait") == 0) ||
    13971398          (strcmp(state, "failed_revert") == 0) ||
    13981399          (strcmp(state, "error_cleaned") == 0) ||
  • branches/eam_branches/ipp-20110213/ippTools/src/magictool.c

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • branches/eam_branches/ipp-20110213/ippTools/src/pubtool.c

    r30376 r30812  
    3737static bool addMode(pxConfig *config);
    3838static bool revertMode(pxConfig *config);
     39static bool updaterunMode(pxConfig *config);
    3940
    4041# define MODECASE(caseName, func) \
     
    6364        MODECASE(PUBTOOL_MODE_ADD, addMode);
    6465        MODECASE(PUBTOOL_MODE_REVERT, revertMode);
     66        MODECASE(PUBTOOL_MODE_UPDATERUN, updaterunMode);
    6567      default:
    6668        psAbort("invalid option (this should not happen)");
     
    459461}
    460462
     463static bool updaterunMode(pxConfig *config)
     464{
     465    PS_ASSERT_PTR_NON_NULL(config, false);
     466
     467    psMetadata *where = psMetadataAlloc(); // WHERE conditions
     468    PXOPT_COPY_S64(config->args, where, "-pub_id", "pub_id", "==");
     469    PXOPT_COPY_S64(config->args, where, "-client_id", "client_id", "==");
     470    PXOPT_COPY_STR(config->args, where, "-state", "state", "==");
     471    PXOPT_COPY_STR(config->args, where, "-label", "label", "==");
     472    PXOPT_COPY_STR(config->args, where, "-fault", "fault", "==");
     473
     474    PXOPT_LOOKUP_STR(state, config->args, "-set_state",  true, false);
     475
     476    psString query = NULL;              // Query to run
     477    psStringAppend(&query, "UPDATE publishRun LEFT JOIN publishDone using(pub_id) SET state = '%s'", state);
     478
     479    if (psListLength(where->list)) {
     480        psString clause = psDBGenerateWhereConditionSQL(where, NULL);
     481        psStringAppend(&query, "\n WHERE %s", clause);
     482        psFree(clause);
     483    } else {
     484        psError(PS_ERR_UNKNOWN, false, "select arguments are required");
     485        return false;
     486    }
     487    psFree(where);
     488
     489    if (!p_psDBRunQuery(config->dbh, query)) {
     490        psError(PS_ERR_UNKNOWN, false, "Database error");
     491        psFree(query);
     492        return false;
     493    }
     494    psFree(query);
     495
     496    long numUpdated = psDBAffectedRows(config->dbh);
     497    psLogMsg("pubtool", PS_LOG_INFO, "%ld rows updated.", numUpdated);
     498
     499    return true;
     500}
  • branches/eam_branches/ipp-20110213/ippTools/src/pubtool.h

    r25929 r30812  
    3131    PUBTOOL_MODE_ADD,
    3232    PUBTOOL_MODE_REVERT,
     33    PUBTOOL_MODE_UPDATERUN,
    3334} pubtoolMode;
    3435
  • branches/eam_branches/ipp-20110213/ippTools/src/pubtoolConfig.c

    r30376 r30812  
    102102    psMetadataAddStr(revertArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "search on label", NULL);
    103103
     104    // -updaterun
     105    psMetadata *updaterunArgs = psMetadataAlloc();
     106    psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-set_state", 0, "new value for state (required)", NULL);
     107    psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-state", 0, "search by state", NULL);
     108    psMetadataAddS64(updaterunArgs, PS_LIST_TAIL, "-pub_id", 0, "search on pub_id", 0);
     109    psMetadataAddS64(updaterunArgs, PS_LIST_TAIL, "-client_id", 0, "search on client_id", 0);
     110    psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-label", 0, "search by label", NULL);
     111    psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-fault", 0, "search by fault", NULL);
     112
    104113
    105114    psMetadata *argSets = psMetadataAlloc();
     
    112121    PXOPT_ADD_MODE("-add", "", PUBTOOL_MODE_ADD, addArgs);
    113122    PXOPT_ADD_MODE("-revert", "", PUBTOOL_MODE_REVERT, revertArgs);
     123    PXOPT_ADD_MODE("-updaterun", "", PUBTOOL_MODE_UPDATERUN, updaterunArgs);
    114124
    115125    if (!pxGetOptions(stderr, argc, argv, config, modes, argSets)) {
  • branches/eam_branches/ipp-20110213/ippTools/src/pxtools.c

    r28486 r30812  
    278278
    279279// shared code for updating the various strings for a Run
    280 bool pxUpdateRun(pxConfig *config, psMetadata *where, psString *pQuery, psString runTable, psString idColumn, psString fileTable, bool has_dist_group)
     280bool pxUpdateRun(pxConfig *config, psMetadata *where, psString *pQuery, psString runTable, psString idColumn, psString fileTable, bool has_dist_group, bool has_magicked)
    281281{
    282282    PS_ASSERT_PTR_NON_NULL(config, false);
     
    360360    if (fileWhere) {
    361361        psStringAppend(pQuery, "%s", fileWhere);
     362    }
     363    if (has_magicked) {
     364        pxmagicAddWhere(config, pQuery, runTable);
    362365    }
    363366
  • branches/eam_branches/ipp-20110213/ippTools/src/pxtools.h

    r30544 r30812  
    8484bool pxGetOptions(FILE *stream, int argc, char **argv, pxConfig *config, psMetadata *modes, psMetadata *argSets);
    8585
    86 bool pxUpdateRun(pxConfig *config, psMetadata *where, psString *pQuery, psString runTable, psString idColumn, psString fileTable, bool has_dist_group);
     86bool pxUpdateRun(pxConfig *config, psMetadata *where, psString *pQuery, psString runTable, psString idColumn, psString fileTable, bool has_dist_group, bool has_magicked);
    8787
    8888#define PXOPT_ADD_MODE(option, comment, modeval, argset) \
  • branches/eam_branches/ipp-20110213/ippTools/src/stacktool.c

    r30429 r30812  
    750750
    751751    // pxUpdateRun gets parameters from config->args and updates
    752     bool result = pxUpdateRun(config, where, &query, "stackRun", "stack_id", "stackSumSkyfile", true);
     752    bool result = pxUpdateRun(config, where, &query, "stackRun", "stack_id", "stackSumSkyfile", true, false);
    753753
    754754    psFree(query);
  • branches/eam_branches/ipp-20110213/ippTools/src/staticskytool.c

    r29066 r30812  
    360360
    361361    // pxUpdateRun gets parameters from config->args and updates
    362     bool result = pxUpdateRun(config, where, &query, "staticskyRun", "sky_id", "staticskyResult", true);
     362    bool result = pxUpdateRun(config, where, &query, "staticskyRun", "sky_id", "staticskyResult", true, false);
    363363    psFree(query);
    364364    psFree(where);
  • branches/eam_branches/ipp-20110213/ippTools/src/warptool.c

    r30556 r30812  
    435435
    436436    // pxUpdateRun gets parameters from config->args and updates
    437     bool result = pxUpdateRun(config, where, &query, "warpRun", "warp_id", "warpSkyfile", true);
     437    bool result = pxUpdateRun(config, where, &query, "warpRun", "warp_id", "warpSkyfile", true, true);
    438438
    439439    psFree(query);
  • branches/eam_branches/ipp-20110213/ippTools/src/warptoolConfig.c

    r29416 r30812  
    141141    psMetadataAddTime(updaterunArgs, PS_LIST_TAIL, "-registered_begin", 0, "search for runs by registration time (>=)", NULL);
    142142    psMetadataAddTime(updaterunArgs, PS_LIST_TAIL, "-registered_end", 0, "search for runs by registration time (<)", NULL);
    143     psMetadataAddBool(updaterunArgs, PS_LIST_TAIL, "-destreaked", 0, "search for runs that have been destreaked", false);
    144143    psMetadataAddBool(updaterunArgs, PS_LIST_TAIL, "-pretend", 0, "only pretend to run the query", false);
    145144
     
    149148    psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-set_dist_group", 0,   "define new dist_group", NULL);
    150149    psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-set_note", 0,         "define new note", NULL);
     150    pxmagicAddArguments(updaterunArgs);
    151151
    152152    // -exp
  • branches/eam_branches/ipp-20110213/ippconfig

  • branches/eam_branches/ipp-20110213/ippconfig/recipes/nightly_science.config

    r30470 r30812  
    22CLEAN_MODES METADATA
    33  MODE           STR CHIP
    4   COMMAND        STR chiptool -dbname @DBNAME@ -updaterun -set_state goto_cleaned -state full -set_label goto_cleaned -label @LABEL@ -data_group @DATA_GROUP@
     4  COMMAND        STR chiptool -dbname @DBNAME@ -updaterun -set_state goto_cleaned -state full -set_label goto_cleaned -label @LABEL@ -data_group @DATA_GROUP@ -destreaked
    55  RETENTION_TIME U16 21
    66END
    77CLEAN_MODES METADATA
    88  MODE           STR WARP
    9   COMMAND        STR warptool -dbname @DBNAME@ -updaterun -set_state goto_cleaned -state full -set_label goto_cleaned -label @LABEL@ -data_group @DATA_GROUP@
     9  COMMAND        STR warptool -dbname @DBNAME@ -updaterun -set_state goto_cleaned -state full -set_label goto_cleaned -label @LABEL@ -data_group @DATA_GROUP@ -destreaked
    1010  RETENTION_TIME U16 7
    1111END
    1212CLEAN_MODES METADATA
    1313  MODE           STR DIFF
    14   COMMAND        STR difftool -dbname @DBNAME@ -updaterun -set_state goto_cleaned -state full -set_label goto_cleaned -label @LABEL@ -data_group @DATA_GROUP@
     14  COMMAND        STR difftool -dbname @DBNAME@ -updaterun -set_state goto_cleaned -state full -set_label goto_cleaned -label @LABEL@ -data_group @DATA_GROUP@ -destreaked
    1515  RETENTION_TIME S16 21
    1616END
  • branches/eam_branches/ipp-20110213/pstamp/scripts/pstamp_checkdependent.pl

    r30676 r30812  
    2727my $IPP_DIFF_MODE_STACK_STACK = 4;
    2828
    29 my ($dep_id, $stage, $stage_id, $component, $imagedb, $rlabel, $need_magic, $fault_count, $max_fault_count);
     29my ($dep_id, $stage, $stage_id, $component, $imagedb, $rlabel, $need_magic, $fault_count, $max_fault_count, $logfile);
    3030my ($dbname, $ps_dbserver, $verbose, $save_temps, $no_update);
    3131
     
    4040    'fault_count=i' =>  \$fault_count,
    4141    'max_fault_count=i' =>  \$max_fault_count,
     42    'logfile=s'     =>  \$logfile,
    4243    'dbname=s'      =>  \$dbname,       # postage stamp server dbname
    4344    'dbserver=s'    =>  \$ps_dbserver,  # postage stamp server dbserver
     
    6869my $ipprc = PS::IPP::Config->new();
    6970
     71if ($logfile) {
     72   $ipprc->redirect_output($logfile);
     73}
     74
    7075if (!$ps_dbserver) {
    7176    $ps_dbserver =  metadataLookupStr($ipprc->{_siteConfig}, 'PS_DBSERVER');
     
    314319    my $data_state = $metadata->{data_state};
    315320
     321    # The update system currently requires that data that has been magicked be destreaked
     322    # at chip stage so it needs magic even if the customer doesn't.
     323    if ($metadata->{magicked} != 0) {
     324        $need_magic = 1;
     325    }
     326
    316327    if (($state =~ /error/) or ($state =~ /purged/) or ($state =~ /scrubbed/) or ($state eq 'drop') or
    317328         ($data_state =~ /error/) or ($data_state =~ /purged/) or ($data_state =~ /scrubbed/) or ($data_state eq 'drop')) {
     
    350361    foreach my $chip (@$data) {
    351362        $chip_id = $chip->{chip_id};
    352         if (($chip->{data_state} ne 'full') or ($need_magic and ($chip->{magicked} <= 0))) {
     363
     364        # if chip has been magicked before require it to be magicked again
     365        # because the warp pending query requires it.
     366        if ($chip->{magicked} < 0) {
     367            print "Input has been destreaked so we must destreak before warping\n";
     368            $need_magic = 1
     369        }
     370
     371        if ($need_magic and ($chip->{magicked} eq 0)) {
     372            my_die("Client requires magic, but chip never magicked. How did this dependent get queued?", $PS_EXIT_PROG_ERROR);
     373        }
     374
     375        if (($chip->{data_state} ne 'full') or ($need_magic and ($chip->{magicked} < 0))) {
    353376            $chips_ready = 0;
    354377            $chip->{fault} = $chip->{chip_fault};
     
    399422    my $skycell = $metadata;
    400423    my $skycell_id = $skycell->{skycell_id};
     424
     425    # The update system currently requires that data that has been magicked be destreaked
     426    # at chip stage so it needs magic even if the customer doesn't.
     427    if ($metadata->{magicked} != 0) {
     428        $need_magic = 1;
     429    }
    401430
    402431    if ($diff_mode == $IPP_DIFF_MODE_WARP_STACK ) {
  • branches/eam_branches/ipp-20110213/pstamp/scripts/pstampparse.pl

    r30565 r30812  
    3131my $no_update;
    3232my $dest_requires_magic;
     33
     34# set this to true to disable update processing
     35my $no_updates_allowed = 0;
    3336
    3437GetOptions(
     
    424427                # and this user's data store destination is allowed uncensored stamps, so accept the request
    425428                $need_magic = 0;
     429
     430                # Since user can get unmagicked data "by coordinate" requests can go back in time
     431                # to dredge unusable data from the "dark days"...
     432                if ($req_type eq 'bycoord' and $mjd_min eq 0) {
     433                    # ... so unless the user sets mjd_min clamp it to 2009-04-01
     434                    # XXX: This value should live in the pstampProject table not be hardcoded here
     435                    $mjd_min = 54922;
     436                }
    426437            } else {
    427438                print STDERR "Error row $rownum: User not authorized to to request uncensored stamps.\n";
     
    465476    print "Time to locate_images for row $rownum $dtime_locate\n";
    466477
    467     # handle this XXX: what did I mean by this comment
     478    # handle this
     479    # XXX: what did I mean by that comment?
    468480    $row->{need_magic} = $need_magic;
    469481
    470482    $num_jobs += queueJobs($mode, \@rowList, $imageList);
    471483
    472     # if a row slipped through with no jobs add one
     484    # if a row slipped through with no jobs add a faulted one
    473485    foreach my $row (@rowList) {
    474486        if ($row->{job_num} == 0) {
     
    495507    my $option_mask = $row->{OPTION_MASK};
    496508    my $components = $row->{components};
     509
     510    $option_mask |= $PSTAMP_NO_WAIT_FOR_UPDATE if $no_updates_allowed;
    497511
    498512    my $roi_string;
     
    668682    my $rownum = $row->{ROWNUM};
    669683    my $option_mask = $row->{OPTION_MASK};
     684
     685    $option_mask |= $PSTAMP_NO_WAIT_FOR_UPDATE if $no_updates_allowed;
    670686
    671687    # For dist_bundle we need
  • branches/eam_branches/ipp-20110213/pstamp/scripts/pstampstopfaulted

    r29428 r30812  
     1#!/bin/bash
     2#
     3# script executed by the task pstamp.stopfaulted to stop proceessing of jobs
     4# and dependents that have fault_count >= some maximum value. That value is expected
     5# to be passed in as an argument otherwise the default in pstamptool is used
     6# All arguments are passed to pstamptool
    17
    2 # script executed by the task pstamp.stopfaulted to stop proceessing of jobs
    3 # and dependents that have faulted 5 or more times
    4 # all arguments to this script are passed to pstamptool
    5 
    6 # 25 is PSTAMP_NOT_AVAILABLE
     8# note: 25 is PSTAMP_NOT_AVAILABLE
    79fault_code=25
    8 fault_count=3
    910
    1011date
    1112echo stopping faulted dependent jobs
    12 pstamptool -stopdependentjob -set_fault $fault_code -fault_count $fault_count $*
     13cmd="pstamptool -stopdependentjob -set_fault $fault_code $*"
     14echo $cmd
     15$cmd
    1316
    1417echo stopping faulted jobs
    15 pstamptool -updatejob -state run -set_state stop -set_fault $fault_code -fault_count $fault_count $*
     18cmd="pstamptool -updatejob -state run -set_state stop -set_fault $fault_code $*"
     19echo $cmd
     20$cmd
  • branches/eam_branches/ipp-20110213/tools/czartool/Config.pm

    r30274 r30812  
    6666    $self->{roboczaremail} = $xc->findvalue('//roboczar/email');
    6767    $self->{roboczarserverinterval} = $xc->findvalue('//roboczar/serverinterval');
    68 
    69 
     68    $self->{roboczarinterestedservers} = $xc->findvalue('//roboczar/interestedservers');
    7069}
    7170
     
    126125###########################################################################
    127126#
     127# Returns array of servers we are interested in for roboczar
     128#
     129###########################################################################
     130sub getRoboczarInterestedServers {
     131    my ($self) = @_;
     132
     133    my @servers = split('\s+', $self->{roboczarinterestedservers});
     134
     135    return @servers;
     136}
     137
     138###########################################################################
     139#
    128140# Returns the email to which roboczar should send its warnings
    129141#
     
    136148###########################################################################
    137149#
    138 # Returns  
     150# Returns font for gnuplot
    139151#
    140152###########################################################################
     
    146158###########################################################################
    147159#
    148 # Returns  
     160# Returns font size for gnuplot
    149161#
    150162###########################################################################
     
    156168###########################################################################
    157169#
    158 # Returns  
     170# Returns save location for metrics
    159171#
    160172###########################################################################
     
    166178###########################################################################
    167179#
    168 # Returns  
     180# Returns daily start time for metrics
    169181#
    170182###########################################################################
     
    176188###########################################################################
    177189#
    178 # Returns  
     190# Returns name for gpc1 Db
    179191#
    180192###########################################################################
     
    186198###########################################################################
    187199#
    188 # Returns  
     200# Returns host for gpc1 Db
    189201#
    190202###########################################################################
     
    196208###########################################################################
    197209#
    198 # Returns  
     210# Returns user for gpc1 Db
    199211#
    200212###########################################################################
     
    206218###########################################################################
    207219#
    208 # Returns  
     220# Returns password for gpc1 Db
    209221#
    210222###########################################################################
     
    216228###########################################################################
    217229#
    218 # Returns  
     230# Returns czar Db name
    219231#
    220232###########################################################################
     
    226238###########################################################################
    227239#
    228 # Returns  
     240# Returns host for czar Db
    229241#
    230242###########################################################################
     
    236248###########################################################################
    237249#
    238 # Returns  
     250# Returns username for czar Db
    239251#
    240252###########################################################################
     
    246258###########################################################################
    247259#
    248 # Returns
     260# Returns password for czar Db
    249261#
    250262###########################################################################
  • branches/eam_branches/ipp-20110213/tools/czartool/czarconfig.xml

    r30274 r30812  
    11<?xml version="1.0" encoding="UTF-8"?>
     2
     3<!-- Global config for all czartool stuff -->
    24
    35<czarconfig>
    46
     7  <!-- Gnuplot config section -->
    58  <gnuplot>
    69    <font>/usr/share/fonts/corefonts/arial.ttf</font>
     
    811  </gnuplot>
    912
     13  <!-- Metrics section -->
    1014  <metrics>
    1115    <savelocation>/data/ipp004.0/ipp/ippMetrics</savelocation>
     
    1317  </metrics>
    1418
     19  <!-- gpc1 Db section -->
    1520  <gpc1database>
    1621    <name>gpc1</name>
     
    2025  </gpc1database>
    2126
     27  <!-- Czar Db section -->
    2228  <czardatabase>
    2329    <name>czardb</name>
     
    2834  </czardatabase>
    2935
     36  <!-- Roboczar section -->
    3037  <roboczar>
    3138    <email>ps-ipp-ops@ifa.hawaii.edu</email>
     39    <!-- How often should ropbczar check status? (MySQL 'interval' format please, eg 20 MINUTE, 1 HOUR etc) check-->
    3240    <serverinterval>20 MINUTE</serverinterval>
     41    <!-- whitespace-separated server list for servers we want roboczar to check -->
     42    <!-- <interestedservers>stdscience distribution summitcopy registration pstamp</interestedservers> -->
     43    <interestedservers>pstamp</interestedservers>
    3344  </roboczar>
     45
    3446</czarconfig>
  • branches/eam_branches/ipp-20110213/tools/roboczar.pl

    r30250 r30812  
    2222
    2323my @stages = ("burntool", "chip", "cam", "fake", "warp", "stack", "diff", "magic", "magicDS", "dist"); # TODO get from Pantasks
    24 my @serversWeCareAbout = ("stdscience", "distribution", "summitcopy", "registration", "pstamp");
    2524
     25my @interestedServers = $config->getRoboczarInterestedServers();
    2626
    2727my $stuckMessage;
     
    115115    ${$message} = "Pantasks servers:\n";
    116116
    117     foreach $server (@serversWeCareAbout) {
     117    foreach $server (@interestedServers) {
    118118
    119119        # is server alice?
Note: See TracChangeset for help on using the changeset viewer.