Changeset 36018 for trunk/PS-IPP-PStamp
- Timestamp:
- Aug 23, 2013, 1:31:54 PM (13 years ago)
- Location:
- trunk/PS-IPP-PStamp/lib/PS/IPP/PStamp
- Files:
-
- 2 edited
-
Job.pm (modified) (6 diffs)
-
RequestFile.pm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/PS-IPP-PStamp/lib/PS/IPP/PStamp/Job.pm
r36010 r36018 774 774 } 775 775 776 776 777 if ($skycells) { 778 # We have a list of skycells. Find matching projection cells. 779 780 #list of projection_cells that we've included 781 my %projection_cells_found; 777 782 foreach my $skycell (@$skycells) { 778 783 my $tess_id = $skycell->{tess_id}; … … 781 786 my $projection_cell = skycell_id_to_projection_cell($skycell_id); 782 787 783 print "$tess_id $skycell_id $projection_cell\n"; 784 my $command = "$stacktool -dbname $imagedb -summary -tess_id $tess_id -projection_cell $projection_cell"; 788 # only need to include a projection cell once 789 next if $projection_cells_found{$projection_cell}; 790 791 $projection_cells_found{$projection_cell} = 1; 792 793 # print "$tess_id $skycell_id $projection_cell\n"; 794 795 my $command = "$stacktool -dbname $imagedb -summary -tess_id $tess_id"; 796 $command .= " -projection_cell $projection_cell"; 785 797 786 798 $command .= " -filter $filter" if $filter; … … 791 803 } 792 804 } 793 # XXX: Lookup stackSummaries that match794 } 805 } 806 795 807 if ($results) { 796 808 foreach my $summary (@$results) { … … 799 811 800 812 # we need to flesh out the hashes returned with values that the parser expects 813 $summary->{stage} = 'stack_summary'; 801 814 $summary->{component} = $projection_cell; 802 815 $summary->{stage_id} = $summary->{sass_id}; 803 # $summary->{image} = "$path_base.$projection_cell.image.b1.fits"; 804 $summary->{image} = "$path_base.$projection_cell"; 816 $summary->{path_base} = "$path_base.$projection_cell"; 817 818 # The stack_summary stage doesn't follow the usual ipp conventions for file rules 819 # and path_base. We leave it up to the program that runs the job to handle this. 820 # However, the parser uses the image parameter to set the job's outputBase (by removing the .fits) 821 # so we need to set it. Just use the new path_base. 822 $summary->{image} = $summary->{path_base}; 805 823 $summary->{state} = 'full'; 806 824 $summary->{data_state} = 'full'; … … 809 827 $summary->{row_index} = []; 810 828 push @{$summary->{row_index}}, 0; 811 # XXX: is there anything else? 829 830 # XXX: Are there any other required parameters? 812 831 # TODO: create a function to validate the components returned 813 # and make sure that any required elements are there 832 # and make sure that any required elements are there. 814 833 } 815 834 } … … 1970 1989 } 1971 1990 1972 # not particularly elegant 1991 # Convert from skycell_id to projection_cell 1992 # This code is not particularly elegant but I think that it matches the SQL used 1993 # to create stackAssocations does. 1994 1973 1995 sub skycell_id_to_projection_cell { 1974 1996 my $skycell_id = shift; 1997 1998 # split skycell_id into '.' separated components 1975 1999 my @strs = split '\.', $skycell_id; 1976 2000 1977 2001 my $num = scalar @strs; 2002 2003 # projection_cell is 'skycell_id' plus all .num values except the last one 1978 2004 my $projection_cell = $strs[0]; 1979 2005 for (my $i=1; $i < $num - 1; $i++) { -
trunk/PS-IPP-PStamp/lib/PS/IPP/PStamp/RequestFile.pm
r35466 r36018 29 29 $PSTAMP_SELECT_BACKMDL 30 30 $PSTAMP_SELECT_JPEG 31 $PSTAMP_SELECT_EXP 32 $PSTAMP_SELECT_NUM 31 33 $PSTAMP_SELECT_UNCOMPRESSED 32 34 $PSTAMP_SELECT_INVERSE … … 71 73 our $PSTAMP_SELECT_BACKMDL = 32; 72 74 our $PSTAMP_SELECT_JPEG = 64; 73 # unused 128 74 # unused 256 75 our $PSTAMP_SELECT_EXP = 128; 76 our $PSTAMP_SELECT_NUM = 256; 75 77 our $PSTAMP_SELECT_UNCOMPRESSED = 512; 76 78 our $PSTAMP_SELECT_INVERSE = 1024;
Note:
See TracChangeset
for help on using the changeset viewer.
