IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 25050


Ignore:
Timestamp:
Aug 11, 2009, 2:36:22 PM (17 years ago)
Author:
watersc1
Message:

Fixed typos in cleanup sql and created the correct filelist to delete.

Made changes to psastro and pmAstrometryWCS to allow the choice between PC and CD header keywords.

Location:
branches/czw_branch/cleanup
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • branches/czw_branch/cleanup/ippScripts/scripts/ipp_cleanup.pl

    r24972 r25050  
    767767    }
    768768
    769 #     # if there are no detProcessedImfiles (@$stdout_buf == 0), the reset the state to 'new'
    770 #     if (@$stdout_buf == 0)  {
    771 #       my $command = "$dettool -det_id $stage_id -updateprocessedimfile -data_state new";
    772 #       $command .= " -dbname $dbname" if defined $dbname;
    773 
    774 #       my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    775 #           run(command => $command, verbose => $verbose);
    776 #       unless ($success) {
    777 #           $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    778 #           &my_die("Unable to perform dettool: $error_code", "$stage", $stage_id, $error_code);
    779 #       }
    780 #       exit 0;
    781 #     }
    782    
    783     if (@$stdout_buf == 0) {
    784         exit 0; #silently abort. I need to fix this for propers
     769    # if there are no detProcessedImfiles (@$stdout_buf == 0), the reset the state to 'new'
     770    if (@$stdout_buf == 0)  {
     771        exit 0; # Silently exit if there's nothing to do.  I don't know how we'd ever get here, but let's be safe.
    785772    }
    786773
     
    831818            addFilename (\@files, "PPIMAGE.OUTPUT.MASK", $path_base, $class_id);
    832819            addFilename (\@files, "PPIMAGE.OUTPUT.VARIANCE", $path_base, $class_id);
    833 #            addFilename (\@files, "PPIMAGE.CHIP", $path_base, $class_id);
    834 #            addFilename (\@files, "PPIMAGE.CHIP.MASK", $path_base, $class_id);
    835 #            addFilename (\@files, "PPIMAGE.CHIP.VARIANCE", $path_base, $class_id);
    836820            if ($mode eq "goto_purged") {
    837821                # additional files to remove for 'purge' mode
    838 #                addFilename (\@files, "PPIMAGE.OUTPUT.FPA1", $path_base, $class_id);
    839 #                addFilename (\@files, "PPIMAGE.OUTPUT.FPA2", $path_base, $class_id);
    840                 addFilename (\@files, "PPIMAGE.BIN1", $path_base, $class_id);
    841                 addFilename (\@files, "PPIMAGE.BIN2", $path_base, $class_id);
    842                 addFilename (\@files, "PPIMAGE.JPEG1", $path_base, $class_id);
    843                 addFilename (\@files, "PPIMAGE.JPEG2", $path_base, $class_id);
     822                addFilename (\@files, "PPIMAGE.BIN1", $path_base, $class_id);
     823                addFilename (\@files, "PPIMAGE.BIN2", $path_base, $class_id);
    844824                addFilename (\@files, "PPIMAGE.STATS", $path_base, $class_id);
    845 #                addFilename (\@files, "PPIMAGE.CONFIG", $path_base, $class_id);
    846825            }
    847826
     
    960939        # goto_scrubbed now requires the config file to not be present
    961940        if ($mode eq "goto_cleaned") {
    962             my $config_file = $ipprc->filename("PSASTRO.CONFIG", $path_base);
     941            my $config_file = $ipprc->filename("PSIMAGE.CONFIG", $path_base);
    963942           
    964943            if (!$config_file or ! -e $config_file) {
     
    968947        }
    969948        elsif ($mode eq "goto_scrubbed") {
    970             my $config_file = $ipprc->filename("PSASTRO.CONFIG", $path_base);
     949            my $config_file = $ipprc->filename("PSIMAGE.CONFIG", $path_base);
    971950           
    972951            if ($config_file and -e $config_file) {
     
    978957            my @files = ();
    979958            # delete the temporary image datafiles
    980             addFilename (\@files, "PSASTRO.OUTPUT", $path_base);
     959            # I can't find anything to put here
    981960            if ($mode eq "goto_purged") {
    982961                # additional files to remove for 'purge' mode
    983962                addFilename (\@files, "PPIMAGE.JPEG1", $path_base);
    984963                addFilename (\@files, "PPIMAGE.JPEG2", $path_base);
    985                 addFilename (\@files, "PSASTRO.STATS", $path_base);
    986964            }
    987965            # actual command to delete the files
     
    10921070
    10931071        my $status = 1;
     1072
    10941073#       if ($mode eq "goto_cleaned") {
    10951074#           my $config_file = $ipprc->filename("PPMERGE.CONFIG", $path_base, $stage_id);
     
    11121091#           }
    11131092#       }
     1093
    11141094        if ($status) {
    11151095            # delete the temporary image datafiles
    1116 #           addFilename(\@files, "PPMERGE.OUTPUT", $path_base, $stage_id);
     1096            # There's no convenient way to get the detrend type, so I'm queueing all of them for deletion.
     1097            # I understand that they all point to the same filename right now, but that may not be true in
     1098            # the future.
     1099            addFilename(\@files, "PPMERGE.OUTPUT.MASK", $path_base, $stage_id);
     1100            addFilename(\@files, "PPMERGE.OUTPUT.BIAS", $path_base, $stage_id);
     1101            addFilename(\@files, "PPMERGE.OUTPUT.DARK", $path_base, $stage_id);
     1102            addFilename(\@files, "PPMERGE.OUTPUT.SHUTTER", $path_base, $stage_id);
     1103            addFilename(\@files, "PPMERGE.OUTPUT.FLAT", $path_base, $stage_id);
     1104            addFilename(\@files, "PPMERGE.OUTPUT.FRINGE", $path_base, $stage_id);
     1105           
     1106
    11171107            addFilename(\@files, "PPMERGE.OUTPUT.SIGMA", $path_base, $stage_id);
    11181108            addFilename(\@files, "PPMERGE.OUTPUT.COUNT", $path_base, $stage_id);
     
    11201110            if ($mode eq "goto_purged") {
    11211111                # additional files to remove for 'purge' mode
    1122                 # Nothing?
     1112#               addFilename(\@files, "PPMERGE.OUTPUT", $path_base, $stage_id);
    11231113            }
    11241114
     
    12411231            }
    12421232        } else {
    1243             # since 'camera' has only a single imfile, we can just update the run
    12441233            my $command = "$dettool -updatenormalizedstat -det_id $stage_id -iteration $iteration -class_id $class_id -data_state $error_state";
    12451234            $command .= " -dbname $dbname" if defined $dbname;
     
    12961285if ($stage eq "detrend.norm.imfile") {
    12971286    die "--stage_id required for stage $stage\n" if !$stage_id;
    1298     # this stage uses 'camtool'
     1287    # this stage uses 'dettool'
    12991288    my $dettool = can_run('dettool') or die "Can't find dettool";
    13001289
     
    13411330        if ($status) {
    13421331            my @files = ();
    1343             # delete the temporary image datafiles
    1344             addFilename (\@files, "PPIMAGE.OUTPUT", $path_base);
    1345             addFilename (\@files, "PPIMAGE.OUTPUT.FPA1", $path_base);
    1346             addFilename (\@files, "PPIMAGE.OUTPUT.FPA2", $path_base);
     1332
    13471333            if ($mode eq "goto_purged") {
    13481334                # additional files to remove for 'purge' mode
    1349                 addFilename (\@files, "PPIMAGE.JPEG1", $path_base);
    1350                 addFilename (\@files, "PPIMAGE.JPEG2", $path_base);
     1335                addFilename (\@files, "PPIMAGE.OUTPUT.FPA1", $path_base);
     1336                addFilename (\@files, "PPIMAGE.OUTPUT.FPA2", $path_base);
     1337
     1338                addFilename (\@files, "PPIMAGE.OUTPUT", $path_base);
     1339                addFilename (\@files, "PPIMAGE.STATS", $path_base);
    13511340            }
    13521341            # actual command to delete the files
     
    14261415if ($stage eq "detrend.norm.exp") {
    14271416    die "--stage_id required for stage $stage\n" if !$stage_id;
    1428     # this stage uses 'camtool'
     1417    # this stage uses 'dettool'
    14291418    my $dettool = can_run('dettool') or die "Can't find dettool";
    14301419
     
    14391428        &my_die("Unable to perform dettool: $error_code", "$stage", $stage_id, $error_code);
    14401429    }
    1441     # This is a hack to bomb out until I can diagnose why pantasks wants to keep running this
     1430
    14421431    if (@$stdout_buf == 0) {
    14431432        exit 0;
     
    14581447        # goto_scrubbed now requires the config file to not be present
    14591448        if ($mode eq "goto_cleaned") {
    1460             my $config_file = $ipprc->filename("PSASTRO.CONFIG", $path_base);
     1449            my $config_file = $ipprc->filename("PPIMAGE.CONFIG", $path_base);
    14611450           
    14621451            if (!$config_file or ! -e $config_file) {
     
    14661455        }
    14671456        elsif ($mode eq "goto_scrubbed") {
    1468             my $config_file = $ipprc->filename("PSASTRO.CONFIG", $path_base);
     1457            my $config_file = $ipprc->filename("PPIMAGE.CONFIG", $path_base);
    14691458           
    14701459            if ($config_file and -e $config_file) {
     
    14761465            my @files = ();
    14771466            # delete the temporary image datafiles
    1478 #           addFilename (\@files, "PSASTRO.OUTPUT", $path_base);
    14791467            if ($mode eq "goto_purged") {
    14801468                # additional files to remove for 'purge' mode
    14811469                addFilename (\@files, "PPIMAGE.JPEG1", $path_base);
    14821470                addFilename (\@files, "PPIMAGE.JPEG2", $path_base);
    1483 #               addFilename (\@files, "PSASTRO.STATS", $path_base);
    14841471            }
    14851472            # actual command to delete the files
     
    15761563    }
    15771564
    1578     # if there are no detProcessedImfiles (@$stdout_buf == 0), the reset the state to 'new'
    1579 #     if (@$stdout_buf == 0)  {
    1580 #       my $command = "$dettool -det_id $stage_id -updateresidimfile -data_state new";
    1581 #       $command .= " -dbname $dbname" if defined $dbname;
    1582 
    1583 #       my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    1584 #           run(command => $command, verbose => $verbose);
    1585 #       unless ($success) {
    1586 #           $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    1587 #           &my_die("Unable to perform dettool: $error_code", "$stage", $stage_id, $error_code);
    1588 #       }
    1589 #       exit 0;
    1590 #     }
    1591    
    15921565    if (@$stdout_buf == 0) {
    1593         exit 0; #silently abort. I need to fix this for propers
     1566        exit 0;
    15941567    }
    15951568
     
    16391612            # delete the temporary image datafiles
    16401613            addFilename (\@files, "PPIMAGE.OUTPUT", $path_base, $class_id);
    1641 #            addFilename (\@files, "PPIMAGE.CHIP", $path_base, $class_id);
    1642 #            addFilename (\@files, "PPIMAGE.CHIP.MASK", $path_base, $class_id);
    1643 #            addFilename (\@files, "PPIMAGE.CHIP.VARIANCE", $path_base, $class_id);
    16441614            if ($mode eq "goto_purged") {
    16451615                # additional files to remove for 'purge' mode
    1646 #                addFilename (\@files, "PPIMAGE.OUTPUT.FPA1", $path_base, $class_id);
    1647 #                addFilename (\@files, "PPIMAGE.OUTPUT.FPA2", $path_base, $class_id);
    1648                 addFilename (\@files, "PPIMAGE.BIN1", $path_base, $class_id);
    1649                 addFilename (\@files, "PPIMAGE.BIN2", $path_base, $class_id);
    1650                 addFilename (\@files, "PPIMAGE.JPEG1", $path_base, $class_id);
    1651                 addFilename (\@files, "PPIMAGE.JPEG2", $path_base, $class_id);
     1616                addFilename (\@files, "PPIMAGE.BIN1", $path_base, $class_id);
     1617                addFilename (\@files, "PPIMAGE.BIN2", $path_base, $class_id);
    16521618                addFilename (\@files, "PPIMAGE.STATS", $path_base, $class_id);
    1653 #                addFilename (\@files, "PPIMAGE.CONFIG", $path_base, $class_id);
    16541619            }
    16551620
     
    17581723        my $iteration = $exp->{iteration};
    17591724        my $path_base = $exp->{path_base};
    1760 
     1725#       my $class_id  = $exp->{class_id}
    17611726        my $status = 1;
    17621727        # don't clean up unless the data needed to update is available
    17631728        # goto_scrubbed now requires the config file to not be present
    17641729        if ($mode eq "goto_cleaned") {
    1765             my $config_file = $ipprc->filename("PSASTRO.CONFIG", $path_base);
     1730            my $config_file = $ipprc->filename("PPIMAGE.CONFIG", $path_base);
    17661731           
    17671732            if (!$config_file or ! -e $config_file) {
     
    17711736        }
    17721737        elsif ($mode eq "goto_scrubbed") {
    1773             my $config_file = $ipprc->filename("PSASTRO.CONFIG", $path_base);
     1738            my $config_file = $ipprc->filename("PPIMAGE.CONFIG", $path_base);
    17741739           
    17751740            if ($config_file and -e $config_file) {
     
    17811746            my @files = ();
    17821747            # delete the temporary image datafiles
    1783             addFilename (\@files, "PSASTRO.OUTPUT", $path_base);
    17841748            if ($mode eq "goto_purged") {
    17851749                # additional files to remove for 'purge' mode
    1786                 addFilename (\@files, "PPIMAGE.JPEG1", $path_base);
    1787                 addFilename (\@files, "PPIMAGE.JPEG2", $path_base);
    1788                 addFilename (\@files, "PSASTRO.STATS", $path_base);
     1750                addFilename (\@files, "PPIMAGE.JPEG1", $path_base);#, $class_id);
     1751                addFilename (\@files, "PPIMAGE.JPEG2", $path_base);#, $class_id);
    17891752            }
    17901753            # actual command to delete the files
     
    18761839    foreach my $file (@$files) {
    18771840        print STDERR "unlinking $file\n";
    1878         print TMPLOG "$file\n";
     1841        print TMPLOG "$stage $stage_id $file";
     1842        my $ff = $file;
     1843        $ff =~ s%^file://%%;
     1844        unless (-e $ff) {
     1845            print TMPLOG "\t File not found\n";
     1846        }
     1847        else {
     1848            print TMPLOG "\n";
     1849        }
     1850
    18791851        $ipprc->file_delete($file);
    18801852    }
  • branches/czw_branch/cleanup/ippScripts/scripts/stack_skycell.pl

    r23745 r25050  
    6565
    6666my $ipprc = PS::IPP::Config->new() or my_die( "Unable to set up", $stack_id, $PS_EXIT_CONFIG_ERROR ); # IPP configuration
     67$| = 1;
     68print "I've set up: $stack_id\n";
    6769
    6870# XXX camera is not known here; cannot use filerules...
     
    107109&my_die("Stack list contains less than two elements", $stack_id, $PS_EXIT_SYS_ERROR) unless
    108110    scalar @$files >= 2;
     111
     112print "I've loaded my inputs: $stack_id\n";
    109113
    110114# Parse the list of input files to get the tesselation, skycell identifiers and camera
     
    146150}
    147151
     152print "I've configured everything: $stack_id\n";
     153
    148154# Generate MDC file with the inputs
    149155my $tess_base = basename($tess_id);
     
    180186    print $listFile "END\n\n";
    181187}
     188
     189print "I've checked everything: $stack_id\n";
    182190
    183191# Get the output filenames
     
    200208
    201209my $cmdflags;
     210
    202211
    203212# Perform stacking
     
    265274#       &my_die("Couldn't find expected output file: $bin2Name",    $stack_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($bin2Name);
    266275    }
    267 
     276   
     277    print "I've stacked $listName: $stack_id\n";
    268278}
    269279
     
    298308}
    299309
     310print "I've updated teh database: $stack_id\n";
     311
    300312
    301313my $my_die_called = 0;
     
    372384}
    373385
     386print "I've reached the end of processing with a code of $?: $stack_id\n";
    374387
    375388END {
  • branches/czw_branch/cleanup/ippTools/share/dettool_pendingcleanup_normalizedimfile.sql

    r24972 r25050  
    1 SELECT
     1SELECT DISTINCT
    22    detNormalizedImfile.*,
    33    rawExp.camera
  • branches/czw_branch/cleanup/ippTools/share/dettool_pendingcleanup_stacked.sql

    r24972 r25050  
    1 SELECT
     1SELECT DISTINCT
    22    detStackedImfile.*,
    33    rawExp.camera
  • branches/czw_branch/cleanup/ippconfig/recipes/psastro.config

    r24654 r25050  
    33PSASTRO.ONLY.REFSTARS      BOOL FALSE  # skip all but refstar matches
    44PSASTRO.SAVE.REFMATCH      BOOL FALSE  # save refstar matches as table in output smf file
     5
     6# select which WCS style to use on output images.
     7PSASTRO.WCS.USECDKEYS    BOOL FALSE
    58
    69# perform single-chip astrometry?
  • branches/czw_branch/cleanup/psModules/src/astrom/pmAstrometryWCS.c

    r24951 r25050  
    289289    // test the CDELTi varient
    290290    if (pcKeys) {
    291         wcs->useCDkeys = 0;
     291        wcs->wcsCDkeys = 0;
    292292        wcs->cdelt1 = psMetadataLookupF64 (&status, header, "CDELT1");
    293293        wcs->cdelt2 = psMetadataLookupF64 (&status, header, "CDELT2");
     
    335335    // test the CDi_j varient
    336336    if (cdKeys) {
    337         wcs->useCDkeys = 1;
     337        wcs->wcsCDkeys = 1;
    338338        wcs->trans->x->coeff[1][0] = psMetadataLookupF64 (&status, header, "CD1_1"); // == PC1_1
    339339        wcs->trans->x->coeff[0][1] = psMetadataLookupF64 (&status, header, "CD1_2"); // == PC1_2
     
    377377    // XXX make it optional to write out CDi_j terms, or other versions
    378378    // apply CDELT1,2 (degrees / pixel) to yield PCi,j terms of order unity
    379     if (!(wcs->useCDkeys)) {
     379    if (!(wcs->wcsCDkeys)) {
    380380
    381381      double cdelt1 = wcs->cdelt1;
     
    419419      }
    420420    }
    421     if (wcs->useCDkeys) {
     421    if (wcs->wcsCDkeys) {
    422422     
    423423      psMetadataAddF64 (header, PS_LIST_TAIL, "CD1_1", PS_META_REPLACE, "", wcs->trans->x->coeff[1][0]);
     
    555555        fpa->toSky->R -= 2.0*M_PI;
    556556
     557    fpa->wcsCDkeys = wcs->wcsCDkeys;
     558
    557559    psTrace ("psastro", 5, "toFPA: %f %f  (%f,%f),(%f,%f)\n",
    558560             chip->toFPA->x->coeff[0][0], chip->toFPA->y->coeff[0][0],
     
    702704    wcs->cdelt2 = hypot (wcs->trans->y->coeff[1][0], wcs->trans->y->coeff[0][1]);
    703705
     706    wcs->wcsCDkeys = fpa->wcsCDkeys;
    704707    psFree (toTPA);
    705708
     
    942945    wcs->trans = psPlaneTransformAlloc (nXorder, nYorder);
    943946    wcs->toSky = NULL;
    944     wcs->useCDkeys = 0;
     947    wcs->wcsCDkeys = 0;
    945948
    946949    memset (wcs->ctype1, 0, PM_ASTROM_WCS_TYPE_SIZE);
  • branches/czw_branch/cleanup/psModules/src/astrom/pmAstrometryWCS.h

    r24951 r25050  
    2323    double crpix1, crpix2;
    2424    double cdelt1, cdelt2;
    25     bool useCDkeys;
     25    bool wcsCDkeys;
    2626    psProjection *toSky;
    2727    psPlaneTransform *trans;
  • branches/czw_branch/cleanup/psModules/src/camera/pmFPA.h

    r21363 r25050  
    4848    psPlaneTransform *toTPA;  ///< Transformation from focal plane to tangent plane, or NULL
    4949    psProjection *toSky;         ///< Projection from tangent plane to sky, or NULL
     50    bool wcsCDkeys;
    5051    // Information
    5152    psMetadata *concepts;               ///< FPA-level concepts
  • branches/czw_branch/cleanup/psastro/src/psastroChipAstrom.c

    r24036 r25050  
    9797                // write the elapsed time here; this will be updated in psastroMosaicAstrometry, if called
    9898                psMetadataAddF32 (updates, PS_LIST_TAIL, "DT_ASTR", PS_META_REPLACE, "elapsed psastro time", psTimerMark ("psastroAnalysis"));
    99 
     99               
     100                fpa->wcsCDkeys = psMetadataLookupBool(&status, recipe , "PSASTRO.WCS.USECDKEYS");
    100101                pmAstromWriteWCS (updates, fpa, chip, NONLIN_TOL);
    101102
Note: See TracChangeset for help on using the changeset viewer.