IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 20152


Ignore:
Timestamp:
Oct 14, 2008, 3:33:43 PM (18 years ago)
Author:
bills
Message:

compute fileset registration data for mask and weight images

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pstamp/scripts/pstamp_job_run.pl

    r19221 r20152  
    1313use File::Basename;
    1414use Digest::MD5::File qw( file_md5_hex );
    15 
    16 # values for OPTION_MASK
    17 # XXX put these in a module
    18 use constant PSTAMP_SELECT_IMAGE  => 1;
    19 use constant PSTAMP_SELECT_MASK   => 2;
    20 use constant PSTAMP_SELECT_WEIGHT => 4;
    21 
     15use PStamp::RequestFile qw( :standard );
    2216
    2317my $verbose;
     
    124118        open F, ">$reglist" or die "can't open $reglist for output";
    125119
    126         # we are assuming an interface with ppstamp here.
     120        # figure out what output images we should expect
     121
     122        # Note: we are assuming the contents of the filerules here.
    127123        my @extensions = ( "fits", "mk.fits", "wt.fits");
    128124
    129         # XXX TODO: add mask of expected file types to pstampJob so we know what to expect
    130 
    131         my $output_mask = PSTAMP_SELECT_IMAGE;
    132         my $m = 1;  # XXX we're getting a bit intimate with the bit field definitions here. do better use a hash
     125        # we always require an image
     126        my $output_mask = $PSTAMP_SELECT_IMAGE;
     127
     128        # we search the argString for -mask and -weight.
     129        # searching the arg string allows us to avoid adding a column in pstampJob
     130        # XXX yeah but does this make us susceptible to user input fouling us up?
     131        # For example, what if somebody sets the output base to file-mask-weight
     132        # TODO: clean this up
     133        $output_mask |= $PSTAMP_SELECT_MASK   if ($argString =~ /-mask/);
     134        $output_mask |= $PSTAMP_SELECT_WEIGHT if ($argString =~ /-weight/);
     135
     136        # XXX we're getting a bit intimate with the bit field definitions here.
     137        # do better use a hash
     138
     139        my $m = 1;
    133140        foreach my $extension (@extensions) {
    134141            my $do_this_one = $m & $output_mask;
     
    141148            my $path  = "${outputBase}.${extension}";
    142149
    143             # XXX is pstamp always the right file type, if not where can we get the right one?
     150            # XXX is pstamp always the right file type, if not where do we get the right one?
    144151            print F file_registration_line($filename, $path, "pstamp") . "\n";
    145152        }
     
    182189exit $jobStatus;
    183190
     191# create a string to be passed as input to dsreg when registering this file in a fileset
    184192# XXX move this to a module so it can be shared
     193
    185194sub file_registration_line {
    186195    my $filename = shift;
Note: See TracChangeset for help on using the changeset viewer.