Changeset 23239 for branches/cnb_branches/cnb_branch_20090215
- Timestamp:
- Mar 9, 2009, 3:41:26 PM (17 years ago)
- Location:
- branches/cnb_branches/cnb_branch_20090215
- Files:
-
- 102 edited
- 7 copied
-
. (modified) (1 prop)
-
Nebulous/nebclient/src (modified) (1 prop)
-
Nebulous/nebclient/tests/tap/src (modified) (1 prop)
-
Ohana (modified) (1 prop)
-
Ohana/src/addstar/src/get2mass_full.c (modified) (10 diffs)
-
Ohana/src/addstar/src/sky_tessalation.c (modified) (5 diffs)
-
Ohana/src/imregister/base/get_fwhm.c (copied) (copied from trunk/Ohana/src/imregister/base/get_fwhm.c ) (1 prop)
-
Ohana/src/imregister/detrend/usage.c (copied) (copied from trunk/Ohana/src/imregister/detrend/usage.c ) (1 prop)
-
Ohana/src/imregister/imreg/load_probes.c (copied) (copied from trunk/Ohana/src/imregister/imreg/load_probes.c ) (1 prop)
-
Ohana/src/libdvo (modified) (1 prop)
-
Ohana/src/libdvo/lib (modified) (1 prop)
-
Ohana/src/libfits/lib (modified) (1 prop)
-
Ohana/src/libkapa/lib (modified) (1 prop)
-
Ohana/src/libohana/lib (modified) (1 prop)
-
Ohana/src/libtap/lib (modified) (1 prop)
-
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 trunk/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)
-
ippTasks/automate.pro (modified) (4 diffs)
-
ippTasks/calibration.pro (modified) (2 diffs)
-
ippTasks/camera.pro (modified) (4 diffs)
-
ippTasks/chip.pro (modified) (5 diffs)
-
ippTasks/detrend.correct.pro (modified) (2 diffs)
-
ippTasks/detrend.mkruns.pro (modified) (3 diffs)
-
ippTasks/detrend.norm.pro (modified) (12 diffs)
-
ippTasks/detrend.process.pro (modified) (8 diffs)
-
ippTasks/detrend.reject.pro (modified) (2 diffs)
-
ippTasks/detrend.resid.pro (modified) (8 diffs)
-
ippTasks/detrend.stack.pro (modified) (4 diffs)
-
ippTasks/diff.pro (modified) (4 diffs)
-
ippTasks/fake.pro (modified) (4 diffs)
-
ippTasks/flatcorr.pro (modified) (3 diffs)
-
ippTasks/magic.pro (modified) (6 diffs)
-
ippTasks/pstamp.pro (modified) (7 diffs)
-
ippTasks/register.pro (modified) (4 diffs)
-
ippTasks/replicate.pro (modified) (2 diffs)
-
ippTasks/stack.pro (modified) (4 diffs)
-
ippTasks/summit.copy.pro (modified) (9 diffs)
-
ippTasks/warp.pro (modified) (6 diffs)
-
ippTools/scripts/test_create_detrend.sql (copied) (copied from trunk/ippTools/scripts/test_create_detrend.sql )
-
ippTools/scripts/test_insert_detrend.sql (copied) (copied from trunk/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)
-
ippconfig/dvo.ps1v1.photcodes (copied) (copied from trunk/ippconfig/dvo.ps1v1.photcodes )
-
ippconfig/gpc1/ppImage.config (modified) (1 diff)
-
ippconfig/recipes/filerules-mef.mdc (modified) (1 diff)
-
ippconfig/recipes/filerules-simple.mdc (modified) (1 diff)
-
ippconfig/recipes/filerules-split.mdc (modified) (1 diff)
-
ippconfig/recipes/ppImage.config (modified) (1 diff)
-
ippconfig/recipes/ppStack.config (modified) (1 diff)
-
ippconfig/recipes/ppSub.config (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/ppStackArguments.c (modified) (2 diffs)
-
ppStack/src/ppStackSources.c (modified) (5 diffs)
-
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/ppSubArguments.c (modified) (6 diffs)
-
ppSub/src/ppSubCamera.c (modified) (5 diffs)
-
ppSub/src/ppSubMakePSF.c (modified) (1 diff)
-
ppSub/src/ppSubMatchPSFs.c (modified) (2 diffs)
-
ppSub/src/ppSubVersion.c (modified) (2 diffs)
-
psLib/src/imageops/psImageInterpolate.c (modified) (1 diff)
-
psLib/src/sys/Makefile.am (modified) (2 diffs)
-
psLib/src/sys/psConfigure.c (modified) (2 diffs)
-
psLib/src/sys/psLogMsg.c (modified) (2 diffs)
-
psModules/src/config/Makefile.am (modified) (1 diff)
-
psModules/src/config/pmConfig.c (modified) (3 diffs)
-
psModules/src/config/pmVersion.c (modified) (2 diffs)
-
psModules/src/objects/pmSourceMatch.c (modified) (8 diffs)
-
psModules/src/objects/pmSourceMatch.h (modified) (1 diff)
-
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/psphotSetThreads.c (modified) (1 diff)
-
psphot/src/psphotSourceStats.c (modified) (14 diffs)
-
psphot/src/psphotVersion.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/cnb_branches/cnb_branch_20090215
- Property svn:mergeinfo changed
/branches/eam_branches/eam_branch_20090303 (added) merged: 23158,23175-23181,23202-23210,23220-23225 /trunk merged: 23211-23219,23226-23238
- Property svn:mergeinfo changed
-
branches/cnb_branches/cnb_branch_20090215/Nebulous/nebclient/src
- Property svn:ignore
-
old new 10 10 soapServerLib.c 11 11 soapServer.c 12 .libs
-
- Property svn:ignore
-
branches/cnb_branches/cnb_branch_20090215/Nebulous/nebclient/tests/tap/src
- Property svn:ignore
-
old new 6 6 .deps 7 7 Makefile 8 .libs
-
- Property svn:ignore
-
branches/cnb_branches/cnb_branch_20090215/Ohana
-
Property svn:mergeinfo
set to
/trunk/Ohana merged eligible
-
Property svn:mergeinfo
set to
-
branches/cnb_branches/cnb_branch_20090215/Ohana/src/addstar/src/get2mass_full.c
r21536 r23239 1 1 # include "addstar.h" 2 2 # include "2mass.h" 3 4 // XXX check to see if desired output format is PS1_V1 or later? (use 16bit version if not?) 3 5 4 6 // fill in the data for a JHK triplet star. takes a pointer to the start of the line the … … 171 173 172 174 switch (qual) { 173 case ' X': star[0].measure.photFlags |= 0x0000; break;174 case ' U': star[0].measure.photFlags |= 0x0001; break;175 case ' F': star[0].measure.photFlags |= 0x0002; break;176 case ' E': star[0].measure.photFlags |= 0x0003; break;177 case ' A': star[0].measure.photFlags |= 0x0004; break;178 case ' B': star[0].measure.photFlags |= 0x0005; break;179 case ' C': star[0].measure.photFlags |= 0x0006; break;180 case ' D': star[0].measure.photFlags |= 0x0007; break;175 case 'A': star[0].measure.photFlags |= 0x00000001; break; // was: 0x0004 176 case 'B': star[0].measure.photFlags |= 0x00000002; break; // was: 0x0005 177 case 'C': star[0].measure.photFlags |= 0x00000004; break; // was: 0x0006 178 case 'D': star[0].measure.photFlags |= 0x00000008; break; // was: 0x0007 179 case 'E': star[0].measure.photFlags |= 0x00000010; break; // was: 0x0003 180 case 'F': star[0].measure.photFlags |= 0x00000020; break; // was: 0x0002 181 case 'U': star[0].measure.photFlags |= 0x00000040; break; // was: 0x0001 182 case 'X': star[0].measure.photFlags |= 0x00000080; break; // was: 0x0000 181 183 default: 182 184 fprintf (stderr, "error!\n"); … … 189 191 190 192 switch (qual) { 191 case '0': star[0].measure.photFlags |= 0x0000 ; break;192 case '1': star[0].measure.photFlags |= 0x00 10; break;193 case '2': star[0].measure.photFlags |= 0x00 20; break;194 case '3': star[0].measure.photFlags |= 0x00 30; break;195 case '4': star[0].measure.photFlags |= 0x00 40; break;196 case '6': star[0].measure.photFlags |= 0x00 50; break;197 case '9': star[0].measure.photFlags |= 0x00 60; break;193 case '0': star[0].measure.photFlags |= 0x00000100; break; // was: 0x0000 194 case '1': star[0].measure.photFlags |= 0x00000200; break; // was: 0x0010 195 case '2': star[0].measure.photFlags |= 0x00000400; break; // was: 0x0020 196 case '3': star[0].measure.photFlags |= 0x00000800; break; // was: 0x0030 197 case '4': star[0].measure.photFlags |= 0x00001000; break; // was: 0x0040 198 case '6': star[0].measure.photFlags |= 0x00002000; break; // was: 0x0050 199 case '9': star[0].measure.photFlags |= 0x00004000; break; // was: 0x0060 198 200 default: 199 201 fprintf (stderr, "error!\n"); … … 206 208 207 209 switch (qual) { 208 case 'p': star[0].measure.photFlags |= 0x000 0; break;209 case 'c': star[0].measure.photFlags |= 0x0 100; break;210 case 'd': star[0].measure.photFlags |= 0x0 200; break;211 case 's': star[0].measure.photFlags |= 0x0 300; break;212 case 'b': star[0].measure.photFlags |= 0x0 400; break;213 case '0': star[0].measure.photFlags |= 0x0 500; break;210 case 'p': star[0].measure.photFlags |= 0x00010000; break; // was: 0x0000 211 case 'c': star[0].measure.photFlags |= 0x00020000; break; // was: 0x0100 212 case 'd': star[0].measure.photFlags |= 0x00040000; break; // was: 0x0200 213 case 's': star[0].measure.photFlags |= 0x00080000; break; // was: 0x0300 214 case 'b': star[0].measure.photFlags |= 0x00010000; break; // was: 0x0400 215 case '0': star[0].measure.photFlags |= 0x00020000; break; // was: 0x0500 214 216 default: 215 217 fprintf (stderr, "error!\n"); … … 222 224 223 225 switch (qual) { 224 case '0': star[0].measure.photFlags &= ~0x00 08; break;225 case '1': star[0].measure.photFlags &= ~0x0008; break;226 default: star[0].measure.photFlags |= 0x00 08; break;226 case '0': star[0].measure.photFlags &= ~0x00300000; break; // was: ~0x0008 227 case '1': star[0].measure.photFlags |= 0x00100000; break; // was: ~0x0008 228 default: star[0].measure.photFlags |= 0x00200000; break; // was: 0x0008 227 229 } 228 230 return (TRUE); … … 232 234 233 235 switch (qual) { 234 case '0': star[0].measure.photFlags &= ~0x0080; break; 235 case '1': star[0].measure.photFlags &= ~0x0080; break; 236 default: 237 star[0].measure.photFlags |= 0x0080; 236 case '0': star[0].measure.photFlags &= ~0x00c00000; break; // was: ~0x0080 237 case '1': star[0].measure.photFlags |= 0x00400000; break; // was: ~0x0080 238 default: star[0].measure.photFlags |= 0x00800000; // was: 0x0080 238 239 star[0].measure.extNsigma = 100.0; 239 240 break; … … 245 246 246 247 switch (qual) { 247 case '0': star[0].measure.photFlags &= ~0x0 800; break;248 case '1': star[0].measure.photFlags &= ~0x0800; break;249 default: star[0].measure.photFlags |= 0x0 800; break;248 case '0': star[0].measure.photFlags &= ~0x03000000; break; // was: ~0x0800 249 case '1': star[0].measure.photFlags |= 0x01000000; break; // was: ~0x0800 250 default: star[0].measure.photFlags |= 0x02000000; break; // was: 0x0800 250 251 } 251 252 return (TRUE); … … 255 256 256 257 switch (qual) { 257 case '0': star[0].measure.photFlags &= ~0x 1000; break;258 case '1': star[0].measure.photFlags &= ~0x1000; break;259 default: star[0].measure.photFlags |= 0x 1000; break;258 case '0': star[0].measure.photFlags &= ~0x0c000000; break; // was: ~0x1000 259 case '1': star[0].measure.photFlags |= 0x04000000; break; // was: ~0x1000 260 default: star[0].measure.photFlags |= 0x08000000; break; // was: 0x1000 260 261 } 261 262 return (TRUE); … … 265 266 266 267 switch (qual) { 267 case '0': star[0].measure.photFlags &= ~0x 2000; break;268 case '1': star[0].measure.photFlags |= 0x 2000; break;268 case '0': star[0].measure.photFlags &= ~0x10000000; break; // was: ~0x2000 269 case '1': star[0].measure.photFlags |= 0x10000000; break; // was: 0x2000 269 270 default: abort(); 270 271 } … … 272 273 } 273 274 275 // unused photFlags: 276 // 0x0000.8000 277 // 0x0004.0000 278 // 0x0008.0000 279 // 0x2000.0000 280 // 0x4000.0000 281 // 0x8000.0000 -
branches/cnb_branches/cnb_branch_20090215/Ohana/src/addstar/src/sky_tessalation.c
r23199 r23239 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 -
branches/cnb_branches/cnb_branch_20090215/Ohana/src/imregister/base/get_fwhm.c
-
Property svn:mergeinfo
set to
/branches/eam_branches/eam_branch_20090303/Ohana/src/imregister/base/get_fwhm.c merged eligible
-
Property svn:mergeinfo
set to
-
branches/cnb_branches/cnb_branch_20090215/Ohana/src/imregister/detrend/usage.c
-
Property svn:mergeinfo
set to
/branches/eam_branches/eam_branch_20090303/Ohana/src/imregister/detrend/usage.c merged eligible
-
Property svn:mergeinfo
set to
-
branches/cnb_branches/cnb_branch_20090215/Ohana/src/imregister/imreg/load_probes.c
-
Property svn:mergeinfo
set to
/branches/eam_branches/eam_branch_20090303/Ohana/src/imregister/imreg/load_probes.c merged eligible
-
Property svn:mergeinfo
set to
-
branches/cnb_branches/cnb_branch_20090215/Ohana/src/libdvo
- Property svn:ignore
-
old new 1 lib 1
-
- Property svn:ignore
-
branches/cnb_branches/cnb_branch_20090215/Ohana/src/libdvo/lib
- Property svn:ignore
-
old new 1 *.linux 2 *.lin64 3 *.sol 4 *.sun 5 *.sid 6 *.hp 7 *.irix 8 *.darwin.dylib 9 *.darwin_x86.dylib 1 *.a 2 *.so
-
- Property svn:ignore
-
branches/cnb_branches/cnb_branch_20090215/Ohana/src/libfits/lib
- Property svn:ignore
-
old new 1 *.linux 2 *.lin64 3 *.sol 4 *.sun 5 *.sid 6 *.hp 7 *.irix 8 *.darwin.dylib 9 *.darwin_x86.dylib 1 *.a 2 *.so
-
- Property svn:ignore
-
branches/cnb_branches/cnb_branch_20090215/Ohana/src/libkapa/lib
- Property svn:ignore
-
old new 1 *.linux 2 *.lin64 3 *.sol 4 *.sun 5 *.sid 6 *.hp 7 *.irix 8 *.darwin.dylib 9 *.darwin_x86.dylib 1 *.a 2 *.so
-
- Property svn:ignore
-
branches/cnb_branches/cnb_branch_20090215/Ohana/src/libohana/lib
- Property svn:ignore
-
old new 1 *.linux 2 *.lin64 3 *.sol 4 *.sun 5 *.sid 6 *.hp 7 *.irix 8 *.darwin.dylib 9 *.darwin_x86.dylib 1 *.a 2 *.so
-
- Property svn:ignore
-
branches/cnb_branches/cnb_branch_20090215/Ohana/src/libtap/lib
- Property svn:ignore
-
old new 1 *.linux 2 *.lin64 3 *.sol 4 *.sun 5 *.sid 6 *.hp 7 *.irix 8 *.darwin.dylib 9 *.darwin_x86.dylib 1 *.a 2 *.so
-
- Property svn:ignore
-
branches/cnb_branches/cnb_branch_20090215/dbconfig/changes.txt
r21434 r23239 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; -
branches/cnb_branches/cnb_branch_20090215/dbconfig/config.md
r21310 r23239 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 -
branches/cnb_branches/cnb_branch_20090215/dbconfig/det.md
r19620 r23239 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 -
branches/cnb_branches/cnb_branch_20090215/ippScripts/scripts/detrend_norm_apply.pl
r23199 r23239 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 -
branches/cnb_branches/cnb_branch_20090215/ippScripts/scripts/detrend_norm_calc.pl
r23199 r23239 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 } -
branches/cnb_branches/cnb_branch_20090215/ippScripts/scripts/detrend_resid_exp.pl
r23199 r23239 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 -
branches/cnb_branches/cnb_branch_20090215/ippScripts/scripts/ipp_cleanup.pl
r23199 r23239 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 { -
branches/cnb_branches/cnb_branch_20090215/ippTasks/automate.pro
r19621 r23239 175 175 end 176 176 177 task.exit crash 178 showcommand crash 179 end 180 177 181 # operation times out? 178 182 task.exit timeout … … 283 287 end 284 288 289 task.exit crash 290 showcommand crash 291 end 292 285 293 # operation times out? 286 294 task.exit timeout … … 373 381 end 374 382 383 task.exit crash 384 showcommand crash 385 end 386 375 387 # operation times out? 376 388 task.exit timeout … … 448 460 end 449 461 462 task.exit crash 463 book setword automate $pageName pantaskState INIT.REGULAR 464 showcommand crash 465 end 466 450 467 # operation times out? 451 468 task.exit timeout -
branches/cnb_branches/cnb_branch_20090215/ippTasks/calibration.pro
r19465 r23239 90 90 end 91 91 92 task.exit crash 93 showcommand crash 94 end 95 92 96 # operation times out? 93 97 task.exit timeout … … 166 170 end 167 171 172 task.exit crash 173 showcommand crash 174 book setword calBook $options:0 pantaskState CRASH 175 end 176 168 177 # operation timed out? 169 178 task.exit timeout -
branches/cnb_branches/cnb_branch_20090215/ippTasks/camera.pro
r19559 r23239 104 104 end 105 105 106 task.exit crash 107 showcommand crash 108 end 109 106 110 # operation times out? 107 111 task.exit timeout … … 177 181 task.exit default 178 182 process_exit camPendingExp $options:0 $JOB_STATUS 183 end 184 185 # locked list 186 task.exit crash 187 showcommand crash 188 echo "hostname: $JOB_HOSTNAME" 189 book setword camPendingExp $options:0 pantaskState CRASH 179 190 end 180 191 … … 236 247 end 237 248 249 task.exit crash 250 showcommand crash 251 end 252 238 253 # operation times out? 239 254 task.exit timeout … … 289 304 end 290 305 306 task.exit crash 307 showcommand crash 308 book setword camPendingCleanup $options:0 pantaskState CRASH 309 end 310 291 311 # operation timed out? 292 312 task.exit timeout -
branches/cnb_branches/cnb_branch_20090215/ippTasks/chip.pro
r21464 r23239 111 111 task.exit default 112 112 showcommand failure 113 end 114 115 task.exit crash 116 showcommand crash 113 117 end 114 118 … … 188 192 end 189 193 194 # locked list 195 task.exit crash 196 showcommand crash 197 echo "hostname: $JOB_HOSTNAME" 198 book setword chipPendingImfile $options:0 pantaskState CRASH 199 end 200 190 201 # operation timed out? 191 202 task.exit timeout … … 235 246 end 236 247 248 task.exit crash 249 showcommand crash 250 end 251 237 252 # operation times out? 238 253 task.exit timeout … … 291 306 end 292 307 308 task.exit crash 309 showcommand crash 310 end 311 293 312 # operation times out? 294 313 task.exit timeout … … 344 363 end 345 364 365 task.exit crash 366 showcommand crash 367 book setword chipPendingCleanup $options:0 pantaskState CRASH 368 end 369 346 370 # operation timed out? 347 371 task.exit timeout -
branches/cnb_branches/cnb_branch_20090215/ippTasks/detrend.correct.pro
r20398 r23239 85 85 end 86 86 87 task.exit crash 88 showcommand crash 89 end 90 87 91 # operation times out? 88 92 task.exit timeout 89 showcommand 93 showcommand timeout 90 94 end 91 95 end … … 145 149 end 146 150 151 # locked list 152 task.exit crash 153 showcommand crash 154 echo "hostname: $JOB_HOSTNAME" 155 book setword detPendingCorrectImfile $options:0 pantaskState CRASH 156 end 157 147 158 # operation times out? 148 159 task.exit timeout -
branches/cnb_branches/cnb_branch_20090215/ippTasks/detrend.mkruns.pro
r16298 r23239 34 34 end 35 35 36 task.exit crash 37 # send someone email? 38 echo "unable to define a new detrend run" 39 end 40 36 41 # operation timed out? is the database down? 37 42 task.exit timeout … … 60 65 # default exit status 61 66 task.exit default 67 echo "unable to define a new detrend run" 68 end 69 70 task.exit crash 71 # send someone email? 62 72 echo "unable to define a new detrend run" 63 73 end … … 92 102 end 93 103 104 task.exit crash 105 # send someone email? 106 echo "unable to define a new detrend run" 107 end 108 94 109 # operation timed out? is the database down? 95 110 task.exit timeout -
branches/cnb_branches/cnb_branch_20090215/ippTasks/detrend.norm.pro
r19465 r23239 168 168 end 169 169 170 task.exit crash 171 showcommand crash 172 end 173 170 174 # operation times out? 171 175 task.exit timeout … … 225 229 task.exit default 226 230 process_exit detPendingNormStatImfile $options:0 $JOB_STATUS 231 end 232 233 # locked list 234 task.exit crash 235 showcommand crash 236 echo "hostname: $JOB_HOSTNAME" 237 book setword detPendingNormStatImfile $options:0 pantaskState CRASH 227 238 end 228 239 … … 278 289 task.exit default 279 290 showcommand failure 291 end 292 293 task.exit crash 294 showcommand crash 280 295 end 281 296 … … 342 357 end 343 358 359 # locked list 360 task.exit crash 361 showcommand crash 362 echo "hostname: $JOB_HOSTNAME" 363 book setword detPendingNormImfile $options:0 pantaskState CRASH 364 end 365 344 366 # operation times out? 345 367 task.exit timeout … … 395 417 end 396 418 419 task.exit crash 420 showcommand crash 421 end 422 397 423 # operation times out? 398 424 task.exit timeout … … 452 478 task.exit default 453 479 process_exit detPendingNormExp $options:0 $JOB_STATUS 480 end 481 482 # locked list 483 task.exit crash 484 showcommand crash 485 echo "hostname: $JOB_HOSTNAME" 486 book setword detPendingNormExp $options:0 pantaskState CRASH 454 487 end 455 488 … … 506 539 end 507 540 541 task.exit crash 542 showcommand crash 543 end 544 508 545 # operation times out? 509 546 task.exit timeout … … 558 595 task.exit default 559 596 process_exit detCleanupNormStatImfile $options:0 $JOB_STATUS 597 end 598 599 task.exit crash 600 showcommand crash 601 book setword detCleanupNormStatImfile $options:0 pantaskState CRASH 560 602 end 561 603 … … 612 654 end 613 655 656 task.exit crash 657 showcommand crash 658 end 659 614 660 # operation times out? 615 661 task.exit timeout … … 665 711 task.exit default 666 712 process_exit detCleanupNormImfile $options:0 $JOB_STATUS 713 end 714 715 task.exit crash 716 showcommand crash 717 book setword detCleanupNormImfile $options:0 pantaskState CRASH 667 718 end 668 719 … … 719 770 end 720 771 772 task.exit crash 773 showcommand crash 774 end 775 721 776 # operation times out? 722 777 task.exit timeout … … 773 828 end 774 829 830 task.exit crash 831 showcommand crash 832 book setword detCleanupNormExp $options:0 pantaskState CRASH 833 end 834 775 835 # operation timed out? 776 836 task.exit timeout -
branches/cnb_branches/cnb_branch_20090215/ippTasks/detrend.process.pro
r19465 r23239 136 136 end 137 137 138 task.exit crash 139 showcommand crash 140 end 141 138 142 # operation times out? 139 143 task.exit timeout 140 showcommand 144 showcommand timeout 141 145 end 142 146 end … … 202 206 end 203 207 208 # locked list 209 task.exit crash 210 showcommand crash 211 echo "hostname: $JOB_HOSTNAME" 212 book setword detPendingProcessedImfile $options:0 pantaskState CRASH 213 end 214 204 215 # operation times out? 205 216 task.exit timeout … … 255 266 end 256 267 268 task.exit crash 269 showcommand crash 270 end 271 257 272 # operation times out? 258 273 task.exit timeout … … 319 334 end 320 335 336 # locked list 337 task.exit crash 338 showcommand crash 339 echo "hostname: $JOB_HOSTNAME" 340 book setword detPendingProcessedExp $options:0 pantaskState CRASH 341 end 342 321 343 # operation times out? 322 344 task.exit timeout … … 371 393 end 372 394 395 task.exit crash 396 showcommand crash 397 end 398 373 399 # operation times out? 374 400 task.exit timeout … … 424 450 task.exit default 425 451 process_exit detCleanupProcessedImfile $options:0 $JOB_STATUS 452 end 453 454 # locked list 455 task.exit crash 456 showcommand crash 457 echo "hostname: $JOB_HOSTNAME" 458 book setword detCleanupProcessedImfile $options:0 pantaskState CRASH 426 459 end 427 460 … … 479 512 end 480 513 514 task.exit crash 515 showcommand crash 516 end 517 481 518 # operation times out? 482 519 task.exit timeout … … 533 570 end 534 571 572 # locked list 573 task.exit crash 574 showcommand crash 575 echo "hostname: $JOB_HOSTNAME" 576 book setword detCleanupProcessedExp $options:0 pantaskState CRASH 577 end 578 535 579 # operation timed out? 536 580 task.exit timeout -
branches/cnb_branches/cnb_branch_20090215/ippTasks/detrend.reject.pro
r19465 r23239 83 83 end 84 84 85 task.exit crash 86 showcommand crash 87 end 88 85 89 # operation times out? 86 90 task.exit timeout 87 showcommand failure91 showcommand timeout 88 92 end 89 93 end … … 143 147 end 144 148 149 # locked list 150 task.exit crash 151 showcommand crash 152 echo "hostname: $JOB_HOSTNAME" 153 book setword detRejectExp $options:0 pantaskState CRASH 154 end 155 145 156 # operation times out? 146 157 task.exit timeout -
branches/cnb_branches/cnb_branch_20090215/ippTasks/detrend.resid.pro
r19621 r23239 129 129 task.exit default 130 130 showcommand failure 131 end 132 133 task.exit crash 134 showcommand crash 131 135 end 132 136 … … 203 207 end 204 208 209 # locked list 210 task.exit crash 211 showcommand crash 212 echo "hostname: $JOB_HOSTNAME" 213 book setword detPendingResidImfile $options:0 pantaskState CRASH 214 end 215 205 216 # operation times out? 206 217 task.exit timeout … … 254 265 task.exit default 255 266 showcommand failure 267 end 268 269 task.exit crash 270 showcommand crash 256 271 end 257 272 … … 320 335 end 321 336 337 # locked list 338 task.exit crash 339 showcommand crash 340 echo "hostname: $JOB_HOSTNAME" 341 book setword detPendingResidExp $options:0 pantaskState CRASH 342 end 343 322 344 # operation times out? 323 345 task.exit timeout … … 372 394 end 373 395 396 task.exit crash 397 showcommand crash 398 end 399 374 400 # operation times out? 375 401 task.exit timeout … … 426 452 task.exit default 427 453 process_exit detCleanupResidImfile $options:0 $JOB_STATUS 454 end 455 456 # locked list 457 task.exit crash 458 showcommand crash 459 echo "hostname: $JOB_HOSTNAME" 460 book setword detCleanupResidImfile $options:0 pantaskState CRASH 428 461 end 429 462 … … 481 514 end 482 515 516 task.exit crash 517 showcommand crash 518 end 519 483 520 # operation times out? 484 521 task.exit timeout … … 536 573 end 537 574 575 # locked list 576 task.exit crash 577 showcommand crash 578 echo "hostname: $JOB_HOSTNAME" 579 book setword detCleanupResidExp $options:0 pantaskState CRASH 580 end 581 538 582 # operation timed out? 539 583 task.exit timeout -
branches/cnb_branches/cnb_branch_20090215/ippTasks/detrend.stack.pro
r19465 r23239 101 101 end 102 102 103 task.exit crash 104 showcommand crash 105 end 106 103 107 # operation times out? 104 108 task.exit timeout … … 163 167 task.exit default 164 168 process_exit detPendingStackedImfile $options:0 $JOB_STATUS 169 end 170 171 # locked list 172 task.exit crash 173 showcommand crash 174 echo "hostname: $JOB_HOSTNAME" 175 book setword detPendingStackedImfile $options:0 pantaskState CRASH 165 176 end 166 177 … … 217 228 end 218 229 230 task.exit crash 231 showcommand crash 232 end 233 219 234 # operation times out? 220 235 task.exit timeout … … 272 287 end 273 288 289 # locked list 290 task.exit crash 291 showcommand crash 292 echo "hostname: $JOB_HOSTNAME" 293 book setword detCleanupStackedImfile $options:0 pantaskState CRASH 294 end 295 274 296 # operation timed out? 275 297 task.exit timeout -
branches/cnb_branches/cnb_branch_20090215/ippTasks/diff.pro
r21312 r23239 112 112 end 113 113 114 task.exit crash 115 showcommand crash 116 end 117 114 118 # operation times out? 115 119 task.exit timeout … … 173 177 task.exit default 174 178 process_exit diffSkyfile $options:0 $JOB_STATUS 179 end 180 181 # locked list 182 task.exit crash 183 showcommand crash 184 echo "hostname: $JOB_HOSTNAME" 185 book setword diffSkyfile $options:0 pantaskState CRASH 175 186 end 176 187 … … 229 240 end 230 241 242 task.exit crash 243 showcommand crash 244 end 245 231 246 # operation times out? 232 247 task.exit timeout … … 282 297 end 283 298 299 task.exit crash 300 showcommand crash 301 book setword diffCleanup $options:0 pantaskState CRASH 302 end 303 284 304 # operation timed out? 285 305 task.exit timeout -
branches/cnb_branches/cnb_branch_20090215/ippTasks/fake.pro
r21464 r23239 176 176 end 177 177 178 # locked list 179 task.exit crash 180 showcommand crash 181 echo "hostname: $JOB_HOSTNAME" 182 book setword fakePendingImfile $options:0 pantaskState CRASH 183 end 184 178 185 # operation timed out? 179 186 task.exit timeout … … 219 226 task.exit default 220 227 showcommand failure 228 end 229 230 task.exit crash 231 showcommand crash 221 232 end 222 233 … … 278 289 end 279 290 291 task.exit crash 292 showcommand crash 293 end 294 280 295 # operation times out? 281 296 task.exit timeout … … 331 346 end 332 347 348 task.exit crash 349 showcommand crash 350 book setword fakePendingCleanup $options:0 pantaskState CRASH 351 end 352 333 353 # operation timed out? 334 354 task.exit timeout -
branches/cnb_branches/cnb_branch_20090215/ippTasks/flatcorr.pro
r20513 r23239 104 104 end 105 105 106 task.exit crash 107 showcommand crash 108 end 109 106 110 # operation times out? 107 111 task.exit timeout … … 157 161 end 158 162 163 task.exit crash 164 showcommand crash 165 end 166 159 167 # operation times out? 160 168 task.exit timeout … … 229 237 end 230 238 239 task.exit crash 240 showcommand crash 241 book setword flatcorrBook $options:0 pantaskState CRASH 242 end 243 231 244 # operation timed out? 232 245 task.exit timeout -
branches/cnb_branches/cnb_branch_20090215/ippTasks/magic.pro
r21436 r23239 118 118 end 119 119 120 task.exit crash 121 showcommand crash 122 end 123 120 124 # operation times out? 121 125 task.exit timeout … … 189 193 end 190 194 195 task.exit crash 196 showcommand crash 197 book setword magicToTree $options:0 pantaskState CRASH 198 end 199 191 200 # operation timed out? 192 201 task.exit timeout … … 239 248 end 240 249 250 task.exit crash 251 showcommand crash 252 end 253 241 254 # operation times out? 242 255 task.exit timeout … … 302 315 task.exit default 303 316 process_exit magicToProcess $options:0 $JOB_STATUS 317 end 318 319 task.exit crash 320 showcommand crash 321 book setword magicToProcess $options:0 pantaskState CRASH 304 322 end 305 323 … … 353 371 task.exit default 354 372 showcommand failure 373 end 374 375 task.exit crash 376 showcommand crash 355 377 end 356 378 … … 423 445 end 424 446 447 task.exit crash 448 showcommand crash 449 book setword magicToDS $options:0 pantaskState CRASH 450 end 451 425 452 # operation timed out? 426 453 task.exit timeout -
branches/cnb_branches/cnb_branch_20090215/ippTasks/pstamp.pro
r21411 r23239 97 97 end 98 98 99 task.exit crash 100 showcommand crash 101 end 102 99 103 task.exit timeout 100 104 showcommand timeout … … 136 140 end 137 141 142 task.exit crash 143 showcommand crash 144 end 145 138 146 task.exit timeout 139 147 showcommand timeout … … 178 186 showcommand failure 179 187 process_exit pstampRequest $options:0 $JOB_STATUS 188 end 189 190 task.exit crash 191 showcommand crash 192 book setword pstampRequest $options:0 pantaskState CRASH 180 193 end 181 194 … … 219 232 end 220 233 234 task.exit crash 235 showcommand crash 236 end 237 221 238 task.exit timeout 222 239 showcommand timeout … … 263 280 process_exit pstampFinish $options:0 $JOB_STATUS 264 281 showcommand failure 282 end 283 284 task.exit crash 285 showcommand crash 286 book setword pstampFinish $options:0 pantaskState CRASH.run 265 287 end 266 288 … … 307 329 end 308 330 331 task.exit crash 332 showcommand crash 333 end 334 309 335 task.exit timeout 310 336 showcommand timeout … … 362 388 end 363 389 390 task.exit crash 391 echo pstamp.job.run task.crash $JOB_ID status: $JOB_STATUS 392 process_exit pstampJob $options:0 $JOB_STATUS 393 showcommand crash 394 book setword pstampJob $options:0 pantaskState CRASH 395 end 396 364 397 task.exit timeout 365 398 echo pstamp.job.run task.timeout $JOB_ID status: $JOB_STATUS -
branches/cnb_branches/cnb_branch_20090215/ippTasks/register.pro
r20498 r23239 180 180 end 181 181 182 task.exit crash 183 showcommand crash 184 end 185 182 186 # operation times out? 183 187 task.exit timeout … … 255 259 task.exit default 256 260 process_exit regPendingImfile $options:0 $JOB_STATUS 261 end 262 263 # locked list 264 task.exit crash 265 showcommand crash 266 echo "hostname: $JOB_HOSTNAME" 267 book setword regPendingImfile $options:0 pantaskState CRASH 257 268 end 258 269 … … 306 317 task.exit default 307 318 showcommand failure 319 end 320 321 task.exit crash 322 showcommand crash 308 323 end 309 324 … … 392 407 end 393 408 409 # locked list 410 task.exit crash 411 showcommand crash 412 echo "hostname: $JOB_HOSTNAME" 413 book setword regPendingExp $options:0 pantaskState CRASH 414 end 415 416 task.exit crash 417 showcommand crash 418 book setword regPendingExp $options:0 pantaskState CRASH 419 end 420 394 421 # operation times out? 395 422 task.exit timeout -
branches/cnb_branches/cnb_branch_20090215/ippTasks/replicate.pro
r19747 r23239 102 102 end 103 103 104 task.exit crash 105 showcommand crash 106 end 107 104 108 # operation times out? 105 109 task.exit timeout … … 158 162 end 159 163 164 task.exit crash 165 showcommand crash 166 book setword replicatePending $options:0 pantaskState CRASH 167 end 168 160 169 # operation timed out? 161 170 task.exit timeout -
branches/cnb_branches/cnb_branch_20090215/ippTasks/stack.pro
r19597 r23239 112 112 end 113 113 114 task.exit crash 115 showcommand crash 116 end 117 114 118 # operation times out? 115 119 task.exit timeout … … 172 176 task.exit default 173 177 process_exit stackSumSkyfile $options:0 $JOB_STATUS 178 end 179 180 # locked list 181 task.exit crash 182 showcommand crash 183 echo "hostname: $JOB_HOSTNAME" 184 book setword stackSumSkyfile $options:0 pantaskState CRASH 174 185 end 175 186 … … 229 240 end 230 241 242 task.exit crash 243 showcommand crash 244 end 245 231 246 # operation times out? 232 247 task.exit timeout … … 282 297 end 283 298 299 task.exit crash 300 showcommand crash 301 book setword stackCleanup $options:0 pantaskState CRASH 302 end 303 284 304 # operation timed out? 285 305 task.exit timeout -
branches/cnb_branches/cnb_branch_20090215/ippTasks/summit.copy.pro
r21478 r23239 126 126 showcommand failure 127 127 end 128 task.exit crash 129 showcommand crash 130 end 128 131 task.exit timeout 129 132 showcommand timeout … … 182 185 showcommand failure 183 186 end 187 task.exit crash 188 showcommand crash 189 end 184 190 task.exit timeout 185 191 showcommand timeout … … 228 234 queueprint stderr 229 235 end 236 end 237 task.exit crash 238 showcommand crash 230 239 end 231 240 task.exit timeout … … 296 305 showcommand failure 297 306 process_exit pzPendingExp $options:0 $JOB_STATUS 307 end 308 309 task.exit crash 310 showcommand crash 311 book setword pzPendingExp $options:0 pantaskState CRASH 298 312 end 299 313 … … 344 358 showcommand failure 345 359 end 360 task.exit crash 361 showcommand crash 362 end 346 363 task.exit timeout 347 364 showcommand timeout … … 413 430 book setword pzPendingImfile $pageName filename $FILENAME 414 431 432 stdout $LOGDIR/summit.copy.log 433 stderr $LOGDIR/summit.copy.log 434 415 435 $run = summit_copy.pl --uri $URI --filename $FILENAME --exp_name $EXP_NAME --inst $CAMERA --telescope $TELESCOPE --class $CLASS --class_id $CLASS_ID --bytes $BYTES --md5 $MD5SUM --end_stage reg --workdir $workdir --dbname $DBNAME --timeout 120 --verbose --copies 2 416 436 if ($COMPRESS) … … 442 462 end 443 463 464 task.exit crash 465 showcommand crash 466 book setword pzPendingImfile $options:0 pantaskState CRASH 467 end 468 444 469 # operation timed out? 445 470 task.exit timeout … … 476 501 task.exit default 477 502 showcommand failure 503 end 504 task.exit crash 505 showcommand crash 478 506 end 479 507 task.exit timeout … … 518 546 end 519 547 548 task.exit crash 549 showcommand crash 550 end 551 520 552 # operation times out? 521 553 task.exit timeout -
branches/cnb_branches/cnb_branch_20090215/ippTasks/warp.pro
r20932 r23239 127 127 end 128 128 129 task.exit crash 130 showcommand crash 131 end 132 129 133 # operation times out? 130 134 task.exit timeout … … 185 189 task.exit default 186 190 process_exit warpInputExp $options:0 $JOB_STATUS 191 end 192 193 # locked list 194 task.exit crash 195 showcommand crash 196 echo "hostname: $JOB_HOSTNAME" 197 book setword warpInputExp $options:0 pantaskState CRASH 187 198 end 188 199 … … 239 250 task.exit default 240 251 showcommand failure 252 end 253 254 task.exit crash 255 showcommand crash 241 256 end 242 257 … … 303 318 end 304 319 320 # locked list 321 task.exit crash 322 showcommand crash 323 echo "hostname: $JOB_HOSTNAME" 324 book setword warpPendingSkyCell $options:0 pantaskState CRASH 325 end 326 305 327 # operation timed out? 306 328 task.exit timeout … … 357 379 end 358 380 381 task.exit crash 382 showcommand crash 383 end 384 359 385 # operation times out? 360 386 task.exit timeout … … 410 436 end 411 437 438 task.exit crash 439 showcommand crash 440 book setword warpPendingCleanup $options:0 pantaskState CRASH 441 end 442 412 443 # operation timed out? 413 444 task.exit timeout -
branches/cnb_branches/cnb_branch_20090215/ippTools/share/chiptool_change_imfile_data_state.sql
r19527 r23239 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' -
branches/cnb_branches/cnb_branch_20090215/ippTools/share/dettool_processedimfile.sql
r18561 r23239 1 -- is this DISTINCT needed? 1 2 SELECT DISTINCT 2 3 detRun.det_type, -
branches/cnb_branches/cnb_branch_20090215/ippTools/share/dettool_residimfile.sql
r19632 r23239 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 -
branches/cnb_branches/cnb_branch_20090215/ippTools/share/dettool_tonormalizedstat.sql
r18118 r23239 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 -
branches/cnb_branches/cnb_branch_20090215/ippTools/share/dettool_toresidexp.sql
r19815 r23239 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) -
branches/cnb_branches/cnb_branch_20090215/ippTools/share/dettool_toresidimfile.sql
r19816 r23239 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 -
branches/cnb_branches/cnb_branch_20090215/ippTools/share/pxadmin_create_tables.sql
r21308 r23239 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 -
branches/cnb_branches/cnb_branch_20090215/ippTools/share/warptool_change_skyfile_data_state.sql
r19521 r23239 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' -
branches/cnb_branches/cnb_branch_20090215/ippTools/src/chiptool.c
r23199 r23239 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) -
branches/cnb_branches/cnb_branch_20090215/ippTools/src/chiptoolConfig.c
r23199 r23239 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); -
branches/cnb_branches/cnb_branch_20090215/ippTools/src/dettoolConfig.c
r23199 r23239 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 -
branches/cnb_branches/cnb_branch_20090215/ippTools/src/dettool_processedimfile.c
r19621 r23239 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 { -
branches/cnb_branches/cnb_branch_20090215/ippTools/src/dettool_residimfile.c
r19632 r23239 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) { -
branches/cnb_branches/cnb_branch_20090215/ippTools/src/warptool.c
r21402 r23239 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 } -
branches/cnb_branches/cnb_branch_20090215/ippTools/src/warptoolConfig.c
r20973 r23239 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); -
branches/cnb_branches/cnb_branch_20090215/ippconfig/gpc1/ppImage.config
r23199 r23239 9 9 OVERSCAN.STAT STR MEDIAN 10 10 OVERSCAN.BOXCAR S32 3 11 12 # Normalization class 13 NORM.CLASS STR CHIP # How to find the per-class normalizations 11 14 12 15 OLDDARK BOOL FALSE -
branches/cnb_branches/cnb_branch_20090215/ippconfig/recipes/filerules-mef.mdc
r23199 r23239 98 98 PPSUB.INPUT.MASK INPUT @FILES FPA MASK 99 99 PPSUB.INPUT.VARIANCE INPUT @FILES FPA VARIANCE 100 PPSUB.INPUT.SOURCES INPUT @FILES FPA CMF 100 101 PPSUB.REF INPUT @FILES FPA IMAGE 101 102 PPSUB.REF.MASK INPUT @FILES FPA MASK 102 103 PPSUB.REF.VARIANCE INPUT @FILES FPA VARIANCE 103 PPSUB. SOURCESINPUT @FILES FPA CMF104 PPSUB.REF.SOURCES INPUT @FILES FPA CMF 104 105 105 106 ## files used by ppstack -
branches/cnb_branches/cnb_branch_20090215/ippconfig/recipes/filerules-simple.mdc
r23199 r23239 61 61 PPSUB.INPUT.MASK INPUT @FILES FPA MASK 62 62 PPSUB.INPUT.VARIANCE INPUT @FILES FPA VARIANCE 63 PPSUB.INPUT.SOURCES INPUT @FILES FPA CMF 63 64 PPSUB.REF INPUT @FILES FPA IMAGE 64 65 PPSUB.REF.MASK INPUT @FILES FPA MASK 65 66 PPSUB.REF.VARIANCE INPUT @FILES FPA VARIANCE 66 PPSUB. SOURCESINPUT @FILES FPA CMF67 PPSUB.REF.SOURCES INPUT @FILES FPA CMF 67 68 68 69 ## files used by ppstack -
branches/cnb_branches/cnb_branch_20090215/ippconfig/recipes/filerules-split.mdc
r23199 r23239 73 73 PPSUB.INPUT.MASK INPUT @FILES FPA MASK 74 74 PPSUB.INPUT.VARIANCE INPUT @FILES FPA VARIANCE 75 PPSUB.INPUT.SOURCES INPUT @FILES FPA CMF 75 76 PPSUB.REF INPUT @FILES FPA IMAGE 76 77 PPSUB.REF.MASK INPUT @FILES FPA MASK 77 78 PPSUB.REF.VARIANCE INPUT @FILES FPA VARIANCE 78 PPSUB. SOURCESINPUT @FILES FPA CMF79 PPSUB.REF.SOURCES INPUT @FILES FPA CMF 79 80 80 81 ## files used by ppstack -
branches/cnb_branches/cnb_branch_20090215/ippconfig/recipes/ppImage.config
r23199 r23239 40 40 NONLIN.SOURCE STR CHIP.NAME # How to determine the source 41 41 NONLIN.DATA STR nonlin.dat # Filename for lookup table 42 43 # Normalization class 44 NORM.CLASS STR FPA # How to find the per-class normalizations 42 45 43 46 OLDDARK BOOL FALSE # Use old-style darks? -
branches/cnb_branches/cnb_branch_20090215/ippconfig/recipes/ppStack.config
r21475 r23239 32 32 33 33 ZP.RADIUS F32 1.0 # Radius (pixels) for matching sources 34 ZP.ITER S32 1000 # Maximum iterations for zero point 34 ZP.ITER.1 S32 5 # Iterations for zero point; pass 1 35 ZP.ITER.2 S32 1000 # Iterations for zero point; pass 2 35 36 ZP.TOL F32 1.0e-6 # Tolerance for zero point iterations 36 37 ZP.TRANS.ITER S32 2 # Iterations for transparency determination 37 38 ZP.TRANS.REJ F32 3.0 # Rejection threshold for transparency determination 38 39 ZP.TRANS.THRESH F32 1.0 # Threshold for transparency determination 39 ZP.STAR.REJ F32 3.0 # Rejection threshold for stars 40 ZP.STAR.REJ.1 F32 20.0 # Rejection threshold for stars; pass 1 41 ZP.STAR.REJ.2 F32 3.0 # Rejection threshold for stars; pass 2 40 42 ZP.STAR.LIMIT F32 1.0e-2 # Limit on star rejection fraction for successful iteration 41 ZP.STAR.SYS F32 0.05 # Estimated systematic error 43 ZP.STAR.SYS.1 F32 0.10 # Estimated systematic error; pass 1 44 ZP.STAR.SYS.2 F32 0.05 # Estimated systematic error; pass 2 45 ZP.MATCH F32 0.3 # Fraction of images to match for good star 42 46 ZP.AIRMASS METADATA # Airmass terms by filter 43 47 g F32 0.0 -
branches/cnb_branches/cnb_branch_20090215/ippconfig/recipes/ppSub.config
r21370 r23239 5 5 SPATIAL.ORDER S32 0 # Spatial polynomial order 6 6 REGION.SIZE F32 0 # Iso-kernel region size (pixels) 7 SOURCE.RADIUS F32 3.0 # Source matching radius (pixels) 7 8 STAMP.SPACING F32 200 # Typical spacing between stamps (pixels) 8 9 STAMP.FOOTPRINT S32 20 # Size of stamps (pixels) -
branches/cnb_branches/cnb_branch_20090215/ppArith/src/Makefile.am
r23199 r23239 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 -
branches/cnb_branches/cnb_branch_20090215/ppArith/src/ppArithVersion.c
r23199 r23239 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 -
branches/cnb_branches/cnb_branch_20090215/ppImage/src/Makefile.am
r23199 r23239 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 = \ -
branches/cnb_branches/cnb_branch_20090215/ppImage/src/ppImage.h
r23199 r23239 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 -
branches/cnb_branches/cnb_branch_20090215/ppImage/src/ppImageArguments.c
r21536 r23239 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 } -
branches/cnb_branches/cnb_branch_20090215/ppImage/src/ppImageDetrendReadout.c
r21364 r23239 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 } -
branches/cnb_branches/cnb_branch_20090215/ppImage/src/ppImageOptions.c
r21364 r23239 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 } -
branches/cnb_branches/cnb_branch_20090215/ppImage/src/ppImageVersion.c
r23199 r23239 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 "); -
branches/cnb_branches/cnb_branch_20090215/ppMerge/src/Makefile.am
r23199 r23239 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 -
branches/cnb_branches/cnb_branch_20090215/ppMerge/src/ppMergeVersion.c
r23199 r23239 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 -
branches/cnb_branches/cnb_branch_20090215/ppSim/src/Makefile.am
r23199 r23239 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 = \ -
branches/cnb_branches/cnb_branch_20090215/ppSim/src/ppSimVersion.c
r23199 r23239 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 -
branches/cnb_branches/cnb_branch_20090215/ppStack/src/Makefile.am
r23199 r23239 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 -
branches/cnb_branches/cnb_branch_20090215/ppStack/src/ppStackArguments.c
r23199 r23239 168 168 "Play safe with small numbers of pixels to combine?", false); 169 169 psMetadataAddF32(arguments, PS_LIST_TAIL, "-zp-radius", 0, "Radius (pixels) for matching sources", NAN); 170 psMetadataAddS32(arguments, PS_LIST_TAIL, "-zp-iter", 0, "Maximum iterations for zero point", 0); 170 psMetadataAddS32(arguments, PS_LIST_TAIL, "-zp-iter-1", 0, "Maximum iterations for zero point; pass 1", 0); 171 psMetadataAddS32(arguments, PS_LIST_TAIL, "-zp-iter-2", 0, "Maximum iterations for zero point; pass 2", 0); 171 172 psMetadataAddF32(arguments, PS_LIST_TAIL, "-zp-tol", 0, "Tolerance for zero point iterations", NAN); 172 173 psMetadataAddS32(arguments, PS_LIST_TAIL, "-zp-trans-iter", 0, "Iterations for transparency determination", 0); 173 174 psMetadataAddF32(arguments, PS_LIST_TAIL, "-zp-trans-rej", 0, "Rejection threshold for transparency determination", NAN); 174 175 psMetadataAddF32(arguments, PS_LIST_TAIL, "-zp-trans-thresh", 0, "Threshold for transparency determination", NAN); 175 psMetadataAddF32(arguments, PS_LIST_TAIL, "-zp-star-rej", 0, "Rejection threshold for stars", NAN); 176 psMetadataAddF32(arguments, PS_LIST_TAIL, "-zp-star-rej-1", 0, "Rejection threshold for stars; pass 1", NAN); 177 psMetadataAddF32(arguments, PS_LIST_TAIL, "-zp-star-rej-2", 0, "Rejection threshold for stars; pass 2", NAN); 176 178 psMetadataAddF32(arguments, PS_LIST_TAIL, "-zp-star-limit", 0, "Limit on star rejection fraction for successful iteration", NAN); 177 psMetadataAddF32(arguments, PS_LIST_TAIL, "-zp-star-sys", 0, "Estimated systematic error", NAN); 179 psMetadataAddF32(arguments, PS_LIST_TAIL, "-zp-star-sys-1", 0, "Estimated systematic error; pass 1", NAN); 180 psMetadataAddF32(arguments, PS_LIST_TAIL, "-zp-star-sys-2", 0, "Estimated systematic error; pass 2", NAN); 178 181 psMetadataAddStr(arguments, PS_LIST_TAIL, "-temp-image", 0, "Suffix for temporary images", NULL); 179 182 psMetadataAddStr(arguments, PS_LIST_TAIL, "-temp-mask", 0, "Suffix for temporary masks", NULL); … … 242 245 243 246 VALUE_ARG_RECIPE_FLOAT("-zp-radius", "ZP.RADIUS", F32); 244 VALUE_ARG_RECIPE_INT("-zp-iter", "ZP.ITER", S32, 0); 247 VALUE_ARG_RECIPE_INT("-zp-iter-1", "ZP.ITER.1", S32, 0); 248 VALUE_ARG_RECIPE_INT("-zp-iter-2", "ZP.ITER.2", S32, 0); 245 249 VALUE_ARG_RECIPE_FLOAT("-zp-tol", "ZP.TOL", F32); 246 250 VALUE_ARG_RECIPE_INT("-zp-trans-iter", "ZP.TRANS.ITER", S32, 0); 247 251 VALUE_ARG_RECIPE_FLOAT("-zp-trans-rej", "ZP.TRANS.REJ", F32); 248 252 VALUE_ARG_RECIPE_FLOAT("-zp-trans-thresh", "ZP.TRANS.THRESH", F32); 249 VALUE_ARG_RECIPE_FLOAT("-zp-star-rej", "ZP.STAR.REJ", F32); 253 VALUE_ARG_RECIPE_FLOAT("-zp-star-rej-1", "ZP.STAR.REJ.1", F32); 254 VALUE_ARG_RECIPE_FLOAT("-zp-star-rej-2", "ZP.STAR.REJ.2", F32); 250 255 VALUE_ARG_RECIPE_FLOAT("-zp-star-limit", "ZP.STAR.LIMIT", F32); 251 VALUE_ARG_RECIPE_FLOAT("-zp-star-sys", "ZP.STAR.SYS", F32); 256 VALUE_ARG_RECIPE_FLOAT("-zp-star-sys-1", "ZP.STAR.SYS.1", F32); 257 VALUE_ARG_RECIPE_FLOAT("-zp-star-sys-2", "ZP.STAR.SYS.2", F32); 252 258 253 259 VALUE_ARG_RECIPE_INT("-psf-instances", "PSF.INSTANCES", S32, 0); -
branches/cnb_branches/cnb_branch_20090215/ppStack/src/ppStackSources.c
r23199 r23239 81 81 82 82 float radius = psMetadataLookupF32(NULL, recipe, "ZP.RADIUS"); // Radius (pixels) for matching sources 83 int iter = psMetadataLookupS32(NULL, recipe, "ZP.ITER"); // Maximum iterations 83 int iter1 = psMetadataLookupS32(NULL, recipe, "ZP.ITER.1"); // Maximum iterations for pass 1 84 int iter2 = psMetadataLookupS32(NULL, recipe, "ZP.ITER.2"); // Maximum iterations for pass 2 84 85 float tol = psMetadataLookupF32(NULL, recipe, "ZP.TOL"); // Tolerance for zero point iterations 85 86 int transIter = psMetadataLookupS32(NULL, recipe, "ZP.TRANS.ITER"); // Iterations for transparency 86 87 float transRej = psMetadataLookupF32(NULL, recipe, "ZP.TRANS.REJ");// Rejection threshold for transparency 87 88 float transThresh = psMetadataLookupF32(NULL, recipe, "ZP.TRANS.THRESH"); // Threshold for transparency 88 float starRej = psMetadataLookupF32(NULL, recipe, "ZP.STAR.REJ"); // Rejection threshold for stars 89 90 float starRej1 = psMetadataLookupF32(NULL, recipe, "ZP.STAR.REJ.1"); // Rejection threshold for stars 91 float starSys1 = psMetadataLookupF32(NULL, recipe, "ZP.STAR.SYS.1"); // Estimated systematic error 92 float starRej2 = psMetadataLookupF32(NULL, recipe, "ZP.STAR.REJ.2"); // Rejection threshold for stars 93 float starSys2 = psMetadataLookupF32(NULL, recipe, "ZP.STAR.SYS.2"); // Estimated systematic error 94 89 95 float starLimit = psMetadataLookupF32(NULL, recipe, "ZP.STAR.LIMIT"); // Limit on star rejection fraction 90 float starSys = psMetadataLookupF32(NULL, recipe, "ZP.STAR.SYS"); // Estimated systematic error 96 97 float fracMatch = psMetadataLookupF32(NULL, recipe, "ZP.MATCH"); // Fraction of images to match for star 91 98 92 99 psMetadata *airmassZP = psMetadataLookupMetadata(NULL, recipe, "ZP.AIRMASS"); // Airmass terms … … 110 117 pmReadout *fake = pmReadoutAlloc(NULL); // Fake readout 111 118 pmPSF *psf = psMetadataLookupPtr(NULL, config->arguments, "PSF.TARGET"); // PSF for fake image 112 pmReadoutFakeFromSources(fake, FAKE_COLS, FAKE_ROWS, sourceLists->data[i], NULL, NULL, psf, 5, 0, false, true); 119 pmReadoutFakeFromSources(fake, FAKE_COLS, FAKE_ROWS, sourceLists->data[i], 120 NULL, NULL, psf, 5, 0, false, true); 113 121 psString name = NULL; 114 122 psStringAppend(&name, "start_%03d.fits", i); … … 153 161 } 154 162 155 psArray *matches = pmSourceMatchSources(sourceLists, radius ); // List of matches163 psArray *matches = pmSourceMatchSources(sourceLists, radius, true); // List of matches 156 164 if (!matches) { 157 165 psError(PS_ERR_UNKNOWN, false, "Unable to match sources"); … … 164 172 #endif 165 173 166 psVector *trans = pmSourceMatchRelphot(matches, zp, iter, tol, starLimit, transIter, transRej, 167 transThresh, starRej, starSys); // Transparencies for each image 174 psVector *trans = pmSourceMatchRelphot(matches, zp, tol, iter1, starRej1, starSys1, 175 iter2, starRej2, starSys2, starLimit, 176 transIter, transRej, transThresh); // Transparencies for each image 168 177 if (!trans) { 169 178 psError(PS_ERR_UNKNOWN, false, "Unable to measure transparencies"); … … 184 193 // XXX this is a really poor output location; clean up the pmFPAfiles used in ppStack 185 194 pmCell *sourcesCell = pmFPAfileThisCell(config->files, view, "PPSTACK.OUTPUT"); 186 psArray *sourcesBest = psArrayAllocEmpty (100);187 188 // XXX something of a hack: require at 2 detections or 1/2of the max possible189 int minMatches = PS_MAX (2, 0.5*num);195 psArray *sourcesBest = psArrayAllocEmpty(matches->n); 196 197 // XXX something of a hack: require at least 2 detections or the nominated fraction of the max possible 198 int minMatches = PS_MAX(2, fracMatch * num);// Minimum number of matches required 190 199 for (int i = 0; i < matches->n; i++) { 191 200 pmSourceMatch *match = matches->data[i]; // Match of interest 192 if (match->num < minMatches) continue; 201 if (match->num < minMatches) { 202 continue; 203 } 193 204 194 205 // We need to grab a single instance of this source: just take the first available 195 int nImage = match->image->data.S32[0];196 int nIndex = match->index->data.S32[0];197 psArray *sources = sourceLists->data[ nImage];198 pmSource *source = sources->data[ nIndex];199 200 // stick this sample source on sourcesBest201 psArrayAdd (sourcesBest, 100, source);202 }203 psMetadataAdd (sourcesCell->analysis, PS_LIST_TAIL, "PSPHOT.SOURCES", PS_DATA_ARRAY | PS_META_REPLACE,"psphot sources", sourcesBest);204 psLogMsg("ppStack", PS_LOG_INFO, "Selected %ld sources for photometry analysis \n", sourcesBest->n);205 psFree (sourcesBest);206 int image = match->image->data.S32[0]; // Index of image 207 int index = match->index->data.S32[0]; // Index of source within image 208 psArray *sources = sourceLists->data[image]; // Sources for image 209 pmSource *source = sources->data[index]; // Source of interest 210 211 psArrayAdd(sourcesBest, sourcesBest->n, source); 212 } 213 psMetadataAdd(sourcesCell->analysis, PS_LIST_TAIL, "PSPHOT.SOURCES", PS_DATA_ARRAY | PS_META_REPLACE, 214 "psphot sources", sourcesBest); 215 psLogMsg("ppStack", PS_LOG_INFO, "Selected %ld sources for photometry analysis", sourcesBest->n); 216 psFree(sourcesBest); 206 217 207 218 psFree(matches); -
branches/cnb_branches/cnb_branch_20090215/ppStack/src/ppStackVersion.c
r23199 r23239 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 -
branches/cnb_branches/cnb_branch_20090215/ppStats/src/Makefile.am
r23199 r23239 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 -
branches/cnb_branches/cnb_branch_20090215/ppStats/src/ppStatsVersion.c
r23199 r23239 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 -
branches/cnb_branches/cnb_branch_20090215/ppSub/src/Makefile.am
r23199 r23239 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 -
branches/cnb_branches/cnb_branch_20090215/ppSub/src/ppSubArguments.c
r23199 r23239 30 30 fprintf(stderr, "\nPan-STARRS PSF-matched image subtraction\n\n"); 31 31 fprintf(stderr, "Usage: %s INPUT.fits REFERENCE.fits OUTPUT_ROOT \n" 32 "\t[-psf REFERENCE.psf.fits] [-sources REFERENCE.cmf]\n\n"32 "\t[-psf REFERENCE.psf.fits]\n\n" 33 33 "This subtracts the convolved REFERENCE from the INPUT, by default.\n", 34 34 program); … … 201 201 202 202 203 pmConfigFileSetsMD(config->arguments, &argc, argv, "PPSUB.SOURCES", "-sources", NULL);204 205 203 psMetadata *arguments = config->arguments; // Command-line arguments 206 204 psMetadataAddStr(arguments, PS_LIST_TAIL, "-inmask", 0, "Input mask image", NULL); 207 205 psMetadataAddStr(arguments, PS_LIST_TAIL, "-invariance", 0, "Input variance image", NULL); 206 psMetadataAddStr(arguments, PS_LIST_TAIL, "-insources", 0, "Input source list", NULL); 208 207 psMetadataAddStr(arguments, PS_LIST_TAIL, "-refmask", 0, "Reference mask image", NULL); 209 208 psMetadataAddStr(arguments, PS_LIST_TAIL, "-refvariance", 0, "Reference variance image", NULL); 209 psMetadataAddStr(arguments, PS_LIST_TAIL, "-refsources", 0, "Reference source list", NULL); 210 210 psMetadataAddStr(arguments, PS_LIST_TAIL, "-stats", 0, "Statistics file", NULL); 211 211 psMetadataAddF32(arguments, PS_LIST_TAIL, "-region", 0, "Size of iso-kernel region", NAN); … … 224 224 psMetadataAddF32(arguments, PS_LIST_TAIL, "-spacing", 0, "Typical stamp spacing (pixels)", NAN); 225 225 psMetadataAddS32(arguments, PS_LIST_TAIL, "-footprint", 0, "Stamp footprint half-size (pixels)", -1); 226 psMetadataAddF32(arguments, PS_LIST_TAIL, "-source-radius", 0, "Source matching radius (pixels)", NAN); 226 227 psMetadataAddS32(arguments, PS_LIST_TAIL, "-stride", 0, "Size of convolution patches (pixels)", -1); 227 228 psMetadataAddF32(arguments, PS_LIST_TAIL, "-threshold", 0, "Minimum threshold for stamps (ADU)", NAN); … … 268 269 fileList("INPUT.VARIANCE", inVariance, "Name of the input variance image", config); 269 270 } 271 const char *inSources = psMetadataLookupStr(NULL, arguments, "-insources"); // Name of input source list 272 if (inSources && strlen(inSources) > 0) { 273 fileList("INPUT.SOURCES", inSources, "Name of the input source list", config); 274 } 270 275 271 276 const char *refMask = psMetadataLookupStr(NULL, arguments, "-refmask"); // Name of reference mask … … 276 281 if (refVariance && strlen(refVariance) > 0) { 277 282 fileList("REF.VARIANCE", refVariance, "Name of the reference variance image", config); 283 } 284 const char *refSources = psMetadataLookupStr(NULL, arguments, "-refsources"); // Name of ref source list 285 if (refSources && strlen(refSources) > 0) { 286 fileList("REF.SOURCES", refSources, "Name of the reference source list", config); 278 287 } 279 288 … … 300 309 } 301 310 302 VALUE_ARG_RECIPE_FLOAT("-region", "REGION.SIZE", F32); 303 VALUE_ARG_RECIPE_INT("-size", "KERNEL.SIZE", S32, 0); 304 VALUE_ARG_RECIPE_INT("-order", "SPATIAL.ORDER", S32, -1); 305 VALUE_ARG_RECIPE_FLOAT("-spacing", "STAMP.SPACING", F32); 306 VALUE_ARG_RECIPE_INT("-rings-order", "RINGS.ORDER", S32, -1); 307 VALUE_ARG_RECIPE_INT("-inner", "INNER", S32, -1); 308 VALUE_ARG_RECIPE_INT("-spam-binning", "SPAM.BINNING", S32, 0); 309 VALUE_ARG_RECIPE_INT("-footprint", "STAMP.FOOTPRINT", S32, -1); 310 VALUE_ARG_RECIPE_INT("-stride", "STRIDE", S32, -1); 311 VALUE_ARG_RECIPE_FLOAT("-threshold", "STAMP.THRESHOLD", F32); 312 VALUE_ARG_RECIPE_INT("-iter", "ITER", S32, -1); 313 VALUE_ARG_RECIPE_FLOAT("-rej", "REJ", F32); 314 VALUE_ARG_RECIPE_FLOAT("-sys", "SYS", F32); 315 VALUE_ARG_RECIPE_FLOAT("-badfrac", "BADFRAC", F32); 316 VALUE_ARG_RECIPE_FLOAT("-penalty", "PENALTY", F32); 317 VALUE_ARG_RECIPE_FLOAT("-poor-frac", "POOR.FRACTION", F32); 318 VALUE_ARG_RECIPE_INT("-bin1", "BIN1", S32, 0); 319 VALUE_ARG_RECIPE_INT("-bin2", "BIN2", S32, 0); 311 VALUE_ARG_RECIPE_FLOAT("-region", "REGION.SIZE", F32); 312 VALUE_ARG_RECIPE_INT("-size", "KERNEL.SIZE", S32, 0); 313 VALUE_ARG_RECIPE_INT("-order", "SPATIAL.ORDER", S32, -1); 314 VALUE_ARG_RECIPE_FLOAT("-spacing", "STAMP.SPACING", F32); 315 VALUE_ARG_RECIPE_INT("-rings-order", "RINGS.ORDER", S32, -1); 316 VALUE_ARG_RECIPE_INT("-inner", "INNER", S32, -1); 317 VALUE_ARG_RECIPE_INT("-spam-binning", "SPAM.BINNING", S32, 0); 318 VALUE_ARG_RECIPE_INT("-footprint", "STAMP.FOOTPRINT", S32, -1); 319 VALUE_ARG_RECIPE_FLOAT("-source-radius", "SOURCE.RADIUS", F32); 320 VALUE_ARG_RECIPE_INT("-stride", "STRIDE", S32, -1); 321 VALUE_ARG_RECIPE_FLOAT("-threshold", "STAMP.THRESHOLD", F32); 322 VALUE_ARG_RECIPE_INT("-iter", "ITER", S32, -1); 323 VALUE_ARG_RECIPE_FLOAT("-rej", "REJ", F32); 324 VALUE_ARG_RECIPE_FLOAT("-sys", "SYS", F32); 325 VALUE_ARG_RECIPE_FLOAT("-badfrac", "BADFRAC", F32); 326 VALUE_ARG_RECIPE_FLOAT("-penalty", "PENALTY", F32); 327 VALUE_ARG_RECIPE_FLOAT("-poor-frac", "POOR.FRACTION", F32); 328 VALUE_ARG_RECIPE_INT("-bin1", "BIN1", S32, 0); 329 VALUE_ARG_RECIPE_INT("-bin2", "BIN2", S32, 0); 320 330 321 331 valueArgRecipeStr(arguments, recipe, "-mask-in", "MASK.IN", recipe); -
branches/cnb_branches/cnb_branch_20090215/ppSub/src/ppSubCamera.c
r22419 r23239 40 40 pmFPAfile *inputMask = pmFPAfileBindFromArgs(&status, input, config, "PPSUB.INPUT.MASK", "INPUT.MASK"); 41 41 if (!status) { 42 psError (PS_ERR_UNKNOWN, false, "Failed to load file definition PPSUB.INPUT.MASK");42 psError(PS_ERR_UNKNOWN, false, "Failed to load file definition PPSUB.INPUT.MASK"); 43 43 return NULL; 44 44 } … … 51 51 pmFPAfile *inputVariance = pmFPAfileBindFromArgs(&status, input, config, "PPSUB.INPUT.VARIANCE", "INPUT.VARIANCE"); 52 52 if (!status) { 53 psError (PS_ERR_UNKNOWN, false, "Failed to load file definition PPSUB.INPUT.VARIANCE");53 psError(PS_ERR_UNKNOWN, false, "Failed to load file definition PPSUB.INPUT.VARIANCE"); 54 54 return NULL; 55 55 } 56 56 if (inputVariance && inputVariance->type != PM_FPA_FILE_VARIANCE) { 57 57 psError(PS_ERR_IO, true, "PPSUB.INPUT.VARIANCE is not of type VARIANCE"); 58 return false; 59 } 60 61 // Input source list 62 pmFPAfile *inputSources = pmFPAfileBindFromArgs(&status, input, config, "PPSUB.INPUT.SOURCES", "INPUT.SOURCES"); 63 if (!status) { 64 psError(PS_ERR_UNKNOWN, false, "Failed to load file definition PPSUB.INPUT.SOURCES"); 65 return NULL; 66 } 67 if (inputSources && inputSources->type != PM_FPA_FILE_CMF) { 68 psError(PS_ERR_IO, true, "PPSUB.INPUT.SOURCES is not of type CMF"); 58 69 return false; 59 70 } … … 74 85 pmFPAfile *refMask = pmFPAfileBindFromArgs(&status, ref, config, "PPSUB.REF.MASK", "REF.MASK"); 75 86 if (!status) { 76 psError (PS_ERR_UNKNOWN, false, "Failed to load file definition PPSUB.REF.MASK");87 psError(PS_ERR_UNKNOWN, false, "Failed to load file definition PPSUB.REF.MASK"); 77 88 return NULL; 78 89 } … … 85 96 pmFPAfile *refVariance = pmFPAfileBindFromArgs(&status, ref, config, "PPSUB.REF.VARIANCE", "REF.VARIANCE"); 86 97 if (!status) { 87 psError (PS_ERR_UNKNOWN, false, "Failed to load file definition PPSUB.REF.VARIANCE");98 psError(PS_ERR_UNKNOWN, false, "Failed to load file definition PPSUB.REF.VARIANCE"); 88 99 return NULL; 89 100 } 90 101 if (refVariance && refVariance->type != PM_FPA_FILE_VARIANCE) { 91 102 psError(PS_ERR_IO, true, "PPSUB.REF.VARIANCE is not of type VARIANCE"); 103 return false; 104 } 105 106 // Reference source list 107 pmFPAfile *refSources = pmFPAfileBindFromArgs(&status, ref, config, "PPSUB.REF.SOURCES", "REF.SOURCES"); 108 if (!status) { 109 psError(PS_ERR_UNKNOWN, false, "Failed to load file definition PPSUB.REF.SOURCES"); 110 return NULL; 111 } 112 if (refSources && refSources->type != PM_FPA_FILE_CMF) { 113 psError(PS_ERR_IO, true, "PPSUB.REF.SOURCES is not of type CMF"); 92 114 return false; 93 115 } … … 241 263 outKernels->save = true; 242 264 243 #if 0244 if (!pmFPAAddSourceFromFormat(output->fpa, "Subtraction", output->format)) {245 psError(PS_ERR_UNKNOWN, false, "Unable to generate output FPA.");246 return false;247 }248 #endif249 250 pmFPAfile *sources = pmFPAfileDefineFromArgs(&status, config, "PPSUB.SOURCES", "PPSUB.SOURCES");251 if (!status) {252 psError(PS_ERR_IO, false, "Failed to load file definition PPSUB.SOURCES");253 return false;254 }255 if (sources && sources->type != PM_FPA_FILE_CMF) {256 psError(PS_ERR_IO, true, "PPSUB.SOURCES is not of type CMF");257 return false;258 }259 265 260 266 psMetadata *recipe = psMetadataLookupMetadata(NULL, config->recipes, PPSUB_RECIPE); // Recipe for ppSim -
branches/cnb_branches/cnb_branch_20090215/ppSub/src/ppSubMakePSF.c
r23197 r23239 81 81 // Extract the loaded sources from the associated readout, and generate PSF 82 82 // Here, we assume the image is background-subtracted 83 pmReadout *sourcesRO = pmFPAfileThisReadout(config->files, view, "PPSUB.SOURCES"); 84 psArray *sources = psMetadataLookupPtr(&mdok, sourcesRO->analysis, "PSPHOT.SOURCES"); 83 psArray *sources = psMetadataLookupPtr(&mdok, minuend->analysis, "PSPHOT.SOURCES"); 85 84 if (!psphotReadoutFindPSF(config, view, sources)) { 86 85 psError(PS_ERR_UNKNOWN, false, "Unable to perform photometry on subtracted image."); -
branches/cnb_branches/cnb_branch_20090215/ppSub/src/ppSubMatchPSFs.c
r22419 r23239 50 50 51 51 // Sources in image, used for stamps: these must be loaded from previous analysis stages 52 pmReadout *sourcesRO = pmFPAfileThisReadout(config->files, view, "PPSUB.SOURCES"); // Readout with sources 53 psArray *sources = NULL; // Sources in image; used for stamps 54 if (sourcesRO) { 55 sources = psMetadataLookupPtr(&mdok, sourcesRO->analysis, "PSPHOT.SOURCES"); 52 psArray *inSources = psMetadataLookupPtr(&mdok, inRO->analysis, "PSPHOT.SOURCES"); // Input source list 53 psArray *refSources = psMetadataLookupPtr(&mdok, refRO->analysis, "PSPHOT.SOURCES"); // Ref source list 54 55 psArray *sources = NULL; // Merged list of sources 56 if (inSources && refSources) { 57 float radius = psMetadataLookupF32(NULL, recipe, "SOURCE.RADIUS"); // Matching radius 58 psArray *lists = psArrayAlloc(2); // Source lists 59 lists->data[0] = psMemIncrRefCounter(inSources); 60 lists->data[1] = psMemIncrRefCounter(refSources); 61 sources = pmSourceMatchMerge(lists, radius); 62 psFree(lists); 63 if (!sources) { 64 psError(PS_ERR_UNKNOWN, false, "Unable to merge source lists"); 65 return false; 66 } 67 } else if (inSources) { 68 sources = psMemIncrRefCounter(inSources); 69 } else if (refSources) { 70 sources = psMemIncrRefCounter(refSources); 56 71 } 72 73 psMetadataAddArray(inConv->analysis, PS_LIST_TAIL, "PSPHOT.SOURCES", PS_META_REPLACE, 74 "Merged source list", sources); 75 psMetadataAddArray(refConv->analysis, PS_LIST_TAIL, "PSPHOT.SOURCES", PS_META_REPLACE, 76 "Merged source list", sources); 77 psFree(sources); // Drop reference 57 78 58 79 int footprint = psMetadataLookupS32(NULL, recipe, "STAMP.FOOTPRINT"); // Stamp half-size … … 129 150 130 151 // XXX drop the pixels associated with inRO and refRO (now that we have inConv and refConf) 131 152 #ifdef TESTING 132 153 psphotSaveImage (NULL, inRO->image, "inRO.fits"); 133 154 psphotSaveImage (NULL, refRO->image, "refRO.fits"); 134 155 psphotSaveImage (NULL, inConv->image, "inConv.fits"); 135 156 psphotSaveImage (NULL, refConv->image, "refConv.fits"); 157 #endif 136 158 137 159 return true; -
branches/cnb_branches/cnb_branch_20090215/ppSub/src/ppSubVersion.c
r23199 r23239 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 -
branches/cnb_branches/cnb_branch_20090215/psLib/src/imageops/psImageInterpolate.c
r21290 r23239 133 133 } 134 134 135 float norm1 = 2.0 / PS_SQR(M_PI); // Normalisation for laczos136 float norm2 = M_PI * 4.0 / (float)size;// Normalisation for sinc function 1137 float norm3 = M_PI _2 * 4.0 / (float)size; // Normalisation for sinc function 2135 float norm1 = size / 2.0 / PS_SQR(M_PI); // Normalisation for laczos 136 float norm2 = M_PI; // Normalisation for sinc function 1 137 float norm3 = M_PI * 2.0 / (float)size; // Normalisation for sinc function 2 138 138 float pos = - (size - 1)/2 - frac; // Position of interest 139 139 for (int i = 0; i < size; i++, pos += 1.0) { -
branches/cnb_branches/cnb_branch_20090215/psLib/src/sys/Makefile.am
r23199 r23239 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 \ -
branches/cnb_branches/cnb_branch_20090215/psLib/src/sys/psConfigure.c
r23199 r23239 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 -
branches/cnb_branches/cnb_branch_20090215/psLib/src/sys/psLogMsg.c
r20546 r23239 195 195 } 196 196 197 int fileD = creat(dest, 0666);197 int fileD = open(dest, O_WRONLY | O_CREAT, 0666); 198 198 if (fileD == 0) { 199 199 psError(PS_ERR_IO, true, _("Could not open file '%s' for output."), dest); … … 316 316 317 317 if (write(logFD, head, strlen(head))) {;} // ignore return value 318 318 319 319 if (logMsg) { 320 320 psString msg = NULL; // Message to print -
branches/cnb_branches/cnb_branch_20090215/psModules/src/config/Makefile.am
r23199 r23239 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 = \ -
branches/cnb_branches/cnb_branch_20090215/psModules/src/config/pmConfig.c
r21314 r23239 1110 1110 // camera. If we are discovering the camera (config->camera == NULL), then we also load the 1111 1111 // recipe files for the camera. 1112 psMetadata *pmConfigCameraFormatFromHeader(psMetadata **camera, psString *cameraName, psString *formatName, 1113 pmConfig *config, const psMetadata *header, bool readRecipes)1112 psMetadata *pmConfigCameraFormatFromHeader(psMetadata **camera, psString *cameraName, psString *formatName, 1113 pmConfig *config, const psMetadata *header, bool readRecipes) 1114 1114 { 1115 1115 PS_ASSERT_PTR_NON_NULL(config, NULL); … … 1672 1672 // if the object does not exist and create isn't set, then we 1673 1673 // should puke 1674 psError(PM_ERR_SYS, true, "Unable to access file %s ", filename);1674 psError(PM_ERR_SYS, true, "Unable to access file %s: %s", filename, nebErr(server)); 1675 1675 nebServerFree(server); 1676 1676 return NULL; … … 1685 1685 if (trunc) { 1686 1686 if(truncate(path, 0) != 0) { 1687 psError(PS_ERR_IO, true, "Failed to truncate Nebulous file %s (real name %s)\n", filename, path); 1687 psError(PS_ERR_IO, true, "Failed to truncate Nebulous file %s (real name %s)\n", 1688 filename, path); 1688 1689 return NULL; 1689 1690 } -
branches/cnb_branches/cnb_branch_20090215/psModules/src/config/pmVersion.c
r23199 r23239 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 -
branches/cnb_branches/cnb_branch_20090215/psModules/src/objects/pmSourceMatch.c
r23199 r23239 152 152 153 153 154 psArray *pmSourceMatchSources(const psArray *sourceArrays, float radius )154 psArray *pmSourceMatchSources(const psArray *sourceArrays, float radius, bool cullSingles) 155 155 { 156 156 PS_ASSERT_ARRAY_NON_NULL(sourceArrays, NULL); … … 220 220 221 221 // Match with the master list 222 223 psTree *tree = psTreePlant(2, SOURCES_MAX_LEAF, xMaster, yMaster); // kd Tree with sources224 long numMatch = 0; // Number of matches225 226 long size = numMaster + numSources; // New size227 xMaster = psVectorRealloc(xMaster, size);228 yMaster = psVectorRealloc(yMaster, size);229 matches = psArrayRealloc(matches, size);230 231 psVector *coords = psVectorAlloc(2, PS_TYPE_F32); // Coordinates for tree lookup232 for (int j = 0; j < numSources; j++) {233 coords->data.F32[0] = xImage->data.F32[j];234 coords->data.F32[1] = yImage->data.F32[j];235 long index = psTreeNearestWithin(tree, coords, radius); // Match index236 if (index >= 0) {237 // Record the match238 pmSourceMatch *match = matches->data[index]; // Match data239 pmSourceMatchAdd(match, magImage->data.F32[j], magErrImage->data.F32[j], i, j);240 numMatch++;241 } else {242 // Add to the master list243 pmSourceMatch *match = pmSourceMatchAlloc(numImages); // Match data244 pmSourceMatchAdd(match, magImage->data.F32[j], magErrImage->data.F32[j], i, j);245 xMaster->data.F32[numMaster] = xImage->data.F32[j];246 yMaster->data.F32[numMaster] = yImage->data.F32[j];247 matches->data[numMaster] = match;248 numMaster++;249 xMaster->n = yMaster->n = matches->n = numMaster;250 }251 252 }253 psFree(coords);254 psFree(tree);255 222 { 223 psTree *tree = psTreePlant(2, SOURCES_MAX_LEAF, xMaster, yMaster); // kd Tree with sources 224 long numMatch = 0; // Number of matches 225 226 long size = numMaster + numSources; // New size 227 xMaster = psVectorRealloc(xMaster, size); 228 yMaster = psVectorRealloc(yMaster, size); 229 matches = psArrayRealloc(matches, size); 230 231 psVector *coords = psVectorAlloc(2, PS_TYPE_F32); // Coordinates for tree lookup 232 for (int j = 0; j < numSources; j++) { 233 coords->data.F32[0] = xImage->data.F32[j]; 234 coords->data.F32[1] = yImage->data.F32[j]; 235 long index = psTreeNearestWithin(tree, coords, radius); // Match index 236 if (index >= 0) { 237 // Record the match 238 pmSourceMatch *match = matches->data[index]; // Match data 239 pmSourceMatchAdd(match, magImage->data.F32[j], magErrImage->data.F32[j], i, j); 240 numMatch++; 241 } else { 242 // Add to the master list 243 pmSourceMatch *match = pmSourceMatchAlloc(numImages); // Match data 244 pmSourceMatchAdd(match, magImage->data.F32[j], magErrImage->data.F32[j], i, j); 245 xMaster->data.F32[numMaster] = xImage->data.F32[j]; 246 yMaster->data.F32[numMaster] = yImage->data.F32[j]; 247 matches->data[numMaster] = match; 248 numMaster++; 249 xMaster->n = yMaster->n = matches->n = numMaster; 250 } 251 252 } 253 psFree(coords); 254 psFree(tree); 255 } 256 256 257 257 match_image_done: … … 263 263 } 264 264 265 // Now cull the matches that contain only a single star 266 int numGood = 0; // Number of good matches 265 if (cullSingles) { 266 // Now cull the matches that contain only a single star 267 int numGood = 0; // Number of good matches 268 for (int i = 0; i < matches->n; i++) { 269 pmSourceMatch *match = matches->data[i]; // Match of interest 270 if (match->num > 1) { 271 if (i != numGood) { 272 psFree(matches->data[numGood]); 273 matches->data[numGood] = psMemIncrRefCounter(match); 274 } 275 numGood++; 276 } 277 } 278 matches->n = numGood; 279 for (int i = numGood; i < numMaster; i++) { 280 psFree(matches->data[i]); 281 matches->data[i] = NULL; 282 } 283 } 284 285 return matches; 286 } 287 288 289 psArray *pmSourceMatchMerge(psArray *sourceArrays, float radius) 290 { 291 PS_ASSERT_ARRAY_NON_NULL(sourceArrays, NULL); 292 PS_ASSERT_FLOAT_LARGER_THAN(radius, 0.0, NULL); 293 294 psArray *matches = pmSourceMatchSources(sourceArrays, radius, false); // Source matches 295 if (!matches) { 296 psError(PS_ERR_UNKNOWN, false, "Unable to match source lists."); 297 return NULL; 298 } 299 300 int index = 0; // Index to current position on list 267 301 for (int i = 0; i < matches->n; i++) { 302 pmSource *source = NULL; // Source to put in merged list 268 303 pmSourceMatch *match = matches->data[i]; // Match of interest 269 if (match->num > 1) { 270 if (i != numGood) { 271 psFree(matches->data[numGood]); 272 matches->data[numGood] = psMemIncrRefCounter(match); 273 // psFree(match); 274 } 275 numGood++; 276 } 277 } 278 matches->n = numGood; 279 for (int i = numGood; i < numMaster; i++) { 280 psFree(matches->data[i]); 281 matches->data[i] = NULL; 282 } 304 for (int j = 0; j < match->num && !source; j++) { 305 if (!isfinite(match->mag->data.F32[j]) || !isfinite(match->magErr->data.F32[j])) { 306 continue; 307 } 308 int image = match->image->data.S32[j]; // Index of image 309 int index = match->index->data.S32[j]; // Index of source for image 310 psArray *list = sourceArrays->data[image]; // List of interest 311 source = list->data[index]; 312 break; 313 } 314 315 if (source) { 316 psFree(matches->data[index]); 317 matches->data[index] = psMemIncrRefCounter(source); 318 index++; 319 } 320 } 321 322 // Clear out the rest of the list 323 int num = index; // Number of good sources 324 for (; index < matches->n; index++) { 325 psFree(matches->data[index]); 326 matches->data[index] = NULL; 327 } 328 matches->n = num; 283 329 284 330 return matches; 285 331 } 286 287 332 288 333 // Iterate on the star magnitudes and image transparencies … … 524 569 psVector *pmSourceMatchRelphot(const psArray *matches, // Array of matches 525 570 const psVector *zp, // Zero points for each image (including airmass term) 526 int maxIter, // Maximum number of iterations527 571 float tol, // Relative tolerance for convergence 572 int iter1, // Number of iterations for pass 1 573 float rej1, // Limit on rejection between iterations for pass 1 574 float sys1, // Systematic error in measurements for pass 1 575 int iter2, // Number of iterations for pass 2 576 float rej2, // Limit on rejection between iterations for pass 2 577 float sys2, // Systematic error in measurements for pass 2 528 578 float rejLimit, // Limit on rejection between iterations 529 579 int transIter, // Clipping iterations for transparency 530 580 float transClip, // Clipping level for transparency 531 float photoLevel, // Level at which we declare image is photometric 532 float starClip, // Clipping for stars 533 float sysErr // Systematic error in measurements 581 float photoLevel // Level at which we declare image is photometric 534 582 ) 535 583 { … … 539 587 PS_ASSERT_FLOAT_LARGER_THAN(transClip, 0.0, NULL); 540 588 541 sysErr *= sysErr; 589 sys1 *= sys1; 590 sys2 *= sys2; 542 591 543 592 int numImages = zp->n; // Number of images … … 552 601 553 602 float chi2 = sourceMatchRelphotIterate(trans, stars, badImage, matches, zp, 554 photo, sys Err); // chi^2 for solution603 photo, sys1); // chi^2 for solution 555 604 psTrace("psModules.objects", 1, "Initial: chi^2 = %f\n", chi2); 556 605 float lastChi2 = INFINITY; // chi^2 on last iteration 557 606 float fracRej = INFINITY; // Fraction of measurements rejected 558 607 559 // in the first passes, the transparencies are not well deteremined: use high systematic error and the rejection thresholds 560 for (int i = 0; i < 5; i++) { 608 // In the first passes, the transparencies are not well deteremined: use high systematic error and 609 // rejection thresholds 610 for (int i = 0; i < iter1; i++) { 561 611 562 612 // Identify photometric nights … … 572 622 psTrace("psModules.objects", 3, "Pass 1: Determined %d/%d are photometric", numPhoto, numImages); 573 623 574 // XXX use 20 sigma rejection and 0.1 mag systematic error (move these to the recipe) 575 fracRej = sourceMatchRelphotReject(trans, stars, matches, zp, photo, badImage, 20.0, PS_SQR(0.1)); 624 fracRej = sourceMatchRelphotReject(trans, stars, matches, zp, photo, badImage, rej1, sys1); 576 625 psTrace("psModules.objects", 3, "Pass 1: %f%% of measurements rejected", fracRej * 100); 577 626 578 // XXX use 0.05 mag systematic error (move these to the recipe) 579 chi2 = sourceMatchRelphotIterate(trans, stars, badImage, matches, zp, photo, PS_SQR(0.1)); 627 chi2 = sourceMatchRelphotIterate(trans, stars, badImage, matches, zp, photo, sys1); 580 628 psTrace("psModules.objects", 1, "Pass 1: iter = %d: chi^2 = %f rejected = %f\n", i, chi2, fracRej); 581 629 } 582 630 583 for (int i = 0; i < maxIter&& (fabsf(lastChi2 - chi2) > tol * chi2 || fracRej > rejLimit); i++) {631 for (int i = 0; i < iter2 && (fabsf(lastChi2 - chi2) > tol * chi2 || fracRej > rejLimit); i++) { 584 632 lastChi2 = chi2; 585 633 … … 594 642 return NULL; 595 643 } 596 psTrace("psModules.objects", 3, " Determined %d/%d are photometric", numPhoto, numImages);597 598 fracRej = sourceMatchRelphotReject(trans, stars, matches, zp, photo, badImage, starClip, sysErr);599 psTrace("psModules.objects", 3, " %f%% of measurements rejected", fracRej * 100);600 601 chi2 = sourceMatchRelphotIterate(trans, stars, badImage, matches, zp, photo, sys Err);602 psTrace("psModules.objects", 1, " iter = %d: chi^2 = %f rejected = %f\n", i, chi2, fracRej);644 psTrace("psModules.objects", 3, "Pass 2: Determined %d/%d are photometric", numPhoto, numImages); 645 646 fracRej = sourceMatchRelphotReject(trans, stars, matches, zp, photo, badImage, rej2, sys2); 647 psTrace("psModules.objects", 3, "Pass 2: %f%% of measurements rejected", fracRej * 100); 648 649 chi2 = sourceMatchRelphotIterate(trans, stars, badImage, matches, zp, photo, sys2); 650 psTrace("psModules.objects", 1, "Pass 2: iter = %d: chi^2 = %f rejected = %f\n", i, chi2, fracRej); 603 651 } 604 652 -
branches/cnb_branches/cnb_branch_20090215/psModules/src/objects/pmSourceMatch.h
r20953 r23239 48 48 /// 49 49 /// Returns an array of psSourceMatch 50 psArray *pmSourceMatchSources(const psArray *sourceArrays, // Array of arrays of sources on each image 51 float radius // Correlation radius 50 psArray *pmSourceMatchSources(const psArray *sourceArrays, ///< Array of arrays of sources on each image 51 float radius, ///< Matching radius 52 bool cullSingles ///< Cull "matches" with only a single source? 52 53 ); 54 55 /// Merge two source lists 56 /// 57 /// Sources are pulled from the lists into a new list, with no effort made to adjust them. 58 psArray *pmSourceMatchMerge(psArray *sourceArrays, ///< Array of arrays of sources on each image 59 float radius ///< Matching radius 60 ); 53 61 54 62 /// Perform relative photometry to calibrate images 55 63 psVector *pmSourceMatchRelphot(const psArray *matches, // Array of matches 56 64 const psVector *zp, // Zero points for each image (including airmass term) 57 int maxIter, // Maximum number of iterations58 65 float tol, // Relative tolerance for convergence 66 int iter1, // Number of iterations for pass 1 67 float rej1, // Limit on rejection between iterations for pass 1 68 float sys1, // Systematic error in measurements for pass 1 69 int iter2, // Number of iterations for pass 2 70 float rej2, // Limit on rejection between iterations for pass 2 71 float sys2, // Systematic error in measurements for pass 2 59 72 float rejLimit, // Limit on rejection between iterations 60 73 int transIter, // Clipping iterations for transparency 61 74 float transClip, // Clipping level for transparency 62 float photoLevel, // Level at which we declare image is photometric 63 float starClip, // Clipping for stars 64 float sysErr // Systematic error in measurements 75 float photoLevel // Level at which we declare image is photometric 65 76 ); 66 77 -
branches/cnb_branches/cnb_branch_20090215/psastro/src/Makefile.am
r23199 r23239 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 -
branches/cnb_branches/cnb_branch_20090215/psastro/src/psastroVersion.c
r23199 r23239 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 -
branches/cnb_branches/cnb_branch_20090215/psconfig/psbuild
r23199 r23239 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"); -
branches/cnb_branches/cnb_branch_20090215/psphot/src/Makefile.am
r23199 r23239 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 -
branches/cnb_branches/cnb_branch_20090215/psphot/src/psphotSetThreads.c
r21392 r23239 25 25 psFree(task); 26 26 27 task = psThreadTaskAlloc("PSPHOT_SOURCE_STATS", 4);27 task = psThreadTaskAlloc("PSPHOT_SOURCE_STATS", 5); 28 28 task->function = &psphotSourceStats_Threaded; 29 29 psThreadTaskAdd(task); -
branches/cnb_branches/cnb_branch_20090215/psphot/src/psphotSourceStats.c
r21536 r23239 15 15 int nThreads = psMetadataLookupS32(&status, config->arguments, "NTHREADS"); // Number of threads 16 16 if (!status) { 17 nThreads = 0;17 nThreads = 0; 18 18 } 19 19 … … 41 41 pmSource *source = pmSourceAlloc(); 42 42 43 // add the peak43 // add the peak 44 44 source->peak = psMemIncrRefCounter(peak); 45 45 46 // allocate space for moments46 // allocate space for moments 47 47 source->moments = pmMomentsAlloc(); 48 48 … … 50 50 pmSourceDefinePixels (source, readout, source->peak->x, source->peak->y, OUTER); 51 51 52 peak->assigned = true;53 psArrayAdd (sources, 100, source);54 psFree (source);52 peak->assigned = true; 53 psArrayAdd (sources, 100, source); 54 psFree (source); 55 55 } 56 56 57 57 if (!strcasecmp (breakPt, "PEAKS")) { 58 psLogMsg ("psphot", PS_LOG_INFO, "%ld sources : %f sec\n", sources->n, psTimerMark ("psphot.stats"));59 psLogMsg ("psphot", PS_LOG_INFO, "break point PEAKS, skipping MOMENTS\n");60 psphotVisualShowMoments (sources);61 return sources;58 psLogMsg ("psphot", PS_LOG_INFO, "%ld sources : %f sec\n", sources->n, psTimerMark ("psphot.stats")); 59 psLogMsg ("psphot", PS_LOG_INFO, "break point PEAKS, skipping MOMENTS\n"); 60 psphotVisualShowMoments (sources); 61 return sources; 62 62 } 63 63 … … 65 65 int Nfail = 0; 66 66 int Nmoments = 0; 67 int Nfaint = 0; 67 68 68 69 // choose Cx, Cy (see psphotThreadTools.c for overview of the concepts) … … 74 75 for (int i = 0; i < cellGroups->n; i++) { 75 76 76 psArray *cells = cellGroups->data[i]; 77 78 for (int j = 0; j < cells->n; j++) { 79 80 // allocate a job -- if threads are not defined, this just runs the job 81 psThreadJob *job = psThreadJobAlloc ("PSPHOT_SOURCE_STATS"); 82 83 psArrayAdd(job->args, 1, cells->data[j]); // sources 84 psArrayAdd(job->args, 1, recipe); 85 PS_ARRAY_ADD_SCALAR(job->args, 0, PS_TYPE_S32); // this is used as a return value for Nmoments 86 PS_ARRAY_ADD_SCALAR(job->args, 0, PS_TYPE_S32); // this is used as a return value for Nfail 87 88 if (!psThreadJobAddPending(job)) { 89 psError(PS_ERR_UNKNOWN, false, "Unable to guess model."); 90 psFree (job); 91 return NULL; 92 } 93 psFree(job); 77 psArray *cells = cellGroups->data[i]; 78 79 for (int j = 0; j < cells->n; j++) { 80 81 // allocate a job -- if threads are not defined, this just runs the job 82 psThreadJob *job = psThreadJobAlloc ("PSPHOT_SOURCE_STATS"); 83 84 psArrayAdd(job->args, 1, cells->data[j]); // sources 85 psArrayAdd(job->args, 1, recipe); 86 PS_ARRAY_ADD_SCALAR(job->args, 0, PS_TYPE_S32); // this is used as a return value for Nmoments 87 PS_ARRAY_ADD_SCALAR(job->args, 0, PS_TYPE_S32); // this is used as a return value for Nfail 88 PS_ARRAY_ADD_SCALAR(job->args, 0, PS_TYPE_S32); // this is used as a return value for Nfaint 89 90 if (!psThreadJobAddPending(job)) { 91 psError(PS_ERR_UNKNOWN, false, "Unable to guess model."); 92 psFree (job); 93 return NULL; 94 } 95 psFree(job); 94 96 95 97 # if (0) 96 int nfail = 0;97 int nmoments = 0;98 if (!psphotSourceStats_Unthreaded (&nfail, &nmoments, cells->data[j], recipe)) {99 psError(PS_ERR_UNKNOWN, false, "Unable to guess model.");100 return NULL;101 }102 Nfail += nfail;103 Nmoments += nmoments;98 int nfail = 0; 99 int nmoments = 0; 100 if (!psphotSourceStats_Unthreaded (&nfail, &nmoments, cells->data[j], recipe)) { 101 psError(PS_ERR_UNKNOWN, false, "Unable to guess model."); 102 return NULL; 103 } 104 Nfail += nfail; 105 Nmoments += nmoments; 104 106 # endif 105 } 106 107 // wait for the threads to finish and manage results 108 if (!psThreadPoolWait (false)) { 109 psError(PS_ERR_UNKNOWN, false, "Unable to guess model."); 110 return NULL; 111 } 112 113 // we have only supplied one type of job, so we can assume the types here 114 psThreadJob *job = NULL; 115 while ((job = psThreadJobGetDone()) != NULL) { 116 if (job->args->n < 1) { 117 fprintf (stderr, "error with job\n"); 118 } else { 119 psScalar *scalar = NULL; 120 scalar = job->args->data[2]; 121 Nmoments += scalar->data.S32; 122 scalar = job->args->data[3]; 123 Nfail += scalar->data.S32; 124 } 125 psFree(job); 126 } 107 } 108 109 // wait for the threads to finish and manage results 110 if (!psThreadPoolWait (false)) { 111 psError(PS_ERR_UNKNOWN, false, "Unable to guess model."); 112 return NULL; 113 } 114 115 // we have only supplied one type of job, so we can assume the types here 116 psThreadJob *job = NULL; 117 while ((job = psThreadJobGetDone()) != NULL) { 118 if (job->args->n < 1) { 119 fprintf (stderr, "error with job\n"); 120 } else { 121 psScalar *scalar = NULL; 122 scalar = job->args->data[2]; 123 Nmoments += scalar->data.S32; 124 scalar = job->args->data[3]; 125 Nfail += scalar->data.S32; 126 scalar = job->args->data[4]; 127 Nfaint += scalar->data.S32; 128 } 129 psFree(job); 130 } 127 131 } 128 132 129 133 psFree (cellGroups); 130 134 131 psLogMsg ("psphot", PS_LOG_INFO, "%ld sources, %d moments, %d fai led: %f sec\n", sources->n, Nmoments, Nfail, psTimerMark ("psphot.stats"));135 psLogMsg ("psphot", PS_LOG_INFO, "%ld sources, %d moments, %d faint, %d failed: %f sec\n", sources->n, Nmoments, Nfaint, Nfail, psTimerMark ("psphot.stats")); 132 136 133 137 psphotVisualShowMoments (sources); … … 166 170 int Nfail = 0; 167 171 int Nmoments = 0; 172 int Nfaint = 0; 168 173 for (int i = 0; i < sources->n; i++) { 169 174 pmSource *source = sources->data[i]; … … 171 176 // skip faint sources for moments measurement 172 177 if (source->peak->SN < MIN_SN) { 173 source->mode |= PM_SOURCE_MODE_BELOW_MOMENTS_SN; 178 source->mode |= PM_SOURCE_MODE_BELOW_MOMENTS_SN; 179 Nfaint++; 174 180 continue; 175 181 } … … 179 185 status = pmSourceLocalSky (source, PS_STAT_SAMPLE_MEDIAN, INNER, maskVal, markVal); 180 186 if (!status) { 181 source->mode |= PM_SOURCE_MODE_SKY_FAILURE;182 psErrorClear(); // XXX re-consider the errors raised here183 Nfail ++;184 continue;187 source->mode |= PM_SOURCE_MODE_SKY_FAILURE; 188 psErrorClear(); // XXX re-consider the errors raised here 189 Nfail ++; 190 continue; 185 191 } 186 192 … … 189 195 status = pmSourceLocalSkyVariance (source, PS_STAT_SAMPLE_MEDIAN, INNER, maskVal, markVal); 190 196 if (!status) { 191 source->mode |= PM_SOURCE_MODE_SKYVAR_FAILURE;192 Nfail ++;193 psErrorClear();194 continue;197 source->mode |= PM_SOURCE_MODE_SKYVAR_FAILURE; 198 Nfail ++; 199 psErrorClear(); 200 continue; 195 201 } 196 202 … … 208 214 status = pmSourceMoments (source, BIG_RADIUS); 209 215 if (status) { 210 source->mode |= PM_SOURCE_MODE_BIG_RADIUS;216 source->mode |= PM_SOURCE_MODE_BIG_RADIUS; 211 217 Nmoments ++; 212 218 continue; 213 219 } 214 220 215 source->mode |= PM_SOURCE_MODE_MOMENTS_FAILURE;221 source->mode |= PM_SOURCE_MODE_MOMENTS_FAILURE; 216 222 Nfail ++; 217 223 psErrorClear(); … … 225 231 scalar = job->args->data[3]; 226 232 scalar->data.S32 = Nfail; 227 233 234 scalar = job->args->data[4]; 235 scalar->data.S32 = Nfaint; 236 228 237 return true; 229 238 } … … 268 277 status = pmSourceLocalSky (source, PS_STAT_SAMPLE_MEDIAN, INNER, maskVal, markVal); 269 278 if (!status) { 270 psErrorClear(); // XXX re-consider the errors raised here271 Nfail ++;272 continue;279 psErrorClear(); // XXX re-consider the errors raised here 280 Nfail ++; 281 continue; 273 282 } 274 283 … … 277 286 status = pmSourceLocalSkyVariance (source, PS_STAT_SAMPLE_MEDIAN, INNER, maskVal, markVal); 278 287 if (!status) { 279 Nfail ++;280 psErrorClear();281 continue;288 Nfail ++; 289 psErrorClear(); 290 continue; 282 291 } 283 292 … … 307 316 *nmoments = Nmoments; 308 317 *nfail = Nfail; 309 318 310 319 return true; 311 320 } 312 # endif 321 # endif -
branches/cnb_branches/cnb_branch_20090215/psphot/src/psphotVersion.c
r23199 r23239 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.
