Changeset 15677
- Timestamp:
- Nov 21, 2007, 2:33:39 PM (18 years ago)
- Location:
- trunk/PS-IPP-Config
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/PS-IPP-Config/Build.PL
r14745 r15677 13 13 'File::Spec' => '0.87', 14 14 'Getopt::Long' => '2.33', 15 'IPC::Cmd' => '0.36', 15 16 'PS::IPP::Metadata::Config' => '1.00', 16 17 'Statistics::Descriptive' => '2.6', -
trunk/PS-IPP-Config/MANIFEST
r14896 r15677 2 2 LICENSE 3 3 lib/PS/IPP/Config.pm 4 lib/PS/IPP/Operations.pm 4 5 lib/PS/IPP/Metadata/List.pm 5 6 lib/PS/IPP/Metadata/Stats.pm -
trunk/PS-IPP-Config/lib/PS/IPP/Operations.pm
r15645 r15677 1 1 # Copyright (c) 2007 Paul Price 2 2 # 3 # $Id: Operations.pm,v 1. 1 2007-11-17 02:35:59 price Exp $3 # $Id: Operations.pm,v 1.2 2007-11-22 00:33:39 price Exp $ 4 4 5 5 package PS::IPP::Operations; … … 12 12 use Carp qw( carp ); 13 13 use IPC::Cmd 0.36 qw( can_run run ); 14 use PS::IPP::Config qw( caturi ); 14 15 15 # Allow exporting of function 16 # Allow exporting of functions 16 17 use base qw( Exporter ); 17 our @EXPORT_OK = qw( generate_skycells ); 18 our @EXPORT_OK = qw( 19 skycell_file 20 generate_skycells 21 ); 18 22 19 23 #$::RD_TRACE = 1; … … 21 25 #use Data::Dumper; 22 26 23 # Extract skycells to images 24 sub generate_skycells { 25 my $ipprc = shift; # Configuration object 26 my $tess_ids = shift; # List of tessellation ids 27 my $skycell_ids = shift; # List of skycell ids 27 sub skycell_file 28 { 29 my $tess_id = shift; # Tessellation identifier 30 my $skycell_id = shift; # Skycell identifier 28 31 my $workdir = shift; # Working directory 29 32 30 if (scalar @$tess_ids != scalar @$skycell_ids) { 31 carp "Lengths of tess_id and skycell_id don't match"; 33 unless (defined $tess_id and defined $skycell_id and defined $workdir) { 34 carp "Input parameters not defined"; 35 return 0; 36 } 37 38 return caturi($workdir, "tess_" . $tess_id, "sky_" . $skycell_id, $skycell_id ); 39 } 40 41 42 43 # Extract skycells to images 44 sub generate_skycells 45 { 46 my $ipprc = shift; # Configuration object 47 my $tess_id = shift; # Tessellation identifier 48 my $skycells = shift; # List of skycell ids 49 my $workdir = shift; # Working directory 50 51 unless (defined $ipprc and defined $tess_id and defined $skycells and defined $workdir) { 52 carp "Input parameters not defined."; 32 53 return 0; 33 54 } … … 38 59 (carp "Can't get list of tessellations." and return 0); # Hash of defined tessellations 39 60 40 for (my $i = 0; $i < scalar @$tess_ids; $i++) { 41 my $tess_id = $$tess_ids[$i]; # Tessellation identifier 42 my $skycell_id = $$skycell_ids[$i]; # Skycell identifier 61 ### Because DVO doesn't use psModules, it doesn't understand Nebulous --- check 62 my $scheme = file_scheme($$tessellations{$tess_id}); # The scheme, e.g., file, path, neb 63 if (defined $scheme and lc($scheme) eq 'neb') { 64 carp "Tessellation $tess_id refers to a Nebulous path: $$tessellations{$tess_id}"; 65 return 0; 66 } 67 68 my $tess_dir = $ipprc->convert_filename_absolute( $$tessellations{$tess_id} ); # Catdir for DVO 43 69 44 ### Because DVO doesn't use psModules, it doesn't understand Nebulous --- check 45 my $scheme = file_scheme($$tessellations{$tess_id}); # The scheme, e.g., file, path, neb 46 if (defined $scheme and lc($scheme) eq 'neb') { 47 carp "Tessellation $tess_id refers to a Nebulous path: $$tessellations{$tess_id}"; 48 return 0; 49 } 50 51 my $tess_dir = $ipprc->convert_filename_absolute( $$tessellations{$tess_id} ); # Catdir for DVO 52 my $skyDir = caturi($workdir, "tess_" . $tess_id, "sky_" . $skycell_id ); # Directory for output 53 70 foreach my $skycell_id ( @$skycells ) { 54 71 # Extract the skycell to an image 55 my $skyFile = $ipprc->file_prepare( $skycell_id, $skyDir);72 my $skyFile = skycell_file($tess_id, $skycell_id, $workdir); 56 73 unless ($ipprc->file_exists( $skyFile )) { 57 74 my $skyFileResolved = $ipprc->file_create( $skyFile ); # Resolved filename, for Nebulous
Note:
See TracChangeset
for help on using the changeset viewer.
