Changeset 23229
- Timestamp:
- Mar 8, 2009, 4:50:46 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 51 edited
- 4 copied
-
. (modified) (1 prop)
-
Ohana/src/addstar/doc/ps1.tessellation.tamas.pdf (copied) (copied from branches/eam_branches/eam_branch_20090303/Ohana/src/addstar/doc/ps1.tessellation.tamas.pdf )
-
Ohana/src/addstar/src/sky_tessalation.c (modified) (5 diffs)
-
dbconfig/changes.txt (modified) (2 diffs)
-
dbconfig/config.md (modified) (1 diff)
-
dbconfig/det.md (modified) (2 diffs)
-
doc/misc/detnorm.rework.txt (copied) (copied from branches/eam_branches/eam_branch_20090303/doc/misc/detnorm.rework.txt )
-
ippScripts/scripts/detrend_norm_apply.pl (modified) (1 diff)
-
ippScripts/scripts/detrend_norm_calc.pl (modified) (2 diffs)
-
ippScripts/scripts/detrend_resid_exp.pl (modified) (7 diffs)
-
ippScripts/scripts/ipp_cleanup.pl (modified) (7 diffs)
-
ippTools/scripts/test_create_detrend.sql (copied) (copied from branches/eam_branches/eam_branch_20090303/ippTools/scripts/test_create_detrend.sql )
-
ippTools/scripts/test_insert_detrend.sql (copied) (copied from branches/eam_branches/eam_branch_20090303/ippTools/scripts/test_insert_detrend.sql )
-
ippTools/share/chiptool_change_imfile_data_state.sql (modified) (1 diff)
-
ippTools/share/dettool_processedimfile.sql (modified) (1 diff)
-
ippTools/share/dettool_residimfile.sql (modified) (1 diff)
-
ippTools/share/dettool_tonormalizedstat.sql (modified) (1 diff)
-
ippTools/share/dettool_toresidexp.sql (modified) (2 diffs)
-
ippTools/share/dettool_toresidimfile.sql (modified) (3 diffs)
-
ippTools/share/pxadmin_create_tables.sql (modified) (1 diff)
-
ippTools/share/warptool_change_skyfile_data_state.sql (modified) (1 diff)
-
ippTools/src/chiptool.c (modified) (6 diffs)
-
ippTools/src/chiptoolConfig.c (modified) (3 diffs)
-
ippTools/src/dettoolConfig.c (modified) (1 diff)
-
ippTools/src/dettool_processedimfile.c (modified) (4 diffs)
-
ippTools/src/dettool_residimfile.c (modified) (2 diffs)
-
ippTools/src/warptool.c (modified) (4 diffs)
-
ippTools/src/warptoolConfig.c (modified) (1 diff)
-
ppArith/src/Makefile.am (modified) (1 diff)
-
ppArith/src/ppArithVersion.c (modified) (2 diffs)
-
ppImage/src/Makefile.am (modified) (1 diff)
-
ppImage/src/ppImage.h (modified) (1 diff)
-
ppImage/src/ppImageArguments.c (modified) (2 diffs)
-
ppImage/src/ppImageDetrendReadout.c (modified) (6 diffs)
-
ppImage/src/ppImageOptions.c (modified) (2 diffs)
-
ppImage/src/ppImageVersion.c (modified) (3 diffs)
-
ppMerge/src/Makefile.am (modified) (1 diff)
-
ppMerge/src/ppMergeVersion.c (modified) (2 diffs)
-
ppSim/src/Makefile.am (modified) (1 diff)
-
ppSim/src/ppSimVersion.c (modified) (2 diffs)
-
ppStack/src/Makefile.am (modified) (1 diff)
-
ppStack/src/ppStackVersion.c (modified) (2 diffs)
-
ppStats/src/Makefile.am (modified) (1 diff)
-
ppStats/src/ppStatsVersion.c (modified) (2 diffs)
-
ppSub/src/Makefile.am (modified) (1 diff)
-
ppSub/src/ppSubVersion.c (modified) (2 diffs)
-
psLib/src/sys/Makefile.am (modified) (2 diffs)
-
psLib/src/sys/psConfigure.c (modified) (2 diffs)
-
psModules/src/config/Makefile.am (modified) (1 diff)
-
psModules/src/config/pmVersion.c (modified) (2 diffs)
-
psastro/src/Makefile.am (modified) (1 diff)
-
psastro/src/psastroVersion.c (modified) (2 diffs)
-
psconfig/psbuild (modified) (3 diffs)
-
psphot/src/Makefile.am (modified) (1 diff)
-
psphot/src/psphotVersion.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to
/branches/eam_branches/eam_branch_20090303 merged eligible
-
Property svn:mergeinfo
set to
-
trunk/Ohana/src/addstar/src/sky_tessalation.c
r23138 r23229 240 240 // integer number of dec zones between -90 and +90 241 241 242 nDEC = 180.0 / CELLSIZE; 243 dDEC = 180.0 / nDEC; 242 // in fact, we place a single image on each pole, so the real range of dec is 180.0 - CELLSIZE: 243 244 nDEC = (180.0 - CELLSIZE) / CELLSIZE; 245 dDEC = (180.0 - CELLSIZE) / nDEC; 246 nDEC += 2; 247 248 // a test 249 // for (dec = 0.0 + 0.5*dDEC; dec < +90.0; dec += dDEC) { 244 250 245 251 // generate the a collection of rectangles for each ring 246 for (dec = -90.0 + 0.5*dDEC; dec < +90.0; dec += dDEC) {252 for (dec = -90.0; dec < +90.0 + 0.5*dDEC; dec += dDEC) { 247 253 248 254 ring = sky_rectangle_ring (dec, dDEC, &Nring); 255 if (!ring) continue; 249 256 250 257 // subdivide each image (Nx x Ny subcells) … … 529 536 SkyRectangle *sky_rectangle_ring (float dec, float dDEC, int *nring) { 530 537 531 int i, nRA, NX, NY; 532 float dRA, decLower; 538 int i, NX, NY, nRA; 533 539 SkyRectangle *ring; 540 float theta, dRA; 534 541 535 542 // 'dec' is a guess at the center of the cell; in fact, we need to choose decLower and … … 537 544 538 545 // we can determine the 'lower' bound (bound closest to the equator): 539 decLower = (dec > 0.0) ? dec - 0.5*dDEC : dec + 0.5*dDEC; 540 541 // Subdivide the 'lower' bound into an integer number of segments: 542 nRA = cos(dec*RAD_DEG) * 360.0 / CELLSIZE; // CELLSIZE is a projection size 543 dRA = 360.0 / nRA; // dRA is a size in RA degrees 546 float decLower = (dec > 0.0) ? dec - 0.5*dDEC : dec + 0.5*dDEC; 547 548 // solve for actual cellsize (\theta): tan(\delta_{n+1} - \theta/2) = tan(\delta_n + \theta/2)cos(\alpha_n / 2) 549 float decUpper = (dec > 0.0) ? dec + dDEC : dec - dDEC; 550 551 if (fabs(dec) + 0.5*dDEC > 90.0) { 552 // onPole = TRUE; 553 theta = dDEC; 554 nRA = 1; 555 dRA = theta / cos(decLower*RAD_DEG); // make a square at the pole 556 } else { 557 // onPole = FALSE; 558 // Subdivide the 'lower' bound into an integer number of segments: 559 nRA = cos(RAD_DEG*decLower) * 360.0 / CELLSIZE; // CELLSIZE is a projection size 560 dRA = 360.0 / nRA; // dRA is a size in RA degrees == \alpha_n 561 562 // tan(decUpper - theta/2) = tan(dec + theta/2) cos(dRA / 2); 563 564 // we solve this equation for theta (fairly ugly: expand the tangents into sin/cos, expand the 565 // sum-of-angle sine and cosine, multiply through, convert via half-angle formulae and write 566 // as a quadratic expression in sine(theta/2) 567 568 float sd1 = sin(RAD_DEG*decUpper); 569 float cd1 = cos(RAD_DEG*decUpper); 570 float sd2 = sin(RAD_DEG*dec); 571 float cd2 = cos(RAD_DEG*dec); 572 float k = cos(RAD_DEG*dRA/2.0); 573 574 float c1 = (sd1*cd2 + sd2*cd1)*(1.0 - k); 575 float c2 = (sd1*cd2 - sd2*cd1)*(1.0 + k); 576 float c3 = -(sd1*sd2 + cd1*cd2)*(1.0 + k); 577 578 float A = SQ(c3) + SQ(c2); 579 float B = 2*c1*c3; 580 float C = SQ(c1) - SQ(c2); 581 582 float arg = SQ(B) - 4.0*A*C; 583 584 float root; 585 586 if (dec >= 0.0) { 587 root = (-B + sqrt (arg)) / (2.0*A); 588 theta = +DEG_RAD*asin(root); 589 } else { 590 root = (-B - sqrt (arg)) / (2.0*A); 591 theta = -DEG_RAD*asin(root); 592 } 593 594 // the negative solution yields a negative cellsize 595 // float root2 = (-B - sqrt (arg)) / (2.0*A); 596 // float theta2 = DEG_RAD*asin(root2); 597 598 // test lines: 599 // float r1 = tan(RAD_DEG*(decUpper - 0.5*theta1)); 600 // float r2 = tan(RAD_DEG*(dec + 0.5*theta1)); 601 // fprintf (stdout, "%f %f %f %f %f %f %f %f %f %f %f\n", dec, decUpper, dRA, arg, root1, root2, theta1, theta2, r1, r2, k*r2); 602 } 603 fprintf (stdout, "%f %f %f x %f (%d)\n", dec, decUpper, dRA, theta, nRA); 544 604 545 605 // I think we need to return the value of dec for the next ring, but I am not sure... … … 559 619 560 620 // range values are in projected degrees 561 NX = cos(dec *RAD_DEG) * dRA* 3600.0 / SCALE;562 NY = dDEC* 3600.0 / SCALE;621 NX = cos(decLower*RAD_DEG) * dRA * 3600.0 / SCALE; 622 NY = theta * 3600.0 / SCALE; 563 623 564 624 // crpix1,crpix2 is the projection center … … 576 636 577 637 578 fprintf (stderr, "%f %f : %f %f\n",579 ring[i].coords.crval1, ring[i].coords.crval2,580 ring[i].coords.crpix1, ring[i].coords.crpix2);638 // fprintf (stderr, "%f %f : %f %f\n", 639 // ring[i].coords.crval1, ring[i].coords.crval2, 640 // ring[i].coords.crpix1, ring[i].coords.crpix2); 581 641 } 582 642 -
trunk/dbconfig/changes.txt
r21434 r23229 795 795 ALTER TABLE magicInputSkyfile DROP PRIMARY KEY, ADD PRIMARY KEY(magic_id, diff_id, node); 796 796 797 798 799 797 -- Version: 1.1.48 800 798 … … 834 832 WHERE warpImfile.skycell_id IS NULL; 835 833 836 837 834 -- Version: 1.1.49 (change detrend sequence) 835 836 show create table detResidImfile; 837 alter table detResidImfile drop foreign key detResidImfile_ibfk_3; -
trunk/dbconfig/config.md
r21310 r23229 2 2 pkg_name STR ippdb 3 3 pkg_namespace STR ippdb 4 pkg_version STR 1.1.4 84 pkg_version STR 1.1.49 5 5 END -
trunk/dbconfig/det.md
r19620 r23229 90 90 class_id STR 64 # Primary Key 91 91 uri STR 255 92 recipe STR 64 93 bg F64 0.0 94 bg_stdev F64 0.0 95 bg_mean_stdev F64 0.0 96 user_1 F64 0.0 97 user_2 F64 0.0 98 user_3 F64 0.0 99 user_4 F64 0.0 100 user_5 F64 0.0 101 # XXX does it make sense to 'clean' the stacked imfiled? 92 # XXX missing path_base 93 recipe STR 64 94 bg F64 0.0 95 bg_stdev F64 0.0 96 bg_mean_stdev F64 0.0 97 user_1 F64 0.0 98 user_2 F64 0.0 99 user_3 F64 0.0 100 user_4 F64 0.0 101 user_5 F64 0.0 102 # XXX does it make sense to 'clean' the stacked imfiled? (EAM: yes) 102 103 data_state STR 64 # full, cleaned, purged (only track end states; request states are in detRunSummary by iteration) 103 104 fault S16 0 # Key NOT NULL … … 148 149 fault S16 0 # Key NOT NULL 149 150 END 150 151 #detMasterFrame METADATA152 # det_id S64 0 # Primary Key153 # iteration S32 0 # Primary Key154 # comment STR 255155 #END156 #157 ## drop?158 #detMasterImfile METADATA159 # det_id S64 0 # Primary Key160 # class_id STR 64 # Primary Key161 # uri STR 255162 # recipe STR 64163 #END164 151 165 152 detResidImfile METADATA -
trunk/ippScripts/scripts/detrend_norm_apply.pl
r23186 r23229 38 38 'iteration|n=s' => \$iter, # Iteration 39 39 'class_id|i=s' => \$class_id, # Class ID 40 'value|v=s' => \$value, # Value to multiple(for normalisation)40 'value|v=s' => \$value, # Value to apply (for normalisation) 41 41 'input_uri|u=s' => \$input_uri, # Input file 42 42 'camera|c=s' => \$camera, # Camera -
trunk/ippScripts/scripts/detrend_norm_calc.pl
r23186 r23229 90 90 my @files; # The input files 91 91 { 92 my $command = "$dettool -processedimfile"; 93 $command .= " -det_id $det_id"; # Command to run 92 my $command = "$dettool -residimfile"; 93 $command .= " -det_id $det_id"; 94 $command .= " -iteration $iter"; 94 95 $command .= " -included"; # only use the inputs for this detrend run to calculate the norm 95 96 $command .= " -dbname $dbname" if defined $dbname; … … 98 99 print "Running [$command]...\n" if $verbose; 99 100 if (not run(\@command, \$stdin, \$stdout, \$stderr)) { 100 &my_die("Unable to perform dettool - processedimfile on detrend $det_id/$iter: $?",101 &my_die("Unable to perform dettool -residimfile on detrend $det_id/$iter: $?", 101 102 $det_id, $iter, $PS_EXIT_SYS_ERROR); 102 103 } -
trunk/ippScripts/scripts/detrend_resid_exp.pl
r23186 r23229 88 88 &my_die("Unrecognised detrend type: $det_type", $det_id, $iter, $PS_EXIT_PROG_ERROR) unless defined $recipe; 89 89 90 # variables used for I/O 91 my ($command, $success, $error_code, $full_buf, $stdout_buf, $stderr_buf); 92 93 # Get list of normalizations by class_id : stored as $norms; save to temp file for ppImage runs below 94 my (%norms, $normsName); 95 { 96 # dettool command to select imfile data for this exp_id 97 $command = "$dettool -normalizedstat"; 98 $command .= " -det_id $det_id"; 99 $command .= " -iteration $iter"; 100 $command .= " -dbname $dbname" if defined $dbname; 101 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 102 run(command => $command, verbose => $verbose); 103 unless ($success) { 104 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 105 warn("Unable to perform dettool -residimfile: $error_code\n"); 106 exit($error_code); 107 } 108 if (@$stdout_buf == 0) { 109 &my_die("No normalizations were found", $det_id, $iter, $PS_EXIT_PROG_ERROR); 110 } 111 112 # Parse the stdout buffer into a metadata 113 my $mdcParser = PS::IPP::Metadata::Config->new; 114 my $metadata = $mdcParser->parse(join "", @$stdout_buf) or 115 &my_die("Unable to parse metadata config doc", $det_id, $iter, $exp_id, $PS_EXIT_PROG_ERROR); 116 117 # parse the file info in the metadata 118 my $normsMD = parse_md_list($metadata) or 119 &my_die("Unable to parse metadata list", $det_id, $iter, $exp_id, $PS_EXIT_PROG_ERROR); 120 121 122 # write the normalizations to a file as a metadata config file in the form: class_id F32 value 123 # XXX a possible optimization: if there is only one imfile, skip normalization 124 my $normsFile; 125 ($normsFile, $normsName) = tempfile( "/tmp/$exp_tag.detresid.$det_id.$iter.norms.XXXX", UNLINK => !$save_temps ); 126 print "saving norms to $normsName\n"; 127 foreach my $norm (@$normsMD) { 128 my $class_id = $norm->{class_id}; 129 my $normalization = $norm->{norm}; 130 131 $norms{$class_id} = $normalization; 132 printf $normsFile "$class_id F32 $normalization\n", 133 } 134 close $normsFile; 135 } 136 90 137 # Get list of imfile files 91 138 my $cmdflags; 92 my ( $files, $command, $success, $error_code, $full_buf, $stdout_buf, $stderr_buf);139 my (@files); 93 140 { 94 141 # dettool command to select imfile data for this exp_id … … 105 152 exit($error_code); 106 153 } 107 # XXX report an error message if stdout_buf is empty 154 if (@$stdout_buf == 0) { 155 &my_die("No imfiles were found", $det_id, $iter, $PS_EXIT_PROG_ERROR); 156 } 108 157 109 158 # Parse the stdout buffer into a metadata … … 112 161 &my_die("Unable to parse metadata config doc", $det_id, $iter, $exp_id, $PS_EXIT_PROG_ERROR); 113 162 163 # since I can't figure out how to do input and output within PERL, I'm writing the (modified) metadata to a temp file 164 my ($statFile, $statName) = tempfile( "/tmp/$exp_tag.detresid.$det_id.$iter.stats.XXXX", UNLINK => !$save_temps ); 165 114 166 # parse the file info in the metadata 115 $files = parse_md_list($metadata) or 116 &my_die("Unable to parse metadata list", $det_id, $iter, $exp_id, $PS_EXIT_PROG_ERROR); 117 118 # since I can't figure out how to do input and output within PERL, I'm writing to a temp file 119 my ($statFile, $statName) = tempfile( "/tmp/$exp_tag.detresid.$det_id.$iter.stats.XXXX", UNLINK => !$save_temps ); 120 print "saving stats to $statName\n"; 121 foreach my $line (@$stdout_buf) { 122 print $statFile $line; 167 # as we parse the list of files and their stats, apply the normalization to the relevant fields 168 # also, write out the modified metadata set 169 foreach my $mdItem (@$metadata) { 170 if ($mdItem->{class} ne "metadata") { 171 carp "MD element ", $mdItem->{name}, " isn't of type METADATA --- ignored.\n"; 172 next; 173 } 174 my %hash; # Hash element 175 my $mdComponents = $mdItem->{value}; # Components of the metadata 176 177 # determine the class_id for this block: 178 my $class_id; 179 foreach my $data (@$mdComponents) { 180 unless ($data->{name} eq "class_id") { next; } 181 $class_id = $data->{value}; 182 last; 183 } 184 185 # a new metadata block 186 print $statFile "rawResidImfile METADATA\n"; 187 188 # modify and save the data in this block: 189 foreach my $data (@$mdComponents) { 190 my $norm = $norms{$class_id}; 191 192 # fields to modify by the normalization: 193 if ($data->{name} eq "bg") { $data->{value} *= $norm; } 194 if ($data->{name} eq "bg_stdev") { $data->{value} *= $norm; } 195 if ($data->{name} eq "bg_mean_stdev") { $data->{value} *= $norm; } 196 if ($data->{name} eq "bg_skewness") { $data->{value} *= $norm; } 197 if ($data->{name} eq "bg_kurtosis") { $data->{value} *= $norm; } 198 if ($data->{name} eq "bin_stdev") { $data->{value} *= $norm; } 199 200 # write out the metadata, save on the array of hashes 201 print $statFile " $data->{name} $data->{type} $data->{value}\n"; 202 $hash{$data->{name}} = $data->{value}; 203 } 204 print $statFile "END\n"; 205 push @files, \%hash; 123 206 } 124 207 close $statFile; … … 154 237 my ($list1File, $list1Name) = tempfile( "/tmp/$exp_tag.detresid.$det_id.$iter.b1.list.XXXX", UNLINK => !$save_temps ); 155 238 my ($list2File, $list2Name) = tempfile( "/tmp/$exp_tag.detresid.$det_id.$iter.b2.list.XXXX", UNLINK => !$save_temps ); 156 foreach my $file (@ $files) {239 foreach my $file (@files) { 157 240 print $list1File ($ipprc->filename( "PPIMAGE.BIN1", $file->{path_base}, $file->{class_id} ) . "\n"); 158 241 print $list2File ($ipprc->filename( "PPIMAGE.BIN2", $file->{path_base}, $file->{class_id} ) . "\n"); … … 165 248 unless ($no_op) { 166 249 # Make the jpeg for binning 1 250 # XXX EAM : supply the collection of normalizations as a metadata 167 251 $command = "$ppImage -list $list1Name $outroot"; # Command to run 168 252 $command .= " -recipe PPIMAGE PPIMAGE_J1"; 169 253 $command .= " -recipe JPEG $recipe"; 254 $command .= " -normlist $normsName"; 170 255 $command .= " -dbname $dbname" if defined $dbname; 171 256 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = … … 178 263 179 264 # Make the jpeg for binning 2 265 # XXX EAM : supply the collection of normalizations as a metadata 180 266 $command = "$ppImage -list $list2Name $outroot"; # Command to run 181 267 $command .= " -recipe PPIMAGE PPIMAGE_J2"; 182 268 $command .= " -recipe JPEG $recipe"; 269 $command .= " -normlist $normsName"; 183 270 $command .= " -dbname $dbname" if defined $dbname; 184 271 ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = … … 215 302 my @fluxes; 216 303 217 foreach my $file (@ $files) {304 foreach my $file (@files) { 218 305 my $name = $file->{class_id}; 219 306 my $mean = $file->{bg}; # Mean for this imfile -
trunk/ippScripts/scripts/ipp_cleanup.pl
r23186 r23229 45 45 my $ipprc = PS::IPP::Config->new( $camera ) or my_die("Unable to set up", $stage_id, $PS_EXIT_CONFIG_ERROR); # this is used for PATH, NEB filename conversions 46 46 47 # $mode must be one of "goto_cleaned", "goto_scrubbed", or "goto_purged" 48 # goto_cleaned and goto_scrubbed both result in 'cleaned': scrubbed allows chips without config files to 49 # be cleaned (they cannot be recovered, but the small data is left behind) 47 # $mode must be one of "goto_cleaned", "goto_scrubbed", or 48 # "goto_purged" goto_cleaned and goto_scrubbed both result in 49 # 'cleaned' on success ('scrubbed' allows chips without config files 50 # to be cleaned; they cannot be recovered, but the small data is left 51 # behind). XXX make 'scrubbed' a data_state? 50 52 unless (($mode eq "goto_cleaned") || ($mode eq "goto_scrubbed") || ($mode eq "goto_purged")) { 51 53 die "invalid cleanup mode $mode\n"; 52 54 } 55 56 my $error_state; 57 if ($mode eq "goto_cleaned") { $error_state = "error_cleaned"; } 58 if ($mode eq "goto_scrubbed") { $error_state = "error_scrubbed"; } 59 if ($mode eq "goto_purged") { $error_state = "error_purged"; } 60 53 61 54 62 my %stages = ( chip => 1, camera => 1, fake => 1, warp => 1, stack => 1, diff => 1); … … 148 156 } 149 157 } else { 150 # if an error happens for one chip, the chipRun will stay in goto_*, but the chips will stop be run 151 my $command = "$chiptool -updateprocessedimfile -chip_id $stage_id -class_id $class_id -code 1"; 152 $command .= " -dbname $dbname" if defined $dbname; 158 159 # if an error happens for one chip, the chipRun will stay in goto_*, but the chips will go to error_* (matching the goto_*) 160 my $command = "$chiptool -updateprocessedimfile -chip_id $stage_id -class_id $class_id -set_state $error_state"; 161 $command .= " -dbname $dbname" if defined $dbname; 153 162 154 163 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = … … 216 225 217 226 if ($status) { 218 my $command = "$camtool -cam_id $stage_id -updaterun";227 my $command; 219 228 if ($mode eq "goto_cleaned") { 220 $command .= " -state cleaned"; 221 } else { 222 $command .= " -state purged"; 229 $command = "$camtool -updaterun -cam_id $stage_id -set_state cleaned"; 230 } 231 if ($mode eq "goto_scrubbed") { 232 $command = "$camtool -updaterun -cam_id $stage_id -set_state cleaned"; 233 } 234 if ($mode eq "goto_purged") { 235 $command = "$camtool -updaterun -cam_id $stage_id -set_state purged"; 223 236 } 224 237 $command .= " -dbname $dbname" if defined $dbname; … … 230 243 } 231 244 } else { 232 my $command = "$camtool -updateprocessedexp -cam_id $stage_id -code 1"; 245 # since 'camera' has only a single imfile, we can just update the run 246 my $command = "$camtool -updaterun -cam_id $stage_id -set_state $error_state"; 233 247 $command .= " -dbname $dbname" if defined $dbname; 234 248 … … 319 333 } 320 334 } else { 321 # XXX: -updateskyfile mode does not exist, need to add it 322 my $command = "$warptool -updateskyfile -warp_id $stage_id -skycell_id $skycell_id -code 1"; 323 $command .= " -dbname $dbname" if defined $dbname; 335 my $command = "$warptool -updateskyfile -warp_id $stage_id -skycell_id $skycell_id -set_state $error_state"; 336 $command .= " -dbname $dbname" if defined $dbname; 324 337 325 338 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = … … 337 350 # left TODO 338 351 # fake : faketool : -pendingcleanupimfile (loop over imfiles) 339 # stack: stacktool : -pendingcleanupskyfile (loop over skyfiles)340 # diff: difftool : -pendingcleanupskyfile 352 # stack: stacktool : -pendingcleanupskyfile 353 # diff: difftool : -pendingcleanupskyfile (loop over skyfiles) 341 354 342 355 die "ipp_cleanup.pl -stage $stage not yet implemented\n"; … … 367 380 } 368 381 382 # XXX we currently do not set the error state in the db on my_die 369 383 sub my_die 370 384 { -
trunk/ippTools/share/chiptool_change_imfile_data_state.sql
r19527 r23229 7 7 chip_id = %lld 8 8 AND class_id = '%s' 9 -- only update if chipRun.state has the expected value 10 AND ( 11 SELECT state from chipRun where chipRun.chip_id = chipProcessedImfile.chip_id 12 ) = '%s' 13 14 9 -- -- only update if chipRun.state has the expected value 10 -- AND ( 11 -- SELECT state from chipRun where chipRun.chip_id = chipProcessedImfile.chip_id 12 -- ) = '%s' -
trunk/ippTools/share/dettool_processedimfile.sql
r18561 r23229 1 -- is this DISTINCT needed? 1 2 SELECT DISTINCT 2 3 detRun.det_type, -
trunk/ippTools/share/dettool_residimfile.sql
r19632 r23229 2 2 detRun.det_type, 3 3 detRun.mode, 4 detResidImfile.*, 5 rawExp.exp_time 6 FROM detResidImfile 7 JOIN detRun 8 USING(det_id, iteration) 9 JOIN rawExp 10 USING(exp_id) 4 rawExp.exp_time, 5 detResidImfile.* 6 FROM detResidImfile 7 JOIN detRun 8 USING(det_id, iteration) 9 JOIN detInputExp 10 ON detRun.det_id = detInputExp.det_id 11 AND detRun.iteration = detInputExp.iteration 12 AND detResidImfile.exp_id = detInputExp.exp_id 13 JOIN rawExp 14 ON rawExp.exp_id = detResidImfile.exp_id -
trunk/ippTools/share/dettool_tonormalizedstat.sql
r18118 r23229 1 -- select detRun.det_id (det_id) 2 -- select detRun.iteration 3 -- by: 4 -- find the current iteration bassed on det_id 5 -- find all exp_ids in the current det_id/iteration from detInputExp 6 -- sort to detInputExp.imfiles to find the largest value per det_id/iter 7 -- compare imfiles to the number of detStackedImfiles by class_id 8 -- and: 9 -- ??? 10 -- det_id is not in detStackedImfile; 11 -- iteration is not in detStackedImfile; 12 13 SELECT 14 det_id, 15 det_type, 16 iteration, 17 camera, 18 workdir, 19 class_id 20 FROM 21 (SELECT DISTINCT 22 detRun.det_id, 23 detRun.det_type, 24 detRun.iteration, 25 detRun.workdir, 26 rawExp.camera, 27 detStackedImfile.class_id, 28 rawImfile.class_id as rawimfile_class_id 29 FROM detRun 30 JOIN detInputExp 31 ON detRun.det_id = detInputExp.det_id 32 AND detRun.iteration = detInputExp.iteration 33 JOIN rawExp 34 ON detInputExp.exp_id = rawExp.exp_id 35 JOIN rawImfile 36 ON rawExp.exp_id = rawImfile.exp_id 37 LEFT JOIN detStackedImfile 38 ON detInputExp.det_id = detStackedImfile.det_id 39 AND detInputExp.iteration = detStackedImfile.iteration 40 AND rawImfile.class_id = detStackedImfile.class_id 41 LEFT JOIN detNormalizedStatImfile 42 ON detStackedImfile.det_id = detNormalizedStatImfile.det_id 43 AND detStackedImfile.iteration = detNormalizedStatImfile.iteration 44 AND detStackedImfile.class_id = detNormalizedStatImfile.class_id 45 WHERE 46 detRun.state = 'run' 47 AND detRun.mode = 'master' 48 AND detNormalizedStatImfile.det_id IS NULL 49 AND detNormalizedStatImfile.iteration IS NULL 50 AND detNormalizedStatImfile.class_id IS NULL 51 GROUP BY 52 -- rawExp.exp_id, 53 detRun.iteration, 54 detRun.det_id 55 HAVING 56 COUNT(rawImfile.class_id) = COUNT(detStackedImfile.class_id) 57 AND SUM(detStackedImfile.fault) = 0 58 ) as tonormalizedstat 1 -- a det_run + iteration is ready for normstat when: all detResidImfile entries for that iteration corresponding to all detProcessedImfile entries are available 2 SELECT 3 detRun.det_id, 4 detRun.det_type, 5 detRun.iteration, 6 detRun.camera, 7 detRun.workdir, 8 detProcessedImfile.class_id, 9 COUNT(detProcessedImfile.class_id), 10 COUNT(detResidImfile.class_id) 11 FROM detRun 12 JOIN detProcessedImfile 13 ON detProcessedImfile.det_id = detRun.det_id 14 LEFT JOIN detResidImfile 15 ON detResidImfile.det_id = detProcessedImfile.det_id 16 AND detResidImfile.class_id = detProcessedImfile.class_id 17 AND detResidImfile.iteration = detRun.iteration 18 LEFT JOIN detNormalizedStatImfile 19 ON detNormalizedStatImfile.det_id = detRun.det_id 20 AND detNormalizedStatImfile.iteration = detRun.iteration 21 AND detNormalizedStatImfile.class_id = detProcessedImfile.class_id 22 WHERE 23 detRun.state = 'run' 24 AND detRun.mode = 'master' 25 AND detNormalizedStatImfile.det_id IS NULL 26 AND detNormalizedStatImfile.iteration IS NULL 27 AND detNormalizedStatImfile.class_id IS NULL 28 GROUP BY 29 detRun.iteration, 30 detRun.det_id 31 HAVING 32 COUNT(detProcessedImfile.class_id) = COUNT(detResidImfile.class_id) 33 AND SUM(detResidImfile.fault) = 0 -
trunk/ippTools/share/dettool_toresidexp.sql
r19815 r23229 5 5 -- id, detrend type, and whether the exposure was included in the stack for 6 6 -- this iteration. 7 8 -- require the corresponding detNormalizedExp to complete before starting 7 9 8 10 -- select detRun.det_id … … 41 43 detResidImfile.class_id 42 44 FROM detRun 45 JOIN detNormalizedExp 46 USING(det_id, iteration) 43 47 JOIN detInputExp 44 48 USING(det_id, iteration) -
trunk/ippTools/share/dettool_toresidimfile.sql
r19816 r23229 13 13 detProcessedImfile.class_id, 14 14 detProcessedImfile.uri, 15 detNormalizedImfile.uri AS det_uri, 15 -- detNormalizedImfile.uri AS det_uri, 16 detStackedImfile.uri AS det_uri, 16 17 detRun.det_id AS ref_det_id, 17 18 detRun.iteration AS ref_iter, … … 26 27 ON detRun.det_id = detProcessedImfile.det_id 27 28 AND detInputExp.exp_id = detProcessedImfile.exp_id 28 JOIN detNormalizedImfile 29 ON detRun.det_id = detNormalizedImfile.det_id 30 AND detRun.iteration = detNormalizedImfile.iteration 31 AND detProcessedImfile.class_id = detNormalizedImfile.class_id 32 JOIN detNormalizedExp 33 ON detRun.det_id = detNormalizedExp.det_id 34 AND detRun.iteration = detNormalizedExp.iteration 29 JOIN detStackedImfile 30 ON detRun.det_id = detStackedImfile.det_id 31 AND detRun.iteration = detStackedImfile.iteration 32 AND detProcessedImfile.class_id = detStackedImfile.class_id 33 -- EAM : replacing detNormalizedImfile with detStackedImfile to change the sequencing 34 -- JOIN detNormalizedImfile 35 -- ON detRun.det_id = detNormalizedImfile.det_id 36 -- AND detRun.iteration = detNormalizedImfile.iteration 37 -- AND detProcessedImfile.class_id = detNormalizedImfile.class_id 38 -- EAM : we there is no reason to wait for all stacks to complete before continuing 39 -- JOIN detNormalizedExp 40 -- ON detRun.det_id = detNormalizedExp.det_id 41 -- AND detRun.iteration = detNormalizedExp.iteration 35 42 LEFT JOIN detResidImfile 36 43 ON detRun.det_id = detResidImfile.det_id … … 41 48 detRun.state = 'run' 42 49 AND detRun.mode = 'master' 43 AND detNormalizedImfile.fault = 0 44 AND detNormalizedExp.fault = 0 50 AND detStackedImfile.fault = 0 51 -- AND detNormalizedImfile.fault = 0 52 -- AND detNormalizedExp.fault = 0 45 53 AND detResidImfile.det_id IS NULL 46 54 AND detResidImfile.iteration IS NULL -
trunk/ippTools/share/pxadmin_create_tables.sql
r21308 r23229 737 737 REFERENCES detInputExp(det_id, iteration, exp_id), 738 738 FOREIGN KEY (det_id, exp_id, class_id) 739 REFERENCES detProcessedImfile(det_id, exp_id, class_id), 740 FOREIGN KEY (ref_det_id, ref_iter) 741 REFERENCES detNormalizedExp(det_id, iteration) 739 REFERENCES detProcessedImfile(det_id, exp_id, class_id) 742 740 ) ENGINE=innodb DEFAULT CHARSET=latin1; 743 741 -
trunk/ippTools/share/warptool_change_skyfile_data_state.sql
r19521 r23229 9 9 AND skycell_id = '%s' 10 10 -- only update if chipRun.state has the expected value 11 AND ( 12 SELECT state from warpRun where warpRun.warp_id = warpSkyfile.warp_id 13 ) = '%s' 14 15 11 -- AND ( 12 -- SELECT state from warpRun where warpRun.warp_id = warpSkyfile.warp_id 13 -- ) = '%s' -
trunk/ippTools/src/chiptool.c
r22751 r23229 52 52 static bool runMode(pxConfig *config); 53 53 static bool tocleanedimfileMode(pxConfig *config); 54 static bool tocleanedimfile_from_scrubbedMode(pxConfig *config);54 // static bool tocleanedimfile_from_scrubbedMode(pxConfig *config); 55 55 static bool tofullimfileMode(pxConfig *config); 56 56 static bool topurgedimfileMode(pxConfig *config); 57 57 static bool exportrunMode(pxConfig *config); 58 58 static bool importrunMode(pxConfig *config); 59 static bool change_imfile_data_state(pxConfig *config, psString data_state, psString run_state); 59 60 60 61 # define MODECASE(caseName, func) \ … … 92 93 MODECASE(CHIPTOOL_MODE_RUN, runMode); 93 94 MODECASE(CHIPTOOL_MODE_TOCLEANEDIMFILE, tocleanedimfileMode); 94 MODECASE(CHIPTOOL_MODE_TOCLEANEDIMFILE_FROM_SCRUBBED, tocleanedimfile_from_scrubbedMode);95 // MODECASE(CHIPTOOL_MODE_TOCLEANEDIMFILE_FROM_SCRUBBED, tocleanedimfile_from_scrubbedMode); 95 96 MODECASE(CHIPTOOL_MODE_TOFULLIMFILE, tofullimfileMode); 96 97 MODECASE(CHIPTOOL_MODE_TOPURGEDIMFILE, topurgedimfileMode); … … 651 652 PXOPT_COPY_S64(config->args, where, "-chip_id", "chip_id", "=="); 652 653 PXOPT_COPY_STR(config->args, where, "-class_id", "class_id", "=="); 653 PXOPT_LOOKUP_S16(code, config->args, "-code", true, false); 654 655 if (!pxSetFaultCode(config->dbh, "chipProcessedImfile", where, code)) { 654 PXOPT_LOOKUP_STR(state, config->args, "-set_state", false, false); 655 PXOPT_LOOKUP_S16(code, config->args, "-code", false, false); 656 657 if (state && code) { 658 psError(PS_ERR_UNKNOWN, true, "only one of -set_state and -code may be supplied"); 659 return false; 660 } 661 662 if (state) { 663 // make sure that the state string is valid 664 if (!pxIsValidState(state)) { 665 psError(PXTOOLS_ERR_DATA, false, "%s is not a valid state", state); 666 return false; 667 } 668 if (!change_imfile_data_state(config, state, "unknown")) { 656 669 psError(PS_ERR_UNKNOWN, false, "failed to set set fault flag"); 657 670 return false; 658 } 659 psFree(where); 660 661 return true; 671 } 672 return true; 673 } 674 675 if (code) { 676 if (!pxSetFaultCode(config->dbh, "chipProcessedImfile", where, code)) { 677 psError(PS_ERR_UNKNOWN, false, "failed to set set fault flag"); 678 return false; 679 } 680 psFree(where); 681 return true; 682 } 683 684 psError(PS_ERR_UNKNOWN, true, "one of -set_state or -code must be supplied"); 685 return false; 662 686 } 663 687 … … 1195 1219 // shared code for the modes -tocleanedimfile -tofullimfile -topurgedimfile 1196 1220 1221 // XXX EAM : this function was enforcing only certain transitions with the SQL. However, 1222 // this is getting fairly messy now that we have added a few additional target and 1223 // destination states. I'm disabling these restrictions for now; is there are better way 1224 // to enforce the allowed state transitions? 1225 1197 1226 static bool change_imfile_data_state(pxConfig *config, psString data_state, psString run_state) 1198 1227 { … … 1210 1239 } 1211 1240 1241 // XXX this feature is disabled (run_state is ignored) 1212 1242 // note only updates if chipRun.state = run_state 1213 if (!p_psDBRunQueryF(config->dbh, query, data_state, chip_id, class_id, run_state)) { 1243 1244 if (!p_psDBRunQueryF(config->dbh, query, data_state, chip_id, class_id)) { 1214 1245 psError(PS_ERR_UNKNOWN, false, "database error"); 1215 1246 // rollback … … 1246 1277 { 1247 1278 return change_imfile_data_state(config, "cleaned", "goto_cleaned"); 1248 }1249 static bool tocleanedimfile_from_scrubbedMode(pxConfig *config)1250 {1251 return change_imfile_data_state(config, "cleaned", "goto_scrubbed");1252 1279 } 1253 1280 static bool tofullimfileMode(pxConfig *config) -
trunk/ippTools/src/chiptoolConfig.c
r22751 r23229 172 172 // -updateprocessedimfile 173 173 psMetadata *updateprocessedimfileArgs = psMetadataAlloc(); 174 psMetadataAddS64(updateprocessedimfileArgs, PS_LIST_TAIL, "-chip_id", 0, "search by chip ID", 0); 175 psMetadataAddStr(updateprocessedimfileArgs, PS_LIST_TAIL, "-class_id", 0, "search by class ID", NULL); 176 psMetadataAddS16(updateprocessedimfileArgs, PS_LIST_TAIL, "-code", 0, "set fault code (required)", 0); 174 psMetadataAddS64(updateprocessedimfileArgs, PS_LIST_TAIL, "-chip_id", 0, "search by chip ID", 0); 175 psMetadataAddStr(updateprocessedimfileArgs, PS_LIST_TAIL, "-class_id", 0, "search by class ID", NULL); 176 psMetadataAddS16(updateprocessedimfileArgs, PS_LIST_TAIL, "-code", 0, "set fault code", 0); 177 psMetadataAddStr(updateprocessedimfileArgs, PS_LIST_TAIL, "-set_state", 0, "set state", NULL); 177 178 178 179 // -promoteexp … … 234 235 psMetadataAddStr(tocleanedimfileArgs, PS_LIST_TAIL, "-class_id", 0, "class ID to update", NULL); 235 236 236 // -tocleanedimfile_from_scrubbed237 psMetadata *tocleanedimfile_from_scrubbedArgs = psMetadataAlloc();238 psMetadataAddS64(tocleanedimfile_from_scrubbedArgs, PS_LIST_TAIL, "-chip_id", 0, "chip ID to update", 0);239 psMetadataAddStr(tocleanedimfile_from_scrubbedArgs, PS_LIST_TAIL, "-class_id", 0, "class ID to update", NULL);240 237 // // -tocleanedimfile_from_scrubbed 238 // psMetadata *tocleanedimfile_from_scrubbedArgs = psMetadataAlloc(); 239 // psMetadataAddS64(tocleanedimfile_from_scrubbedArgs, PS_LIST_TAIL, "-chip_id", 0, "chip ID to update", 0); 240 // psMetadataAddStr(tocleanedimfile_from_scrubbedArgs, PS_LIST_TAIL, "-class_id", 0, "class ID to update", NULL); 241 // 241 242 // -tofullimfile 242 243 psMetadata *tofullimfileArgs = psMetadataAlloc(); … … 280 281 PXOPT_ADD_MODE("-run", "show runs", CHIPTOOL_MODE_RUN, runArgs); 281 282 PXOPT_ADD_MODE("-tocleanedimfile", "set imfile state to cleaned", CHIPTOOL_MODE_TOCLEANEDIMFILE, tocleanedimfileArgs); 282 PXOPT_ADD_MODE("-tocleanedimfile_from_scrubbed", "set imfile state to cleaned (for goto_scrubbed)", CHIPTOOL_MODE_TOCLEANEDIMFILE_FROM_SCRUBBED, tocleanedimfile_from_scrubbedArgs);283 // PXOPT_ADD_MODE("-tocleanedimfile_from_scrubbed", "set imfile state to cleaned (for goto_scrubbed)", CHIPTOOL_MODE_TOCLEANEDIMFILE_FROM_SCRUBBED, tocleanedimfile_from_scrubbedArgs); 283 284 PXOPT_ADD_MODE("-tofullimfile", "set imfile state to full", CHIPTOOL_MODE_TOFULLIMFILE, tofullimfileArgs); 284 285 PXOPT_ADD_MODE("-topurgedimfile", "set imfile state to purged", CHIPTOOL_MODE_TOPURGEDIMFILE, topurgedimfileArgs); -
trunk/ippTools/src/dettoolConfig.c
r23154 r23229 640 640 // -residimfile 641 641 psMetadata *residimfileArgs = psMetadataAlloc(); 642 psMetadataAddS64(residimfileArgs, PS_LIST_TAIL, "-det_id", 0, "search for detrend ID", 0);643 psMetadataAddS32(residimfileArgs, PS_LIST_TAIL, "-iteration", 0, "search for iteration number", 0);644 psMetadataAddS64(residimfileArgs, PS_LIST_TAIL, "-exp_id", 0, "search by detrend ID", 0);645 psMetadataAddStr(residimfileArgs, PS_LIST_TAIL, "-class_id", 0, "search for class ID", NULL);646 psMetadataAddStr(residimfileArgs, PS_LIST_TAIL, "-recip", 0, "search for recipe", NULL);647 psMetadataAddU64(residimfileArgs, PS_LIST_TAIL, "-limit", 0, "limit result set to N items", 0);642 psMetadataAddS64(residimfileArgs, PS_LIST_TAIL, "-det_id", 0, "search for detrend ID", 0); 643 psMetadataAddS32(residimfileArgs, PS_LIST_TAIL, "-iteration", 0, "search for iteration number", 0); 644 psMetadataAddS64(residimfileArgs, PS_LIST_TAIL, "-exp_id", 0, "search by detrend ID", 0); 645 psMetadataAddStr(residimfileArgs, PS_LIST_TAIL, "-class_id", 0, "search for class ID", NULL); 646 psMetadataAddStr(residimfileArgs, PS_LIST_TAIL, "-recip", 0, "search for recipe", NULL); 647 psMetadataAddU64(residimfileArgs, PS_LIST_TAIL, "-limit", 0, "limit result set to N items", 0); 648 648 psMetadataAddBool(residimfileArgs, PS_LIST_TAIL, "-faulted", 0, "only return imfiles with a fault status set", false); 649 649 psMetadataAddBool(residimfileArgs, PS_LIST_TAIL, "-simple", 0, "use the simple output format", false); 650 psMetadataAddStr(residimfileArgs, PS_LIST_TAIL, "-select_state", 0, "search for state", NULL); 650 psMetadataAddBool(residimfileArgs, PS_LIST_TAIL, "-included", 0, "restrict results to exposures 'includeded' in the current iteration", false); 651 psMetadataAddStr(residimfileArgs, PS_LIST_TAIL, "-select_state", 0, "search for state", NULL); 651 652 652 653 // -revertresidimfile -
trunk/ippTools/src/dettool_processedimfile.c
r19621 r23229 165 165 PS_ASSERT_PTR_NON_NULL(config, false); 166 166 167 bool hasWhere = false;168 169 PXOPT_LOOKUP_BOOL(included, config->args, "-included", false);170 PXOPT_LOOKUP_BOOL(faulted, config->args, "-faulted", false);171 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);172 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);173 174 167 psMetadata *where = psMetadataAlloc(); 175 168 PXOPT_COPY_S64(config->args, where, "-det_id", "detProcessedImfile.det_id", "=="); … … 179 172 PXOPT_COPY_STR(config->args, where, "-select_mode", "detRun.mode", "=="); 180 173 174 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 175 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 176 177 PXOPT_LOOKUP_BOOL(faulted, config->args, "-faulted", false); 178 PXOPT_LOOKUP_BOOL(included, config->args, "-included", false); 179 181 180 psString query = pxDataGet("dettool_processedimfile.sql"); 182 181 if (!query) { … … 186 185 } 187 186 187 bool hasWhere = false; 188 188 if (psListLength(where->list)) { 189 189 psString whereClause = psDBGenerateWhereSQL(where, NULL); … … 211 211 212 212 if (faulted) { 213 // list only faulted rows 213 214 psStringAppend(&query, " %s", " detProcessedImfile.fault != 0"); 214 215 } else { -
trunk/ippTools/src/dettool_residimfile.c
r19632 r23229 159 159 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 160 160 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 161 161 162 PXOPT_LOOKUP_BOOL(faulted, config->args, "-faulted", false); 163 PXOPT_LOOKUP_BOOL(included, config->args, "-included", false); 162 164 163 165 psString query = pxDataGet("dettool_residimfile.sql"); … … 175 177 } 176 178 psFree(where); 179 180 // restrict search to included imfiles 181 if (included) { 182 if (hasWhere) { 183 psStringAppend(&query, " AND detInputExp.include = 1"); 184 } else { 185 psStringAppend(&query, " WHERE detInputExp.include = 1"); 186 } 187 hasWhere = true; 188 } 177 189 178 190 if (hasWhere) { -
trunk/ippTools/src/warptool.c
r21402 r23229 55 55 static bool updateskyfileMode(pxConfig *config); 56 56 57 static bool change_skyfile_data_state(pxConfig *config, psString data_state, psString run_state); 57 58 static bool parseAndInsertSkyCellMap(pxConfig *config, const char *mapfile); 58 59 static bool isValidMode(pxConfig *config, const char *mode); … … 1604 1605 // shared code for the modes -tocleanedskyfile -tofullskyfile -topurgedskyfile 1605 1606 1607 // XXX EAM : this function was enforcing only certain transitions with the SQL. However, 1608 // this is getting fairly messy now that we have added a few additional target and 1609 // destination states. I'm disabling these restrictions for now; is there are better way 1610 // to enforce the allowed state transitions? 1611 1606 1612 static bool change_skyfile_data_state(pxConfig *config, psString data_state, psString run_state) 1607 1613 { … … 1619 1625 } 1620 1626 1627 // XXX this feature is disabled (run_state is ignored) 1621 1628 // note only updates if warpRun.state = run_state 1622 if (!p_psDBRunQueryF(config->dbh, query, data_state, warp_id, skycell_id, run_state)) { 1629 1630 if (!p_psDBRunQueryF(config->dbh, query, data_state, warp_id, skycell_id)) { 1623 1631 psError(PS_ERR_UNKNOWN, false, "database error"); 1624 1632 // rollback … … 1668 1676 PXOPT_LOOKUP_S64(warp_id, config->args, "-warp_id", true, false); 1669 1677 PXOPT_LOOKUP_STR(skycell_id, config->args, "-skycell_id", true, false); 1678 PXOPT_LOOKUP_STR(state, config->args, "-set_state", false, false); 1670 1679 PXOPT_LOOKUP_S16(code, config->args, "-code", false, false); 1671 1680 1672 psString query = pxDataGet("warptool_updateskyfile.sql"); 1673 1674 if (!p_psDBRunQueryF(config->dbh, query, code, warp_id, skycell_id)) { 1675 psError(PS_ERR_UNKNOWN, false, "database error"); 1676 return false; 1677 } 1678 psFree(query); 1679 1680 return true; 1681 } 1681 if (state && code) { 1682 psError(PS_ERR_UNKNOWN, true, "only one of -set_state and -code may be supplied"); 1683 return false; 1684 } 1685 1686 if (state) { 1687 // make sure that the state string is valid 1688 if (!pxIsValidState(state)) { 1689 psError(PXTOOLS_ERR_DATA, false, "%s is not a valid state", state); 1690 return false; 1691 } 1692 if (!change_skyfile_data_state(config, state, "unknown")) { 1693 psError(PS_ERR_UNKNOWN, false, "failed to set set fault flag"); 1694 return false; 1695 } 1696 return true; 1697 } 1698 1699 if (code) { 1700 psString query = pxDataGet("warptool_updateskyfile.sql"); 1701 1702 if (!p_psDBRunQueryF(config->dbh, query, code, warp_id, skycell_id)) { 1703 psError(PS_ERR_UNKNOWN, false, "database error"); 1704 return false; 1705 } 1706 psFree(query); 1707 return true; 1708 } 1709 1710 psError(PS_ERR_UNKNOWN, true, "one of -set_state or -code must be supplied"); 1711 return false; 1712 } -
trunk/ippTools/src/warptoolConfig.c
r20973 r23229 348 348 psMetadataAddStr(tofullskyfileArgs, PS_LIST_TAIL, "-skycell_id", 0, "skycell ID to update", NULL); 349 349 350 // - toupdateskyfile350 // -updateskyfile 351 351 psMetadata *updateskyfileArgs = psMetadataAlloc(); 352 psMetadataAddS64(updateskyfileArgs, PS_LIST_TAIL, "-warp_id", 0,"warptool ID to update", 0);352 psMetadataAddS64(updateskyfileArgs, PS_LIST_TAIL, "-warp_id", 0, "warptool ID to update", 0); 353 353 psMetadataAddStr(updateskyfileArgs, PS_LIST_TAIL, "-skycell_id", 0, "skycell ID to update", NULL); 354 psMetadataAddS16(updateskyfileArgs, PS_LIST_TAIL, "-code", 0, "new fault code", 0); 354 psMetadataAddS16(updateskyfileArgs, PS_LIST_TAIL, "-code", 0, "set fault code", 0); 355 psMetadataAddStr(updateskyfileArgs, PS_LIST_TAIL, "-set_state", 0, "set state", NULL); 355 356 356 357 psFree(now); -
trunk/ppArith/src/Makefile.am
r23124 r23229 1 1 bin_PROGRAMS = ppArith 2 2 3 PPARITH_VERSION=`if [ -e ../../VERSION ]; then cat ../../VERSION; else svnversion; fi` 4 PPARITH_BRANCH=`if [ -e ../../BRANCH ]; then cat ../../BRANCH; else svn info | sed -n -e '/URL:/ h' -e '/Repository Root:/ { x; H; x; s|Repository Root: \(.*\)\nURL: \1\(.*\)|\2| ; s|^/|| ; s|/[a-zA-Z]*/src.*|| ; p }'; fi` 5 PPARITH_SOURCE=`if [ -e ../../SOURCE ]; then cat ../../SOURCE; else svn info | sed -n -e 's/Repository UUID: // p'; fi` 3 # PPARITH_VERSION=`if [ -e ../../VERSION ]; then cat ../../VERSION; else svnversion; fi` 4 # PPARITH_BRANCH=`if [ -e ../../BRANCH ]; then cat ../../BRANCH; else svn info | sed -n -e '/URL:/ h' -e '/Repository Root:/ { x; H; x; s|Repository Root: \(.*\)\nURL: \1\(.*\)|\2| ; s|^/|| ; s|/[a-zA-Z]*/src.*|| ; p }'; fi` 5 # PPARITH_SOURCE=`if [ -e ../../SOURCE ]; then cat ../../SOURCE; else svn info | sed -n -e 's/Repository UUID: // p'; fi` 6 # 7 # # Force recompilation of ppArithVersion.c, since it gets the version information 8 # ppArithVersion.c: FORCE 9 # touch ppArith.c 10 # FORCE: ; 6 11 7 # Force recompilation of ppArithVersion.c, since it gets the version information 8 ppArithVersion.c: FORCE 9 touch ppArith.c 10 FORCE: ; 11 12 ppArith_CPPFLAGS = $(PSLIB_CFLAGS) $(PSMODULE_CFLAGS) $(PPSTATS_CFLAGS) $(PSPHOT_CFLAGS) $(PPARITH_CFLAGS) -DPPARITH_VERSION=\"$(PPARITH_VERSION)\" -DPPARITH_BRANCH=\"$(PPARITH_BRANCH)\" -DPPARITH_SOURCE=\"$(PPARITH_SOURCE)\" 12 ppArith_CPPFLAGS = $(PSLIB_CFLAGS) $(PSMODULE_CFLAGS) $(PPSTATS_CFLAGS) $(PSPHOT_CFLAGS) $(PPARITH_CFLAGS) -DPPARITH_VERSION=$(SVN_VERSION) -DPPARITH_BRANCH=$(SVN_BRANCH) -DPPARITH_SOURCE=$(SVN_SOURCE) 13 13 ppArith_LDFLAGS = $(PSLIB_LIBS) $(PSMODULE_LIBS) $(PPSTATS_LIBS) $(PSPHOT_LIBS) $(PPARITH_LIBS) 14 14 -
trunk/ppArith/src/ppArithVersion.c
r23195 r23229 22 22 #include "ppArith.h" 23 23 24 psString ppArithVersion(void)25 {26 24 #ifndef PPARITH_VERSION 27 25 #error "PPARITH_VERSION is not set" … … 30 28 #error "PPARITH_BRANCH is not set" 31 29 #endif 32 return psStringCopy(PPARITH_BRANCH "@" PPARITH_VERSION); 30 #ifndef PPARITH_SOURCE 31 #error "PPARITH_SOURCE is not set" 32 #endif 33 34 #define xstr(s) str(s) 35 #define str(s) #s 36 37 psString ppArithVersion(void) 38 { 39 char *value = NULL; 40 psStringAppend(&value, "%s@%s", xstr(PPARITH_BRANCH), xstr(PPARITH_VERSION)); 41 return value; 33 42 } 34 43 35 44 psString ppArithSource(void) 36 45 { 37 #ifndef PPARITH_SOURCE 38 #error "PPARITH_SOURCE is not set" 39 #endif 40 return psStringCopy(PPARITH_SOURCE); 46 return psStringCopy(xstr(PPARITH_SOURCE)); 41 47 } 42 48 -
trunk/ppImage/src/Makefile.am
r23125 r23229 4 4 ppImage.h 5 5 6 PPIMAGE_VERSION=`if [ -e ../../VERSION ]; then cat ../../VERSION; else svnversion; fi`7 PPIMAGE_BRANCH=`if [ -e ../../BRANCH ]; then cat ../../BRANCH; else svn info | sed -n -e '/URL:/ h' -e '/Repository Root:/ { x; H; x; s|Repository Root: \(.*\)\nURL: \1\(.*\)|\2| ; s|^/|| ; s|/[a-zA-Z]*/src.*|| ; p }'; fi`8 PPIMAGE_SOURCE=`if [ -e ../../SOURCE ]; then cat ../../SOURCE; else svn info | sed -n -e 's/Repository UUID: // p'; fi`6 #PPIMAGE_VERSION=`if [ -e ../../VERSION ]; then cat ../../VERSION; else svnversion; fi` 7 #PPIMAGE_BRANCH=`if [ -e ../../BRANCH ]; then cat ../../BRANCH; else svn info | sed -n -e '/URL:/ h' -e '/Repository Root:/ { x; H; x; s|Repository Root: \(.*\)\nURL: \1\(.*\)|\2| ; s|^/|| ; s|/[a-zA-Z]*/src.*|| ; p }'; fi` 8 #PPIMAGE_SOURCE=`if [ -e ../../SOURCE ]; then cat ../../SOURCE; else svn info | sed -n -e 's/Repository UUID: // p'; fi` 9 9 10 10 # Force recompilation of ppImageVersion.c, since it gets the version information 11 ppImageVersion.c: FORCE12 touch ppImageVersion.c13 FORCE: ;11 # ppImageVersion.c: FORCE 12 # touch ppImageVersion.c 13 # FORCE: ; 14 14 15 ppImage_CFLAGS = $(PPIMAGE_CFLAGS) $(PPSTATS_CFLAGS) $(PSASTRO_CFLAGS) $(PSPHOT_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS) -DPPIMAGE_VERSION= \"$(PPIMAGE_VERSION)\" -DPPIMAGE_BRANCH=\"$(PPIMAGE_BRANCH)\" -DPPIMAGE_SOURCE=\"$(PPIMAGE_SOURCE)\"15 ppImage_CFLAGS = $(PPIMAGE_CFLAGS) $(PPSTATS_CFLAGS) $(PSASTRO_CFLAGS) $(PSPHOT_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS) -DPPIMAGE_VERSION=$(SVN_VERSION) -DPPIMAGE_BRANCH=$(SVN_BRANCH) -DPPIMAGE_SOURCE=$(SVN_SOURCE) 16 16 ppImage_LDFLAGS = $(PPIMAGE_LIBS) $(PSASTRO_LIBS) $(PPSTATS_LIBS) $(PSPHOT_LIBS) $(PSMODULE_LIBS) $(PSLIB_LIBS) 17 17 ppImage_SOURCES = \ -
trunk/ppImage/src/ppImage.h
r23195 r23229 86 86 int remnanceSize; // Size for remnance detection 87 87 float remnanceThresh; // Threshold for remnance detection 88 89 char *normClass; // class to use for per-class normalization 88 90 } ppImageOptions; 89 91 -
trunk/ppImage/src/ppImageArguments.c
r19943 r23229 14 14 fprintf(stderr, "\t-chip CHIPNUM: Only process this chip number.\n"); 15 15 fprintf(stderr, "\t-norm VALUE: Divide through by this value when done.\n"); 16 fprintf(stderr, "\t-normlist file.mdc: normalizations by class_id.\n"); 16 17 fprintf(stderr, "\n"); 17 18 fprintf(stderr, "Input options (single file / file list):\n"); … … 128 129 } 129 130 130 // Optional normali sation factor131 // Optional normalization factor 131 132 if ((argnum = psArgumentGet(argc, argv, "-norm"))) { 132 133 psArgumentRemove(argnum, &argc, argv); 133 134 float norm = atof(argv[argnum]); 134 psMetadataAddF32(config->arguments, PS_LIST_TAIL, "NORMALI SATION", 0,135 psMetadataAddF32(config->arguments, PS_LIST_TAIL, "NORMALIZATION", 0, 135 136 "Normalisation to apply", norm); 137 psArgumentRemove(argnum, &argc, argv); 138 } 139 140 // Optional per-class normalization table 141 if ((argnum = psArgumentGet(argc, argv, "-normlist"))) { 142 psArgumentRemove(argnum, &argc, argv); 143 144 unsigned int nFail = 0; 145 psMetadata *normlist = psMetadataConfigRead (NULL, &nFail, argv[argnum], false); 146 // XXX allow this file to be in nebulous? 147 148 psMetadataAddMetadata(config->arguments, PS_LIST_TAIL, "NORMALIZATION.TABLE", 0, "Normalization to apply", normlist); 149 psFree (normlist); 136 150 psArgumentRemove(argnum, &argc, argv); 137 151 } -
trunk/ppImage/src/ppImageDetrendReadout.c
r21364 r23229 54 54 if (!pmBiasSubtract(input, options->overscan, bias, oldDark, view)) { 55 55 psError(PS_ERR_UNKNOWN, false, "Unable to subtract bias."); 56 psFree(detview); 56 57 return false; 57 58 } … … 67 68 if (!pmDarkApply(input, dark, options->maskValue)) { 68 69 psError(PS_ERR_UNKNOWN, false, "Unable to subtract dark."); 70 psFree(detview); 69 71 return false; 70 72 } … … 75 77 options->remnanceSize, options->remnanceThresh)) { 76 78 psError(PS_ERR_UNKNOWN, false, "Unable to mask remnance."); 79 psFree(detview); 77 80 return false; 78 81 } … … 83 86 pmReadout *shutter = pmFPAfileThisReadout(config->files, detview, "PPIMAGE.SHUTTER"); 84 87 if (!pmShutterCorrectionApply(input, shutter, pmConfigMaskGet("FLAT", config))) { 88 psFree(detview); 85 89 return false; 86 90 } … … 91 95 pmReadout *flat = pmFPAfileThisReadout(config->files, detview, "PPIMAGE.FLAT"); 92 96 if (!pmFlatField(input, flat, options->flatMask)) { 97 psFree(detview); 93 98 return false; 94 99 } 95 100 } 96 101 97 // Normali sation by a(known) constant102 // Normalization by a single (known) constant 98 103 bool mdok; // Status of MD lookup 99 float norm = psMetadataLookupF32(&mdok, config->arguments, "NORMALI SATION");104 float norm = psMetadataLookupF32(&mdok, config->arguments, "NORMALIZATION"); 100 105 if (mdok && isfinite(norm) && norm != 1.0) { 101 106 pmHDU *hdu = pmHDUFromReadout(input); // HDU of interest … … 108 113 } 109 114 115 # if (1) 116 // Normalization by per-class values 117 psMetadata *normlist = psMetadataLookupMetadata(&mdok, config->arguments, "NORMALIZATION.TABLE"); 118 if (normlist) { 119 pmFPAfile *inputFile = psMetadataLookupPtr(&mdok, config->files, "PPIMAGE.INPUT"); 120 121 // get the menu of class IDs 122 psMetadata *menu = psMetadataLookupMetadata(&mdok, inputFile->camera, "CLASSID"); 123 if (!menu) { 124 psError(PS_ERR_IO, false, "Unable to find CLASSID metadata in camera configuration"); 125 psFree(detview); 126 return false; 127 } 128 // get the rule for class_id for the desired class 129 const char *rule = psMetadataLookupStr(&mdok, menu, options->normClass); 130 if (!rule) { 131 psError(PS_ERR_IO, false, "Unable to find NORM.CLASS value %s in CLASSID in camera configuration", options->normClass); 132 psFree(detview); 133 return false; 134 } 135 // get the class_id from the rule 136 char *classID = pmFPAfileNameFromRule(rule, inputFile, view); 137 if (!classID) { 138 psError(PS_ERR_IO, false, "error converting CLASSID rule %s to name\n", rule); 139 psFree(detview); 140 return false; 141 } 142 143 // get normalization from the class_id 144 float norm = psMetadataLookupF32 (&mdok, normlist, classID); 145 146 pmHDU *hdu = pmHDUFromReadout(input); // HDU of interest 147 psString comment = NULL; // Comment to add 148 psStringAppend(&comment, "Normalization: %f", norm); 149 psMetadataAddStr(hdu->header, PS_LIST_TAIL, "HISTORY", PS_META_DUPLICATE_OK, comment, ""); 150 psFree(comment); 151 152 // apply the normalization 153 psBinaryOp(input->image, input->image, "*", psScalarAlloc(norm, PS_TYPE_F32)); 154 155 psFree (classID); 156 } 157 # endif 158 110 159 if (options->doFringe) { 111 160 pmCell *fringe = pmFPAfileThisCell(config->files, detview, "PPIMAGE.FRINGE"); 112 161 if (!ppImageDetrendFringeMeasure(input, fringe, false, options)) { 162 psFree(detview); 113 163 return false; 114 164 } -
trunk/ppImage/src/ppImageOptions.c
r21364 r23229 81 81 options->remnanceThresh = 25.0; // Threshold for remnance detection 82 82 83 // per-class normalization source 84 options->normClass = NULL; // per-class normalizations refer to this class 85 83 86 return options; 84 87 } … … 278 281 options->remnanceThresh = psMetadataLookupS32(NULL, recipe, "REMNANCE.THRESH"); 279 282 283 // per-class normalization source (just a reference; don't free) 284 options->normClass = psMetadataLookupStr(NULL, recipe, "NORM.CLASS"); 285 280 286 return options; 281 287 } -
trunk/ppImage/src/ppImageVersion.c
r23195 r23229 5 5 #include "ppImage.h" 6 6 7 psString ppImageVersion(void)8 {9 7 #ifndef PPIMAGE_VERSION 10 8 #error "PPIMAGE_VERSION is not set" … … 13 11 #error "PPIMAGE_BRANCH is not set" 14 12 #endif 15 return psStringCopy(PPIMAGE_BRANCH "@" PPIMAGE_VERSION); 13 #ifndef PPIMAGE_SOURCE 14 #error "PPIMAGE_SOURCE is not set" 15 #endif 16 17 #define xstr(s) str(s) 18 #define str(s) #s 19 20 psString ppImageVersion(void) 21 { 22 char *value = NULL; 23 psStringAppend(&value, "%s@%s", xstr(PPIMAGE_BRANCH), xstr(PPIMAGE_VERSION)); 24 return value; 16 25 } 17 26 18 27 psString ppImageSource(void) 19 28 { 20 #ifndef PPIMAGE_SOURCE 21 #error "PPIMAGE_SOURCE is not set" 22 #endif 23 return psStringCopy(PPIMAGE_SOURCE); 29 return psStringCopy (xstr(PPIMAGE_SOURCE)); 24 30 } 25 31 … … 27 33 { 28 34 psString version = ppImageVersion(); // Version, to return 29 psString source = ppImageSource(); // Source35 psString source = ppImageSource(); // Source 30 36 31 37 psStringPrepend(&version, "ppImage "); -
trunk/ppMerge/src/Makefile.am
r23126 r23229 1 1 bin_PROGRAMS = ppMerge 2 2 3 PPMERGE_VERSION=`if [ -e ../../VERSION ]; then cat ../../VERSION; else svnversion; fi` 4 PPMERGE_BRANCH=`if [ -e ../../BRANCH ]; then cat ../../BRANCH; else svn info | sed -n -e '/URL:/ h' -e '/Repository Root:/ { x; H; x; s|Repository Root: \(.*\)\nURL: \1\(.*\)|\2| ; s|^/|| ; s|/[a-zA-Z]*/src.*|| ; p }'; fi` 5 PPMERGE_SOURCE=`if [ -e ../../SOURCE ]; then cat ../../SOURCE; else svn info | sed -n -e 's/Repository UUID: // p'; fi` 3 # PPMERGE_VERSION=`if [ -e ../../VERSION ]; then cat ../../VERSION; else svnversion; fi` 4 # PPMERGE_BRANCH=`if [ -e ../../BRANCH ]; then cat ../../BRANCH; else svn info | sed -n -e '/URL:/ h' -e '/Repository Root:/ { x; H; x; s|Repository Root: \(.*\)\nURL: \1\(.*\)|\2| ; s|^/|| ; s|/[a-zA-Z]*/src.*|| ; p }'; fi` 5 # PPMERGE_SOURCE=`if [ -e ../../SOURCE ]; then cat ../../SOURCE; else svn info | sed -n -e 's/Repository UUID: // p'; fi` 6 # 7 # # Force recompilation of ppMergeVersion.c, since it gets the version information 8 # ppMergeVersion.c: FORCE 9 # touch ppMergeVersion.c 10 # FORCE: ; 6 11 7 # Force recompilation of ppMergeVersion.c, since it gets the version information 8 ppMergeVersion.c: FORCE 9 touch ppMergeVersion.c 10 FORCE: ; 11 12 ppMerge_CFLAGS = $(PPMERGE_CFLAGS) $(PPSTATS_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS) -DPPMERGE_VERSION=\"$(PPMERGE_VERSION)\" -DPPMERGE_BRANCH=\"$(PPMERGE_BRANCH)\" -DPPMERGE_SOURCE=\"$(PPMERGE_SOURCE)\" 12 ppMerge_CFLAGS = $(PPMERGE_CFLAGS) $(PPSTATS_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS) -DPPMERGE_VERSION=$(SVN_VERSION) -DPPMERGE_BRANCH=$(SVN_BRANCH) -DPPMERGE_SOURCE=$(SVN_SOURCE) 13 13 ppMerge_LDFLAGS = $(PPMERGE_LIBS) $(PPSTATS_LIBS) $(PSMODULE_LIBS) $(PSLIB_LIBS) 14 14 -
trunk/ppMerge/src/ppMergeVersion.c
r23195 r23229 22 22 #include "ppMergeVersion.h" 23 23 24 psString ppMergeVersion(void)25 {26 24 #ifndef PPMERGE_VERSION 27 25 #error "PPMERGE_VERSION is not set" … … 30 28 #error "PPMERGE_BRANCH is not set" 31 29 #endif 32 return psStringCopy(PPMERGE_BRANCH "@" PPMERGE_VERSION); 30 #ifndef PPMERGE_SOURCE 31 #error "PPMERGE_SOURCE is not set" 32 #endif 33 34 #define xstr(s) str(s) 35 #define str(s) #s 36 37 psString ppMergeVersion(void) 38 { 39 char *value = NULL; 40 psStringAppend(&value, "%s@%s", xstr(PPMERGE_BRANCH), xstr(PPMERGE_VERSION)); 41 return value; 33 42 } 34 43 35 44 psString ppMergeSource(void) 36 45 { 37 #ifndef PPMERGE_SOURCE 38 #error "PPMERGE_SOURCE is not set" 39 #endif 40 return psStringCopy(PPMERGE_SOURCE); 46 return psStringCopy(xstr(PPMERGE_SOURCE)); 41 47 } 42 48 -
trunk/ppSim/src/Makefile.am
r23139 r23229 1 1 bin_PROGRAMS = ppSim ppSimSequence 2 2 3 PPSIM_VERSION=`if [ -e ../../VERSION ]; then cat ../../VERSION; else svnversion; fi` 4 PPSIM_BRANCH=`if [ -e ../../BRANCH ]; then cat ../../BRANCH; else svn info | sed -n -e '/URL:/ h' -e '/Repository Root:/ { x; H; x; s|Repository Root: \(.*\)\nURL: \1\(.*\)|\2| ; s|^/|| ; s|/[a-zA-Z]*/src.*|| ; p }'; fi` 5 PPSIM_SOURCE=`if [ -e ../../SOURCE ]; then cat ../../SOURCE; else svn info | sed -n -e 's/Repository UUID: // p'; fi` 3 # PPSIM_VERSION=`if [ -e ../../VERSION ]; then cat ../../VERSION; else svnversion; fi` 4 # PPSIM_BRANCH=`if [ -e ../../BRANCH ]; then cat ../../BRANCH; else svn info | sed -n -e '/URL:/ h' -e '/Repository Root:/ { x; H; x; s|Repository Root: \(.*\)\nURL: \1\(.*\)|\2| ; s|^/|| ; s|/[a-zA-Z]*/src.*|| ; p }'; fi` 5 # PPSIM_SOURCE=`if [ -e ../../SOURCE ]; then cat ../../SOURCE; else svn info | sed -n -e 's/Repository UUID: // p'; fi` 6 # 7 # # Force recompilation of ppSimVersion.c, since it gets the version information 8 # ppSimVersion.c: FORCE 9 # touch ppSimVersion.c 10 # FORCE: ; 6 11 7 # Force recompilation of ppSimVersion.c, since it gets the version information 8 ppSimVersion.c: FORCE 9 touch ppSimVersion.c 10 FORCE: ; 11 12 ppSim_CPPFLAGS = $(PSLIB_CFLAGS) $(PSMODULE_CFLAGS) $(PSPHOT_CFLAGS) $(PSASTRO_CFLAGS) $(ppSim_CFLAGS) -DPPSIM_VERSION=\"$(PPSIM_VERSION)\" -DPPSIM_BRANCH=\"$(PPSIM_BRANCH)\" -DPPSIM_SOURCE=\"$(PPSIM_SOURCE)\" 12 ppSim_CPPFLAGS = $(PSLIB_CFLAGS) $(PSMODULE_CFLAGS) $(PSPHOT_CFLAGS) $(PSASTRO_CFLAGS) $(ppSim_CFLAGS) -DPPSIM_VERSION=$(SVN_VERSION) -DPPSIM_BRANCH=$(SVN_BRANCH) -DPPSIM_SOURCE=$(SVN_SOURCE) 13 13 ppSim_LDFLAGS = $(PSLIB_LIBS) $(PSMODULE_LIBS) $(PSPHOT_LIBS) $(PSASTRO_LIBS) 14 14 ppSim_SOURCES = \ -
trunk/ppSim/src/ppSimVersion.c
r23139 r23229 1 1 #include "ppSim.h" 2 2 3 4 psString ppSimVersion(void)5 {6 3 #ifndef PPSIM_VERSION 7 4 #error "PPSIM_VERSION is not set" … … 10 7 #error "PPSIM_BRANCH is not set" 11 8 #endif 12 return psStringCopy(PPSIM_BRANCH "@" PPSIM_VERSION); 9 #ifndef PPSIM_SOURCE 10 #error "PPSIM_SOURCE is not set" 11 #endif 12 13 #define xstr(s) str(s) 14 #define str(s) #s 15 16 psString ppSimVersion(void) 17 { 18 char *value = NULL; 19 psStringAppend(&value, "%s@%s", xstr(PPSIM_BRANCH), xstr(PPSIM_VERSION)); 20 return value; 13 21 } 14 22 15 23 psString ppSimSource(void) 16 24 { 17 #ifndef PPSIM_SOURCE 18 #error "PPSIM_SOURCE is not set" 19 #endif 20 return psStringCopy(PPSIM_SOURCE); 25 return psStringCopy(xstr(PPSIM_SOURCE)); 21 26 } 22 27 -
trunk/ppStack/src/Makefile.am
r23143 r23229 1 1 bin_PROGRAMS = ppStack 2 2 3 PPSTACK_VERSION=`if [ -e ../../VERSION ]; then cat ../../VERSION; else svnversion; fi` 4 PPSTACK_BRANCH=`if [ -e ../../BRANCH ]; then cat ../../BRANCH; else svn info | sed -n -e '/URL:/ h' -e '/Repository Root:/ { x; H; x; s|Repository Root: \(.*\)\nURL: \1\(.*\)|\2| ; s|^/|| ; s|/[a-zA-Z]*/src.*|| ; p }'; fi` 5 PPSTACK_SOURCE=`if [ -e ../../SOURCE ]; then cat ../../SOURCE; else svn info | sed -n -e 's/Repository UUID: // p'; fi` 3 # PPSTACK_VERSION=`if [ -e ../../VERSION ]; then cat ../../VERSION; else svnversion; fi` 4 # PPSTACK_BRANCH=`if [ -e ../../BRANCH ]; then cat ../../BRANCH; else svn info | sed -n -e '/URL:/ h' -e '/Repository Root:/ { x; H; x; s|Repository Root: \(.*\)\nURL: \1\(.*\)|\2| ; s|^/|| ; s|/[a-zA-Z]*/src.*|| ; p }'; fi` 5 # PPSTACK_SOURCE=`if [ -e ../../SOURCE ]; then cat ../../SOURCE; else svn info | sed -n -e 's/Repository UUID: // p'; fi` 6 # 7 # # Force recompilation of ppStackVersion.c, since it gets the version information 8 # ppStackVersion.c: FORCE 9 # touch ppStackVersion.c 10 # FORCE: ; 6 11 7 # Force recompilation of ppStackVersion.c, since it gets the version information 8 ppStackVersion.c: FORCE 9 touch ppStackVersion.c 10 FORCE: ; 11 12 ppStack_CFLAGS = $(PSLIB_CFLAGS) $(PSMODULE_CFLAGS) $(PSPHOT_CFLAGS) $(PPSTATS_CFLAGS) $(PPSTACK_CFLAGS) -DPPSTACK_VERSION=\"$(PPSTACK_VERSION)\" -DPPSTACK_BRANCH=\"$(PPSTACK_BRANCH)\" -DPPSTACK_SOURCE=\"$(PPSTACK_SOURCE)\" 12 ppStack_CFLAGS = $(PSLIB_CFLAGS) $(PSMODULE_CFLAGS) $(PSPHOT_CFLAGS) $(PPSTATS_CFLAGS) $(PPSTACK_CFLAGS) -DPPSTACK_VERSION=$(SVN_VERSION) -DPPSTACK_BRANCH=$(SVN_BRANCH) -DPPSTACK_SOURCE=$(SVN_SOURCE) 13 13 ppStack_LDFLAGS = $(PSLIB_LIBS) $(PSMODULE_LIBS) $(PSPHOT_LIBS) $(PPSTATS_LIBS) $(PPSTACK_LIBS) 14 14 -
trunk/ppStack/src/ppStackVersion.c
r23195 r23229 11 11 #include "ppStack.h" 12 12 13 psString ppStackVersion(void)14 {15 13 #ifndef PPSTACK_VERSION 16 14 #error "PPSTACK_VERSION is not set" … … 19 17 #error "PPSTACK_BRANCH is not set" 20 18 #endif 21 return psStringCopy(PPSTACK_BRANCH "@" PPSTACK_VERSION); 19 #ifndef PPSTACK_SOURCE 20 #error "PPSTACK_SOURCE is not set" 21 #endif 22 23 #define xstr(s) str(s) 24 #define str(s) #s 25 26 psString ppStackVersion(void) 27 { 28 char *value = NULL; 29 psStringAppend(&value, "%s@%s", xstr(PPSTACK_BRANCH), xstr(PPSTACK_VERSION)); 30 return value; 22 31 } 23 32 24 33 psString ppStackSource(void) 25 34 { 26 #ifndef PPSTACK_SOURCE 27 #error "PPSTACK_SOURCE is not set" 28 #endif 29 return psStringCopy(PPSTACK_SOURCE); 35 return psStringCopy(xstr(PPSTACK_SOURCE)); 30 36 } 31 37 -
trunk/ppStats/src/Makefile.am
r23119 r23229 1 1 lib_LTLIBRARIES = libppStats.la 2 2 3 PPSTATS_VERSION=`if [ -e ../../VERSION ]; then cat ../../VERSION; else svnversion; fi` 4 PPSTATS_BRANCH=`if [ -e ../../BRANCH ]; then cat ../../BRANCH; else svn info | sed -n -e '/URL:/ h' -e '/Repository Root:/ { x; H; x; s|Repository Root: \(.*\)\nURL: \1\(.*\)|\2| ; s|^/|| ; s|/[a-zA-Z]*/src.*|| ; p }'; fi` 5 PPSTATS_SOURCE=`if [ -e ../../SOURCE ]; then cat ../../SOURCE; else svn info | sed -n -e 's/Repository UUID: // p'; fi` 3 # PPSTATS_VERSION=`if [ -e ../../VERSION ]; then cat ../../VERSION; else svnversion; fi` 4 # PPSTATS_BRANCH=`if [ -e ../../BRANCH ]; then cat ../../BRANCH; else svn info | sed -n -e '/URL:/ h' -e '/Repository Root:/ { x; H; x; s|Repository Root: \(.*\)\nURL: \1\(.*\)|\2| ; s|^/|| ; s|/[a-zA-Z]*/src.*|| ; p }'; fi` 5 # PPSTATS_SOURCE=`if [ -e ../../SOURCE ]; then cat ../../SOURCE; else svn info | sed -n -e 's/Repository UUID: // p'; fi` 6 # 7 # # Force recompilation of ppStatsVersion.c, since it gets the version information 8 # ppStatsVersion.c: FORCE 9 # touch ppStatsVersion.c 10 # FORCE: ; 6 11 7 # Force recompilation of ppStatsVersion.c, since it gets the version information 8 ppStatsVersion.c: FORCE 9 touch ppStatsVersion.c 10 FORCE: ; 11 12 libppStats_la_CFLAGS = $(PPSTATS_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS) -DPPSTATS_VERSION=\"$(PPSTATS_VERSION)\" -DPPSTATS_BRANCH=\"$(PPSTATS_BRANCH)\" -DPPSTATS_SOURCE=\"$(PPSTATS_SOURCE)\" 12 libppStats_la_CFLAGS = $(PPSTATS_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS) -DPPSTATS_VERSION=$(SVN_VERSION) -DPPSTATS_BRANCH=$(SVN_BRANCH) -DPPSTATS_SOURCE=$(SVN_SOURCE) 13 13 libppStats_la_LDFLAGS = $(PPSTATS_LIBS) $(PSMODULE_LIBS) $(PSLIB_LIBS) 14 14 -
trunk/ppStats/src/ppStatsVersion.c
r23163 r23229 1 1 #include "ppStatsInternal.h" 2 2 3 psString ppStatsVersion(void)4 {5 3 #ifndef PPSTATS_VERSION 6 4 #error "PPSTATS_VERSION is not set" … … 9 7 #error "PPSTATS_BRANCH is not set" 10 8 #endif 11 return psStringCopy(PPSTATS_BRANCH "@" PPSTATS_VERSION); 9 #ifndef PPSTATS_SOURCE 10 #error "PPSTATS_SOURCE is not set" 11 #endif 12 13 #define xstr(s) str(s) 14 #define str(s) #s 15 16 psString ppStatsVersion(void) 17 { 18 char *value = NULL; 19 psStringAppend(&value, "%s@%s", xstr(PPSTATS_BRANCH), xstr(PPSTATS_VERSION)); 20 return value; 12 21 } 13 22 14 23 psString ppStatsSource(void) 15 24 { 16 #ifndef PPSTATS_SOURCE 17 #error "PPSTATS_SOURCE is not set" 18 #endif 19 return psStringCopy(PPSTATS_SOURCE); 25 return psStringCopy(xstr(PPSTATS_SOURCE)); 20 26 } 21 27 -
trunk/ppSub/src/Makefile.am
r23144 r23229 1 1 bin_PROGRAMS = ppSub ppSubKernel 2 2 3 PPSUB_VERSION=`if [ -e ../../VERSION ]; then cat ../../VERSION; else svnversion; fi` 4 PPSUB_BRANCH=`if [ -e ../../BRANCH ]; then cat ../../BRANCH; else svn info | sed -n -e '/URL:/ h' -e '/Repository Root:/ { x; H; x; s|Repository Root: \(.*\)\nURL: \1\(.*\)|\2| ; s|^/|| ; s|/[a-zA-Z]*/src.*|| ; p }'; fi` 5 PPSUB_SOURCE=`if [ -e ../../SOURCE ]; then cat ../../SOURCE; else svn info | sed -n -e 's/Repository UUID: // p'; fi` 3 # PPSUB_VERSION=`if [ -e ../../VERSION ]; then cat ../../VERSION; else svnversion; fi` 4 # PPSUB_BRANCH=`if [ -e ../../BRANCH ]; then cat ../../BRANCH; else svn info | sed -n -e '/URL:/ h' -e '/Repository Root:/ { x; H; x; s|Repository Root: \(.*\)\nURL: \1\(.*\)|\2| ; s|^/|| ; s|/[a-zA-Z]*/src.*|| ; p }'; fi` 5 # PPSUB_SOURCE=`if [ -e ../../SOURCE ]; then cat ../../SOURCE; else svn info | sed -n -e 's/Repository UUID: // p'; fi` 6 # 7 # # Force recompilation of ppSubVersion.c, since it gets the version information 8 # ppSubVersion.c: FORCE 9 # touch ppSubVersion.c 10 # FORCE: ; 6 11 7 # Force recompilation of ppSubVersion.c, since it gets the version information 8 ppSubVersion.c: FORCE 9 touch ppSubVersion.c 10 FORCE: ; 11 12 ppSub_CPPFLAGS = $(PSLIB_CFLAGS) $(PSMODULE_CFLAGS) $(PPSTATS_CFLAGS) $(PSPHOT_CFLAGS) $(PPSUB_CFLAGS) -DPPSUB_VERSION=\"$(PPSUB_VERSION)\" -DPPSUB_BRANCH=\"$(PPSUB_BRANCH)\" -DPPSUB_SOURCE=\"$(PPSUB_SOURCE)\" 12 ppSub_CPPFLAGS = $(PSLIB_CFLAGS) $(PSMODULE_CFLAGS) $(PPSTATS_CFLAGS) $(PSPHOT_CFLAGS) $(PPSUB_CFLAGS) -DPPSUB_VERSION=$(SVN_VERSION) -DPPSUB_BRANCH=$(SVN_BRANCH) -DPPSUB_SOURCE=$(SVN_SOURCE) 13 13 ppSub_LDFLAGS = $(PSLIB_LIBS) $(PSMODULE_LIBS) $(PPSTATS_LIBS) $(PSPHOT_LIBS) $(PPSUB_LIBS) 14 14 -
trunk/ppSub/src/ppSubVersion.c
r23195 r23229 23 23 #include "ppSub.h" 24 24 25 psString ppSubVersion(void)26 {27 25 #ifndef PPSUB_VERSION 28 26 #error "PPSUB_VERSION is not set" … … 31 29 #error "PPSUB_BRANCH is not set" 32 30 #endif 33 return psStringCopy(PPSUB_BRANCH "@" PPSUB_VERSION); 31 #ifndef PPSUB_SOURCE 32 #error "PPSUB_SOURCE is not set" 33 #endif 34 35 #define xstr(s) str(s) 36 #define str(s) #s 37 38 psString ppSubVersion(void) 39 { 40 char *value = NULL; 41 psStringAppend(&value, "%s@%s", xstr(PPSUB_BRANCH), xstr(PPSUB_VERSION)); 42 return value; 34 43 } 35 44 36 45 psString ppSubSource(void) 37 46 { 38 #ifndef PPSUB_SOURCE 39 #error "PPSUB_SOURCE is not set" 40 #endif 41 return psStringCopy(PPSUB_SOURCE); 47 return psStringCopy(xstr(PPSUB_SOURCE)); 42 48 } 43 49 -
trunk/psLib/src/sys/Makefile.am
r23115 r23229 3 3 noinst_LTLIBRARIES = libpslibsys.la 4 4 5 PSLIB_VERSION=`if [ -e ../../VERSION ]; then cat ../../VERSION; else svnversion; fi`6 PSLIB_BRANCH=`if [ -e ../../BRANCH ]; then cat ../../BRANCH; else svn info | sed -n -e '/URL:/ h' -e '/Repository Root:/ { x; H; x; s|Repository Root: \(.*\)\nURL: \1\(.*\)|\2| ; s|^/|| ; s|/[a-zA-Z]*/src.*|| ; p }'; fi`7 PSLIB_SOURCE=`if [ -e ../../SOURCE ]; then cat ../../SOURCE; else svn info | sed -n -e 's/Repository UUID: // p'; fi`5 # PSLIB_VERSION=`if [ -e ../../VERSION ]; then cat ../../VERSION; else svnversion; fi` 6 # PSLIB_BRANCH=`if [ -e ../../BRANCH ]; then cat ../../BRANCH; else svn info | sed -n -e '/URL:/ h' -e '/Repository Root:/ { x; H; x; s|Repository Root: \(.*\)\nURL: \1\(.*\)|\2| ; s|^/|| ; s|/[a-zA-Z]*/src.*|| ; p }'; fi` 7 # PSLIB_SOURCE=`if [ -e ../../SOURCE ]; then cat ../../SOURCE; else svn info | sed -n -e 's/Repository UUID: // p'; fi` 8 8 9 9 # Force recompilation of psConfigure.c, since it gets the version information … … 12 12 FORCE: ; 13 13 14 libpslibsys_la_CPPFLAGS = $(SRCINC) $(PSLIB_CFLAGS) $(CFITSIO_CFLAGS) -DPSLIB_VERSION= \"$(PSLIB_VERSION)\" -DPSLIB_BRANCH=\"$(PSLIB_BRANCH)\" -DPSLIB_SOURCE=\"$(PSLIB_SOURCE)\"14 libpslibsys_la_CPPFLAGS = $(SRCINC) $(PSLIB_CFLAGS) $(CFITSIO_CFLAGS) -DPSLIB_VERSION=$(SVN_VERSION) -DPSLIB_BRANCH=$(SVN_BRANCH) -DPSLIB_SOURCE=$(SVN_SOURCE) 15 15 libpslibsys_la_SOURCES = \ 16 16 psAbort.c \ -
trunk/psLib/src/sys/psConfigure.c
r23116 r23229 47 47 static FILE *memCheckFile = NULL; // File to which to write results of mem check 48 48 49 50 psString psLibVersion(void)51 {52 49 #ifndef PSLIB_VERSION 53 50 #error "PSLIB_VERSION is not set" … … 56 53 #error "PSLIB_BRANCH is not set" 57 54 #endif 58 return psStringCopy(PSLIB_BRANCH "@" PSLIB_VERSION); 55 #ifndef PSLIB_SOURCE 56 #error "PSLIB_SOURCE is not set" 57 #endif 58 59 #define xstr(s) str(s) 60 #define str(s) #s 61 62 psString psLibVersion(void) 63 { 64 char *value = NULL; 65 psStringAppend(&value, "%s@%s", xstr(PSLIB_BRANCH), xstr(PSLIB_VERSION)); 66 return value; 59 67 } 60 68 61 69 psString psLibSource(void) 62 70 { 63 #ifndef PSLIB_SOURCE 64 #error "PSLIB_SOURCE is not set" 65 #endif 66 return psStringCopy(PSLIB_SOURCE); 71 return psStringCopy(xstr(PSLIB_SOURCE)); 67 72 } 68 73 -
trunk/psModules/src/config/Makefile.am
r23117 r23229 1 1 noinst_LTLIBRARIES = libpsmodulesconfig.la 2 2 3 PSMODULES_VERSION=`if [ -e ../../VERSION ]; then cat ../../VERSION; else svnversion; fi`4 PSMODULES_BRANCH=`if [ -e ../../BRANCH ]; then cat ../../BRANCH; else svn info | sed -n -e '/URL:/ h' -e '/Repository Root:/ { x; H; x; s|Repository Root: \(.*\)\nURL: \1\(.*\)|\2| ; s|^/|| ; s|/[a-zA-Z]*/src.*|| ; p }'; fi`5 PSMODULES_SOURCE=`if [ -e ../../SOURCE ]; then cat ../../SOURCE; else svn info | sed -n -e 's/Repository UUID: // p'; fi`3 # PSMODULES_VERSION=`if [ -e ../../VERSION ]; then cat ../../VERSION; else svnversion; fi` 4 # PSMODULES_BRANCH=`if [ -e ../../BRANCH ]; then cat ../../BRANCH; else svn info | sed -n -e '/URL:/ h' -e '/Repository Root:/ { x; H; x; s|Repository Root: \(.*\)\nURL: \1\(.*\)|\2| ; s|^/|| ; s|/[a-zA-Z]*/src.*|| ; p }'; fi` 5 # PSMODULES_SOURCE=`if [ -e ../../SOURCE ]; then cat ../../SOURCE; else svn info | sed -n -e 's/Repository UUID: // p'; fi` 6 6 7 7 # Force recompilation of pmVersion.c, since it gets the version information 8 pmVersion.c: FORCE9 touch pmVersion.c10 FORCE: ;8 # pmVersion.c: FORCE 9 # touch pmVersion.c 10 # FORCE: ; 11 11 12 libpsmodulesconfig_la_CPPFLAGS = $(SRCINC) $(PSMODULES_CFLAGS) -DPSMODULES_VERSION= \"$(PSMODULES_VERSION)\" -DPSMODULES_BRANCH=\"$(PSMODULES_BRANCH)\" -DPSMODULES_SOURCE=\"$(PSMODULES_SOURCE)\"12 libpsmodulesconfig_la_CPPFLAGS = $(SRCINC) $(PSMODULES_CFLAGS) -DPSMODULES_VERSION=$(SVN_VERSION) -DPSMODULES_BRANCH=$(SVN_BRANCH) -DPSMODULES_SOURCE=$(SVN_SOURCE) 13 13 libpsmodulesconfig_la_LDFLAGS = -release $(PACKAGE_VERSION) 14 14 libpsmodulesconfig_la_SOURCES = \ -
trunk/psModules/src/config/pmVersion.c
r23193 r23229 8 8 #include "pmVersion.h" 9 9 10 psString psModulesVersion(void)11 {12 10 #ifndef PSMODULES_VERSION 13 11 #error "PSMODULES_VERSION is not set" … … 16 14 #error "PSMODULES_BRANCH is not set" 17 15 #endif 18 return psStringCopy(PSMODULES_BRANCH "@" PSMODULES_VERSION); 16 #ifndef PSMODULES_SOURCE 17 #error "PSMODULES_SOURCE is not set" 18 #endif 19 20 #define xstr(s) str(s) 21 #define str(s) #s 22 23 psString psModulesVersion(void) 24 { 25 char *value = NULL; 26 psStringAppend(&value, "%s@%s", xstr(PSMODULES_BRANCH), xstr(PSMODULES_VERSION)); 27 return value; 19 28 } 20 29 21 30 psString psModulesSource(void) 22 31 { 23 #ifndef PSMODULES_SOURCE 24 #error "PSMODULES_SOURCE is not set" 25 #endif 26 return psStringCopy(PSMODULES_SOURCE); 32 return psStringCopy(xstr(PSMODULES_SOURCE)); 27 33 } 28 34 -
trunk/psastro/src/Makefile.am
r23195 r23229 1 1 lib_LTLIBRARIES = libpsastro.la 2 2 3 PSASTRO_VERSION=`if [ -e ../../VERSION ]; then cat ../../VERSION; else svnversion; fi` 4 PSASTRO_BRANCH=`if [ -e ../../BRANCH ]; then cat ../../BRANCH; else svn info | sed -n -e '/URL:/ h' -e '/Repository Root:/ { x; H; x; s|Repository Root: \(.*\)\nURL: \1\(.*\)|\2| ; s|^/|| ; s|/[a-zA-Z]*/src.*|| ; p }'; fi` 5 PSASTRO_SOURCE=`if [ -e ../../SOURCE ]; then cat ../../SOURCE; else svn info | sed -n -e 's/Repository UUID: // p'; fi` 3 libpsastro_la_CFLAGS = $(PSASTRO_CFLAGS) $(PPSTATS_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS) -DPSASTRO_VERSION=$(SVN_VERSION) -DPSASTRO_BRANCH=$(SVN_BRANCH) -DPSASTRO_SOURCE=$(SVN_SOURCE) 4 libpsastro_la_LDFLAGS = $(PSASTRO_LIBS) $(PPSTATS_LIBS) $(PSMODULE_LIBS) $(PSLIB_LIBS) 6 5 7 6 # Force recompilation of psastroVersion.c, since it gets the version information 8 psastroVersion.c: FORCE 9 touch psastroVersion.c 10 FORCE: ; 11 12 libpsastro_la_CFLAGS = $(PSASTRO_CFLAGS) $(PPSTATS_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS) -DPSASTRO_VERSION=\"$(PSASTRO_VERSION)\" -DPSASTRO_BRANCH=\"$(PSASTRO_BRANCH)\" -DPSASTRO_SOURCE=\"$(PSASTRO_SOURCE)\" 13 libpsastro_la_LDFLAGS = $(PSASTRO_LIBS) $(PPSTATS_LIBS) $(PSMODULE_LIBS) $(PSLIB_LIBS) 7 # can we do this with dependency info? 8 # psastroVersion.c: FORCE 9 # touch psastroVersion.c 10 # FORCE: ; 14 11 15 12 bin_PROGRAMS = psastro psastroModel psastroModelFit gpcModel -
trunk/psastro/src/psastroVersion.c
r23195 r23229 10 10 #include "psastroInternal.h" 11 11 12 psString psastroVersion(void)13 {14 12 #ifndef PSASTRO_VERSION 15 13 #error "PSASTRO_VERSION is not set" … … 18 16 #error "PSASTRO_BRANCH is not set" 19 17 #endif 20 return psStringCopy(PSASTRO_BRANCH "@" PSASTRO_VERSION); 18 #ifndef PSASTRO_SOURCE 19 #error "PSASTRO_SOURCE is not set" 20 #endif 21 22 #define xstr(s) str(s) 23 #define str(s) #s 24 25 psString psastroVersion(void) 26 { 27 char *value = NULL; 28 psStringAppend(&value, "%s@%s", xstr(PSASTRO_BRANCH), xstr(PSASTRO_VERSION)); 29 return value; 21 30 } 22 31 23 32 psString psastroSource(void) 24 33 { 25 #ifndef PSASTRO_SOURCE 26 #error "PSASTRO_SOURCE is not set" 27 #endif 28 return psStringCopy(PSASTRO_SOURCE); 34 return psStringCopy(xstr(PSASTRO_SOURCE)); 29 35 } 30 36 -
trunk/psconfig/psbuild
r22740 r23229 13 13 $stop = ""; 14 14 $verbose = 0; 15 $use_svn = 1; 15 16 16 17 $extlibs = "none"; … … 83 84 if ($ARGV[0] eq "-bootstrap") { 84 85 &bootstrap (); 86 } 87 if ($ARGV[0] eq "-skip-svn") { 88 $use_svn = 0; 89 shift; next; 85 90 } 86 91 if ($ARGV[0] eq "-env") { … … 157 162 sub build_distribution { 158 163 164 # set environment variables used to supply SVN info to the compilation 165 166 if ($use_svn) { 167 # example dump from svn info: 168 # pikake: svn info 169 # Path: . 170 # URL: https://svn.pan-starrs.ifa.hawaii.edu/repo/ipp/branches/eam_branches/eam_branch_20090303/ppImage 171 # Repository Root: https://svn.pan-starrs.ifa.hawaii.edu/repo/ipp 172 # Repository UUID: 60eb6cdc-a59c-4636-a4e0-dba66a9721fd 173 # Revision: 23158 174 # Node Kind: directory 175 # Schedule: normal 176 # Last Changed Author: price 177 # Last Changed Rev: 23125 178 # Last Changed Date: 2009-03-03 15:41:16 -1000 (Tue, 03 Mar 2009) 179 180 $svn_version = `svnversion`; chomp $svn_version; 181 @svn_info = `svn info`; 182 183 # get the svn_root first: 184 foreach $line (@svn_info) { 185 if ($line =~ m|^Repository Root:|) { 186 ($svn_root) = $line =~ m|^Repository Root:\s*(\S*)|; 187 last; 188 } 189 } 190 191 # now get the branch and UUID values 192 foreach $line (@svn_info) { 193 if ($line =~ m|^URL:|) { 194 ($svn_branch) = $line =~ m|^URL:\s*$svn_root/*(\S*)|; 195 } 196 if ($line =~ m|^Repository UUID:|) { 197 ($svn_source) = $line =~ m|^Repository UUID:\s*(\S*)|; 198 } 199 } 200 201 $ENV{SVN_VERSION} = $svn_version; 202 $ENV{SVN_BRANCH} = $svn_branch; 203 $ENV{SVN_SOURCE} = $svn_source; 204 } else { 205 # alternatively, grab these from the following files: 206 if (! -e "SVNINFO") { 207 print "missing SVNINFO file for repository info, skipping\n"; 208 } else { 209 @svn_info = `cat SVNINFO`; 210 foreach $line (@svn_info) { 211 ($name, $value) = split (" ", $line); 212 $ENV{$name} = $value; 213 } 214 } 215 } 216 print "SVN_VERSION $ENV{SVN_VERSION}\n"; 217 print "SVN_BRANCH $ENV{SVN_BRANCH}\n"; 218 print "SVN_SOURCE $ENV{SVN_SOURCE}\n"; 219 159 220 # use psconfig.csh to set needed build aliases 160 161 221 if ($extlibs eq "check") { 162 222 $status = vsystem ("pschecklibs"); -
trunk/psphot/src/Makefile.am
r23118 r23229 1 1 lib_LTLIBRARIES = libpsphot.la 2 2 3 PSPHOT_VERSION=`if [ -e ../../VERSION ]; then cat ../../VERSION; else svnversion; fi` 4 PSPHOT_BRANCH=`if [ -e ../../BRANCH ]; then cat ../../BRANCH; else svn info | sed -n -e '/URL:/ h' -e '/Repository Root:/ { x; H; x; s|Repository Root: \(.*\)\nURL: \1\(.*\)|\2| ; s|^/|| ; s|/[a-zA-Z]*/src.*|| ; p }'; fi` 5 PSPHOT_SOURCE=`if [ -e ../../SOURCE ]; then cat ../../SOURCE; else svn info | sed -n -e 's/Repository UUID: // p'; fi` 3 # PSPHOT_VERSION=`if [ -e ../../VERSION ]; then cat ../../VERSION; else svnversion; fi` 4 # PSPHOT_BRANCH=`if [ -e ../../BRANCH ]; then cat ../../BRANCH; else svn info | sed -n -e '/URL:/ h' -e '/Repository Root:/ { x; H; x; s|Repository Root: \(.*\)\nURL: \1\(.*\)|\2| ; s|^/|| ; s|/[a-zA-Z]*/src.*|| ; p }'; fi` 5 # PSPHOT_SOURCE=`if [ -e ../../SOURCE ]; then cat ../../SOURCE; else svn info | sed -n -e 's/Repository UUID: // p'; fi` 6 # 7 # # Force recompilation of psphotVersion.c, since it gets the version information 8 # psphotVersion.c: FORCE 9 # touch psphotVersion.c 10 # FORCE: ; 6 11 7 # Force recompilation of psphotVersion.c, since it gets the version information 8 psphotVersion.c: FORCE 9 touch psphotVersion.c 10 FORCE: ; 11 12 libpsphot_la_CFLAGS = $(PSPHOT_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS) -DPSPHOT_VERSION=\"$(PSPHOT_VERSION)\" -DPSPHOT_BRANCH=\"$(PSPHOT_BRANCH)\" -DPSPHOT_SOURCE=\"$(PSPHOT_SOURCE)\" 12 libpsphot_la_CFLAGS = $(PSPHOT_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS) -DPSPHOT_VERSION=$(PSPHOT_VERSION) -DPSPHOT_BRANCH=$(PSPHOT_BRANCH) -DPSPHOT_SOURCE=$(SVN_SOURCE) 13 13 libpsphot_la_LDFLAGS = $(PSPHOT_LIBS) $(PSMODULE_LIBS) $(PSLIB_LIBS) 14 14 -
trunk/psphot/src/psphotVersion.c
r23195 r23229 5 5 #endif 6 6 7 psString psphotVersion(void)8 {9 7 #ifndef PSPHOT_VERSION 10 8 #error "PSPHOT_VERSION is not set" … … 13 11 #error "PSPHOT_BRANCH is not set" 14 12 #endif 15 return psStringCopy(PSPHOT_BRANCH "@" PSPHOT_VERSION); 13 #ifndef PSPHOT_SOURCE 14 #error "PSPHOT_SOURCE is not set" 15 #endif 16 17 #define xstr(s) str(s) 18 #define str(s) #s 19 20 psString psphotVersion(void) 21 { 22 char *value = NULL; 23 psStringAppend(&value, "%s@%s", xstr(PSPHOT_BRANCH), xstr(PSPHOT_VERSION)); 24 return value; 16 25 } 17 26 18 27 psString psphotSource(void) 19 28 { 20 #ifndef PSPHOT_SOURCE 21 #error "PSPHOT_SOURCE is not set" 22 #endif 23 return psStringCopy(PSPHOT_SOURCE); 29 return psStringCopy(xstr(PSPHOT_SOURCE)); 24 30 } 25 31
Note:
See TracChangeset
for help on using the changeset viewer.
