Changeset 30147
- Timestamp:
- Dec 23, 2010, 2:50:34 PM (15 years ago)
- Location:
- trunk/ippToPsps
- Files:
-
- 17 added
- 15 deleted
- 6 edited
-
perl/ippToPsps/Batch.pm (modified) (3 diffs)
-
perl/ippToPsps/DetectionBatch.pm (modified) (3 diffs)
-
perl/ippToPsps/InitBatch.pm (modified) (3 diffs)
-
perl/ippToPsps/StackBatch.pm (modified) (4 diffs)
-
perl/pspsSchema2xml.pl (modified) (4 diffs)
-
src/Batch.c (added)
-
src/Batch.h (added)
-
src/Config.c (added)
-
src/Config.h (added)
-
src/DetectionBatch.c (added)
-
src/DetectionBatch.h (added)
-
src/DetectionBatchEnums.h (added)
-
src/DiffBatchEnums.h (added)
-
src/DifferenceBatch.c (added)
-
src/InitBatch.c (added)
-
src/InitBatch.h (added)
-
src/Makefile.am (modified) (1 diff)
-
src/StackBatch.c (added)
-
src/StackBatch.h (added)
-
src/StackBatchEnums.h (added)
-
src/Version.c (added)
-
src/VersionDefinitions.h (added)
-
src/VersionDefinitions.h.in (added)
-
src/ippToPsps.c (deleted)
-
src/ippToPsps.h (deleted)
-
src/ippToPspsBatchDetection.c (deleted)
-
src/ippToPspsBatchDifference.c (deleted)
-
src/ippToPspsBatchInit.c (deleted)
-
src/ippToPspsBatchStack.c (deleted)
-
src/ippToPspsBatchTest.c (deleted)
-
src/ippToPspsConfig.c (deleted)
-
src/ippToPspsConfig.h (deleted)
-
src/ippToPspsDetEnums.h (deleted)
-
src/ippToPspsDiffEnums.h (deleted)
-
src/ippToPspsTestEnums.h (deleted)
-
src/ippToPspsVersion.c (deleted)
-
src/ippToPspsVersionDefinitions.h.in (deleted)
-
src/main.c (deleted)
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();} -
trunk/ippToPsps/src/Makefile.am
r27809 r30147 14 14 15 15 # Force recompilation of ippToPspsVersion.c, since it gets the version information 16 ippToPspsVersion.c: ippToPspsVersionDefinitions.h17 ippToPspsVersionDefinitions.h: ippToPspsVersionDefinitions.h.in FORCE18 -$(RM) ippToPspsVersionDefinitions.h19 $(SED) -e "s|@IPPTOPSPS_VERSION@|\"$(IPPTOPSPS_VERSION)\"|" -e "s|@IPPTOPSPS_BRANCH@|\"$(IPPTOPSPS_BRANCH)\"|" -e "s|@IPPTOPSPS_SOURCE@|\"$(IPPTOPSPS_SOURCE)\"|" ippToPspsVersionDefinitions.h.in > ippToPspsVersionDefinitions.h16 Version.c: VersionDefinitions.h 17 VersionDefinitions.h: VersionDefinitions.h.in FORCE 18 -$(RM) VersionDefinitions.h 19 $(SED) -e "s|@IPPTOPSPS_VERSION@|\"$(IPPTOPSPS_VERSION)\"|" -e "s|@IPPTOPSPS_BRANCH@|\"$(IPPTOPSPS_BRANCH)\"|" -e "s|@IPPTOPSPS_SOURCE@|\"$(IPPTOPSPS_SOURCE)\"|" VersionDefinitions.h.in > VersionDefinitions.h 20 20 FORCE: ; 21 21 22 bin_PROGRAMS = ippToPsps 22 # all the programs we create 23 bin_PROGRAMS = initbatch detectionbatch stackbatch 23 24 24 ippToPsps_CFLAGS = $(IPPTOPSPS_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS) -I/usr/include/libxml225 ippToPsps_LDFLAGS = $(IPPTOPSPS_LIBS) $(PSMODULE_LIBS) $(PSLIB_LIBS) -lxml226 25 27 ippToPsps_SOURCES = \ 28 main.c \ 29 ippToPsps.c \ 30 ippToPspsVersion.c \ 31 ippToPspsConfig.c \ 32 ippToPspsBatchTest.c \ 33 ippToPspsBatchInit.c \ 34 ippToPspsBatchDetection.c \ 35 ippToPspsBatchStack.c \ 36 ippToPspsBatchDifference.c 26 # initbatch 27 initbatch_CFLAGS = $(IPPTOPSPS_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS) -I/usr/include/libxml2 28 initbatch_LDFLAGS = $(IPPTOPSPS_LIBS) $(PSMODULE_LIBS) $(PSLIB_LIBS) -lxml2 29 initbatch_SOURCES = \ 30 InitBatch.c \ 31 Batch.c \ 32 Version.c \ 33 Config.c 37 34 38 include_HEADERS = \ 39 ippToPsps.h \ 40 ippToPspsConfig.h \ 41 ippToPspsDetEnums.h \ 42 ippToPspsDiffEnums.h \ 43 ippToPspsStackEnums.h 35 # detectionbatch 36 detectionbatch_CFLAGS = $(IPPTOPSPS_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS) -I/usr/include/libxml2 37 detectionbatch_LDFLAGS = $(IPPTOPSPS_LIBS) $(PSMODULE_LIBS) $(PSLIB_LIBS) -lxml2 38 detectionbatch_SOURCES = \ 39 DetectionBatch.c \ 40 Batch.c \ 41 Version.c \ 42 Config.c 43 44 # stackbatch 45 stackbatch_CFLAGS = $(IPPTOPSPS_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS) -I/usr/include/libxml2 46 stackbatch_LDFLAGS = $(IPPTOPSPS_LIBS) $(PSMODULE_LIBS) $(PSLIB_LIBS) -lxml2 47 stackbatch_SOURCES = \ 48 StackBatch.c \ 49 Batch.c \ 50 Version.c \ 51 Config.c 44 52 45 53 clean-local:
Note:
See TracChangeset
for help on using the changeset viewer.
