Changeset 36441
- Timestamp:
- Jan 14, 2014, 2:28:47 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 74 edited
- 17 copied
-
. (modified) (1 prop)
-
Nebulous (modified) (1 prop)
-
Nebulous-Server (modified) (1 prop)
-
Ohana (modified) (1 prop)
-
Ohana/src/dvomerge (modified) (1 prop)
-
Ohana/src/libohana/src (modified) (1 prop)
-
Ohana/src/opihi (modified) (1 prop)
-
Ohana/src/opihi/cmd.astro (modified) (1 prop)
-
Ohana/src/opihi/cmd.data (modified) (1 prop)
-
Ohana/src/relastro/src (modified) (1 prop)
-
dbconfig/cam.md (modified) (1 prop)
-
dbconfig/changes.txt (modified) (1 diff, 1 prop)
-
dbconfig/ff.md (copied) (copied from branches/bills_branches/bills_201312/dbconfig/ff.md )
-
dbconfig/ipp.m4 (modified) (1 diff)
-
ippMonitor (modified) (1 prop)
-
ippScripts/Build.PL (modified) (1 diff)
-
ippScripts/scripts/chip_imfile.pl (modified) (1 prop)
-
ippScripts/scripts/destreak_restore_camera.pl (modified) (1 prop)
-
ippScripts/scripts/ipp_apply_burntool_single.pl (modified) (1 prop)
-
ippScripts/scripts/lap_science.pl (modified) (1 prop)
-
ippScripts/scripts/magic_destreak.pl (modified) (1 prop)
-
ippScripts/scripts/psphot_fullforce_summary.pl (copied) (copied from branches/bills_branches/bills_201312/ippScripts/scripts/psphot_fullforce_summary.pl )
-
ippScripts/scripts/psphot_fullforce_warp.pl (modified) (18 diffs)
-
ippScripts/scripts/publish_file.pl (modified) (1 prop)
-
ippScripts/scripts/staticsky.pl (modified) (4 diffs)
-
ippScripts/scripts/warp_skycell.pl (modified) (1 prop)
-
ippTasks (modified) (1 prop)
-
ippTasks/Makefile.am (modified) (1 diff)
-
ippTasks/fullforce.pro (copied) (copied from branches/bills_branches/bills_201312/ippTasks/fullforce.pro )
-
ippToPsps (modified) (1 prop)
-
ippTools/share (modified) (1 prop)
-
ippTools/share/Makefile.am (modified) (1 diff)
-
ippTools/share/camtool_find_pendingimfile.sql (modified) (1 prop)
-
ippTools/share/chiptool_setimfiletoupdate.sql (modified) (1 prop)
-
ippTools/share/fftool_definebyquery.sql (copied) (copied from branches/bills_branches/bills_201312/ippTools/share/fftool_definebyquery.sql )
-
ippTools/share/fftool_definebyquery_select_warps.sql (copied) (copied from branches/bills_branches/bills_201312/ippTools/share/fftool_definebyquery_select_warps.sql )
-
ippTools/share/fftool_result.sql (copied) (copied from branches/bills_branches/bills_201312/ippTools/share/fftool_result.sql )
-
ippTools/share/fftool_revert.sql (copied) (copied from branches/bills_branches/bills_201312/ippTools/share/fftool_revert.sql )
-
ippTools/share/fftool_revertsummary.sql (copied) (copied from branches/bills_branches/bills_201312/ippTools/share/fftool_revertsummary.sql )
-
ippTools/share/fftool_summary.sql (copied) (copied from branches/bills_branches/bills_201312/ippTools/share/fftool_summary.sql )
-
ippTools/share/fftool_summaryinputs.sql (copied) (copied from branches/bills_branches/bills_201312/ippTools/share/fftool_summaryinputs.sql )
-
ippTools/share/fftool_toadvance.sql (copied) (copied from branches/bills_branches/bills_201312/ippTools/share/fftool_toadvance.sql )
-
ippTools/share/fftool_todo.sql (copied) (copied from branches/bills_branches/bills_201312/ippTools/share/fftool_todo.sql )
-
ippTools/share/pxadmin_create_tables.sql (modified) (1 diff, 1 prop)
-
ippTools/share/pxadmin_drop_tables.sql (modified) (1 diff)
-
ippTools/share/warptool_towarped.sql (modified) (1 prop)
-
ippTools/src (modified) (2 props)
-
ippTools/src/Makefile.am (modified) (3 diffs)
-
ippTools/src/camtool.c (modified) (1 prop)
-
ippTools/src/camtoolConfig.c (modified) (1 prop)
-
ippTools/src/fftool.c (copied) (copied from branches/bills_branches/bills_201312/ippTools/src/fftool.c )
-
ippTools/src/fftool.h (copied) (copied from branches/bills_branches/bills_201312/ippTools/src/fftool.h )
-
ippTools/src/fftoolConfig.c (copied) (copied from branches/bills_branches/bills_201312/ippTools/src/fftoolConfig.c )
-
ippTools/src/magictool.c (modified) (1 prop)
-
ippconfig (modified) (1 prop)
-
ippconfig/gpc1 (modified) (1 prop)
-
ippconfig/recipes/filerules-split.mdc (modified) (1 diff)
-
ippconfig/recipes/ppSub.config (modified) (1 prop)
-
ippconfig/recipes/psastro.config (modified) (2 diffs)
-
ippconfig/recipes/psphot.config (modified) (6 diffs)
-
ippconfig/recipes/reductionClasses.mdc (modified) (1 prop)
-
ppImage/src (modified) (1 prop)
-
ppSub/src/ppSubMatchPSFs.c (modified) (1 diff)
-
psLib/src/math/psMixtureModels.c (modified) (1 prop)
-
psModules (modified) (1 prop)
-
psModules/src/camera/pmFPAfile.c (modified) (1 diff)
-
psModules/src/objects/pmModelClass.c (modified) (3 diffs)
-
psModules/src/objects/pmModelClass.h (modified) (1 diff)
-
psModules/src/objects/pmSourceIO.c (modified) (7 diffs)
-
psModules/src/objects/pmSourceIO.h (modified) (1 diff)
-
psModules/src/objects/pmSourceIO_CFF.c (modified) (8 diffs)
-
psModules/src/objects/pmSourceIO_CMF.c.in (modified) (9 diffs)
-
psModules/src/objects/pmSourceIO_PS1_CAL_0.c (modified) (1 diff)
-
psModules/src/objects/pmSourceIO_PS1_DEV_0.c (modified) (1 diff)
-
psModules/src/objects/pmSourceIO_PS1_DEV_1.c (modified) (1 diff)
-
psModules/src/objects/pmSourceIO_SMPDATA.c (modified) (1 diff)
-
psastro/src/psastroDataSave.c (modified) (2 diffs)
-
psastro/src/psastroDefineFiles.c (modified) (1 diff)
-
psconfig (modified) (1 prop)
-
psphot (modified) (1 prop)
-
psphot/src (modified) (2 props)
-
psphot/src/Makefile.am (modified) (3 diffs)
-
psphot/src/psmakecff.c (modified) (8 diffs)
-
psphot/src/psphot.h (modified) (1 diff)
-
psphot/src/psphotChooseAnalysisOptions.c (modified) (19 diffs)
-
psphot/src/psphotFullForceSummary.c (copied) (copied from branches/bills_branches/bills_201312/psphot/src/psphotFullForceSummary.c )
-
psphot/src/psphotFullForceSummaryReadout.c (copied) (copied from branches/bills_branches/bills_201312/psphot/src/psphotFullForceSummaryReadout.c )
-
psphot/src/psphotGalaxyShape.c (modified) (3 diffs)
-
psphot/src/psphotStackImageLoop.c (modified) (1 prop)
-
pstamp/scripts (modified) (1 prop)
-
psvideophot (modified) (1 prop)
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/bills_branches/bills_201312 (added) merged: 36383,36386,36388-36396,36406-36407,36409-36412,36415-36420,36422-36427,36433,36436-36439
- Property svn:mergeinfo changed
-
trunk/Nebulous
- Property svn:mergeinfo changed (with no actual effect on merging)
-
trunk/Nebulous-Server
- Property svn:mergeinfo changed (with no actual effect on merging)
-
trunk/Ohana
- Property svn:mergeinfo changed
/branches/bills_branches/bills_201312/Ohana (added) merged: 36439
- Property svn:mergeinfo changed
-
trunk/Ohana/src/dvomerge
- Property svn:mergeinfo changed (with no actual effect on merging)
-
trunk/Ohana/src/libohana/src
- Property svn:mergeinfo changed
/branches/bills_branches/bills_201312/Ohana/src/libohana/src (added) merged: 36439
- Property svn:mergeinfo changed
-
trunk/Ohana/src/opihi
- Property svn:mergeinfo changed (with no actual effect on merging)
-
trunk/Ohana/src/opihi/cmd.astro
- Property svn:mergeinfo changed (with no actual effect on merging)
-
trunk/Ohana/src/opihi/cmd.data
- Property svn:mergeinfo changed (with no actual effect on merging)
-
trunk/Ohana/src/relastro/src
- Property svn:mergeinfo changed (with no actual effect on merging)
-
trunk/dbconfig/cam.md
- Property svn:mergeinfo changed (with no actual effect on merging)
-
trunk/dbconfig/changes.txt
- Property svn:mergeinfo changed
/branches/bills_branches/bills_201312/dbconfig/changes.txt (added) merged: 36396,36417
r36374 r36441 2432 2432 UPDATE dbversion set schema_version = '1.1.77', updated= CURRENT_TIMESTAMP(); 2433 2433 2434 -- 2435 2436 CREATE TABLE fullForceRun ( 2437 ff_id BIGINT NOT NULL AUTO_INCREMENT, 2438 skycal_id BIGINT, 2439 sources_path_base VARCHAR(255), 2440 state VARCHAR(64), 2441 workdir VARCHAR(255), 2442 label VARCHAR(64), 2443 data_group VARCHAR(64), 2444 dist_group VARCHAR(64), 2445 note VARCHAR(255), 2446 reduction VARCHAR(64), 2447 registered TIMESTAMP DEFAULT CURRENT_TIMESTAMP, -- time run was registered 2448 PRIMARY KEY(ff_id), 2449 KEY(state), 2450 KEY(label), 2451 KEY(data_group), 2452 KEY(skycal_id), 2453 FOREIGN KEY(skycal_id) REFERENCES skycalRun(skycal_id) 2454 ) ENGINE=innodb DEFAULT CHARSET=latin1; 2455 2456 CREATE TABLE fullForceInput ( 2457 ff_id BIGINT, 2458 warp_id BIGINT, 2459 PRIMARY KEY(ff_id, warp_id), 2460 FOREIGN KEY(ff_id) REFERENCES fullForceRun(ff_id), 2461 FOREIGN KEY(warp_id) REFERENCES warpRun(warp_id) 2462 ) ENGINE=innodb DEFAULT CHARSET=latin1; 2463 2464 CREATE TABLE fullForceResult ( 2465 ff_id BIGINT, 2466 warp_id BIGINT, 2467 path_base VARCHAR(255) NOT NULL, 2468 dtime_script FLOAT, 2469 quality SMALLINT NOT NULL, 2470 hostname VARCHAR(64) NOT NULL, 2471 software_ver VARCHAR(16), 2472 fault SMALLINT NOT NULL, 2473 PRIMARY KEY(ff_id, warp_id), 2474 KEY(fault), 2475 KEY(quality), 2476 FOREIGN KEY(ff_id) REFERENCES fullForceRun(ff_id), 2477 FOREIGN KEY(warp_id) REFERENCES warpRun(warp_id) 2478 ) ENGINE=innodb DEFAULT CHARSET=latin1; 2479 2480 CREATE TABLE fullForceSummary ( 2481 ff_id BIGINT, 2482 path_base VARCHAR(255) NOT NULL, 2483 dtime_script FLOAT, 2484 quality SMALLINT NOT NULL, 2485 hostname VARCHAR(64) NOT NULL, 2486 software_ver VARCHAR(16), 2487 fault SMALLINT NOT NULL, 2488 PRIMARY KEY(ff_id), 2489 KEY(fault), 2490 KEY(quality), 2491 FOREIGN KEY(ff_id) REFERENCES fullForceRun(ff_id) 2492 ) ENGINE=innodb DEFAULT CHARSET=latin1; 2493 2494 UPDATE dbversion set schema_version = '1.1.78', updated= CURRENT_TIMESTAMP(); 2495 - Property svn:mergeinfo changed
-
trunk/dbconfig/ipp.m4
r34911 r36441 40 40 include(skycell.md) 41 41 include(release.md) 42 include(ff.md) -
trunk/ippMonitor
- Property svn:mergeinfo changed (with no actual effect on merging)
-
trunk/ippScripts/Build.PL
r36374 r36441 133 133 scripts/queuestaticsky.pl 134 134 scripts/psphot_fullforce_warp.pl 135 scripts/psphot_fullforce_summary.pl 135 136 )], 136 137 dist_abstract => 'Scripts for running the Pan-STARRS IPP', -
trunk/ippScripts/scripts/chip_imfile.pl
- Property svn:mergeinfo changed (with no actual effect on merging)
-
trunk/ippScripts/scripts/destreak_restore_camera.pl
- Property svn:mergeinfo changed (with no actual effect on merging)
-
trunk/ippScripts/scripts/ipp_apply_burntool_single.pl
- Property svn:mergeinfo changed
/branches/bills_branches/bills_201312/ippScripts/scripts/ipp_apply_burntool_single.pl (added) merged: 36437
- Property svn:mergeinfo changed
-
trunk/ippScripts/scripts/lap_science.pl
- Property svn:mergeinfo changed (with no actual effect on merging)
-
trunk/ippScripts/scripts/magic_destreak.pl
- Property svn:mergeinfo changed (with no actual effect on merging)
-
trunk/ippScripts/scripts/psphot_fullforce_warp.pl
r36374 r36441 31 31 my $psphotFullForce = can_run('psphotFullForce') or (warn "Can't find psphotFullForce" and $missing_tools = 1); 32 32 my $ppStatsFromMetadata = can_run('ppStatsFromMetadata') or (warn "Can't find ppStatsFromMetadata" and $missing_tools = 1); 33 # XXX: fftool is yet to be written 34 my $fftool = "fftool"; # can_run('fftool') or (warn "Can't find fftool" and $missing_tools = 1); 33 my $fftool = can_run('fftool') or (warn "Can't find fftool" and $missing_tools = 1); 35 34 if ($missing_tools) { 36 35 warn("Can't find required tools."); … … 38 37 } 39 38 40 my ($ff w_id, $warp_id, $skycell_id, $path_base, $sourceroot, $camera);39 my ($ff_id, $warp_id, $skycell_id, $path_base, $sourceroot, $camera); 41 40 my ($outroot, $reduction); 42 41 my ($dbname, $threads, $verbose, $no_update, $no_op, $redirect); 43 42 44 43 GetOptions( 45 'ff w_id=s' => \$ffw_id,44 'ff_id=s' => \$ff_id, 46 45 'warp_id=s' => \$warp_id, # warp identifier 47 46 'skycell_id=s' => \$skycell_id,# Skycell identifier 48 47 'warp_path_base=s' => \$path_base, # path_base of the warp skycell 49 'source root=s'=> \$sourceroot,# path_base of sources48 'sources_path_base=s' => \$sourceroot,# path_base of sources 50 49 'camera=s' => \$camera, # camera name of sources 51 50 'dbname|d=s' => \$dbname, # Database name … … 61 60 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 62 61 pod2usage( 63 -msg => "Required options: --ff w_id --sourceroot --skycell_id --warp_path_base --outroot --camera",62 -msg => "Required options: --ff_id --warp_id --sourceroot --skycell_id --warp_path_base --outroot --camera", 64 63 -exitval => 3, 65 ) unless defined $ff w_id,64 ) unless defined $ff_id, 66 65 and defined $sourceroot 67 and (defined $path_base or defined $warp_id) # if we don't have warp's path_base we need warp_id 66 and defined $path_base 67 and defined $warp_id 68 68 and defined $skycell_id 69 69 and defined $camera 70 70 and defined $outroot; 71 71 72 # XXX: fftool is not ready to run commands that update the database 73 $no_update = 1; 74 75 my $ipprc = PS::IPP::Config->new($camera) or my_die( "Unable to set up", $ffw_id, $skycell_id, $PS_EXIT_CONFIG_ERROR ); 72 my $ipprc = PS::IPP::Config->new($camera) or my_die( "Unable to set up", $ff_id, $warp_id, $skycell_id, $PS_EXIT_CONFIG_ERROR ); 76 73 77 74 my $neb; … … 84 81 85 82 $ipprc->redirect_to_logfile($logDest) or my_die( "Unable to redirect output", 86 $ffw_id, $skycell_id, $PS_EXIT_SYS_ERROR ) if $redirect; 87 88 if (!$path_base) { 83 $ff_id, $warp_id, $skycell_id, $PS_EXIT_SYS_ERROR ) if $redirect; 84 85 if (0) { 86 # if (!$path_base) { 89 87 # If path_base is not supplied, look it up in the database. 90 88 my $mdcParser = PS::IPP::Metadata::Config->new; # Parser for metadata config files … … 98 96 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 99 97 &my_die("Unable to perform warptool -warpskyfile -inputskyfile: $error_code", 100 $ff w_id, $skycell_id, $error_code);98 $ff_id, $warp_id, $skycell_id, $error_code); 101 99 } 102 100 103 101 my $metadata = $mdcParser->parse(join "", @$stdout_buf) or 104 &my_die("Unable to parse metadata config doc", $ff w_id, $skycell_id, $PS_EXIT_PROG_ERROR);102 &my_die("Unable to parse metadata config doc", $ff_id, $warp_id, $skycell_id, $PS_EXIT_PROG_ERROR); 105 103 $files = parse_md_list($metadata) or 106 &my_die("Unable to parse metadata list", $ff w_id, $skycell_id, $PS_EXIT_PROG_ERROR);107 } 108 109 &my_die("Input list does not contain exactly one elements", $ff w_id, $skycell_id, $PS_EXIT_SYS_ERROR)104 &my_die("Unable to parse metadata list", $ff_id, $warp_id, $skycell_id, $PS_EXIT_PROG_ERROR); 105 } 106 107 &my_die("Input list does not contain exactly one elements", $ff_id, $warp_id, $skycell_id, $PS_EXIT_SYS_ERROR) 110 108 unless scalar @$files == 1; 111 109 … … 113 111 114 112 $path_base = $warp->{path_base}; 115 &my_die("Couldn't find input path in warptool output", $ff w_id, $skycell_id, $PS_EXIT_UNKNOWN_ERROR)113 &my_die("Couldn't find input path in warptool output", $ff_id, $warp_id, $skycell_id, $PS_EXIT_UNKNOWN_ERROR) 116 114 unless defined $path_base; 117 115 … … 123 121 unless ($recipe_psphot) { 124 122 &my_die("Couldn't find selected reduction for PSPHOT: $reduction\n", 125 $ff w_id, $skycell_id, $PS_EXIT_CONFIG_ERROR);123 $ff_id, $warp_id, $skycell_id, $PS_EXIT_CONFIG_ERROR); 126 124 } 127 125 … … 134 132 print "recipe_psphot: $recipe_psphot\n"; 135 133 134 # use psf measured on input warp 135 # XXX: get this from recipe 136 my $useWarpPSF = 0; 137 136 138 my $input = $ipprc->filename('PSWARP.OUTPUT', $path_base); 137 139 my $inputMask = $ipprc->filename('PSWARP.OUTPUT.MASK', $path_base); 138 140 my $inputVariance = $ipprc->filename('PSWARP.OUTPUT.VARIANCE', $path_base); 139 my $inputPSF = $ ipprc->filename('PSPHOT.PSF.SKY.SAVE', $path_base);141 my $inputPSF = $useWarpPSF ? $ipprc->filename('PSPHOT.PSF.SKY.SAVE', $path_base) : ""; 140 142 my $inputSources = $ipprc->filename('PSPHOT.OUTPUT.CFF', $sourceroot); 141 143 … … 144 146 print "inputMask: $inputMask\n"; 145 147 print "inputVariance: $inputVariance\n"; 146 # print "inputPath: $path_base\n"; 147 print "inputPSF: $inputPSF\n"; 148 print "inputPSF: $inputPSF\n" if $inputPSF; 148 149 print "inputSources: $inputSources\n"; 149 150 } 150 151 151 152 # check that the inputs exist (and have non-zero size) 152 &my_die("Couldn't find input: $input", $ff w_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($input);153 &my_die("Couldn't find input: $inputMask", $ff w_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($inputMask);154 &my_die("Couldn't find input: $inputVariance", $ff w_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($inputVariance);155 &my_die("Couldn't find input: $inputPSF", $ff w_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($inputPSF);156 &my_die("Couldn't find input: $inputSources", $ff w_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($inputSources);153 &my_die("Couldn't find input: $input", $ff_id, $warp_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($input); 154 &my_die("Couldn't find input: $inputMask", $ff_id, $warp_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($inputMask); 155 &my_die("Couldn't find input: $inputVariance", $ff_id, $warp_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($inputVariance); 156 &my_die("Couldn't find input: $inputPSF", $ff_id, $warp_id, $skycell_id, $PS_EXIT_SYS_ERROR) if ($inputPSF && !$ipprc->file_exists($inputPSF)); 157 &my_die("Couldn't find input: $inputSources", $ff_id, $warp_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($inputSources); 157 158 158 159 my $dump_config = 1; … … 193 194 unless ($success) { 194 195 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 195 &my_die("Unable to perform ppSub: $error_code", $ff w_id, $skycell_id, $error_code);196 &my_die("Unable to perform ppSub: $error_code", $ff_id, $warp_id, $skycell_id, $error_code); 196 197 } 197 198 … … 207 208 unless ($success) { 208 209 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 209 &my_die("Unable to perform ppStatsFromMetadata: $error_code", $ff w_id, $skycell_id, $error_code);210 &my_die("Unable to perform ppStatsFromMetadata: $error_code", $ff_id, $warp_id, $skycell_id, $error_code); 210 211 } 211 212 foreach my $line (@$stdout_buf) { … … 226 227 # Add the result to the database 227 228 { 228 my $command = "$fftool -ff w_id $ffw_id -skycell_id $skycell_id";229 $command .= " -add warped-path_base $outroot";229 my $command = "$fftool -ff_id $ff_id -warp_id $warp_id"; 230 $command .= " -addresult -path_base $outroot"; 230 231 $command .= " $cmdflags"; 231 232 $command .= (" -dtime_script " . ((DateTime->now->mjd - $mjd_start) * 86400)); … … 239 240 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 240 241 my $err_message = "Unable to perform fftool -addwarped" ; 241 &my_die("$err_message: $error_code", $ff w_id, $skycell_id, $error_code);242 &my_die("$err_message: $error_code", $ff_id, $warp_id, $skycell_id, $error_code); 242 243 } 243 244 } else { … … 262 263 my $error; 263 264 my $output = $ipprc->prepare_output($filerule, $outroot, undef, $delete, \$error) 264 or &my_die("failed to prepare output file for: $filerule", $ff w_id, $skycell_id, $error);265 or &my_die("failed to prepare output file for: $filerule", $ff_id, $warp_id, $skycell_id, $error); 265 266 return $output; 266 267 } … … 275 276 } 276 277 277 &my_die("Couldn't find expected output file: $file", $ff w_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($file);278 &my_die("Couldn't find expected output file: $file", $ff_id, $warp_id, $skycell_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists($file); 278 279 279 280 # Funpack to confirm we've really made things correctly 280 281 my $diskfile = $ipprc->file_resolve($file); 281 282 if ($diskfile =~ /fits/) { 282 my $funpack = can_run('funpack') or &my_die ("Can't find funpack", $ff w_id, $skycell_id, $PS_EXIT_SYS_ERROR);283 my $funpack = can_run('funpack') or &my_die ("Can't find funpack", $ff_id, $warp_id, $skycell_id, $PS_EXIT_SYS_ERROR); 283 284 my $check_command = "$funpack -S $diskfile > /dev/null"; 284 285 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 285 286 run(command => $check_command, verbose => $verbose); 286 287 if (!$success) { 287 &my_die("Output file not a valid fits file: $file", $ff w_id, $skycell_id, $PS_EXIT_SYS_ERROR);288 &my_die("Output file not a valid fits file: $file", $ff_id, $warp_id, $skycell_id, $PS_EXIT_SYS_ERROR); 288 289 } 289 290 } … … 291 292 292 293 if ($replicate and $neb) { 293 $ipprc->replicate_file($file) or &my_die("failed to replicate: $file\n", $ff w_id, $skycell_id, $PS_EXIT_SYS_ERROR);294 $ipprc->replicate_file($file) or &my_die("failed to replicate: $file\n", $ff_id, $warp_id, $skycell_id, $PS_EXIT_SYS_ERROR); 294 295 } 295 296 } … … 299 300 { 300 301 my $msg = shift; # Warning message on die 301 my $ffw_id = shift; # full force warp identifier 302 my $ff_id = shift; # full force run identifier 303 my $warp_id = shift; # full force warp id 302 304 my $skycell_id = shift; # Skycell identifier 303 305 my $exit_code = shift; # Exit code to add … … 306 308 307 309 warn($msg); 308 if (defined $ff w_id and defined $skycell_id) {309 my $command = "$fftool -ff w_id $ffw_id -skycell_id $skycell_id -fault $exit_code";310 $command .= " -add ffskyfile";310 if (defined $ff_id and defined $skycell_id) { 311 my $command = "$fftool -ff_id $ff_id -warp_id $warp_id -fault $exit_code"; 312 $command .= " -addresult"; 311 313 $command .= (" -dtime_script " . ((DateTime->now->mjd - $mjd_start) * 86400)); 312 314 $command .= " -hostname $host" if defined $host; -
trunk/ippScripts/scripts/publish_file.pl
- Property svn:mergeinfo changed
/branches/bills_branches/bills_201312/ippScripts/scripts/publish_file.pl (added) merged: 36437 /trunk/ippScripts/scripts/publish_file.pl merged: 2-24510
- Property svn:mergeinfo changed
-
trunk/ippScripts/scripts/staticsky.pl
r34852 r36441 138 138 my $configuration = $ipprc->filename("PSPHOT.STACK.CONFIG", $outroot); 139 139 140 my $needConvolvedImages = 0; 141 140 142 foreach my $file (@$files) { 141 143 print $listFile "INPUT METADATA\n"; … … 146 148 my $stack_id = $file->{stack_id}; 147 149 148 my $imageCnv = $ipprc->filename("PPSTACK.OUTPUT", $path_base ); # Image name 149 my $maskCnv = $ipprc->filename("PPSTACK.OUTPUT.MASK", $path_base ); # Mask name 150 my $weightCnv = $ipprc->filename("PPSTACK.OUTPUT.VARIANCE", $path_base ); # Weight name 151 my $expnumCnv = $ipprc->filename("PPSTACK.OUTPUT.EXPNUM", $path_base ); # Expnum name 150 my ($imageCnv, $maskCnv, $weightCnv, $expnumCnv); 151 if ($needConvolvedImages) { 152 $imageCnv = $ipprc->filename("PPSTACK.OUTPUT", $path_base ); # Image name 153 $maskCnv = $ipprc->filename("PPSTACK.OUTPUT.MASK", $path_base ); # Mask name 154 $weightCnv = $ipprc->filename("PPSTACK.OUTPUT.VARIANCE", $path_base ); # Weight name 155 $expnumCnv = $ipprc->filename("PPSTACK.OUTPUT.EXPNUM", $path_base ); # Expnum name 156 } 152 157 153 158 my $imageRaw = $ipprc->filename("PPSTACK.UNCONV", $path_base ); # Image name … … 166 171 &my_die("Couldn't find input: $weightRaw", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists("$weightRaw"); 167 172 &my_die("Couldn't find input: $expnumRaw", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists("$expnumRaw"); 168 &my_die("Couldn't find input: $imageCnv", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists("$imageCnv"); 169 &my_die("Couldn't find input: $maskCnv", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists("$maskCnv"); 170 &my_die("Couldn't find input: $weightCnv", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists("$weightCnv"); 171 &my_die("Couldn't find input: $expnumCnv", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists("$expnumCnv"); 172 &my_die("Couldn't find input: $psfCnv", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists("$psfCnv"); 173 if ($needConvolvedImages) { 174 &my_die("Couldn't find input: $imageCnv", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists("$imageCnv"); 175 &my_die("Couldn't find input: $maskCnv", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists("$maskCnv"); 176 &my_die("Couldn't find input: $weightCnv", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists("$weightCnv"); 177 &my_die("Couldn't find input: $expnumCnv", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists("$expnumCnv"); 178 &my_die("Couldn't find input: $psfCnv", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists("$psfCnv"); 179 } 173 180 &my_die("Couldn't find input: $sources", $sky_id, $PS_EXIT_SYS_ERROR) unless $ipprc->file_exists("$sources"); 174 181 … … 178 185 print $listFile " RAW:VARIANCE STR " . $weightRaw . "\n"; 179 186 print $listFile " RAW:EXPNUM STR " . $expnumRaw . "\n"; 180 181 print $listFile " CNV:IMAGE STR " . $imageCnv . "\n";182 print $listFile " CNV:MASK STR " . $maskCnv . "\n";183 print $listFile " CNV:VARIANCE STR " . $weightCnv . "\n";184 print $listFile " CNV:EXPNUM STR " . $expnumCnv . "\n";185 print $listFile " CNV:PSF STR " . $psfCnv . "\n";186 187 187 print $listFile " SOURCES STR " . $sources . "\n"; 188 if ($needConvolvedImages) { 189 print $listFile " CNV:IMAGE STR " . $imageCnv . "\n"; 190 print $listFile " CNV:MASK STR " . $maskCnv . "\n"; 191 print $listFile " CNV:VARIANCE STR " . $weightCnv . "\n"; 192 print $listFile " CNV:EXPNUM STR " . $expnumCnv . "\n"; 193 print $listFile " CNV:PSF STR " . $psfCnv . "\n"; 194 } 188 195 189 196 print $listFile "END\n\n"; -
trunk/ippScripts/scripts/warp_skycell.pl
- Property svn:mergeinfo changed (with no actual effect on merging)
-
trunk/ippTasks
- Property svn:mergeinfo changed
/branches/bills_branches/bills_201312/ippTasks (added) merged: 36388,36417-36418,36437
- Property svn:mergeinfo changed
-
trunk/ippTasks/Makefile.am
r36372 r36441 47 47 lap.pro \ 48 48 vp.pro \ 49 bg.regeneration.pro 49 bg.regeneration.pro \ 50 fullforce.pro 50 51 51 52 other_files = \ -
trunk/ippToPsps
- Property svn:mergeinfo changed (with no actual effect on merging)
-
trunk/ippTools/share
- Property svn:mergeinfo changed
/branches/bills_branches/bills_201312/ippTools/share (added) merged: 36386,36390,36409,36411,36415-36417,36437
- Property svn:mergeinfo changed
-
trunk/ippTools/share/Makefile.am
r36361 r36441 488 488 releasetool_definerelgroup_select_exp_lap.sql \ 489 489 releasetool_stacksummary.sql \ 490 releasetool_pendingrelgroup.sql 490 releasetool_pendingrelgroup.sql \ 491 fftool_definebyquery.sql \ 492 fftool_definebyquery_select_warps.sql \ 493 fftool_result.sql \ 494 fftool_revert.sql \ 495 fftool_revertsummary.sql \ 496 fftool_summary.sql \ 497 fftool_todo.sql \ 498 fftool_toadvance.sql 491 499 -
trunk/ippTools/share/camtool_find_pendingimfile.sql
- Property svn:mergeinfo changed (with no actual effect on merging)
-
trunk/ippTools/share/chiptool_setimfiletoupdate.sql
- Property svn:mergeinfo changed (with no actual effect on merging)
-
trunk/ippTools/share/pxadmin_create_tables.sql
- Property svn:mergeinfo changed
/branches/bills_branches/bills_201312/ippTools/share/pxadmin_create_tables.sql (added) merged: 36386,36409,36415
r36374 r36441 2307 2307 ) ENGINE=InnoDB DEFAULT CHARSET=latin1; 2308 2308 2309 CREATE TABLE fullForceRun ( 2310 ff_id BIGINT NOT NULL AUTO_INCREMENT, 2311 skycal_id BIGINT, 2312 sources_path_base VARCHAR(255), 2313 state VARCHAR(64), 2314 workdir VARCHAR(255), 2315 label VARCHAR(64), 2316 data_group VARCHAR(64), 2317 dist_group VARCHAR(64), 2318 note VARCHAR(255), 2319 reduction VARCHAR(64), 2320 registered TIMESTAMP DEFAULT CURRENT_TIMESTAMP, -- time run was registered 2321 PRIMARY KEY(ff_id), 2322 KEY(state), 2323 KEY(label), 2324 KEY(data_group), 2325 KEY(skycal_id), 2326 FOREIGN KEY(skycal_id) REFERENCES skycalRun(skycal_id) 2327 ) ENGINE=innodb DEFAULT CHARSET=latin1; 2328 2329 CREATE TABLE fullForceInput ( 2330 ff_id BIGINT, 2331 warp_id BIGINT, 2332 PRIMARY KEY(ff_id, warp_id), 2333 FOREIGN KEY(ff_id) REFERENCES fullForceRun(ff_id), 2334 FOREIGN KEY(warp_id) REFERENCES warpRun(warp_id) 2335 ) ENGINE=innodb DEFAULT CHARSET=latin1; 2336 2337 CREATE TABLE fullForceResult ( 2338 ff_id BIGINT, 2339 warp_id BIGINT, 2340 path_base VARCHAR(255) NOT NULL, 2341 dtime_script FLOAT, 2342 quality SMALLINT NOT NULL, 2343 hostname VARCHAR(64) NOT NULL, 2344 software_ver VARCHAR(16), 2345 fault SMALLINT NOT NULL, 2346 PRIMARY KEY(ff_id, warp_id), 2347 KEY(fault), 2348 KEY(quality), 2349 FOREIGN KEY(ff_id) REFERENCES fullForceRun(ff_id), 2350 FOREIGN KEY(warp_id) REFERENCES warpRun(warp_id) 2351 ) ENGINE=innodb DEFAULT CHARSET=latin1; 2352 2353 CREATE TABLE fullForceSummary ( 2354 ff_id BIGINT, 2355 path_base VARCHAR(255) NOT NULL, 2356 dtime_script FLOAT, 2357 quality SMALLINT NOT NULL, 2358 hostname VARCHAR(64) NOT NULL, 2359 software_ver VARCHAR(16), 2360 fault SMALLINT NOT NULL, 2361 PRIMARY KEY(ff_id), 2362 KEY(fault), 2363 KEY(quality), 2364 FOREIGN KEY(ff_id) REFERENCES fullForceRun(ff_id) 2365 ) ENGINE=innodb DEFAULT CHARSET=latin1; 2366 2309 2367 2310 2368 -- These comment lines are here to avoid an empty query error. - Property svn:mergeinfo changed
-
trunk/ippTools/share/pxadmin_drop_tables.sql
r35896 r36441 120 120 DROP TABLE IF EXISTS dqstatsContent; 121 121 DROP TABLE IF EXISTS dqstatsRun; 122 DROP TABLE IF EXISTS fullForceRun; 123 DROP TABLE IF EXISTS fullForceInput; 124 DROP TABLE IF EXISTS fullForceResult; 125 DROP TABLE IF EXISTS fullForceSummary; 126 122 127 123 128 SET FOREIGN_KEY_CHECKS=1 -
trunk/ippTools/share/warptool_towarped.sql
- Property svn:mergeinfo changed (with no actual effect on merging)
-
trunk/ippTools/src
- Property svn:ignore
-
old new 47 47 sctool 48 48 releasetool 49 fftool
-
- Property svn:mergeinfo changed
/branches/bills_branches/bills_201312/ippTools/src (added) merged: 36386,36392,36395,36409,36411,36417,36437
- Property svn:ignore
-
trunk/ippTools/src/Makefile.am
r34913 r36441 33 33 vptool \ 34 34 sctool \ 35 releasetool 35 releasetool \ 36 fftool 36 37 37 38 pkginclude_HEADERS = \ … … 87 88 vptool.h \ 88 89 sctool.h \ 89 releasetool.h 90 releasetool.h \ 91 fftool.h 90 92 91 93 lib_LTLIBRARIES = libpxtools.la … … 332 334 releasetoolConfig.c 333 335 336 fftool_CFLAGS = $(PSLIB_CFLAGS) $(PSMODULES_CFLAGS) $(IPPDB_CFLAGS) 337 fftool_LDADD = $(PSLIB_LIBS) $(PSMODULES_LIBS) $(IPPDB_LIBS) libpxtools.la 338 fftool_SOURCES = \ 339 fftool.c \ 340 fftoolConfig.c 341 334 342 clean-local: 335 343 -rm -f TAGS -
trunk/ippTools/src/camtool.c
- Property svn:mergeinfo changed (with no actual effect on merging)
-
trunk/ippTools/src/camtoolConfig.c
- Property svn:mergeinfo changed (with no actual effect on merging)
-
trunk/ippTools/src/magictool.c
- Property svn:mergeinfo changed (with no actual effect on merging)
-
trunk/ippconfig
- Property svn:mergeinfo changed
/branches/bills_branches/bills_201312/ippconfig (added) merged: 36393,36420,36425-36426,36437-36438
- Property svn:mergeinfo changed
-
trunk/ippconfig/gpc1
- Property svn:mergeinfo changed
/branches/bills_branches/bills_201312/ippconfig/gpc1 (added) merged: 36437
- Property svn:mergeinfo changed
-
trunk/ippconfig/recipes/filerules-split.mdc
r36375 r36441 262 262 PSPHOT.STACK.RESID OUTPUT {OUTPUT}.stk.{FILE.ID}.res.fits IMAGE COMP_SUB FPA TRUE NONE 263 263 PSPHOT.STACK.CONFIG OUTPUT {OUTPUT}.psphotStack.mdc TEXT NONE FPA TRUE NONE 264 265 PSPHOT.FULLFORCE.OUTPUT OUTPUT {OUTPUT}.cmf CMF NONE FPA TRUE NONE 264 266 265 267 SOURCE.PLOT.RAW.MOMENTS OUTPUT {OUTPUT}.{CHIP.NAME}.mnt.png KAPA NONE CHIP TRUE NONE -
trunk/ippconfig/recipes/ppSub.config
- Property svn:mergeinfo changed
/branches/bills_branches/bills_201312/ippconfig/recipes/ppSub.config (added) merged: 36437
- Property svn:mergeinfo changed
-
trunk/ippconfig/recipes/psastro.config
r36403 r36441 3 3 PSASTRO.ONLY.REFSTARS BOOL FALSE # skip all but refstar matches 4 4 PSASTRO.SAVE.REFMATCH BOOL FALSE # save refstar matches as table in output smf file 5 PSASTRO.SAVE.CFF BOOL FALSE # save a cff file (input for psphotFullForce) 5 6 6 7 # select which WCS style to use on output images. … … 279 280 280 281 STATICSKY_CAL METADATA 282 PSASTRO.SAVE.CFF BOOL TRUE # save a cff file (input for psphotFullForce) 281 283 END 282 284 -
trunk/ippconfig/recipes/psphot.config
r36375 r36441 196 196 EXT.NSIGMA.LIMIT.USE BOOL TRUE 197 197 198 EXT.FIT.MIN.GAL.LIMIT F32 10.0 199 EXT.FIT.MIN.GAL.LIMIT.USE BOOL FALSE 198 # Limits on extended source fits by galactic coordinates 199 EXT.FIT.MIN.GAL.LIMIT.USE BOOL FALSE # if true apply the galactic latitude cut 200 # objects are skipped for extended source fits if they have a abs(galactic latitude) larger than 201 # a limit value which is a function of galactic longitude. 202 # The galactic latitude limit is the sum of the following constant value ... 203 EXT.FIT.MIN.GAL.LIMIT F32 20.0 204 # ... and a gaussian function of galactic longitude centered at b = 0 with this magnitude 205 EXT.FIT.MIN.GAL.LIMIT.BULGE F32 15.0 206 # ... and this sigma 207 EXT.FIT.MIN.GAL.LIMIT.BULGE.SIGMA F32 50.0 # with this sigma value 208 200 209 201 210 KRON_ITERATIONS S32 2 … … 407 416 408 417 EXT.ANALYSIS.MAG.LIMITS METADATA 409 TYPE DATA FILTER.ID MAG.LIMIT 410 gband DATA g NAN411 rband DATA r NAN412 iband DATA i NAN413 zband DATA z NAN414 yband DATA y NAN415 wband DATA w NAN416 other DATA any NAN418 TYPE DATA FILTER.ID MAG.LIMIT.PETRO MAG.LIMIT.EXTFIT 419 gband DATA g 25 22 420 rband DATA r 25 22 421 iband DATA i 25 22 422 zband DATA z 25 21 423 yband DATA y 25 20 424 wband DATA w 25 22 425 other DATA any 25 22 417 426 END 418 427 … … 423 432 RADIAL_APERTURES_SN_LIM F32 0.0 # S/N limit for radial aperture calculation 424 433 434 # zero point and exposure time to which fullForceSummary scales fluxes to 435 PSPHOT.FULLFORCE.EXPTIME F32 1.00 436 PSPHOT.FULLFORCE.ZERO_PT F32 25.00 437 438 425 439 GALAXY_SHAPES BOOL F 440 GALAXY_SHAPES_STYLE STR R_MAJ_R_MIN 441 426 442 GALAXY_SHAPES_FR_MAJOR_MIN F32 0.5 427 GALAXY_SHAPES_FR_MAJOR_MAX F32 2.0 428 GALAXY_SHAPES_FR_MAJOR_DEL F32 0. 1443 GALAXY_SHAPES_FR_MAJOR_MAX F32 2.00 444 GALAXY_SHAPES_FR_MAJOR_DEL F32 0.05 429 445 GALAXY_SHAPES_FR_MINOR_MIN F32 0.5 430 GALAXY_SHAPES_FR_MINOR_MAX F32 2.0 431 GALAXY_SHAPES_FR_MINOR_DEL F32 0.1 432 446 GALAXY_SHAPES_FR_MINOR_MAX F32 2.00 447 GALAXY_SHAPES_FR_MINOR_DEL F32 0.05 448 449 #GALAXY_SHAPES_FR_MAJOR_MIN F32 0.85 450 #GALAXY_SHAPES_FR_MAJOR_MAX F32 1.15 451 #GALAXY_SHAPES_FR_MAJOR_DEL F32 0.05 452 #GALAXY_SHAPES_FR_MINOR_MIN F32 0.85 453 #GALAXY_SHAPES_FR_MINOR_MAX F32 1.15 454 #GALAXY_SHAPES_FR_MINOR_DEL F32 0.05 433 455 434 456 # Extended source fit parameters … … 439 461 EXTENDED_SOURCE_ANNULI BOOL TRUE 440 462 EXT.NSIGMA.LIMIT.USE BOOL FALSE 463 EXT.FIT.MIN.GAL.LIMIT.USE BOOL TRUE # limit extended source fits by galactic coordinates 441 464 442 465 PSPHOT.STACK.MATCH.PSF.SOURCE STR AUTO # which inputs to convolve? (RAW, CNV, AUTO) … … 465 488 EXT_MODEL STR PS_MODEL_QGAUSS 466 489 PEAKS_NMAX_TOTAL S32 0 # set this to limit the allowed number of peaks - Yields fault instead of avoid memory explosion 490 467 491 468 492 SAVE.RESID BOOL TRUE … … 683 707 RADIAL_APERTURES BOOL TRUE 684 708 EXTENDED_SOURCE_FITS BOOL TRUE # this casues the xfit extension to be written out 685 EXTENDED_SOURCE_PETROSIAN BOOL TRUE # I want petrosian mags 709 EXTENDED_SOURCE_PETROSIAN BOOL TRUE # To measure petrosian magnitudes 710 EXTENDED_SOURCE_ANNULI BOOL TRUE 686 711 SAVE.PSF BOOL FALSE 687 712 SAVE.BACKMDL BOOL FALSE 688 # SAVE.RESID BOOL FALSE689 # OUTPUT.FORMAT STR PS1_V3690 END 713 SAVE.RESID BOOL TRUE 714 OUTPUT.FORMAT STR PS1_SV2 715 END -
trunk/ippconfig/recipes/reductionClasses.mdc
- Property svn:mergeinfo changed
/branches/bills_branches/bills_201312/ippconfig/recipes/reductionClasses.mdc (added) merged: 36437
- Property svn:mergeinfo changed
-
trunk/ppImage/src
- Property svn:mergeinfo changed (with no actual effect on merging)
-
trunk/ppSub/src/ppSubMatchPSFs.c
r35924 r36441 156 156 psLogMsg("ppSub", PS_LOG_INFO, "Input FWHM: %f\nReference FWHM: %f\n", inFWHM, refFWHM); 157 157 if (!isfinite(inFWHM) || !isfinite(refFWHM)) { 158 psError(PPSUB_ERR_DATA, false, "Cannot determine FHWM for images, giving up."); 159 return false; 158 psErrorStackPrint(stderr, "Cannot determine FHWM for images, giving up."); 159 int error = psErrorCodeLast(); // Error code 160 ppSubDataQuality(data, error, PPSUB_FILES_ALL); 161 return true; 160 162 } 161 163 -
trunk/psLib/src/math/psMixtureModels.c
- Property svn:mergeinfo changed
/branches/bills_branches/bills_201312/psLib/src/math/psMixtureModels.c (added) merged: 36437
- Property svn:mergeinfo changed
-
trunk/psModules
- Property svn:mergeinfo changed
/branches/bills_branches/bills_201312/psModules (added) merged: 36389,36412,36422-36424
- Property svn:mergeinfo changed
-
trunk/psModules/src/camera/pmFPAfile.c
r36375 r36441 565 565 case PM_FPA_FILE_CMF: 566 566 return ("CMF"); 567 case PM_FPA_FILE_CFF: 568 return ("CFF"); 567 569 case PM_FPA_FILE_WCS: 568 570 return ("WCS"); -
trunk/psModules/src/objects/pmModelClass.c
r34259 r36441 66 66 67 67 static pmModelClass *models = NULL; 68 static psVector *modelClassLookupTable = NULL; // translation between model types in header and here 68 69 static int Nmodels = 0; 69 70 … … 135 136 models = NULL; 136 137 Nmodels = 0; 138 psFree(modelClassLookupTable); 139 modelClassLookupTable = NULL; 137 140 return; 138 141 } … … 193 196 } 194 197 198 199 bool pmModelClassWriteHeader(psMetadata *header) 200 { 201 psMetadataAddS32(header, PS_LIST_TAIL, "MTNUM", PS_META_REPLACE, "number of model types", Nmodels); 202 for (int i = 0; i < Nmodels; i++) { 203 char modelNameKey[16]; 204 char modelValKey[16]; 205 sprintf(modelNameKey, "MTNAM%02d", i); 206 sprintf(modelValKey, "MTVAL%02d", i); 207 psMetadataAddStr(header, PS_LIST_TAIL, modelNameKey, PS_META_REPLACE, "", models[i].name); 208 psMetadataAddS32(header, PS_LIST_TAIL, modelValKey, PS_META_REPLACE, "", i); 209 } 210 211 return true; 212 } 213 214 bool pmModelClassReadHeader(psMetadata *header) { 215 psFree(modelClassLookupTable); 216 217 bool status; 218 int numHeaderModels = psMetadataLookupS32(&status, header, "MTNUM"); 219 if (!status) { 220 return false; 221 } 222 223 psVector *inputTypes = psVectorAlloc(numHeaderModels, PS_TYPE_S32); 224 psVector *localTypes = psVectorAlloc(numHeaderModels, PS_TYPE_S32); 225 int max_val = -1; 226 for (int i = 0; i < numHeaderModels; i++) { 227 char modelNameKey[16]; 228 char modelValKey[16]; 229 sprintf(modelNameKey, "MTNAM%02d", i); 230 sprintf(modelValKey, "MTVAL%02d", i); 231 psString thisName = psMetadataLookupStr(&status, header, modelNameKey); 232 int thisVal = psMetadataLookupS32(&status, header, modelValKey); 233 if (thisVal > max_val) { 234 max_val = thisVal; 235 } 236 inputTypes->data.S32[i] = thisVal; 237 localTypes->data.S32[i] = pmModelClassGetType(thisName); 238 } 239 if (max_val < 0) { 240 psFree(inputTypes); 241 psFree(localTypes); 242 return false; 243 } 244 245 modelClassLookupTable = psVectorAlloc(max_val + 1, PS_TYPE_S32); 246 psVectorInit(modelClassLookupTable, -1); 247 248 for (int i = 0; i < numHeaderModels; i++) { 249 int thisVal = inputTypes->data.S32[i]; 250 int localVal = localTypes->data.S32[i]; 251 modelClassLookupTable->data.S32[thisVal] = localVal; 252 } 253 psFree(inputTypes); 254 psFree(localTypes); 255 256 return true; 257 } 258 259 pmModelType pmModelClassGetLocalType(pmModelType inputType) { 260 pmModelType localType = -1; 261 262 if (modelClassLookupTable) { 263 if (inputType >= 0 && inputType < modelClassLookupTable->n) { 264 localType = modelClassLookupTable->data.S32[inputType]; 265 } 266 } else { 267 // no lookup table defined 268 // for backwards compatability if inputType refers to a defined model, return it 269 if (inputType >= 0 && pmModelClassGetName(inputType)) { 270 localType = inputType; 271 } 272 } 273 274 return localType; 275 } -
trunk/psModules/src/objects/pmModelClass.h
r29004 r36441 76 76 void pmModelClassSetLimits(pmModelLimitsType type); 77 77 78 // write keywords to header definining the model type values used by this program 79 bool pmModelClassWriteHeader(psMetadata *header); 80 // create a lookup table for translating input model type values to local model type values 81 bool pmModelClassReadHeader(psMetadata *header); 82 // translate input model type value to local value 83 pmModelType pmModelClassGetLocalType(pmModelType inputType); 78 84 79 85 /// @} -
trunk/psModules/src/objects/pmSourceIO.c
r36375 r36441 61 61 static bool pmReadoutReadXFIT(pmFPAfile *file, pmReadout *readout, char * exttype, psMetadata *hduHeader, psString xfitname, psArray *sources, long *sourceIndex); 62 62 static bool pmReadoutReadXRAD(pmFPAfile *file, pmReadout *readout, char * exttype, psMetadata *hduHeader, psString xfitname, psArray *sources, long *sourceIndex); 63 static bool pmReadoutReadXGAL(pmFPAfile *file, pmReadout *readout, char * exttype, psMetadata *hduHeader, psString xfitname, psArray *sources, long *sourceIndex); 63 64 64 65 // lookup the EXTNAME values used for table data and image header segments … … 374 375 } \ 375 376 if (xgalname) { \ 376 status &= pmSourcesWrite_##TYPE##_XGAL (file->fits, sources, xgalname, recipe); \377 status &= pmSourcesWrite_##TYPE##_XGAL (file->fits, readout, sources, xgalname, recipe); \ 377 378 } \ 378 379 } … … 1036 1037 bool XFIT_OUTPUT = psMetadataLookupBool(&status, recipe, "EXTENDED_SOURCE_FITS"); 1037 1038 bool XRAD_OUTPUT = psMetadataLookupBool(&status, recipe, "RADIAL_APERTURES"); 1038 bool XGAL_OUTPUT = false; //psMetadataLookupBool(&status, recipe, "GALAXY_SHAPES");1039 bool XGAL_OUTPUT = psMetadataLookupBool(&status, recipe, "GALAXY_SHAPES"); 1039 1040 1040 1041 if (!pmSourceIOextnames(&headname, &dataname, &deteffname, … … 1122 1123 1123 1124 long *sourceIndex = NULL; 1124 if (XSRC_OUTPUT || XFIT_OUTPUT || XRAD_OUTPUT) { 1125 if (XSRC_OUTPUT || XFIT_OUTPUT || XRAD_OUTPUT || XGAL_OUTPUT) { 1126 // Build sourceIndex. Lookup table from source->seq to index in sources array. 1127 // Consists of an array of length max(source->seq) + 1. 1128 1129 // find maximum sequence number 1125 1130 long seq_max = -1; 1126 1131 for (long i = sources->n -1; i >= 0; i--) { … … 1135 1140 } 1136 1141 } 1142 // allocate and initialize the index 1137 1143 sourceIndex = psAlloc((seq_max + 1) * sizeof(long)); 1138 1144 for (long i = 0; i < seq_max; i++) { 1139 1145 sourceIndex[i] = -1; 1140 1146 } 1147 // populate the index 1141 1148 for (long i = 0; i < sources->n; i++) { 1142 1149 pmSource *source = sources->data[i]; … … 1165 1172 psFree(xradname); 1166 1173 } 1174 if (XGAL_OUTPUT && xgalname) { 1175 // a cmf file may have an XGAL extension, but it is not required 1176 if (!pmReadoutReadXGAL(file, readout, exttype, hdu->header, xgalname, sources, sourceIndex)) { 1177 // do anything? 1178 } 1179 psFree(xgalname); 1180 } 1167 1181 psFree(sourceIndex); 1168 1182 … … 1461 1475 return status; 1462 1476 } 1477 static bool pmReadoutReadXGAL(pmFPAfile *file, pmReadout *readout, char *exttype, psMetadata *hduHeader, psString xgalname, psArray *sources, long *sourceIndex) 1478 { 1479 if (!psFitsMoveExtNameClean (file->fits, xgalname)) { 1480 psTrace ("pmFPAfile", 1, "cannot find xgal extension %s in %s, skipping", xgalname, file->filename); 1481 return false; 1482 } 1483 1484 psMetadata *tableHeader = psFitsReadHeader(NULL, file->fits); // The FITS header 1485 if (!tableHeader) psAbort("cannot read table header"); 1486 1487 char *xtension = psMetadataLookupStr (NULL, tableHeader, "XTENSION"); 1488 if (!xtension) psAbort("cannot read table type"); 1489 if (strcmp (xtension, "BINTABLE")) { 1490 psFree(tableHeader); 1491 psWarning ("no binary table in extension %s, skipping\n", xgalname); 1492 return false; 1493 } 1494 1495 # define PM_SOURCES_READ_XGAL(NAME,TYPE) \ 1496 if (!strcmp (exttype, NAME)) { \ 1497 status = pmSourcesRead_##TYPE##_XGAL(file->fits, readout, hduHeader, tableHeader, sources, sourceIndex); \ 1498 } 1499 1500 bool status = false; 1501 if (file->type == PM_FPA_FILE_CMF) { 1502 PM_SOURCES_READ_XGAL("PS1_V1", CMF_PS1_V1); 1503 PM_SOURCES_READ_XGAL("PS1_V2", CMF_PS1_V2); 1504 PM_SOURCES_READ_XGAL("PS1_V3", CMF_PS1_V3); 1505 PM_SOURCES_READ_XGAL("PS1_V4", CMF_PS1_V4); 1506 PM_SOURCES_READ_XGAL("PS1_SV1", CMF_PS1_SV1); 1507 PM_SOURCES_READ_XGAL("PS1_SV2", CMF_PS1_SV2); 1508 PM_SOURCES_READ_XGAL("PS1_DV1", CMF_PS1_DV1); 1509 PM_SOURCES_READ_XGAL("PS1_DV2", CMF_PS1_DV2); 1510 PM_SOURCES_READ_XGAL("PS1_DV3", CMF_PS1_DV3); 1511 } 1512 psFree(tableHeader); 1513 return status; 1514 } -
trunk/psModules/src/objects/pmSourceIO.h
r36375 r36441 21 21 bool pmSourcesWrite_##TYPE##_XFIT(psFits *fits, pmReadout *readout, psArray *sources, psMetadata *imageHeader, char *extname); \ 22 22 bool pmSourcesWrite_##TYPE##_XRAD(psFits *fits, pmReadout *readout, psArray *sources, psMetadata *imageHeader, char *extname, psMetadata *recipe); \ 23 bool pmSourcesWrite_##TYPE##_XGAL(psFits *fits, p sArray *sources, char *extname, psMetadata *recipe); \23 bool pmSourcesWrite_##TYPE##_XGAL(psFits *fits, pmReadout *readout, psArray *sources, char *extname, psMetadata *recipe); \ 24 24 psArray *pmSourcesRead_##TYPE (psFits *fits, psMetadata *header); \ 25 25 bool pmSourcesRead_##TYPE##_XSRC (psFits *fits, pmReadout *readout, psMetadata *header, psMetadata *tableHeader, psArray *sources, long *index); \ 26 26 bool pmSourcesRead_##TYPE##_XFIT (psFits *fits, pmReadout *readout, psMetadata *header, psMetadata *tableHeader, psArray *sources, long *index); \ 27 27 bool pmSourcesRead_##TYPE##_XRAD (psFits *fits, pmReadout *readout, psMetadata *header, psMetadata *tableHeader, psArray *sources, long *index);\ 28 bool pmSourcesRead_##TYPE##_XGAL (psFits *fits, pmReadout *readout, psMetadata *header, psMetadata *tableHeader, psArray *sources, long *index);\ 28 29 29 30 // All of these functions need to use the same API, even if not all elements are used in a specific case -
trunk/psModules/src/objects/pmSourceIO_CFF.c
r36375 r36441 65 65 int modelType = pmModelClassGetType ("PS_MODEL_GAUSS"); 66 66 67 // Read lookup table for model classes (if defined) 68 pmModelClassReadHeader(header); 69 67 70 char *PSF_NAME = psMetadataLookupStr (&status, header, "PSFMODEL"); 68 71 if (PSF_NAME != NULL) { … … 111 114 float theta = psMetadataLookupF32 (&status, row, "THETA"); 112 115 113 // XXX: we need to put a lookup table in the cff header to define the correspondence of the114 // model type values in the cff with our models. (We want to use an interger for efficiency115 // but the value for each model type is set on the organization of the the array in pmModelClass.c116 // For now use the input values verbatim and trust the user that this is valid value117 116 int galaxyModelType = psMetadataLookupS32(&status, row, "MODEL_TYPE"); 117 if (status) { 118 galaxyModelType = pmModelClassGetLocalType(galaxyModelType); 119 } else { 120 galaxyModelType = -1; 121 } 118 122 float Sindex = psMetadataLookupF32 (&status, row, "INDEX"); // Should this be PAR_07 not sersic index 119 123 … … 123 127 source->type = PM_SOURCE_TYPE_STAR; // XXX this should be added to the flags 124 128 125 // XXX we can set this in general, but for a specific image, we need to weed out SATSTARS 129 // XXX we can set this in general, but for a specific image, we need to weed out SATSTARS and 130 // stars that are masked 126 131 if (psfStar) { 127 132 source->tmpFlags |= PM_SOURCE_TMPF_CANDIDATE_PSFSTAR; … … 180 185 } 181 186 182 // XXX: should use < 0 as invalid galaxyModelType 183 184 if (fitGalaxy && galaxyModelType > 0) { 187 if (fitGalaxy && galaxyModelType >= 0) { 185 188 source->modelFits = psArrayAllocEmpty (1); 186 189 pmModel *model = pmModelAlloc(galaxyModelType); … … 235 238 PS_ASSERT(mdok, false); 236 239 240 // write the definition of the model class type values to the header 241 psMetadata *outputHeader = psMetadataAlloc(); 242 pmModelClassWriteHeader(outputHeader); 243 237 244 psArray *table = psArrayAllocEmpty(sources->n); 238 245 … … 246 253 psS32 modelType = 0; 247 254 bool fitGalaxy = false; 248 bool psfStar = false;255 bool psfStar = (source->mode & PM_SOURCE_MODE_PSFSTAR) ? true : false; 249 256 psF32 sersicIndex = 0; 250 if (source->modelFits == NULL) { 257 // For now only perform galaxy fits on extended objects 258 if (source->modelEXT == NULL) { 251 259 pmModel *model = source->modelPSF; 252 260 if (model == NULL) continue; … … 260 268 yPos = model->params->data.F32[PM_PAR_YPOS]; 261 269 flux = source->psfFlux; 262 psfStar = (source->mode & PM_SOURCE_MODE_PSFSTAR) ? true : false;263 270 rMajor = 0; 264 271 rMinor = 0; … … 329 336 330 337 psArrayAdd(table, 100, row); 338 psFree(row); 331 339 } 332 340 333 if (!psFitsWriteTable(fits, NULL, table, extname)) {341 if (!psFitsWriteTable(fits, outputHeader, table, extname)) { 334 342 psError(psErrorCodeLast(), false, "writing ext data %s\n", extname); 335 343 psFree(table); 336 psFree( header);344 psFree(outputHeader); 337 345 return false; 338 346 } 339 347 psFree(table); 340 // psFree(header);348 psFree(outputHeader); 341 349 342 350 return true; -
trunk/psModules/src/objects/pmSourceIO_CMF.c.in
r36375 r36441 708 708 return false; 709 709 } 710 // Find the source with this sequence number. 711 // XXX: I am assuming that sources is sorted in order of seq 710 // Find the source with this sequence number using the sourceIndex. 712 711 long seq = psMetadataLookupU32 (&status, row, "IPP_IDET"); 713 pmSource *source = NULL;714 #ifndef ASSUME_SORTED715 long j = seq < sources->n ? seq : sources->n - 1;716 for (; j >= 0; j--) {717 source = sources->data[j];718 if (source->seq == seq) {719 break;720 }721 }722 #else723 712 long j = sourceIndex[seq]; 724 713 psAssert(j >= 0 && j < sources->n, "invalid sourceIndex"); 725 source = sources->data[j]; 726 #endif 714 pmSource *source = sources->data[j]; 727 715 if (!source) { 728 716 psError(PS_ERR_UNKNOWN, false, "Failed to find source for row %ld sequence number %ld\n", i, seq); … … 793 781 // create a header to hold the output data 794 782 psMetadata *outhead = psMetadataAlloc (); 783 784 pmModelClassWriteHeader(outhead); 795 785 796 786 // write the links to the image header … … 1034 1024 return false; 1035 1025 } 1026 // set up the lookup table to translate between input model types and output model types 1027 // if not defined it is assumed that the tables are the same 1028 pmModelClassReadHeader(tableHeader); 1036 1029 1037 1030 for (long i = 0; i < numSources; i++) { … … 1042 1035 return false; 1043 1036 } 1044 // Find the source with this sequence number.1045 // XXX: I am assuming that sources is sorted in order of seq.1046 1037 long seq = psMetadataLookupU32 (&status, row, "IPP_IDET"); 1047 long j = seq < sources->n ? seq : sources->n - 1; 1048 pmSource *source = NULL; 1049 for (; j >= 0; j--) { 1050 source = sources->data[j]; 1051 if (source->seq == seq) { 1052 break; 1053 } 1054 } 1038 long j = sourceIndex[seq]; 1039 psAssert(j >= 0 && j < sources->n, "invalid sourceIndex"); 1040 pmSource *source = sources->data[j]; 1055 1041 if (!source) { 1056 1042 psError(PS_ERR_UNKNOWN, false, "Failed to find source for row %ld sequence number %ld\n", i, seq); … … 1095 1081 // in the psf table. 1096 1082 psS32 extModelType = psMetadataLookupS32(&status, row, "EXT_MODEL_TYPE"); 1097 if (!status) { 1083 if (status) { 1084 // translate between the type value in xfit and values used by this program 1085 extModelType = pmModelClassGetLocalType(extModelType); 1086 } else { 1098 1087 // older cmfs don't have this column 1099 1088 extModelType = -1; 1100 } 1089 } 1101 1090 1102 1091 psEllipseAxes axes; … … 1339 1328 return false; 1340 1329 } 1341 // Find the source with this sequence number.1342 // XXX: I am assuming that sources is sorted in order of seq.1343 1330 long seq = psMetadataLookupU32 (&status, row, "IPP_IDET"); 1344 long j = seq < sources->n ? seq : sources->n - 1; 1345 pmSource *source = NULL; 1346 for (; j >= 0; j--) { 1347 source = sources->data[j]; 1348 if (source->seq == seq) { 1349 break; 1350 } 1351 } 1331 long j = sourceIndex[seq]; 1332 psAssert(j >= 0 && j < sources->n, "invalid sourceIndex"); 1333 pmSource *source = sources->data[j]; 1352 1334 if (!source) { 1353 1335 psError(PS_ERR_UNKNOWN, false, "Failed to find source for row %ld sequence number %ld\n", i, seq); … … 1407 1389 1408 1390 // XXX where should I record the number of columns?? 1409 bool pmSourcesWrite_CMF_@CMFMODE@_XGAL (psFits *fits, p sArray *sources, char *extname, psMetadata *recipe)1391 bool pmSourcesWrite_CMF_@CMFMODE@_XGAL (psFits *fits, pmReadout *readout, psArray *sources, char *extname, psMetadata *recipe) 1410 1392 { 1411 1393 bool status = false; … … 1422 1404 // write the links to the image header 1423 1405 psMetadataAddStr (outhead, PS_LIST_TAIL, "EXTNAME", PS_META_REPLACE, "galaxy table extension", extname); 1406 1407 psMetadataAddStr (outhead, PS_LIST_TAIL, "HI", PS_META_REPLACE, "does this get through?", "THERE"); 1424 1408 1425 1409 // let's write these out in S/N order … … 1491 1475 } 1492 1476 1477 bool pmSourcesRead_CMF_@CMFMODE@_XGAL(psFits *fits, pmReadout *readout, psMetadata *hduHeader, psMetadata *tableHeader, psArray *sources, long *sourceIndex) 1478 { 1479 PS_ASSERT_PTR_NON_NULL(fits, false); 1480 PS_ASSERT_PTR_NON_NULL(sources, false); 1481 1482 bool status; 1483 long numSources = psFitsTableSize(fits); // Number of sources in table 1484 if (numSources == 0) { 1485 psError(psErrorCodeLast(), false, "XGAL Table contains no entries\n"); 1486 return false; 1487 } 1488 1489 for (long i = 0; i < numSources; i++) { 1490 psMetadata *row = psFitsReadTableRow(fits, i); // Table row 1491 if (!row) { 1492 psError(psErrorCodeLast(), false, "Unable to read row %ld of sources", i); 1493 psFree(row); 1494 return false; 1495 } 1496 // Find the source with this sequence number. 1497 // XXX: I am assuming that sources is sorted in order of seq 1498 long seq = psMetadataLookupU32 (&status, row, "IPP_IDET"); 1499 long j = sourceIndex[seq]; 1500 psAssert(j >= 0 && j < sources->n, "invalid sourceIndex"); 1501 1502 pmSource *source = sources->data[j]; 1503 if (!source) { 1504 psError(PS_ERR_UNKNOWN, false, "Failed to find source for row %ld sequence number %ld\n", i, seq); 1505 psFree(row); 1506 return false; 1507 } 1508 1509 psVector *Flux = psMetadataLookupVector(&status, row, "GAL_FLUX"); 1510 psVector *dFlux = psMetadataLookupVector(&status, row, "GAL_FLUX_ERR"); 1511 psVector *chisq = psMetadataLookupVector(&status, row, "GAL_CHISQ"); 1512 1513 if (Flux && Flux->n > 0) { 1514 psFree(source->galaxyFits); 1515 source->galaxyFits = pmSourceGalaxyFitsAlloc(); 1516 source->galaxyFits->nPix = psMetadataLookupF32(&status, row, "NPIX"); 1517 1518 psFree(source->galaxyFits->Flux); 1519 source->galaxyFits->Flux = psMemIncrRefCounter(Flux); 1520 psFree(source->galaxyFits->dFlux); 1521 source->galaxyFits->dFlux = psMemIncrRefCounter(dFlux); 1522 psFree(source->galaxyFits->chisq); 1523 source->galaxyFits->chisq = psMemIncrRefCounter(chisq); 1524 } 1525 1526 psFree(row); 1527 } 1528 1529 return true; 1530 } -
trunk/psModules/src/objects/pmSourceIO_PS1_CAL_0.c
r36375 r36441 714 714 } 715 715 716 bool pmSourcesWrite_PS1_CAL_0_XGAL (psFits *fits, p sArray *sources, char *extname, psMetadata *recipe)716 bool pmSourcesWrite_PS1_CAL_0_XGAL (psFits *fits, pmReadout *readout, psArray *sources, char *extname, psMetadata *recipe) 717 717 { 718 718 return true; -
trunk/psModules/src/objects/pmSourceIO_PS1_DEV_0.c
r36375 r36441 256 256 } 257 257 258 bool pmSourcesWrite_PS1_DEV_0_XGAL(psFits *fits, p sArray *sources, char *extname, psMetadata *recipe)259 { 260 return true; 261 } 258 bool pmSourcesWrite_PS1_DEV_0_XGAL(psFits *fits, pmReadout *readout, psArray *sources, char *extname, psMetadata *recipe) 259 { 260 return true; 261 } -
trunk/psModules/src/objects/pmSourceIO_PS1_DEV_1.c
r36375 r36441 596 596 } 597 597 598 bool pmSourcesWrite_PS1_DEV_1_XGAL(psFits *fits, p sArray *sources, char *extname, psMetadata *recipe)598 bool pmSourcesWrite_PS1_DEV_1_XGAL(psFits *fits, pmReadout *readout, psArray *sources, char *extname, psMetadata *recipe) 599 599 { 600 600 return true; -
trunk/psModules/src/objects/pmSourceIO_SMPDATA.c
r36375 r36441 226 226 } 227 227 228 bool pmSourcesWrite_SMPDATA_XGAL(psFits *fits, p sArray *sources, char *extname, psMetadata *recipe)228 bool pmSourcesWrite_SMPDATA_XGAL(psFits *fits, pmReadout *readout, psArray *sources, char *extname, psMetadata *recipe) 229 229 { 230 230 return true; -
trunk/psastro/src/psastroDataSave.c
r33669 r36441 42 42 } 43 43 44 // de-activate all files except PSASTRO.OUTPUT 44 // de-activate all files except PSASTRO.OUTPUT, PSASTRO.OUT.ASTROM, and PSPHOT.OUTPUT.CFF 45 45 pmFPAfileActivate (config->files, false, NULL); 46 46 pmFPAfileActivate (config->files, true, "PSASTRO.OUTPUT"); 47 47 pmFPAfileActivate (config->files, true, "PSASTRO.OUT.ASTROM"); 48 pmFPAfileActivate (config->files, true, "PSPHOT.OUTPUT.CFF"); 48 49 49 50 pmFPAview *view = pmFPAviewAlloc (0); … … 103 104 } 104 105 105 // activate all files except PSASTRO.OUTPUT 106 // activate all files except PSASTRO.OUTPUT, and PSPHOT.OUTPUT.CFF 106 107 pmFPAfileActivate (config->files, true, NULL); 107 108 pmFPAfileActivate (config->files, false, "PSASTRO.OUTPUT"); 109 pmFPAfileActivate (config->files, false, "PSPHOT.OUTPUT.CFF"); 108 110 109 111 psFree (view); -
trunk/psastro/src/psastroDefineFiles.c
r32964 r36441 100 100 } 101 101 102 bool writeCff = psMetadataLookupBool (&status, recipe, "PSASTRO.SAVE.CFF"); 103 if (writeCff) { 104 pmFPAfile *file = pmFPAfileDefineOutputFromFile (config, input, "PSPHOT.OUTPUT.CFF"); 105 if (!file) { 106 psError (PS_ERR_IO, false, "Can't find the output cff file definition"); 107 return NULL; 108 } 109 if (file->type != PM_FPA_FILE_CFF) { 110 psError(PS_ERR_IO, true, "%s is not of type %s", "PSPHOT.OUTPUT.CFF", pmFPAfileStringFromType (PM_FPA_FILE_CFF)); 111 return NULL; 112 } 113 file->save = true; 114 } 115 102 116 103 117 # if (0) -
trunk/psconfig
- Property svn:mergeinfo changed (with no actual effect on merging)
-
trunk/psphot
- Property svn:mergeinfo changed
/branches/bills_branches/bills_201312/psphot (added) merged: 36406-36407,36410,36420,36437-36438
- Property svn:mergeinfo changed
-
trunk/psphot/src
- Property svn:ignore
-
old new 26 26 psphotFullForce 27 27 psmakecff 28 psphotFullForceSummary
-
- Property svn:mergeinfo changed
/branches/bills_branches/bills_201312/psphot/src (added) merged: 36406-36407,36410,36420,36437-36438
- Property svn:ignore
-
trunk/psphot/src/Makefile.am
r36375 r36441 25 25 libpsphot_la_LDFLAGS = $(PSPHOT_LIBS) $(PSMODULE_LIBS) $(PSLIB_LIBS) 26 26 27 bin_PROGRAMS = psphot psphotForced psphotFullForce psphot Minimal psphotMakePSF psphotStack psphotModelTest psmakecff27 bin_PROGRAMS = psphot psphotForced psphotFullForce psphotFullForceSummary psphotMinimal psphotMakePSF psphotStack psphotModelTest psmakecff 28 28 # bin_PROGRAMS = psphotPetrosianStudy psphotTest psphotMomentsStudy 29 29 … … 39 39 psphotFullForce_LDFLAGS = $(PSPHOT_LIBS) $(PSMODULE_LIBS) $(PSLIB_LIBS) 40 40 psphotFullForce_LDADD = libpsphot.la 41 42 psphotFullForceSummary_CFLAGS = $(PSPHOT_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS) 43 psphotFullForceSummary_LDFLAGS = $(PSPHOT_LIBS) $(PSMODULE_LIBS) $(PSLIB_LIBS) 44 psphotFullForceSummary_LDADD = libpsphot.la 41 45 42 46 psphotMinimal_CFLAGS = $(PSPHOT_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS) … … 99 103 psphotMosaicChip.c \ 100 104 psphotCleanup.c 105 106 # combine full force results from several inputs 107 psphotFullForceSummary_SOURCES = \ 108 psphotFullForceSummary.c \ 109 psphotFullForceSummaryReadout.c 101 110 102 111 # forced photometry of specified positions given a specified psf -
trunk/psphot/src/psmakecff.c
r36375 r36441 2 2 # include <config.h> 3 3 # endif 4 5 // psmakecff : A program to make read a cmf file and write a cff file 6 // The real work is done in psModules. 4 7 5 8 #include <stdio.h> … … 8 11 #include "psphot.h" 9 12 13 // For simplicilty, this program's (simple) functions are all contained in this file. 10 14 static pmConfig* psmakecffArguments(int, char**); 11 15 static bool psmakecffParseCamera(pmConfig *); … … 25 29 // psphotVersionPrint(); 26 30 27 // load input data (config and images (signal, noise, mask)28 31 if (!psmakecffParseCamera (config)) { 29 32 psErrorStackPrint(stderr, "Error setting up the camera\n"); … … 31 34 } 32 35 33 // call psphot for each readout34 36 if (!psmakecffImageLoop (config)) { 35 37 psErrorStackPrint(stderr, "Error in the psphot image loop\n"); … … 37 39 } 38 40 39 // psLogMsg ("psphot", PS_LOG_WARN, "complete psphot run: %f sec\n", psTimerMark ("complete"));40 41 // psErrorCode exit_status = psphotGetExitStatus();42 // psphotCleanup (config);43 41 exit (0); 44 42 } … … 73 71 return config; 74 72 } 73 75 74 static bool psmakecffParseCamera(pmConfig *config) { 76 75 bool status = false; … … 127 126 psAssert (recipe, "missing recipe?"); 128 127 129 // psImageMaskType maskTest = psMetadataLookupImageMask(&status, recipe, "MASK.PSPHOT");130 128 131 129 // for psphot, we force data to be read at the chip level 132 130 while ((chip = pmFPAviewNextChip (view, input->fpa, 1)) != NULL) { 133 psLogMsg ("psmakec mf", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process);131 psLogMsg ("psmakecff", 4, "Chip %d: %x %x\n", view->chip, chip->file_exists, chip->process); 134 132 if (! chip->process || ! chip->file_exists) { continue; } 135 133 136 #ifdef notdef137 pmFPAfileActivate (config->files, false, NULL);138 pmFPAfileActivate (config->files, true, "PSPHOT.LOAD");139 #endif140 134 if (!pmFPAfileIOChecks (config, view, PM_FPA_BEFORE)) ESCAPE ("failed input for Chip in psmakecff."); 141 135 142 136 // there is now only a single chip (multiple readouts?). loop over it and process 143 137 while ((cell = pmFPAviewNextCell (view, input->fpa, 1)) != NULL) { 144 psLogMsg ("psmakec mf", 5, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);138 psLogMsg ("psmakecff", 5, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process); 145 139 146 140 // process each of the readouts 147 141 while ((readout = pmFPAviewNextReadout (view, input->fpa, 1)) != NULL) { 148 psLogMsg ("psmakec mf", 6, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process);142 psLogMsg ("psmakecff", 6, "Cell %d: %x %x\n", view->cell, cell->file_exists, cell->process); 149 143 if (! readout->data_exists) { continue; } 150 144 151 145 pmHDU *hdu = pmHDUGetHighest(input->fpa, chip, cell); 152 146 if (hdu && hdu != lastHDU) { 147 // XXX: probably should do this 153 148 // psphotVersionHeaderFull(hdu->header); 154 149 lastHDU = hdu; … … 157 152 158 153 } 159 // Defer output and closing of files until we've (possibly) done the NFrames analysis below160 // pmFPAfileActivate (config->files, false, NULL);161 162 154 if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE ("failed pmFPAfileIOChecks for Chip in psmakecff."); 163 155 } 164 156 if (!pmFPAfileIOChecks (config, view, PM_FPA_AFTER)) ESCAPE ("failed pmFPAfileIOChecks for FPA in psphot."); 165 157 166 // fail if we failed to handle anerror158 // fail if we encountered an unhandled error 167 159 if (psErrorCodeLast() != PS_ERR_NONE) psAbort ("failed to handle an error!"); 168 160 -
trunk/psphot/src/psphot.h
r36375 r36441 361 361 bool psphotModelTestReadout(pmConfig *config, const pmFPAview *view, const char *filerule); 362 362 363 bool psphotFullForceSummaryReadout (pmConfig * config, const pmFPAview *view); 364 363 365 int psphotFileruleCount(const pmConfig *config, const char *filerule); 364 366 bool psphotFileruleCountSet(const pmConfig *config, const char *filerule, int num); -
trunk/psphot/src/psphotChooseAnalysisOptions.c
r36375 r36441 60 60 } 61 61 62 bool GetGalacticCoords (psSphere *ptGal, psSphere *ptSky, psSphereRot *toGal, pmChip *chip, float xPos, float yPos);62 static bool GetGalacticCoords (psSphere *ptGal, psSphere *ptSky, psSphereRot *toGal, pmChip *chip, float xPos, float yPos); 63 63 64 64 // this function use an internal flag to mark sources which have already been measured … … 121 121 psSphereRot *toGal = NULL; 122 122 float GAL_LIMIT = 0.0; 123 float GAL_LIMIT_BULGE = 0.0; 124 float GAL_LIMIT_SIGMA2 = 0.0; 123 125 bool useGAL_LIMIT = psMetadataLookupBool(&status, recipe, "EXT.FIT.MIN.GAL.LIMIT.USE"); 124 126 assert (status); 125 127 if (useGAL_LIMIT) { 128 toGal = psSphereRotICRSToGalactic(); 126 129 GAL_LIMIT = psMetadataLookupF32(&status, recipe, "EXT.FIT.MIN.GAL.LIMIT"); 127 toGal = psSphereRotICRSToGalactic(); 130 assert (status); 131 GAL_LIMIT = DEG_TO_RAD(GAL_LIMIT); 132 GAL_LIMIT_BULGE = psMetadataLookupF32(&status, recipe, "EXT.FIT.MIN.GAL.LIMIT.BULGE"); 133 assert (status); 134 GAL_LIMIT_BULGE = DEG_TO_RAD(GAL_LIMIT_BULGE); 135 float GAL_LIMIT_SIGMA = psMetadataLookupF32(&status, recipe, "EXT.FIT.MIN.GAL.LIMIT.BULGE.SIGMA"); 136 assert (status); 137 assert(GAL_LIMIT_SIGMA > 0); 138 GAL_LIMIT_SIGMA = DEG_TO_RAD(GAL_LIMIT_SIGMA); 139 GAL_LIMIT_SIGMA2 = GAL_LIMIT_SIGMA * GAL_LIMIT_SIGMA; 128 140 } 129 141 … … 135 147 } 136 148 149 float petroFluxLim = NAN; 137 150 float extFitFluxLim = NAN; 138 151 … … 140 153 float extFitMagLimDefault = NAN; 141 154 float extFitMagLim = NAN; 155 float petroMagLimDefault = NAN; 156 float petroMagLim = NAN; 142 157 143 158 // match to the given filter … … 156 171 // find a matching filter or default to 'any' 157 172 if (!strcasecmp (thisFilter, "any")) { 158 psString extFitMagLimStr = psMetadataLookupStr (&status, item->data.md, "MAG.LIMIT"); 159 psAssert(extFitMagLimStr, "missing MAG.LIMIT"); 173 psString petroMagLimStr = psMetadataLookupStr (&status, item->data.md, "MAG.LIMIT.PETRO"); 174 psAssert(petroMagLimStr, "missing MAG.LIMIT.PETRO"); 175 petroMagLimDefault = atof (petroMagLimStr); 176 177 psString extFitMagLimStr = psMetadataLookupStr (&status, item->data.md, "MAG.LIMIT.EXTFIT"); 178 psAssert(extFitMagLimStr, "missing MAG.LIMIT.EXTFIT"); 160 179 extFitMagLimDefault = atof (extFitMagLimStr); 161 180 } 162 181 163 // find a matching filter or default to 'any'164 182 if (!strcasecmp (thisFilter, filterID)) { 165 psString extFitMagLimStr = psMetadataLookupStr (&status, item->data.md, "MAG.LIMIT"); 166 psAssert(extFitMagLimStr, "missing MAG.LIMIT"); 183 psString petroMagLimStr = psMetadataLookupStr (&status, item->data.md, "MAG.LIMIT.PETRO"); 184 psAssert(petroMagLimStr, "missing MAG.LIMIT.PETRO"); 185 petroMagLim = atof (petroMagLimStr); 186 187 psString extFitMagLimStr = psMetadataLookupStr (&status, item->data.md, "MAG.LIMIT.EXTFIT"); 188 psAssert(extFitMagLimStr, "missing MAG.LIMIT.EXTFIT"); 167 189 extFitMagLim = atof (extFitMagLimStr); 168 190 break; 169 191 } 170 192 } 193 psFree(iter); 194 if (!isfinite (petroMagLim)) petroMagLim = petroMagLimDefault; 171 195 if (!isfinite (extFitMagLim)) extFitMagLim = extFitMagLimDefault; 172 196 … … 185 209 psAssert (status, "missing FPA.ZP?"); 186 210 211 petroFluxLim = exptime * pow (10.0, 0.4*(zeropt - petroMagLim)); 187 212 extFitFluxLim = exptime * pow (10.0, 0.4*(zeropt - extFitMagLim)); 188 213 } … … 225 250 psSphere ptGal, ptSky; 226 251 GetGalacticCoords (&ptGal, &ptSky, toGal, chip, source->peak->xf, source->peak->yf); 227 if (fabs(ptGal.d) < GAL_LIMIT) continue; 252 float b = ptGal.r; 253 float limit = GAL_LIMIT + GAL_LIMIT_BULGE * exp(-0.5*(b*b/GAL_LIMIT_SIGMA2)); 254 if (fabs(ptGal.d) < limit) continue; 228 255 // include an exception for low density skycells below the limit? 229 256 } 230 257 231 258 // for petro and extFit, we will either use the mag limits or the S/N 259 if (doPetrosian) { 260 if (isfinite(petroFluxLim)) { 261 if (source->moments->KronFlux > petroFluxLim) { 262 source->tmpFlags |= PM_SOURCE_TMPF_PETRO; 263 } 264 } else if (source->moments->KronFlux > SN_LIM * source->moments->KronFluxErr) { 265 source->tmpFlags |= PM_SOURCE_TMPF_PETRO; 266 } 267 } 232 268 if (isfinite(extFitFluxLim)) { 233 269 if (source->moments->KronFlux > extFitFluxLim) { 234 270 source->tmpFlags |= PM_SOURCE_TMPF_EXT_FIT; 235 if (doPetrosian) source->tmpFlags |= PM_SOURCE_TMPF_PETRO;236 271 } 237 272 } else { 238 273 if (source->moments->KronFlux > SN_LIM * source->moments->KronFluxErr) { 239 274 source->tmpFlags |= PM_SOURCE_TMPF_EXT_FIT; 240 if (doPetrosian) source->tmpFlags |= PM_SOURCE_TMPF_PETRO;241 275 } 242 276 } … … 244 278 245 279 psLogMsg ("psphot.options", PS_LOG_WARN, "choose analysis options for %ld sources: %f sec\n", sources->n, psTimerMark ("psphot.options")); 280 281 psFree(toGal); 246 282 247 283 return true; … … 287 323 psSphereRot *toGal = NULL; 288 324 float GAL_LIMIT = 0.0; 325 float GAL_LIMIT_BULGE = 0.0; 326 float GAL_LIMIT_SIGMA2 = 0.0; 289 327 bool useGAL_LIMIT = psMetadataLookupBool(&status, recipe, "EXT.FIT.MIN.GAL.LIMIT.USE"); 290 328 assert (status); 291 329 if (useGAL_LIMIT) { 330 toGal = psSphereRotICRSToGalactic(); 292 331 GAL_LIMIT = psMetadataLookupF32(&status, recipe, "EXT.FIT.MIN.GAL.LIMIT"); 293 toGal = psSphereRotICRSToGalactic(); 332 assert (status); 333 GAL_LIMIT = DEG_TO_RAD(GAL_LIMIT); 334 GAL_LIMIT_BULGE = psMetadataLookupF32(&status, recipe, "EXT.FIT.MIN.GAL.LIMIT.BULGE"); 335 assert (status); 336 GAL_LIMIT_BULGE = DEG_TO_RAD(GAL_LIMIT_BULGE); 337 float GAL_LIMIT_SIGMA = psMetadataLookupF32(&status, recipe, "EXT.FIT.MIN.GAL.LIMIT.BULGE.SIGMA"); 338 assert (status); 339 assert(GAL_LIMIT_SIGMA > 0); 340 GAL_LIMIT_SIGMA = DEG_TO_RAD(GAL_LIMIT_SIGMA); 341 GAL_LIMIT_SIGMA2 = GAL_LIMIT_SIGMA * GAL_LIMIT_SIGMA; 294 342 } 295 343 … … 365 413 // find extFitFluxLim->data.F32[i] for i == image number 366 414 psVector *extFitFluxLim = NULL; 415 psVector *petroFluxLim = NULL; 367 416 if (magLimits) { 368 417 extFitFluxLim = psVectorAlloc (inputFilters->n, PS_TYPE_F32); 418 petroFluxLim = psVectorAlloc (inputFilters->n, PS_TYPE_F32); 369 419 psVectorInit (extFitFluxLim, NAN); 420 psVectorInit (petroFluxLim, NAN); 370 421 371 422 float extFitMagLimDefault = NAN; 423 float petroMagLimDefault = NAN; 372 424 373 425 // match mag limits (flux limits) to the filters … … 383 435 // save the default value to assign to unset filters 384 436 if (!strcasecmp (thisFilter, "any")) { 385 psString magString = psMetadataLookupStr (&status, item->data.md, "MAG.LIMIT ");386 psAssert(magString, "missing MAG.LIMIT ");437 psString magString = psMetadataLookupStr (&status, item->data.md, "MAG.LIMIT.EXTFIT"); 438 psAssert(magString, "missing MAG.LIMIT.EXTFIT"); 387 439 extFitMagLimDefault = atof (magString); 440 441 magString = psMetadataLookupStr (&status, item->data.md, "MAG.LIMIT.PETRO"); 442 psAssert(magString, "missing MAG.LIMIT.PETRO"); 443 petroMagLimDefault = atof (magString); 388 444 continue; 389 445 } … … 393 449 if (i == chisqNum) continue; 394 450 if (!strcasecmp (thisFilter, inputFilters->data[i])) { 395 psString magString = psMetadataLookupStr (&status, item->data.md, "MAG.LIMIT ");396 psAssert(magString, "missing MAG.LIMIT ");451 psString magString = psMetadataLookupStr (&status, item->data.md, "MAG.LIMIT.PETRO"); 452 psAssert(magString, "missing MAG.LIMIT.PETRO"); 397 453 float magvalue = atof (magString); 454 petroFluxLim->data.F32[i] = exptime->data.F32[i] * pow (10.0, 0.4*(zeropt->data.F32[i] - magvalue)); 455 456 magString = psMetadataLookupStr (&status, item->data.md, "MAG.LIMIT.EXTFIT"); 457 psAssert(magString, "missing MAG.LIMIT.EXTFIT"); 458 magvalue = atof (magString); 398 459 extFitFluxLim->data.F32[i] = exptime->data.F32[i] * pow (10.0, 0.4*(zeropt->data.F32[i] - magvalue)); 399 460 break; … … 401 462 } 402 463 } 464 psFree(iter); 403 465 404 466 for (int i = 0; i < num; i++) { 405 467 if (i == chisqNum) continue; 406 if (isfinite(extFitFluxLim->data.F32[i])) continue; 407 extFitFluxLim->data.F32[i] = exptime->data.F32[i] * pow (10.0, 0.4*(zeropt->data.F32[i] - extFitMagLimDefault)); 468 if (!isfinite(petroFluxLim->data.F32[i])) { 469 petroFluxLim->data.F32[i] = exptime->data.F32[i] * pow (10.0, 0.4*(zeropt->data.F32[i] - petroMagLimDefault)); 470 } 471 if (!isfinite(extFitFluxLim->data.F32[i])) { 472 extFitFluxLim->data.F32[i] = exptime->data.F32[i] * pow (10.0, 0.4*(zeropt->data.F32[i] - extFitMagLimDefault)); 473 } 408 474 } 409 475 } … … 420 486 bool doObjectRadial = false; 421 487 bool doObjectExtFit = false; 422 for (int j = 0; !doObjectExtFit && !doObjectRadial && (j < object->sources->n); j++) { 488 bool doObjectPetrosian = false; 489 for (int j = 0; !doObjectExtFit && !doObjectRadial && !doObjectPetrosian && (j < object->sources->n); j++) { 423 490 424 491 pmSource *source = object->sources->data[j]; … … 451 518 if (extFitAll) { 452 519 doObjectExtFit = true; 520 doObjectPetrosian = doPetrosian; 453 521 continue; 454 522 } … … 465 533 psSphere ptGal, ptSky; 466 534 GetGalacticCoords (&ptGal, &ptSky, toGal, chips->data[imageID], source->peak->xf, source->peak->yf); 467 if (fabs(ptGal.d) < GAL_LIMIT) continue; 468 // include an exception for low density skycells below the limit? 469 } 470 471 float fluxLim = extFitFluxLim ? extFitFluxLim->data.F32[imageID] : NAN; 535 float b = ptGal.r; 536 float limit = GAL_LIMIT + GAL_LIMIT_BULGE * exp(-0.5*(b*b/GAL_LIMIT_SIGMA2)); 537 if (fabs(ptGal.d) < limit) continue; 538 } 539 540 float fluxLim = NAN; 541 // for petro and extFit, we will either use the mag limits or the S/N 542 if (doPetrosian) { 543 fluxLim = petroFluxLim ? petroFluxLim->data.F32[imageID] : NAN; 544 if (isfinite(fluxLim)) { 545 if (source->moments->KronFlux > extFitFluxLim->data.F32[imageID]) { 546 doObjectPetrosian = true; 547 } 548 } else { 549 if (source->moments->KronFlux > SN_LIM * source->moments->KronFluxErr) { 550 doObjectPetrosian = true; 551 } 552 } 553 } 554 fluxLim = extFitFluxLim ? extFitFluxLim->data.F32[imageID] : NAN; 472 555 // for petro and extFit, we will either use the mag limits or the S/N 473 556 if (isfinite(fluxLim)) { … … 503 586 if (source->modelPSF == NULL) continue; 504 587 505 // Do the fits if the recipe requests we do extended source fits to everything506 588 if (doObjectExtFit) { 507 589 source->tmpFlags |= PM_SOURCE_TMPF_EXT_FIT; 508 if (doPetrosian) source->tmpFlags |= PM_SOURCE_TMPF_PETRO; 509 } 590 } 591 if (doObjectPetrosian) { 592 source->tmpFlags |= PM_SOURCE_TMPF_PETRO; 593 } 510 594 511 595 // Do the fits if the recipe requests we do extended source fits to everything … … 522 606 psLogMsg ("psphot.options", PS_LOG_WARN, "choose analysis options for %ld objects: %f sec\n", objects->n, psTimerMark ("psphot.options")); 523 607 608 psFree(toGal); 609 524 610 return true; 525 611 } 526 612 527 bool GetGalacticCoords (psSphere *ptGal, psSphere *ptSky, psSphereRot *toGal, pmChip *chip, float xPos, float yPos) {613 static bool GetGalacticCoords (psSphere *ptGal, psSphere *ptSky, psSphereRot *toGal, pmChip *chip, float xPos, float yPos) { 528 614 529 615 pmFPA *fpa = chip->parent; … … 543 629 psSphereRotApply (ptGal, toGal, ptSky); 544 630 631 // psSphereRotApply insures that 0 < r < 2PI. We want -PI < b <= PI 632 if (ptGal->r > M_PI) { 633 ptGal->r -= 2.0 * M_PI; 634 } 635 545 636 return true; 546 637 -
trunk/psphot/src/psphotGalaxyShape.c
r36375 r36441 283 283 } 284 284 285 #ifdef SAVE_BEST_MODEL 286 // Save model with smallest chisq 285 287 if (isfinite(chisqBest)) { 288 #else 289 // Save model with nominal parameters 290 { 291 fRmajorBest = 1; 292 fRminorBest = 1; 293 #endif 286 294 // now save the best fitting model as the source's extended model 287 295 psEllipseAxes testAxes = guessAxes; … … 293 301 psphotGalaxyShapeSource (pcm, source, maskVal, psfSize, false); 294 302 303 // Replace modelEXT with this model 304 // XXX: only do this if the model is good 295 305 psFree (source->modelEXT); 296 306 … … 299 309 source->mode |= PM_SOURCE_MODE_EXTMODEL; 300 310 source->mode |= PM_SOURCE_MODE_NONLINEAR_FIT; 301 302 // adjust the window so the subtraction covers the faint wings303 // psphotSetRadiusMoments(&fitRadius, &windowRadius, readout, source, markVal);304 311 305 312 // cache the model flux -
trunk/psphot/src/psphotStackImageLoop.c
- Property svn:mergeinfo changed
/branches/bills_branches/bills_201312/psphot/src/psphotStackImageLoop.c (added) merged: 36437
- Property svn:mergeinfo changed
-
trunk/pstamp/scripts
- Property svn:mergeinfo changed (with no actual effect on merging)
-
trunk/psvideophot
- Property svn:mergeinfo changed (with no actual effect on merging)
Note:
See TracChangeset
for help on using the changeset viewer.
