Changeset 36480 for branches/eam_branches/ipp-20131211
- Timestamp:
- Feb 6, 2014, 11:48:53 AM (12 years ago)
- Location:
- branches/eam_branches/ipp-20131211
- Files:
-
- 91 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 trunk/dbconfig/ff.md )
-
dbconfig/ipp.m4 (modified) (1 diff)
-
ippMonitor (modified) (1 prop)
-
ippMonitor/czartool/czartool/Gpc1Db.pm (modified) (6 diffs)
-
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/dist_bundle.pl (modified) (6 diffs)
-
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 trunk/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/queuestaticsky.pl (modified) (2 diffs)
-
ippScripts/scripts/stack_skycell.pl (modified) (4 diffs)
-
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 trunk/ippTasks/fullforce.pro )
-
ippTasks/pstamp.pro (modified) (2 diffs)
-
ippTasks/rawcheck.pro (modified) (1 diff)
-
ippToPsps (modified) (1 prop)
-
ippToPsps/jython/dvo.py (modified) (2 diffs)
-
ippToPsps/jython/gpc1db.py (modified) (2 diffs)
-
ippToPsps/jython/queue.py (modified) (1 diff)
-
ippToPsps/jython/stackbatch.py (modified) (2 diffs)
-
ippTools/share (modified) (1 prop)
-
ippTools/share/Makefile.am (modified) (1 diff)
-
ippTools/share/camtool_find_pendingimfile.sql (modified) (1 prop)
-
ippTools/share/chiptool_pendingcleanuprun.sql (modified) (1 diff)
-
ippTools/share/chiptool_setimfiletoupdate.sql (modified) (1 prop)
-
ippTools/share/fftool_definebyquery.sql (copied) (copied from trunk/ippTools/share/fftool_definebyquery.sql )
-
ippTools/share/fftool_definebyquery_select_warps.sql (copied) (copied from trunk/ippTools/share/fftool_definebyquery_select_warps.sql )
-
ippTools/share/fftool_result.sql (copied) (copied from trunk/ippTools/share/fftool_result.sql )
-
ippTools/share/fftool_revert.sql (copied) (copied from trunk/ippTools/share/fftool_revert.sql )
-
ippTools/share/fftool_revertsummary.sql (copied) (copied from trunk/ippTools/share/fftool_revertsummary.sql )
-
ippTools/share/fftool_summary.sql (copied) (copied from trunk/ippTools/share/fftool_summary.sql )
-
ippTools/share/fftool_summaryinputs.sql (copied) (copied from trunk/ippTools/share/fftool_summaryinputs.sql )
-
ippTools/share/fftool_toadvance.sql (copied) (copied from trunk/ippTools/share/fftool_toadvance.sql )
-
ippTools/share/fftool_todo.sql (copied) (copied from trunk/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/chiptool.c (modified) (2 diffs)
-
ippTools/src/fftool.c (copied) (copied from trunk/ippTools/src/fftool.c )
-
ippTools/src/fftool.h (copied) (copied from trunk/ippTools/src/fftool.h )
-
ippTools/src/fftoolConfig.c (copied) (copied from trunk/ippTools/src/fftoolConfig.c )
-
ippTools/src/magictool.c (modified) (1 prop)
-
ippconfig (modified) (1 prop)
-
ippconfig/gpc1 (modified) (1 prop)
-
ippconfig/gpc1/psastro.config (modified) (1 diff)
-
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) (7 diffs)
-
ippconfig/recipes/reductionClasses.mdc (modified) (1 diff, 1 prop)
-
ppImage/src (modified) (1 prop)
-
ppSub/src/ppSubMatchPSFs.c (modified) (1 diff)
-
psLib/src/math/psMixtureModels.c (modified) (4 diffs, 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 trunk/psphot/src/psphotFullForceSummary.c )
-
psphot/src/psphotFullForceSummaryReadout.c (copied) (copied from trunk/psphot/src/psphotFullForceSummaryReadout.c )
-
psphot/src/psphotGalaxyShape.c (modified) (3 diffs)
-
psphot/src/psphotStackImageLoop.c (modified) (1 prop)
-
pstamp/scripts (modified) (1 prop)
-
pstamp/scripts/dqueryparse.pl (modified) (1 diff)
-
pstamp/scripts/pstamp_checkdependent.pl (modified) (4 diffs)
-
psvideophot (modified) (1 prop)
-
tools/mysql-dump/gpc1_install.sh (modified) (1 diff)
-
tools/neb_rawOTA_host_scan.pl (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20131211
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20131211/Nebulous
- Property svn:mergeinfo changed
/trunk/Nebulous (added) merged: 36441,36455
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20131211/Nebulous-Server
- Property svn:mergeinfo changed
/trunk/Nebulous-Server (added) merged: 36441,36455
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20131211/Ohana
- Property svn:mergeinfo changed
/branches/bills_branches/bills_201312/Ohana (added) merged: 36439 /trunk/Ohana (added) merged: 36441,36455
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20131211/Ohana/src/dvomerge
- Property svn:mergeinfo changed
/trunk/Ohana/src/dvomerge (added) merged: 36441,36455
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20131211/Ohana/src/libohana/src
- Property svn:mergeinfo changed
/branches/bills_branches/bills_201312/Ohana/src/libohana/src (added) merged: 36439 /trunk/Ohana/src/libohana/src merged: 36441,36455
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20131211/Ohana/src/opihi
- Property svn:mergeinfo changed
/trunk/Ohana/src/opihi (added) merged: 36441,36455
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20131211/Ohana/src/opihi/cmd.astro
- Property svn:mergeinfo changed
/trunk/Ohana/src/opihi/cmd.astro (added) merged: 36441,36455
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20131211/Ohana/src/opihi/cmd.data
- Property svn:mergeinfo changed
/trunk/Ohana/src/opihi/cmd.data (added) merged: 36441,36455
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20131211/Ohana/src/relastro/src
- Property svn:mergeinfo changed
/trunk/Ohana/src/relastro/src (added) merged: 36441,36455
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20131211/dbconfig/cam.md
- Property svn:mergeinfo changed
/trunk/dbconfig/cam.md (added) merged: 36441,36455
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20131211/dbconfig/changes.txt
- Property svn:mergeinfo changed
/branches/bills_branches/bills_201312/dbconfig/changes.txt (added) merged: 36396,36417 /trunk/dbconfig/changes.txt (added) merged: 36441,36455
r36374 r36480 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
-
branches/eam_branches/ipp-20131211/dbconfig/ipp.m4
r34911 r36480 40 40 include(skycell.md) 41 41 include(release.md) 42 include(ff.md) -
branches/eam_branches/ipp-20131211/ippMonitor
- Property svn:mergeinfo changed
/trunk/ippMonitor (added) merged: 36441,36455,36477-36478
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20131211/ippMonitor/czartool/czartool/Gpc1Db.pm
r33814 r36480 139 139 my $stateCol = $table.".state"; 140 140 141 my $extraState = ""; 142 if ($state eq 'new') { 143 $extraState = " OR $stateCol = 'update' "; 144 } 145 141 146 my $query = $self->{_db}->prepare(<<SQL); 142 147 SELECT COUNT(DISTINCT $id) … … 144 149 JOIN $joinTable USING ($id) 145 150 WHERE label LIKE '$label' 146 AND ( ($faultCol != 0 AND $stateCol = '$state') OR $stateCol = 'failed_revert')151 AND ($faultCol != 0 AND ($stateCol = '$state' $extraState)) 147 152 SQL 148 153 $query->execute; … … 208 213 my $query = undef; 209 214 215 my $joinTable = undef; 216 my $id = undef; 217 if (!getJoinTableAndId($self, $stage, \$joinTable, \$id)) {return -1;} 218 219 # XXX: the "update" page is now obsolete. The standard processing page should now show 220 # counts in new and update state 210 221 if ($state eq "update") { 211 212 222 if ($stage eq "dist") {return 0;} 213 my $joinTable = undef;214 my $id = undef;215 if (!getJoinTableAndId($self, $stage, \$joinTable, \$id)) {return -1;}216 223 217 224 if ($stage eq "chip" || $stage eq "fake" || $stage eq "warp" || $stage eq "diff" || $stage eq "magicDS") { … … 226 233 } 227 234 else { 228 229 235 $query = $self->{_db}->prepare(<<SQL); 230 236 SELECT COUNT(state) 231 FROM $table JOIN $joinTable 232 USING($id) 237 FROM $table 233 238 WHERE label LIKE '$label' 234 239 AND state = 'update'; 235 240 SQL 241 236 242 } 237 243 … … 240 246 elsif ($state eq "new") { 241 247 242 $query = $self->{_db}->prepare(<<SQL); 243 SELECT COUNT(state) 244 FROM $table 245 WHERE label LIKE '$label' 246 AND (state = 'new' OR state = 'update') 247 SQL 248 if ($stage eq "chip" || $stage eq "fake" || $stage eq "warp" || $stage eq "diff" || $stage eq "magicDS") { 249 # get count of runs in new state and update state that have components left to update 250 $query = $self->{_db}->prepare(<<SQL); 251 SELECT COUNT(DISTINCT $id) 252 FROM $table LEFT JOIN $joinTable 253 USING($id) 254 WHERE label LIKE '$label' 255 AND (state = 'new' OR (state = 'update' AND data_state = 'update')) 256 SQL 257 } else { 258 $query = $self->{_db}->prepare(<<SQL); 259 SELECT COUNT(state) 260 FROM $table 261 WHERE label LIKE '$label' 262 AND (state = 'new' OR state = 'update'); 263 SQL 264 } 248 265 } 249 266 else { … … 256 273 SQL 257 274 } 275 276 # print $query->{Statement} . "\n"; 258 277 259 278 $query->execute; -
branches/eam_branches/ipp-20131211/ippScripts/Build.PL
r36374 r36480 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', -
branches/eam_branches/ipp-20131211/ippScripts/scripts/chip_imfile.pl
- Property svn:mergeinfo changed
/trunk/ippScripts/scripts/chip_imfile.pl (added) merged: 36441,36455
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20131211/ippScripts/scripts/destreak_restore_camera.pl
- Property svn:mergeinfo changed
/trunk/ippScripts/scripts/destreak_restore_camera.pl (added) merged: 36441,36455
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20131211/ippScripts/scripts/dist_bundle.pl
r36223 r36480 50 50 'PPSUB.INVERSE.MASK' => 'inv_mask', 51 51 'PPSUB.INVERSE.VARIANCE' => 'inv_variance' ); 52 my %stack_cleaned = ( 'PPSTACK.OUTPUT' => 'image', 52 53 my %stack_cleaned = ( 'PPSTACK.UNCONV' => 'image', 54 'PPSTACK.UNCONV.MASK' => 'mask', 55 'PPSTACK.UNCONV.VARIANCE' => 'variance', 56 'PPSTACK.UNCONV.EXP' => 'exp', 57 'PPSTACK.UNCONV.EXPNUM' => 'expnum', 58 'PPSTACK.UNCONV.EXPWT' => 'expwt' 59 ); 60 61 my %stack_convolved = ( 'PPSTACK.OUTPUT' => 'image', 53 62 'PPSTACK.OUTPUT.MASK' => 'mask', 54 'PPSTACK.OUTPUT.VARIANCE' => 'variance' ); 63 'PPSTACK.OUTPUT.VARIANCE' => 'variance', 64 'PPSTACK.OUTPUT.EXP' => 'exp', 65 'PPSTACK.OUTPUT.EXPNUM' => 'expnum', 66 'PPSTACK.OUTPUT.EXPWT' => 'expwt' 67 ); 55 68 my %empty_cleaned = (); 69 56 70 57 71 … … 136 150 if (($stage ne 'raw') and ($stage ne 'fake') and ($stage ne 'stack_summary') and !$poor_quality) { 137 151 # If the file list is empty it is an error because we should at least get a config dump file 138 # except for fake stage which doesn't do anything yet 152 # except for fake stage which doesn't do anything yet, stack_summary stage, and of course raw files have 153 # no config dump because they aren't processed 139 154 &my_die("empty file list", $component, $PS_EXIT_CONFIG_ERROR) if (!scalar @$file_list); 140 155 } … … 165 180 my $image_type = get_image_type($stage, $file_rule); 166 181 182 # skip useless empty trace files 183 next if ($file_rule =~ /TRACE/); 184 167 185 # if this is an image and we are building a clean bundle or if quality is bad skip this rule 168 186 next if $image_type and ($clean or $poor_quality); 187 188 if ($stage eq 'stack') { 189 # skip convolved stacks since they are deleted just after they are created now 190 next if $stack_convolved{$file_rule}; 191 } 169 192 170 193 # if magic is required, don't ship jpegs or binned fits images … … 180 203 181 204 my $file_name = $file->{name}; 182 my $base = basename($file_name);183 205 my $path = $ipprc->file_resolve($file_name); 206 207 if (!$path and $file_rule =~ /LOG/) { 208 my $compressed_file_name = $file_name . '.bz2'; 209 my $compressed_path = $ipprc->file_resolve($compressed_file_name); 210 if ($compressed_path) { 211 $path = $compressed_path; 212 $file_name = $compressed_file_name; 213 } 214 } 215 184 216 185 217 if (!$path) { … … 194 226 # XXX: perhaps only do this for stages where we know that this happens 195 227 next if $file_rule =~ /STATS/; 196 # don't fail on these "non-essential files" 228 # don't fail if these "non-essential files" are missing 229 next if $file_rule =~ /LOG/; 197 230 next if $file_rule =~ /TRACE/; 198 next if $file_rule =~ /LOG/;199 231 next if $file_rule =~ /BIN/; 200 232 … … 236 268 # create a symbolic link from the file in the nebulous repository 237 269 # in the temporary directory 238 symlink $path, "$tmpdir/ $base";270 symlink $path, "$tmpdir/" . basename($file_name); 239 271 } 240 272 } -
branches/eam_branches/ipp-20131211/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 /trunk/ippScripts/scripts/ipp_apply_burntool_single.pl merged: 36441,36455
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20131211/ippScripts/scripts/lap_science.pl
- Property svn:mergeinfo changed
/trunk/ippScripts/scripts/lap_science.pl (added) merged: 36441,36455
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20131211/ippScripts/scripts/magic_destreak.pl
- Property svn:mergeinfo changed
/trunk/ippScripts/scripts/magic_destreak.pl (added) merged: 36441,36455
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20131211/ippScripts/scripts/psphot_fullforce_warp.pl
r36374 r36480 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; -
branches/eam_branches/ipp-20131211/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: 36441,36455
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20131211/ippScripts/scripts/queuestaticsky.pl
r35329 r36480 33 33 }; 34 34 35 # don't update the database if we are pretending 36 $no_update = 1 if $pretend; 35 37 36 38 my $missing_tools; … … 113 115 } 114 116 } 117 last if $pretend; # only do the first (full) set if we are in pretend mode 115 118 } 116 119 { -
branches/eam_branches/ipp-20131211/ippScripts/scripts/stack_skycell.pl
r35950 r36480 40 40 } 41 41 42 my ($stack_id, $dbname, $outroot, $debug, $run_state, $threads, $reduction, $verbose, $no_update, $no_op, $redirect, $save_temps );42 my ($stack_id, $dbname, $outroot, $debug, $run_state, $threads, $reduction, $verbose, $no_update, $no_op, $redirect, $save_temps, $delete_convolved_images); 43 43 GetOptions( 44 44 'stack_id|d=s' => \$stack_id, # Stack identifier … … 55 55 'redirect-output' => \$redirect, 56 56 'save-temps' => \$save_temps, # Save temporary files? 57 'delete-convolved' => \$delete_convolved_images, 57 58 ) or pod2usage( 2 ); 58 59 … … 92 93 ); 93 94 95 94 96 my $ipprc = PS::IPP::Config->new() or my_die( "Unable to set up", $stack_id, $PS_EXIT_CONFIG_ERROR ); # IPP configuration 95 97 $| = 1; … … 360 362 361 363 if (!$quality) { 364 365 362 366 check_outputs(\@outputFiles, $replicate_outputs); 367 368 if (($convolve)&&($delete_convolved_images)) { # We made convolved products, but do not wish to keep them anymore 369 my @products_to_clear = ('PPSTACK.OUTPUT', 370 'PPSTACK.OUTPUT.MASK', 371 'PPSTACK.OUTPUT.VARIANCE', 372 'PPSTACK.OUTPUT.EXP', 373 'PPSTACK.OUTPUT.EXPNUM', 374 'PPSTACK.OUTPUT.EXPWT'); 375 foreach my $product (@products_to_clear) { 376 my $file = $ipprc->filename($product,$outroot,$skycell_id); 377 print "Deleting unwanted convolved product: $file\n"; 378 my $error= $ipprc->kill_file($file); 379 if ($error_code) { 380 print "Failed to delete unwanted convolved product: $error_code\n"; 381 } 382 } 383 } 384 363 385 } 364 386 -
branches/eam_branches/ipp-20131211/ippScripts/scripts/staticsky.pl
r34852 r36480 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"; -
branches/eam_branches/ipp-20131211/ippScripts/scripts/warp_skycell.pl
- Property svn:mergeinfo changed
/trunk/ippScripts/scripts/warp_skycell.pl (added) merged: 36441,36455
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20131211/ippTasks
- Property svn:mergeinfo changed
/branches/bills_branches/bills_201312/ippTasks (added) merged: 36388,36417-36418,36437 /tags/ipp-20140114/ippTasks (added) merged: 36450 /trunk/ippTasks (added) merged: 36413,36441,36452,36455,36476
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20131211/ippTasks/Makefile.am
r36372 r36480 46 46 diffphot.pro \ 47 47 lap.pro \ 48 lapgroup.pro \ 48 49 vp.pro \ 49 bg.regeneration.pro 50 bg.regeneration.pro \ 51 fullforce.pro 50 52 51 53 other_files = \ -
branches/eam_branches/ipp-20131211/ippTasks/pstamp.pro
r35462 r36480 825 825 book getword pstampDependent $pageName imagedb -var IMAGEDB 826 826 book getword pstampDependent $pageName rlabel -var RLABEL 827 book getword pstampDependent $pageName label -var LABEL 827 828 book getword pstampDependent $pageName outdir -var OUTDIR 828 829 book getword pstampDependent $pageName need_magic -var NEED_MAGIC … … 846 847 stderr $MYLOGFILE 847 848 848 $run = pstamp_checkdependent.pl --dep_id $DEP_ID --stage_id $STAGE_ID --stage $STAGE --component $COMPONENT --imagedb $IMAGEDB --rlabel $RLABEL $NEED_MAGIC --fault_count $FAULT_COUNT --max_fault_count $PSTAMP_MAX_FAULT_COUNT --logfile $MYLOGFILE849 $run = pstamp_checkdependent.pl --dep_id $DEP_ID --stage_id $STAGE_ID --stage $STAGE --component $COMPONENT --imagedb $IMAGEDB --rlabel $RLABEL --label $LABEL $NEED_MAGIC --fault_count $FAULT_COUNT --max_fault_count $PSTAMP_MAX_FAULT_COUNT --logfile $MYLOGFILE 849 850 850 851 add_standard_args run -
branches/eam_branches/ipp-20131211/ippTasks/rawcheck.pro
r36372 r36480 75 75 task.exec 76 76 book npages rawcheckPending -var N 77 if ($N > 200 0)77 if ($N > 200) 78 78 process_cleanup rawcheckPending 79 79 break -
branches/eam_branches/ipp-20131211/ippToPsps
- Property svn:mergeinfo changed
/trunk/ippToPsps (added) merged: 36441,36447,36455
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20131211/ippToPsps/jython/dvo.py
r36201 r36480 65 65 if not self.correctDvo: 66 66 print "*******************************************************************************" 67 self.logger.warning("switching to a new dvo: " + self.skychunk.dvoLocation)67 self.logger.warning("switching to a new dvo: '" + self.skychunk.dvoLocation + "'") 68 68 # response = raw_input("(y/n) ") 69 69 # if response == "y": … … 669 669 cmd += " -time-start " + time_start 670 670 cmd += " -time-end " + time_end 671 671 672 useP2 = 0 673 useST = 0 674 675 for batchType in self.skychunk.batchTypes: 676 self.logger.infoPair("batchType", batchType) 677 if batchType == "ST": 678 useST = 1 679 if batchType == "P2": 680 useP2 = 1 681 682 if (useP2 ==0 and useST ==1): 683 #grab only stacks 684 cmd += " -photcode-start 11000 -photcode-end 11500" 685 686 if (useP2 ==1 and useST==0): 687 #grabd only P2s 688 cmd += " -photcode-start 10000 -photcode-end 10577" 689 690 672 691 self.logger.infoPair("Running dvopsps", cmd) 673 692 p = Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE) -
branches/eam_branches/ipp-20131211/ippToPsps/jython/gpc1db.py
r36201 r36480 93 93 JOIN mergedvodbRun USING(minidvodb_id) \ 94 94 JOIN mergedvodbProcessed USING (merge_id) \ 95 JOIN stackRun USING(stack_id) JOIN skycell USING(skycell_id) \ 95 JOIN stackRun USING(stack_id) \ 96 JOIN stackSumSkyfile using (stack_id) \ 97 JOIN skycell USING(skycell_id) \ 96 98 WHERE mergedvodbRun.mergedvodb = '" + dvoDb + "' \ 97 99 AND minidvodbRun.state = 'merged' \ … … 102 104 AND addRun.state = 'full' \ 103 105 AND decdeg BETWEEN " + str(minDec) + " AND " + str(maxDec) + " \ 104 AND radeg BETWEEN " + str(minRA) + " AND " + str(maxRA) 105 106 AND radeg BETWEEN " + str(minRA) + " AND " + str(maxRA) + " \ 107 AND mjd_obs >= (to_days('" + tstart + "')-678941) \ 108 AND mjd_obs <= (to_days('" + tend + "') - 678941) " 109 self.logger.infoPair("sql",sql) 106 110 try: 107 111 # XXX EAM : test output -
branches/eam_branches/ipp-20131211/ippToPsps/jython/queue.py
r36202 r36480 45 45 46 46 try: 47 print "why doesn't this work" 47 48 self.dvoObjects = DvoObjects(self.logger, self.config, self.skychunk, self.ippToPspsDb, self.scratchDb) 48 49 except: -
branches/eam_branches/ipp-20131211/ippToPsps/jython/stackbatch.py
r36190 r36480 303 303 modelLong = model; 304 304 305 #does it have the EXT_COVAR in there? 306 307 sql = "DESCRIBE SkyChip_xfit 'EXT_COVAR_%'" 308 rs = self.scratchDb.executeQuery(sql) 309 rs.first() 310 hasResult = rs.next() 311 if hasResult: 312 print "EXT_COVARs exist" 313 else: 314 print "No EXT_COVARS here" 315 316 ext_covar_sql = "" 317 318 if (hasResult): 319 ext_covar_sql = ", "+modelLong+"Covar11=b.EXT_COVAR_00_00, \ 320 "+modelLong+"Covar12=b.EXT_COVAR_00_01, \ 321 "+modelLong+"Covar13=b.EXT_COVAR_00_02, \ 322 "+modelLong+"Covar14=b.EXT_COVAR_00_03, \ 323 "+modelLong+"Covar15=b.EXT_COVAR_00_04, \ 324 "+modelLong+"Covar16=b.EXT_COVAR_00_05, \ 325 "+modelLong+"Covar17=b.EXT_COVAR_00_06, \ 326 "+modelLong+"Covar22=b.EXT_COVAR_01_01, \ 327 "+modelLong+"Covar23=b.EXT_COVAR_01_02, \ 328 "+modelLong+"Covar24=b.EXT_COVAR_01_03, \ 329 "+modelLong+"Covar25=b.EXT_COVAR_01_04, \ 330 "+modelLong+"Covar26=b.EXT_COVAR_01_05, \ 331 "+modelLong+"Covar27=b.EXT_COVAR_01_06, \ 332 "+modelLong+"Covar33=b.EXT_COVAR_02_02, \ 333 "+modelLong+"Covar34=b.EXT_COVAR_02_03, \ 334 "+modelLong+"Covar35=b.EXT_COVAR_02_04, \ 335 "+modelLong+"Covar36=b.EXT_COVAR_02_05, \ 336 "+modelLong+"Covar37=b.EXT_COVAR_02_06, \ 337 "+modelLong+"Covar44=b.EXT_COVAR_03_03, \ 338 "+modelLong+"Covar45=b.EXT_COVAR_03_04, \ 339 "+modelLong+"Covar46=b.EXT_COVAR_03_05, \ 340 "+modelLong+"Covar47=b.EXT_COVAR_03_06, \ 341 "+modelLong+"Covar55=b.EXT_COVAR_04_04, \ 342 "+modelLong+"Covar56=b.EXT_COVAR_04_05, \ 343 "+modelLong+"Covar57=b.EXT_COVAR_04_06, \ 344 "+modelLong+"Covar66=b.EXT_COVAR_05_05, \ 345 "+modelLong+"Covar67=b.EXT_COVAR_05_06, \ 346 "+modelLong+"Covar77=b.EXT_COVAR_06_06" 347 348 349 350 305 351 sql = "UPDATE StackModelFit AS a, SkyChip_xfit AS b SET \ 306 352 "+model+"Radius=b.EXT_WIDTH_MAJ, \ … … 308 354 "+model+"FluxErr=ABS(b.EXT_INST_MAG_SIG) * POW(10, -0.4 * b.EXT_INST_MAG) / " + str(self.expTime) + " / 1.085736, \ 309 355 "+model+"Ab=b.EXT_WIDTH_MAJ/b.EXT_WIDTH_MIN, \ 310 "+model+"Phi=b.EXT_THETA, \ 311 "+modelLong+"Covar11=b.EXT_COVAR_00_00, \ 312 "+modelLong+"Covar12=b.EXT_COVAR_00_01, \ 313 "+modelLong+"Covar13=b.EXT_COVAR_00_02, \ 314 "+modelLong+"Covar14=b.EXT_COVAR_00_03, \ 315 "+modelLong+"Covar15=b.EXT_COVAR_00_04, \ 316 "+modelLong+"Covar16=b.EXT_COVAR_00_05, \ 317 "+modelLong+"Covar17=b.EXT_COVAR_00_06, \ 318 "+modelLong+"Covar22=b.EXT_COVAR_01_01, \ 319 "+modelLong+"Covar23=b.EXT_COVAR_01_02, \ 320 "+modelLong+"Covar24=b.EXT_COVAR_01_03, \ 321 "+modelLong+"Covar25=b.EXT_COVAR_01_04, \ 322 "+modelLong+"Covar26=b.EXT_COVAR_01_05, \ 323 "+modelLong+"Covar27=b.EXT_COVAR_01_06, \ 324 "+modelLong+"Covar33=b.EXT_COVAR_02_02, \ 325 "+modelLong+"Covar34=b.EXT_COVAR_02_03, \ 326 "+modelLong+"Covar35=b.EXT_COVAR_02_04, \ 327 "+modelLong+"Covar36=b.EXT_COVAR_02_05, \ 328 "+modelLong+"Covar37=b.EXT_COVAR_02_06, \ 329 "+modelLong+"Covar44=b.EXT_COVAR_03_03, \ 330 "+modelLong+"Covar45=b.EXT_COVAR_03_04, \ 331 "+modelLong+"Covar46=b.EXT_COVAR_03_05, \ 332 "+modelLong+"Covar47=b.EXT_COVAR_03_06, \ 333 "+modelLong+"Covar55=b.EXT_COVAR_04_04, \ 334 "+modelLong+"Covar56=b.EXT_COVAR_04_05, \ 335 "+modelLong+"Covar57=b.EXT_COVAR_04_06, \ 336 "+modelLong+"Covar66=b.EXT_COVAR_05_05, \ 337 "+modelLong+"Covar67=b.EXT_COVAR_05_06, \ 338 "+modelLong+"Covar77=b.EXT_COVAR_06_06 \ 356 "+model+"Phi=b.EXT_THETA \ 357 "+ext_covar_sql+" \ 339 358 WHERE a.ippDetectID=b.IPP_IDET AND b.MODEL_TYPE = '"+ippModelType+"'" 340 359 360 print sql 341 361 self.scratchDb.execute(sql) 342 362 343 363 # sersic fit has an extra parameter 344 if ippModelType == "PS_MODEL_SERSIC":364 if (ippModelType == "PS_MODEL_SERSIC" and hasResult > 0): 345 365 sql = "UPDATE StackModelFit AS a, SkyChip_xfit AS b SET \ 346 366 "+modelLong+"Covar18=b.EXT_COVAR_00_07, \ -
branches/eam_branches/ipp-20131211/ippTools/share
- Property svn:mergeinfo changed
/branches/bills_branches/bills_201312/ippTools/share (added) merged: 36386,36390,36409,36411,36415-36417,36437 /trunk/ippTools/share (added) merged: 36431,36441,36455
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20131211/ippTools/share/Makefile.am
r36361 r36480 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 -
branches/eam_branches/ipp-20131211/ippTools/share/camtool_find_pendingimfile.sql
- Property svn:mergeinfo changed
/trunk/ippTools/share/camtool_find_pendingimfile.sql (added) merged: 36441,36455
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20131211/ippTools/share/chiptool_pendingcleanuprun.sql
r34766 r36480 4 4 rawExp.exp_tag, 5 5 chipRun.state, 6 chipRun.workdir 6 chipRun.workdir, 7 chipRun.label, 8 IFNULL(Label.priority, 10000) AS priority 7 9 FROM chipRun 8 10 JOIN rawExp 9 11 USING (exp_id) 12 LEFT JOIN Label ON chipRun.label = Label.label 10 13 WHERE 11 14 (chipRun.state = 'goto_cleaned' OR chipRun.state = 'goto_scrubbed' OR chipRun.state = 'goto_purged') -
branches/eam_branches/ipp-20131211/ippTools/share/chiptool_setimfiletoupdate.sql
- Property svn:mergeinfo changed
/trunk/ippTools/share/chiptool_setimfiletoupdate.sql (added) merged: 36441,36455
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20131211/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 /trunk/ippTools/share/pxadmin_create_tables.sql (added) merged: 36441,36455
r36374 r36480 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
-
branches/eam_branches/ipp-20131211/ippTools/share/pxadmin_drop_tables.sql
r35896 r36480 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 -
branches/eam_branches/ipp-20131211/ippTools/share/warptool_towarped.sql
- Property svn:mergeinfo changed
/trunk/ippTools/share/warptool_towarped.sql (added) merged: 36441,36455
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20131211/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 /trunk/ippTools/src (added) merged: 36431,36441,36455
- Property svn:ignore
-
branches/eam_branches/ipp-20131211/ippTools/src/Makefile.am
r34913 r36480 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 -
branches/eam_branches/ipp-20131211/ippTools/src/camtool.c
- Property svn:mergeinfo changed
/trunk/ippTools/src/camtool.c (added) merged: 36441,36455
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20131211/ippTools/src/camtoolConfig.c
- Property svn:mergeinfo changed
/trunk/ippTools/src/camtoolConfig.c (added) merged: 36441,36455
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20131211/ippTools/src/chiptool.c
r35789 r36480 1255 1255 1256 1256 psMetadata *where = psMetadataAlloc(); 1257 pxAddLabelSearchArgs (config, where, "-label", " label", "==");1257 pxAddLabelSearchArgs (config, where, "-label", "chipRun.label", "=="); 1258 1258 1259 1259 psString query = pxDataGet("chiptool_pendingcleanuprun.sql"); … … 1269 1269 } 1270 1270 psFree(where); 1271 1272 psStringAppend(&query, "\nORDER BY priority DESC, chip_id"); 1271 1273 1272 1274 // treat limit == 0 as "no limit" -
branches/eam_branches/ipp-20131211/ippTools/src/magictool.c
- Property svn:mergeinfo changed
/trunk/ippTools/src/magictool.c (added) merged: 36441,36455
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20131211/ippconfig
- Property svn:mergeinfo changed
/branches/bills_branches/bills_201312/ippconfig (added) merged: 36393,36420,36425-36426,36437-36438 /tags/ipp-20140114/ippconfig (added) merged: 36446,36448 /trunk/ippconfig (added) merged: 36403-36404,36441,36454
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20131211/ippconfig/gpc1
- Property svn:mergeinfo changed
/branches/bills_branches/bills_201312/ippconfig/gpc1 (added) merged: 36437 /trunk/ippconfig/gpc1 (added) merged: 36403,36441,36454
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20131211/ippconfig/gpc1/psastro.config
r35723 r36480 380 380 END 381 381 382 POLE_REFCAT METADATA 383 PSASTRO.CATDIR STR SYNTH.GRIZY 384 ZERO.POINT.USE.MEAN BOOL TRUE 385 PSASTRO.GRID.MIN.ANGLE F32 -20 386 PSASTRO.GRID.MAX.ANGLE F32 +20 387 PSASTRO.GRID.DEL.ANGLE F32 0.5 388 PSASTRO.FIELD.PADDING F32 0.5 389 END 390 382 391 TEST_REFCAT METADATA 383 392 PSASTRO.CATDIR STR /data/ipp064.0/ipp/ippRefs/catdir.refcat.20120524.v0 -
branches/eam_branches/ipp-20131211/ippconfig/recipes/filerules-split.mdc
r36375 r36480 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 -
branches/eam_branches/ipp-20131211/ippconfig/recipes/ppSub.config
- Property svn:mergeinfo changed
/branches/bills_branches/bills_201312/ippconfig/recipes/ppSub.config (added) merged: 36437 /trunk/ippconfig/recipes/ppSub.config merged: 36441,36454
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20131211/ippconfig/recipes/psastro.config
r35723 r36480 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. … … 272 273 END 273 274 275 POLE_REFCAT METADATA 276 END 277 274 278 TEST_REFCAT METADATA 275 279 END 276 280 277 281 STATICSKY_CAL METADATA 282 PSASTRO.SAVE.CFF BOOL TRUE # save a cff file (input for psphotFullForce) 278 283 END 279 284 -
branches/eam_branches/ipp-20131211/ippconfig/recipes/psphot.config
r36375 r36480 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 … … 224 233 #QGAUSS_PSF EXTENDED_SOURCE_MODEL PS_MODEL_QGAUSS 20.0 TRUE 225 234 # TRAIL_RAW EXTENDED_SOURCE_MODEL PS_MODEL_TRAIL 10.0 FALSE 226 EXP_PCM EXTENDED_SOURCE_MODEL PS_MODEL_EXP 10.0 TRUE227 DEV_PCM EXTENDED_SOURCE_MODEL PS_MODEL_DEV 10.0 TRUE228 SER_PCM EXTENDED_SOURCE_MODEL PS_MODEL_SERSIC 10.0 TRUE235 EXP_PCM EXTENDED_SOURCE_MODEL PS_MODEL_EXP 0.0 TRUE 236 DEV_PCM EXTENDED_SOURCE_MODEL PS_MODEL_DEV 0.0 TRUE 237 SER_PCM EXTENDED_SOURCE_MODEL PS_MODEL_SERSIC 0.0 TRUE 229 238 END 230 239 … … 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 21.5 420 rband DATA r 25 21.5 421 iband DATA i 25 21.5 422 zband DATA z 25 20.5 423 yband DATA y 25 19.5 424 wband DATA w 25 21.5 425 other DATA any 25 21.5 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 -
branches/eam_branches/ipp-20131211/ippconfig/recipes/reductionClasses.mdc
- Property svn:mergeinfo changed
/branches/bills_branches/bills_201312/ippconfig/recipes/reductionClasses.mdc (added) merged: 36437 /trunk/ippconfig/recipes/reductionClasses.mdc merged: 36404,36441,36454
r36375 r36480 251 251 BACKGROUND_PSWARP STR BACKGROUND 252 252 FULLFORCE_PSPHOT STR FULLFORCE_WARP 253 END 254 255 # basic science analysis 256 POLE_REFCAT METADATA 257 CHIP_PPIMAGE STR CHIP 258 CHIP_PSPHOT STR CHIP 259 JPEG_BIN1 STR PPIMAGE_J1 260 JPEG_BIN2 STR PPIMAGE_J2 261 ADDSTAR STR ADDSTAR 262 PSASTRO STR POLE_REFCAT 253 263 END 254 264 - Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20131211/ppImage/src
- Property svn:mergeinfo changed
/trunk/ppImage/src (added) merged: 36441,36455
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20131211/ppSub/src/ppSubMatchPSFs.c
r35924 r36480 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 -
branches/eam_branches/ipp-20131211/psLib/src/math/psMixtureModels.c
- Property svn:mergeinfo changed
/branches/bills_branches/bills_201312/psLib/src/math/psMixtureModels.c (added) merged: 36437 /trunk/psLib/src/math/psMixtureModels.c (added) merged: 36428-36430,36441,36455
r36375 r36480 120 120 *Ncensored = 0; 121 121 122 int k = 0; 122 123 for (int i = 0; i < in->numRows; i++) { 123 124 int isCensored = 0; … … 130 131 *Ncensored = *Ncensored + 1; 131 132 } 132 offsets->data.S32[i] = *Ncensored; 133 } 133 else { 134 offsets->data.S32[k] = i - k; 135 k++; 136 } 137 // offsets->data.S32[i] = isCensored; 138 } 139 134 140 psImage *out; 135 141 if (*Ncensored == 0) { … … 320 326 } 321 327 } 322 i = modes->data.F32[k]; 323 counts->data.F32[i] += 1.0; 328 if (modes->data.F32[k] != -1) { 329 i = modes->data.F32[k]; 330 counts->data.F32[i] += 1.0; 331 } 324 332 } 325 333 … … 335 343 for (k = 0; k < N; k++) { 336 344 i = modes->data.F32[k]; 337 for (j = 0; j < dim; j++) { 338 means->data.F32[i][j] += D->data.F32[k][j]; 345 if (i != -1) { 346 for (j = 0; j < dim; j++) { 347 means->data.F32[i][j] += D->data.F32[k][j]; 348 } 339 349 } 340 350 } - Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20131211/psModules
- Property svn:mergeinfo changed
/branches/bills_branches/bills_201312/psModules (added) merged: 36389,36412,36422-36424 /trunk/psModules (added) merged: 36441,36455
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20131211/psModules/src/camera/pmFPAfile.c
r36375 r36480 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"); -
branches/eam_branches/ipp-20131211/psModules/src/objects/pmModelClass.c
r34259 r36480 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 } -
branches/eam_branches/ipp-20131211/psModules/src/objects/pmModelClass.h
r29004 r36480 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 /// @} -
branches/eam_branches/ipp-20131211/psModules/src/objects/pmSourceIO.c
r36375 r36480 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 } -
branches/eam_branches/ipp-20131211/psModules/src/objects/pmSourceIO.h
r36375 r36480 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 -
branches/eam_branches/ipp-20131211/psModules/src/objects/pmSourceIO_CFF.c
r36375 r36480 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; -
branches/eam_branches/ipp-20131211/psModules/src/objects/pmSourceIO_CMF.c.in
r36375 r36480 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 } -
branches/eam_branches/ipp-20131211/psModules/src/objects/pmSourceIO_PS1_CAL_0.c
r36375 r36480 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; -
branches/eam_branches/ipp-20131211/psModules/src/objects/pmSourceIO_PS1_DEV_0.c
r36375 r36480 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 } -
branches/eam_branches/ipp-20131211/psModules/src/objects/pmSourceIO_PS1_DEV_1.c
r36375 r36480 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; -
branches/eam_branches/ipp-20131211/psModules/src/objects/pmSourceIO_SMPDATA.c
r36375 r36480 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; -
branches/eam_branches/ipp-20131211/psastro/src/psastroDataSave.c
r33669 r36480 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); -
branches/eam_branches/ipp-20131211/psastro/src/psastroDefineFiles.c
r32964 r36480 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) -
branches/eam_branches/ipp-20131211/psconfig
- Property svn:mergeinfo changed
/trunk/psconfig (added) merged: 36441,36455
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20131211/psphot
- Property svn:mergeinfo changed
/branches/bills_branches/bills_201312/psphot (added) merged: 36406-36407,36410,36420,36437-36438 /tags/ipp-20140114/psphot (added) merged: 36445 /trunk/psphot (added) merged: 36441,36453
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20131211/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 /tags/ipp-20140114/psphot/src (added) merged: 36445 /trunk/psphot/src merged: 36441,36453
- Property svn:ignore
-
branches/eam_branches/ipp-20131211/psphot/src/Makefile.am
r36375 r36480 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 -
branches/eam_branches/ipp-20131211/psphot/src/psmakecff.c
r36375 r36480 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 -
branches/eam_branches/ipp-20131211/psphot/src/psphot.h
r36375 r36480 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); -
branches/eam_branches/ipp-20131211/psphot/src/psphotChooseAnalysisOptions.c
r36375 r36480 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 l = ptGal.r; 253 float b_min = GAL_LIMIT + GAL_LIMIT_BULGE * exp(-0.5*(l*l/GAL_LIMIT_SIGMA2)); 254 if (fabs(ptGal.d) < b_min) 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 l = ptGal.r; 536 float b_min = GAL_LIMIT + GAL_LIMIT_BULGE * exp(-0.5*(l*l/GAL_LIMIT_SIGMA2)); 537 if (fabs(ptGal.d) < b_min) 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 -
branches/eam_branches/ipp-20131211/psphot/src/psphotGalaxyShape.c
r36375 r36480 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 -
branches/eam_branches/ipp-20131211/psphot/src/psphotStackImageLoop.c
- Property svn:mergeinfo changed
/branches/bills_branches/bills_201312/psphot/src/psphotStackImageLoop.c (added) merged: 36437 /trunk/psphot/src/psphotStackImageLoop.c merged: 36441,36453
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20131211/pstamp/scripts
- Property svn:mergeinfo changed
/trunk/pstamp/scripts (added) merged: 36441,36455,36459,36463,36476
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20131211/pstamp/scripts/dqueryparse.pl
r34331 r36480 502 502 $command .= " -need_magic" if $need_magic; 503 503 504 my $rlabel = " dq_ud_" . $label if $label;504 my $rlabel = "ps_ud_" . $label if $label; 505 505 $command .= " -rlabel $rlabel" if $rlabel; 506 506 -
branches/eam_branches/ipp-20131211/pstamp/scripts/pstamp_checkdependent.pl
r36166 r36480 27 27 my $IPP_DIFF_MODE_STACK_STACK = 4; 28 28 29 my ($dep_id, $stage, $stage_id, $component, $imagedb, $ rlabel, $need_magic, $fault_count, $max_fault_count, $logfile);29 my ($dep_id, $stage, $stage_id, $component, $imagedb, $label, $rlabel, $need_magic, $fault_count, $max_fault_count, $logfile); 30 30 my ($dbname, $ps_dbserver, $verbose, $save_temps, $no_update); 31 31 … … 36 36 'component=s' => \$component, 37 37 'imagedb=s' => \$imagedb, # dbname for images lookups. 38 'rlabel=s' => \$rlabel, 38 'label=s' => \$label, # request's label 39 'rlabel=s' => \$rlabel, # pstampDependent.rlabel (deprecated) 39 40 'need_magic' => \$need_magic, 40 41 'fault_count=i' => \$fault_count, … … 73 74 } 74 75 76 if ($label) { 77 # rlabel is deprecated. Use one based on the supplied label parameter which is the current label 78 # for the request, which may be different than the one given to the dependent when the job was parsed. 79 # XXX: having the convention that update label is 'ps_ud_' . $label of request embedded here 80 # (and formerly in pstampparse.pl) is not particularly clean but it's simple. 81 my $new_rlabel = 'ps_ud_' . $label; 82 if ($new_rlabel ne $rlabel) { 83 print "Notice: using $new_rlabel instead of $rlabel for update label.\n"; 84 $rlabel = $new_rlabel; 85 } 86 } 87 88 75 89 if (!$ps_dbserver) { 76 90 $ps_dbserver = metadataLookupStr($ipprc->{_siteConfig}, 'PS_DBSERVER'); … … 559 573 } 560 574 return $warp_status; 575 } elsif ($warp->{quality} != 0) { 576 print STDERR "input warp has quality error\n"; 577 faultComponent('diff', $diff_id, $skycell_id, $PSTAMP_GONE); 578 return $PSTAMP_GONE; 561 579 } 562 580 # warps are ready fall through and queue the diff update -
branches/eam_branches/ipp-20131211/psvideophot
- Property svn:mergeinfo changed
/trunk/psvideophot (added) merged: 36441,36455
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20131211/tools/mysql-dump/gpc1_install.sh
r34112 r36480 62 62 log INFO "Symlinking backup file [$TARGET/$BACKUP_FILE] to distribution [$DISTRIBUTION_TARGET]" 63 63 /usr/bin/ln -f $TARGET/$BACKUP_FILE $DISTRIBUTION_TARGET 64 /usr/bin/ mv-f $TARGET/$MD5FILE $DISTRIBUTION_MD564 /usr/bin/cp -f $TARGET/$MD5FILE $DISTRIBUTION_MD5 65 65 66 66 # if it is between 0 and 4, ingest into gpc1_0 or gpc1_1 -
branches/eam_branches/ipp-20131211/tools/neb_rawOTA_host_scan.pl
r36337 r36480 21 21 ) or die "Unable to connect to database $DBI::errstr\n"; 22 22 23 my ($host,$min_ins_id,$verbose,$limit,$continue );23 my ($host,$min_ins_id,$verbose,$limit,$continue,$alt,$vol_label); 24 24 $min_ins_id = 0; 25 25 $verbose = 0; 26 26 $limit = 10000; 27 27 $continue = 0; 28 $alt = 0; 29 $vol_label = 0; 28 30 29 31 GetOptions( … … 33 35 'limit|l=s' => \$limit, 34 36 'continue|c' => \$continue, 37 'alternate|a' => \$alt, 38 'vol_label|L=s' => \$vol_label, 35 39 ) or pod2usage( 2 ); 36 40 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; … … 39 43 defined($host); 40 44 41 my $volume = $host . ". 0";45 my $volume = $host . "." . $vol_label; 42 46 my $rr; 43 47 … … 50 54 my $vol_id = shift( @{ ${ $r_vol }[0] }); 51 55 56 # Get max ins_id 57 my $max_id_sth = "SELECT ins_id FROM instance WHERE vol_id = $vol_id ORDER BY ins_id DESC limit 1"; 58 my $r_max_id = $db->selectall_arrayref( $max_id_sth ); 59 unless (defined(${ $r_max_id }[0])) { 60 die "Cannot find max_id"; 61 } 62 my $max_ins_id = shift( @{ ${ $r_max_id }[0] }); 63 52 64 if ($verbose) { 53 print "$host $volume $vol_id $min_ins_id \n";65 print "$host $volume $vol_id $min_ins_id $max_ins_id\n"; 54 66 } 55 67 … … 70 82 my $number = 0; 71 83 do { 72 my $ins_id_sth = "SELECT ins_id,so_id,uri FROM instance WHERE vol_id = ${vol_id} AND ins_id > $min_ins_id LIMIT $limit"; 84 my $ins_id_sth = "SELECT ins_id,so_id,uri FROM instance WHERE vol_id = ${vol_id} AND ins_id > $min_ins_id AND ins_id <= $max_ins_id LIMIT $limit"; 85 if ($alt) { 86 $ins_id_sth = "SELECT ins_id,so_id,uri,vol_id FROM instance WHERE ins_id > $min_ins_id AND ins_id <= $max_ins_id LIMIT $limit"; 87 } 73 88 my $r_ins = $db->selectall_arrayref( $ins_id_sth ); 74 my $last_ins_id = 0;89 my $last_ins_id = $max_ins_id; 75 90 $number = 0; 76 91 foreach $rr (@{ $r_ins }) { 77 my ($ins_id,$so_id,$uri ) = @{ $rr };92 my ($ins_id,$so_id,$uri,$v_id) = @{ $rr }; 78 93 if ($verbose) { 79 94 # print (" $ins_id $so_id $uri\n"); … … 81 96 $number++; 82 97 $last_ins_id = $ins_id; 98 if ($alt) { 99 if ($v_id != $vol_id) { next; } 100 } 83 101 if ($uri !~ /ota...fits/) { next; } 84 102 my $have_b_node = 0; … … 138 156 $min_ins_id = $last_ins_id; 139 157 } 140 } while ( $continue && $number != 0);158 } while (($continue && $number != 0) || ($min_ins_id < $max_ins_id));
Note:
See TracChangeset
for help on using the changeset viewer.
