Changeset 30147 for trunk/ippToPsps/perl
- Timestamp:
- Dec 23, 2010, 2:50:34 PM (16 years ago)
- Location:
- trunk/ippToPsps/perl
- Files:
-
- 5 edited
-
ippToPsps/Batch.pm (modified) (3 diffs)
-
ippToPsps/DetectionBatch.pm (modified) (3 diffs)
-
ippToPsps/InitBatch.pm (modified) (3 diffs)
-
ippToPsps/StackBatch.pm (modified) (4 diffs)
-
pspsSchema2xml.pl (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/perl/ippToPsps/Batch.pm
r29646 r30147 126 126 $self->{_surveyType} = $self->getSurveyTypeFromDistGroup(); 127 127 128 # can we run ippToPsps?129 $self->{_ippToPsps} = can_run('ippToPsps') or130 (warn "Can't find 'ippToPsps' program" and exit($PS_EXIT_CONFIG_ERROR));131 132 128 # set up batch output paths 133 129 $self->init(); … … 139 135 140 136 return $self; 137 } 138 139 ######################################################################################## 140 # 141 # Sets to program and checks we can run it 142 # 143 ######################################################################################## 144 sub setProgram { 145 my ($self, $program) = @_; 146 147 # can we run ippToPsps? 148 $self->{program} = can_run($program) or 149 (warn "Can't find '$program' program" and exit($PS_EXIT_CONFIG_ERROR)); 141 150 } 142 151 … … 197 206 my ($self, $input, $resultsFilePath) = @_; 198 207 199 # build command 200 my $command = "$self->{_ippToPsps}"; 201 $command .= " -input $input"; 202 $command .= " -output $self->{_batchDir}"; 203 if (defined $self->{_dvoPath} ) {$command .= " -D CATDIR $self->{_dvoPath}";} 204 $command .= " -config ../config"; # TODO 205 $command .= " -id $self->{_expId}"; 206 $command .= " -expname $self->{_expName}"; 207 $command .= " -survey $self->{_surveyType}"; 208 $command .= " -batch $self->{_type}"; 209 $command .= " -results $resultsFilePath"; 210 211 # run command 212 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) 213 = run(command => $command, verbose => $self->{_verbose}); 214 215 return $success; 208 my $thisFunction = (caller(0))[3]; 209 print "* ERROR: '$thisFunction' not implemented\n"; 216 210 } 217 211 -
trunk/ippToPsps/perl/ippToPsps/DetectionBatch.pm
r29997 r30147 8 8 use File::Temp qw(tempfile); 9 9 use XML::LibXML; 10 use IPC::Cmd 0.36 qw( can_run run ); 10 11 11 12 use ippToPsps::Batch; … … 63 64 ); 64 65 66 $self->setProgram("detectionbatch"); 67 65 68 bless $self, $class; 66 69 $self->process(); … … 105 108 ####################################################################################### 106 109 # 110 # runs the ippToPsps program 111 # 112 ####################################################################################### 113 sub runProgram { 114 my ($self, $input, $resultsFilePath) = @_; 115 116 # build command 117 my $command = "$self->{program}"; 118 $command .= " -input $input"; 119 $command .= " -output $self->{_batchDir}"; 120 if (defined $self->{_dvoPath} ) {$command .= " -D CATDIR $self->{_dvoPath}";} 121 $command .= " -config ../config"; # TODO 122 $command .= " -survey $self->{_surveyType}"; 123 $command .= " -results $resultsFilePath"; 124 $command .= " -expid $self->{_expId}"; 125 $command .= " -expname $self->{_expName}"; 126 127 # run command 128 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) 129 = run(command => $command, verbose => $self->{_verbose}); 130 131 return $success; 132 } 133 134 135 ####################################################################################### 136 # 107 137 # - Reads results from processing (min/max obj ID etc) 108 138 # - writes to Db -
trunk/ippToPsps/perl/ippToPsps/InitBatch.pm
r29212 r30147 8 8 use File::Temp qw(tempfile); 9 9 use XML::LibXML; 10 use IPC::Cmd 0.36 qw( can_run run ); 10 11 11 12 use ippToPsps::Batch; … … 37 38 $_[7]); # save_temps 38 39 40 $self->setProgram("initbatch"); 41 39 42 bless $self, $class; 40 43 $self->process(); … … 52 55 return "NULL"; 53 56 } 57 58 ####################################################################################### 59 # 60 # runs the ippToPsps program 61 # 62 ####################################################################################### 63 sub runProgram { 64 my ($self, $input, $resultsFilePath) = @_; 65 66 # build command 67 my $command = "$self->{program}"; 68 $command .= " -output $self->{_batchDir}"; 69 $command .= " -config ../config"; # TODO 70 $command .= " -results $resultsFilePath"; 71 72 # run command 73 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) 74 = run(command => $command, verbose => $self->{_verbose}); 75 76 return $success; 77 } 78 54 79 55 80 ####################################################################################### -
trunk/ippToPsps/perl/ippToPsps/StackBatch.pm
r29236 r30147 8 8 use File::Temp qw(tempfile); 9 9 use XML::LibXML; 10 use IPC::Cmd 0.36 qw( can_run run ); 10 11 11 12 use ippToPsps::Batch; … … 62 63 $_[11] # save_temps 63 64 ); 64 65 66 $self->setProgram("stackbatch"); 65 67 66 68 $self->{_skyId} = $_[1]; … … 78 80 sub createInputFileList { 79 81 my ($self, $inputFile) = @_; 82 83 # TODO hardcode demo file for now 84 print $inputFile "/data/ippc18.0/home/rhenders/psphotstack.v3.001.cmf\n"; 85 return 1; 86 80 87 81 88 my ($nebPath, $numInputs); … … 98 105 return 1; 99 106 } 107 108 ####################################################################################### 109 # 110 # runs the ippToPsps program 111 # 112 ####################################################################################### 113 sub runProgram { 114 my ($self, $input, $resultsFilePath) = @_; 115 116 # build command 117 my $command = "$self->{program}"; 118 $command .= " -input $input"; 119 $command .= " -output $self->{_batchDir}"; 120 if (defined $self->{_dvoPath} ) {$command .= " -D CATDIR $self->{_dvoPath}";} 121 $command .= " -config ../config"; # TODO 122 $command .= " -survey $self->{_surveyType}"; 123 $command .= " -results $resultsFilePath"; 124 $command .= " -skycellid $self->{_expId}"; 125 126 # run command 127 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) 128 = run(command => $command, verbose => $self->{_verbose}); 129 130 return $success; 131 } 132 100 133 101 134 ####################################################################################### -
trunk/ippToPsps/perl/pspsSchema2xml.pl
r29304 r30147 30 30 pod2usage( 31 31 -msg => "\n Required options:\n\n". 32 "- -schema<path to PSPS schema>\n".33 "- -type <init|det|diff|stack|object>\n".32 "-s <path to PSPS schema>\n". 33 "-t <init|detection|diff|stack|object>\n". 34 34 -exitval => 3 35 35 ) unless … … 37 37 defined $type; 38 38 39 if ($type ne "init" && $type ne "det" && $type ne "diff" && $type ne "stack" && $type ne "object" ) { 39 if ( 40 $type ne "init" && 41 $type ne "detection" && 42 $type ne "diff" && 43 $type ne "stack" && 44 $type ne "object" ) { 40 45 41 46 print "Don't understand type '$type'\n"; … … 43 48 } 44 49 45 my $enumsHeader = "ippToPsps".ucfirst($type)."Enums";50 my $enumsHeader = ucfirst($type)."BatchEnums"; 46 51 open(OUT, ">".$enumsHeader.".h") or die("Error"); 47 52 … … 61 66 62 67 if ($type eq "init") {createInit();} 63 elsif ($type eq "det ") {createDetections();}68 elsif ($type eq "detection") {createDetections();} 64 69 elsif ($type eq "diff") {createDiffs();} 65 70 elsif ($type eq "stack") {createStacks();}
Note:
See TracChangeset
for help on using the changeset viewer.
