Changeset 34566
- Timestamp:
- Oct 24, 2012, 3:52:04 PM (14 years ago)
- Location:
- branches/eam_branches/ipp-20120905
- Files:
-
- 39 edited
- 10 copied
-
DataStore/lib/DataStore/FileSet.pm (modified) (1 diff)
-
ippMonitor (modified) (1 prop)
-
ippMonitor/czartool/czartool/czarconfig.xml (modified) (1 diff)
-
ippMonitor/raw/czartool_labels.php (modified) (1 diff)
-
ippMonitor/raw/ipp.css (modified) (1 diff)
-
ippMonitor/raw/site.php.in (modified) (1 diff)
-
ippScripts/scripts/destreak_restore_camera.pl (modified) (1 prop)
-
ippScripts/scripts/ipp_apply_burntool_single.pl (modified) (2 diffs, 1 prop)
-
ippScripts/scripts/magic_destreak.pl (modified) (1 prop)
-
ippScripts/scripts/publish_file.pl (modified) (11 diffs)
-
ippScripts/scripts/staticsky.pl (modified) (1 diff)
-
ippTools/share/camtool_find_pendingimfile.sql (modified) (1 prop)
-
ippTools/share/chiptool_setimfiletoupdate.sql (modified) (1 prop)
-
ippTools/share/pxadmin_create_tables.sql (modified) (1 prop)
-
ippTools/share/warptool_towarped.sql (modified) (1 prop)
-
ippTools/src (modified) (1 prop)
-
ippTools/src/camtool.c (modified) (1 diff)
-
ippTools/src/chiptool.c (modified) (1 diff)
-
ippTools/src/chiptoolConfig.c (modified) (1 diff)
-
ippTools/src/difftool.c (modified) (37 diffs)
-
ippTools/src/magictool.c (modified) (1 prop)
-
ippTools/src/stacktool.c (modified) (2 diffs)
-
ippTools/src/stacktoolConfig.c (modified) (1 diff)
-
ippconfig (modified) (1 prop)
-
ippconfig/gpc1/psastro.config (modified) (1 diff)
-
ippconfig/recipes/filerules-mef.mdc (modified) (3 diffs)
-
ippconfig/recipes/filerules-simple.mdc (modified) (3 diffs)
-
ippconfig/recipes/filerules-split.mdc (modified) (4 diffs)
-
ippconfig/recipes/nightly_science.config (modified) (1 diff)
-
ippconfig/recipes/psphot.config (modified) (3 diffs)
-
ippconfig/recipes/reductionClasses.mdc (modified) (1 prop)
-
ppImage/src (modified) (1 prop)
-
ppTranslate/documentation (copied) (copied from trunk/ppTranslate/documentation )
-
ppTranslate/documentation/ICD (copied) (copied from trunk/ppTranslate/documentation/ICD )
-
ppTranslate/documentation/ICD/Makefile (copied) (copied from trunk/ppTranslate/documentation/ICD/Makefile )
-
ppTranslate/documentation/ICD/PSDC-940-005.tex (copied) (copied from trunk/ppTranslate/documentation/ICD/PSDC-940-005.tex )
-
ppTranslate/documentation/ICD/figures (copied) (copied from trunk/ppTranslate/documentation/ICD/figures )
-
ppTranslate/documentation/ICD/figures/PSSWIF.eps (copied) (copied from trunk/ppTranslate/documentation/ICD/figures/PSSWIF.eps )
-
ppTranslate/documentation/TeXinputs.tar.bz2 (copied) (copied from trunk/ppTranslate/documentation/TeXinputs.tar.bz2 )
-
ppTranslate/src/ppMops.h (modified) (2 diffs)
-
ppTranslate/src/ppMopsArguments.c (modified) (5 diffs)
-
ppTranslate/src/ppMopsGetSkyChipPsfVersion.c (modified) (1 diff)
-
ppTranslate/src/ppMopsMerge.c (modified) (1 diff)
-
ppTranslate/src/ppMopsRead.c (modified) (17 diffs)
-
ppTranslate/src/ppMopsWrite.c (modified) (6 diffs)
-
ppTranslate/tests (copied) (copied from trunk/ppTranslate/tests )
-
ppTranslate/tests/integration (copied) (copied from trunk/ppTranslate/tests/integration )
-
ppTranslate/tests/integration/build_inputs_for_ppMops.sh (copied) (copied from trunk/ppTranslate/tests/integration/build_inputs_for_ppMops.sh )
-
psvideophot (modified) (1 prop)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20120905/DataStore/lib/DataStore/FileSet.pm
r26158 r34566 109 109 sub new 110 110 { 111 # turn off param validation as it has been causing problems 112 local $Params::Validate::NO_VALIDATION = 1; 113 111 114 my $class = shift; 112 115 -
branches/eam_branches/ipp-20120905/ippMonitor
- Property svn:mergeinfo changed
/trunk/ippMonitor merged: 34544-34545
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20120905/ippMonitor/czartool/czartool/czarconfig.xml
r34006 r34566 19 19 20 20 <!-- gpc1 Db section --> 21 <!-- <gpc1database> --> 22 <!-- <name>gpc1</name> --> 23 <!-- <host>scidbs1</host> --> 24 <!-- <user>ippMonitor</user> --> 25 <!-- <password>ippMonitor</password> --> 26 <!-- </gpc1database> --> 21 27 <gpc1database> 22 28 <name>gpc1</name> 23 <host>scidb s1</host>24 <user>ipp Monitor</user>25 <password>ipp Monitor</password>29 <host>scidbm</host> 30 <user>ippuser</user> 31 <password>ippuser</password> 26 32 </gpc1database> 27 33 -
branches/eam_branches/ipp-20120905/ippMonitor/raw/czartool_labels.php
r34316 r34566 219 219 showReplicationsStatus($REPL_HOST_IPPADMIN, $REPL_USER_IPPADMIN, $REPL_PASSWORD_IPPADMIN, $REPL_DBNAME_IPPADMIN); 220 220 showReplicationsStatus($REPL_HOST_ISP, $REPL_USER_ISP, $REPL_PASSWORD_ISP, $REPL_DBNAME_ISP); 221 showReplicationsStatus($REPL_HOST_NEBULOUS_SECONDARY, $REPL_USER_NEBULOUS_SECONDARY, $REPL_PASSWORD_NEBULOUS_SECONDARY, $REPL_DBNAME_NEBULOUS_SECONDARY); 221 222 echo "</table>"; 222 223 -
branches/eam_branches/ipp-20120905/ippMonitor/raw/ipp.css
r28718 r34566 144 144 td.body { 145 145 text-align: left; 146 font-size: small;146 font-size: normal; 147 147 font-weight: normal; 148 148 vertical-align: top; -
branches/eam_branches/ipp-20120905/ippMonitor/raw/site.php.in
r34007 r34566 47 47 $REPL_DBNAME_ISP = "ippc17 (isp)"; 48 48 49 $REPL_HOST_NEBULOUS_SECONDARY = "ippc63.IfA.Hawaii.Edu"; 50 $REPL_USER_NEBULOUS_SECONDARY = "ippMonitor"; 51 $REPL_PASSWORD_NEBULOUS_SECONDARY = "ippMonitor"; 52 $REPL_DBNAME_NEBULOUS_SECONDARY = "ippc63 (secondary nebulous / 50,000 sec behind is acceptable)"; 49 53 50 54 -
branches/eam_branches/ipp-20120905/ippScripts/scripts/destreak_restore_camera.pl
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/ipp-20120905/ippScripts/scripts/ipp_apply_burntool_single.pl
- Property svn:mergeinfo changed
/branches/czw_branch/20120906/ippScripts/scripts/ipp_apply_burntool_single.pl (added) merged: 34533 /trunk/ippScripts/scripts/ipp_apply_burntool_single.pl merged: 34534
r34466 r34566 241 241 $status = vsystem ($command, $REALRUN); 242 242 if ($status) { 243 &my_die("failed to update imfile" );243 &my_die("failed to update imfile",$exp_id,$class_id); 244 244 } 245 245 … … 274 274 my $exp_id = shift; 275 275 my $class_id = shift; 276 sleep(5); # Take a quick nap to let the database cool down, in case we failed doing an update. 276 277 vsystem("$regtool -dbname $dbname -updateprocessedimfile -exp_id $exp_id -class_id $class_id -burntool_state 0 -set_state pending_burntool",1); 277 278 } - Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20120905/ippScripts/scripts/magic_destreak.pl
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/ipp-20120905/ippScripts/scripts/publish_file.pl
r30376 r34566 32 32 my $pubtool = can_run('pubtool') or (warn "Can't find pubtool" and $missing_tools = 1); 33 33 my $camtool = can_run('camtool') or (warn "Can't find camtool" and $missing_tools = 1); 34 my $regtool = can_run('regtool') or (warn "Can't find regtool" and $missing_tools = 1); 34 35 my $difftool = can_run('difftool') or (warn "Can't find difftool" and $missing_tools = 1); 35 36 my $ppMops = can_run('ppMops') or (warn "Can't find ppMops" and $missing_tools = 1); … … 44 45 my ( $pub_id, $camera, $stage, $stage_id, $fileset, $format, $product, $workdir, $need_magic ); 45 46 my ( $dbname, $verbose, $no_update, $no_op, $save_temps, $redirect ); 46 my ( $output_format );47 my ( $output_format, $difftype ); 47 48 48 49 GetOptions( … … 72 73 defined $stage and 73 74 defined $stage_id and 74 defined $workdir; 75 defined $workdir and 76 defined $dbname; 75 77 76 78 my $outroot = "$workdir/$product.$pub_id"; # Output root name … … 166 168 my %negative; # Data for negative diff detections 167 169 foreach my $comp ( @$components ) { 168 my $path_base = $comp->{path_base}; # Base name for file170 my $path_base = $comp->{path_base}; # Base name for file 169 171 if (!$need_magic and $comp->{magicked}) { 170 172 # This client is authorized to receive uncensored detections … … 194 196 195 197 $filename = $resolved; 198 199 my $cam_id = $comp->{cam_id_1}; 200 #print "Getting info from camera stage $cam_id\n"; 201 my $cam_command = "$camtool -processedexp -cam_id $cam_id"; 202 $cam_command .= " -dbname $dbname" if defined $dbname; 203 my ( $cam_success, $cam_error_code, $cam_full_buf, $cam_stdout_buf, $cam_stderr_buf ) = 204 run(command => $cam_command, verbose => $verbose); 205 &my_die( "Unable to retrieve filename", $pub_id, $PS_EXIT_SYS_ERROR) unless $cam_success; 206 my $cam_metadata = $mdcParser->parse(join "", @$cam_stdout_buf) or 207 &my_die("Unable to parse metadata config", $pub_id, $PS_EXIT_PROG_ERROR); 208 my $cam_components = parse_md_list($cam_metadata) or 209 &my_die("Unable to parse metadata list", $pub_id, $PS_EXIT_PROG_ERROR); 210 &my_die("More than one entry for cam_id $stage_id", $pub_id, $PS_EXIT_PROG_ERROR) if scalar @$cam_components > 1; 211 my $cam_comp = $$cam_components[0]; 212 213 my $exp_id = $comp->{exp_id_1}; 214 #print "Getting info from raw stage $exp_id\n"; 215 my $reg_command = "$regtool -processedimfile -exp_id $exp_id"; 216 $reg_command .= " -dbname $dbname" if defined $dbname; 217 my ( $reg_success, $reg_error_code, $reg_full_buf, $reg_stdout_buf, $reg_stderr_buf ) = 218 run(command => $reg_command, verbose => $verbose); 219 &my_die( "Unable to retrieve filename", $pub_id, $PS_EXIT_SYS_ERROR) unless $reg_success; 220 my $reg_metadata = $mdcParser->parse(join "", @$reg_stdout_buf) or 221 &my_die("Unable to parse metadata config", $pub_id, $PS_EXIT_PROG_ERROR); 222 my $reg_components = parse_md_list($reg_metadata) or 223 &my_die("Unable to parse metadata list", $pub_id, $PS_EXIT_PROG_ERROR); 224 my $reg_comp = $$reg_components[0]; 225 226 # Now get the difftype value from diff->{diff_mode} 227 my $difftype = ""; 228 if ($comp->{diff_mode} == 1) { 229 $difftype = "WW"; 230 } elsif ($comp->{diff_mode} == 2) { 231 $difftype = "WS"; 232 } elsif ($comp->{diff_mode} == 3) { 233 $difftype = "SW"; # Not used yet 234 } elsif ($comp->{diff_mode} == 4) { 235 $difftype = "SS"; 236 } else { 237 $difftype = "Unsupported diff_mode value: [" . $comp->{diff_mode} . "]"; 238 } 196 239 197 240 my $data = { zp => $zp, … … 207 250 output_format => $comp->{output_format}, 208 251 direction => 1, 252 comment => $reg_comp->{comment}, 253 obsmode => $reg_comp->{obs_mode}, 254 difftype => $difftype, 255 sky => $cam_comp->{bg}, 256 shutoutc => $reg_comp->{dateobs}, 209 257 }; 210 258 259 #warn("Checking for positive"); 211 260 diff_check(\%positive, $data, "positive"); 212 261 … … 239 288 diff_id => $comp->{diff_id}, 240 289 direction => 0, 290 comment => $reg_comp->{comment}, 291 obsmode => $reg_comp->{obs_mode}, 292 difftype => $difftype, 293 sky => $cam_comp->{bg}, 294 shutoutc => $reg_comp->{dateobs}, 241 295 }; 242 296 297 #warn("Checking for negative"); 243 298 diff_check(\%negative, $data, "negative"); 244 299 … … 288 343 &my_die( "Unable to register with data store", $pub_id, $PS_EXIT_SYS_ERROR) unless $success; 289 344 } 290 291 292 345 293 346 ### Pau. … … 311 364 $data->{diff_id} = $comp->{diff_id} unless defined $data->{diff_id}; 312 365 $data->{direction} = $comp->{direction} unless defined $data->{direction}; 366 $data->{comment} = $comp->{comment} unless defined $data->{comment}; 367 $data->{obsmode} = $comp->{obsmode} unless defined $data->{obsmode}; 368 $data->{difftype} = $comp->{difftype} unless defined $data->{difftype}; 369 $data->{sky} = $comp->{sky} unless defined $data->{sky}; 370 $data->{shutoutc} = $comp->{shutoutc} unless defined $data->{shutoutc}; 313 371 314 372 &my_die("zp value for $name doesn't match", $pub_id, $PS_EXIT_SYS_ERROR) if defined $data->{zp} and $comp->{zp} != $data->{zp}; … … 323 381 &my_die("diff_id value for $name doesn't match", $pub_id, $PS_EXIT_SYS_ERROR) if defined $data->{diff_id} and $comp->{diff_id} != $data->{diff_id}; 324 382 &my_die("direction value for $name doesn't match", $pub_id, $PS_EXIT_SYS_ERROR) if defined $data->{direction} and $comp->{direction} != $data->{direction}; 383 &my_die("comment value for $name doesn't match", $pub_id, $PS_EXIT_SYS_ERROR) if defined $data->{comment} and $comp->{comment} ne $data->{comment}; 384 &my_die("obsmode value for $name doesn't match", $pub_id, $PS_EXIT_SYS_ERROR) if defined $data->{obsmode} and $comp->{obsmode} ne $data->{obsmode}; 385 &my_die("difftype value for $name doesn't match", $pub_id, $PS_EXIT_SYS_ERROR) if defined $data->{difftype} and $comp->{difftype} ne $data->{difftype}; 386 &my_die("sky value for $name doesn't match", $pub_id, $PS_EXIT_SYS_ERROR) if defined $data->{sky} and $comp->{sky} != $data->{sky}; 387 &my_die("shutoutc value for $name doesn't match", $pub_id, $PS_EXIT_SYS_ERROR) if defined $data->{shutoutc} and $comp->{shutoutc} ne $data->{shutoutc}; 325 388 326 389 return 1; … … 350 413 $command .= " -astrom_rms " . $data->{astrom} if defined $data->{astrom}; 351 414 $command .= " -version " . $data->{output_format} if defined $data->{output_format}; 415 $command .= " -comment \"" . $data->{comment} . "\"" if defined $data->{comment}; 416 $command .= " -obsmode " . $data->{obsmode} if defined $data->{obsmode}; 417 $command .= " -difftype " . $data->{difftype} if defined $data->{difftype}; 418 $command .= " -sky " . $data->{sky} if defined $data->{sky}; 419 $command .= " -shutoutc \"" . $data->{shutoutc} . "\"" if defined $data->{shutoutc}; 352 420 353 421 unless ($no_op) { -
branches/eam_branches/ipp-20120905/ippScripts/scripts/staticsky.pl
r33979 r34566 302 302 $mask = $ipprc->filename("PPSTACK.UNCONV.MASK", $path_base ); # Mask name 303 303 $variance = $ipprc->filename("PPSTACK.UNCONV.VARIANCE", $path_base ); # Weight name 304 $expnum = $ipprc->filename("PPSTACK.OUTPUT.EXPNUM", $path_base ); # Expnum name 304 305 } else { 305 306 $image = $ipprc->filename("PPSTACK.OUTPUT", $path_base ); # Image name 306 307 $mask = $ipprc->filename("PPSTACK.OUTPUT.MASK", $path_base ); # Mask name 307 308 $variance = $ipprc->filename("PPSTACK.OUTPUT.VARIANCE", $path_base ); # Weight name 308 $expnum = $ipprc->filename("PPSTACK.OUTPUT.EXPNUM", $path_base ); # Weightname309 $expnum = $ipprc->filename("PPSTACK.OUTPUT.EXPNUM", $path_base ); # Expnum name 309 310 } 310 311 -
branches/eam_branches/ipp-20120905/ippTools/share/camtool_find_pendingimfile.sql
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/ipp-20120905/ippTools/share/chiptool_setimfiletoupdate.sql
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/ipp-20120905/ippTools/share/pxadmin_create_tables.sql
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/ipp-20120905/ippTools/share/warptool_towarped.sql
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/ipp-20120905/ippTools/src
- Property svn:mergeinfo changed
/trunk/ippTools/src merged: 34500-34503,34538
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20120905/ippTools/src/camtool.c
r34081 r34566 974 974 return false; 975 975 } 976 int numUpdated = psDBAffectedRows(config->dbh); 977 psLogMsg("camtool", PS_LOG_INFO, "Updated %d camProcessedExps", numUpdated); 976 978 977 979 return true; -
branches/eam_branches/ipp-20120905/ippTools/src/chiptool.c
r34081 r34566 2066 2066 PXOPT_COPY_STR(config->args, where, "-reduction", "chipRun.reduction", "=="); 2067 2067 PXOPT_COPY_STR(config->args, where, "-state", "chipRun.state", "=="); 2068 PXOPT_COPY_STR(config->args, where, "-tess_id", "chipRun.tess_id", "LIKE"); 2068 2069 pxAddLabelSearchArgs (config, where, "-label", "chipRun.label", "LIKE"); 2069 2070 pxAddLabelSearchArgs (config, where, "-data_group", "chipRun.data_group", "LIKE"); -
branches/eam_branches/ipp-20120905/ippTools/src/chiptoolConfig.c
r33617 r34566 254 254 psMetadataAddStr(listrunArgs, PS_LIST_TAIL, "-label", PS_META_DUPLICATE_OK, "search by chipRun label (LIKE comparison)", NULL); 255 255 psMetadataAddStr(listrunArgs, PS_LIST_TAIL, "-state", 0, "search by chipRun state", NULL); 256 psMetadataAddStr(listrunArgs, PS_LIST_TAIL, "-tess_id", 0, "search by chipRun tess_id (LIKE comparison)", NULL); 256 257 psMetadataAddStr(listrunArgs, PS_LIST_TAIL, "-data_group", PS_META_DUPLICATE_OK, "search by chipRun data_group (LIKE comparison)", NULL); 257 258 psMetadataAddStr(listrunArgs, PS_LIST_TAIL, "-dist_group", PS_META_DUPLICATE_OK, "search by chipRun dist_group (LIKE comparison)", NULL); -
branches/eam_branches/ipp-20120905/ippTools/src/difftool.c
r34081 r34566 97 97 MODECASE(DIFFTOOL_MODE_DEFINEWARPWARP, definewarpwarpMode); 98 98 MODECASE(DIFFTOOL_MODE_DEFINESTACKSTACK, definestackstackMode); 99 MODECASE(DIFFTOOL_MODE_TOSUMMARY, tosummaryMode);100 MODECASE(DIFFTOOL_MODE_ADDSUMMARY, addsummaryMode);99 MODECASE(DIFFTOOL_MODE_TOSUMMARY, tosummaryMode); 100 MODECASE(DIFFTOOL_MODE_ADDSUMMARY, addsummaryMode); 101 101 MODECASE(DIFFTOOL_MODE_PENDINGCLEANUPRUN, pendingcleanuprunMode); 102 102 MODECASE(DIFFTOOL_MODE_PENDINGCLEANUPSKYFILE, pendingcleanupskyfileMode); … … 170 170 exposure, 171 171 false, 172 NULL, // software version173 0, // mask stat npix174 NAN, // static175 NAN, // dynamic176 NAN, // magic177 NAN, // advisory172 NULL, // software version 173 0, // mask stat npix 174 NAN, // static 175 NAN, // dynamic 176 NAN, // magic 177 NAN, // advisory 178 178 diff_mode, 179 179 note … … 579 579 PXOPT_LOOKUP_F32(maskfrac_magic, config->args, "-maskfrac_magic", false, false); 580 580 PXOPT_LOOKUP_F32(maskfrac_advisory, config->args, "-maskfrac_advisory", false, false); 581 581 582 582 psTrace("czw.test",1,"Received versions: pslib %s psmodules %s psphot %s ppstats %s ppsub %s streaks %s\n", 583 ver_pslib,ver_psmodules,ver_psphot,ver_ppstats,ver_ppsub,ver_streaks);583 ver_pslib,ver_psmodules,ver_psphot,ver_ppstats,ver_ppsub,ver_streaks); 584 584 psString ver_code = NULL; 585 585 if ((ver_pslib)&&(ver_psmodules)) { … … 631 631 fault, 632 632 quality, 633 magicked,634 ver_code,635 maskfrac_npix,636 maskfrac_static,637 maskfrac_dynamic,638 maskfrac_magic,639 maskfrac_advisory633 magicked, 634 ver_code, 635 maskfrac_npix, 636 maskfrac_static, 637 maskfrac_dynamic, 638 maskfrac_magic, 639 maskfrac_advisory 640 640 )) { 641 641 if (!psDBRollback(config->dbh)) { … … 726 726 psS64 magicked = psMetadataLookupS64(NULL, row, "magicked"); 727 727 728 psString software_ver = NULL;729 psS64 maskfrac_npix = 0;730 psF32 maskfrac_static = 0;731 psF32 maskfrac_dynamic = 0;732 psF32 maskfrac_magic = 0;733 psF32 maskfrac_advisory = 0;734 735 // Calculate run level masking and software state736 if (!pxCoalesceRunStatus(config,"difftool_coalesce_run.sql",diff_id,737 &software_ver,&maskfrac_npix,738 &maskfrac_static,&maskfrac_dynamic,739 &maskfrac_magic,&maskfrac_advisory)) {740 psError(PS_ERR_UNKNOWN, false, "failed to generate run level statistics");741 psFree(output);742 if (!psDBRollback(config->dbh)) {743 psError(PS_ERR_UNKNOWN, false, "database error");744 }745 return(false);746 }747 // Set diffRun.software_ver to the appropriate value748 if (software_ver) {749 if (!pxSetRunSoftware(config, "diffRun", "diff_id", diff_id, software_ver)) {750 psError(PS_ERR_UNKNOWN, false, "failed to set diffRun.software_ver for diff_id: %" PRId64,751 diff_id);752 psFree(output);753 if (!psDBRollback(config->dbh)) {754 psError(PS_ERR_UNKNOWN, false, "database error");755 }756 return(false);757 }758 }759 // Set diffRun.maskfrac* to the appropriate values.760 if (maskfrac_npix) {761 if (!pxSetRunMaskfrac(config, "diffRun", "diff_id", diff_id, maskfrac_npix, maskfrac_static,762 maskfrac_dynamic, maskfrac_magic, maskfrac_advisory)) {763 psError(PS_ERR_UNKNOWN, false, "failed to set diffRun.software_ver for diff_id: %" PRId64,764 diff_id);765 psFree(output);766 if (!psDBRollback(config->dbh)) {767 psError(PS_ERR_UNKNOWN, false, "database error");768 }769 return(false);770 }771 }728 psString software_ver = NULL; 729 psS64 maskfrac_npix = 0; 730 psF32 maskfrac_static = 0; 731 psF32 maskfrac_dynamic = 0; 732 psF32 maskfrac_magic = 0; 733 psF32 maskfrac_advisory = 0; 734 735 // Calculate run level masking and software state 736 if (!pxCoalesceRunStatus(config,"difftool_coalesce_run.sql",diff_id, 737 &software_ver,&maskfrac_npix, 738 &maskfrac_static,&maskfrac_dynamic, 739 &maskfrac_magic,&maskfrac_advisory)) { 740 psError(PS_ERR_UNKNOWN, false, "failed to generate run level statistics"); 741 psFree(output); 742 if (!psDBRollback(config->dbh)) { 743 psError(PS_ERR_UNKNOWN, false, "database error"); 744 } 745 return(false); 746 } 747 // Set diffRun.software_ver to the appropriate value 748 if (software_ver) { 749 if (!pxSetRunSoftware(config, "diffRun", "diff_id", diff_id, software_ver)) { 750 psError(PS_ERR_UNKNOWN, false, "failed to set diffRun.software_ver for diff_id: %" PRId64, 751 diff_id); 752 psFree(output); 753 if (!psDBRollback(config->dbh)) { 754 psError(PS_ERR_UNKNOWN, false, "database error"); 755 } 756 return(false); 757 } 758 } 759 // Set diffRun.maskfrac* to the appropriate values. 760 if (maskfrac_npix) { 761 if (!pxSetRunMaskfrac(config, "diffRun", "diff_id", diff_id, maskfrac_npix, maskfrac_static, 762 maskfrac_dynamic, maskfrac_magic, maskfrac_advisory)) { 763 psError(PS_ERR_UNKNOWN, false, "failed to set diffRun.software_ver for diff_id: %" PRId64, 764 diff_id); 765 psFree(output); 766 if (!psDBRollback(config->dbh)) { 767 psError(PS_ERR_UNKNOWN, false, "database error"); 768 } 769 return(false); 770 } 771 } 772 772 // set diffRun.state to 'full' 773 773 if (!setdiffRunState(config, diff_id, "full", magicked)) { … … 857 857 } 858 858 } 859 859 860 860 // treat limit == 0 as "no limit" 861 861 if (limit) { … … 1092 1092 false, 1093 1093 0, // magicked 1094 NULL, // software version1095 0, // mask stat npix1096 NAN, // static1097 NAN, // dynamic1098 NAN, // magic1099 NAN, // advisory1094 NULL, // software version 1095 0, // mask stat npix 1096 NAN, // static 1097 NAN, // dynamic 1098 NAN, // magic 1099 NAN, // advisory 1100 1100 diff_mode, // diff_mode 1101 1101 note … … 1475 1475 } 1476 1476 1477 psString warp_data_group = psMetadataLookupStr(&mdok, row, "data_group");1478 if (!mdok) {1479 psError(PXTOOLS_ERR_PROG, false, "warp data_group not found");1480 psFree(warp2Query);1481 psFree(stackQuery);1482 psFree(skycell_query);1483 if (!psDBRollback(config->dbh)) {1484 psError(PS_ERR_UNKNOWN, false, "database error");1485 }1486 return false;1487 }1488 if (warp_data_group) {1489 data_group = warp_data_group;1490 }1491 1477 psString warp_data_group = psMetadataLookupStr(&mdok, row, "data_group"); 1478 if (!mdok) { 1479 psError(PXTOOLS_ERR_PROG, false, "warp data_group not found"); 1480 psFree(warp2Query); 1481 psFree(stackQuery); 1482 psFree(skycell_query); 1483 if (!psDBRollback(config->dbh)) { 1484 psError(PS_ERR_UNKNOWN, false, "database error"); 1485 } 1486 return false; 1487 } 1488 if (!data_group && warp_data_group) { 1489 data_group = warp_data_group; 1490 } 1491 1492 1492 if (!p_psDBRunQueryF(config->dbh, skycell_query, stackQuery, warp_id, filter, warp2Query)) { 1493 1493 psError(PS_ERR_UNKNOWN, false, "database error"); … … 1515 1515 // ok we've got one create the diffRun 1516 1516 diffRunRow *run = diffRunRowAlloc( 1517 0, // ID1518 "reg", // state1517 0, // ID 1518 "reg", // state 1519 1519 workdir, 1520 1520 label, … … 1522 1522 dist_group, 1523 1523 reduction, 1524 NULL, // dvodb1524 NULL, // dvodb 1525 1525 registered, 1526 1526 tess_id, 1527 1527 bothways, // bothways (default is false) 1528 true, // exposure1529 0, // magicked1530 NULL,// software version1531 0,// mask stat npix1532 NAN,// static1533 NAN,// dynamic1534 NAN,// magic1535 NAN,// advisory1528 true, // exposure 1529 0, // magicked 1530 NULL, // software version 1531 0, // mask stat npix 1532 NAN, // static 1533 NAN, // dynamic 1534 NAN, // magic 1535 NAN, // advisory 1536 1536 IPP_DIFF_MODE_WARP_STACK, 1537 1537 note … … 1562 1562 psFree(query); 1563 1563 query = NULL; 1564 psStringAppend(&query, "INSERT INTO diffInputSkyfile SELECT * from skycellsToDiff"); 1564 psStringAppend(&query, 1565 "INSERT INTO diffInputSkyfile(diff_id, skycell_id, warp1, stack1, warp2, stack2, tess_id) SELECT diff_id, skycell_id, warp1, stack1, warp2, stack2, tess_id from skycellsToDiff"); 1565 1566 if (!p_psDBRunQuery(config->dbh, query)) { 1566 1567 psError(PS_ERR_UNKNOWN, false, "database error"); … … 1868 1869 const char *template = psMetadataLookupStr(NULL, row, "template_warp_id"); 1869 1870 const char *tess_id = psMetadataLookupStr(NULL, row, "tess_id"); 1870 psString input_data_group = psMetadataLookupStr(NULL, row, "input_data_group");1871 if (!data_group) {1872 data_group = input_data_group;1873 }1871 psString input_data_group = psMetadataLookupStr(NULL, row, "input_data_group"); 1872 if (!data_group) { 1873 data_group = input_data_group; 1874 } 1874 1875 1875 1876 if (!input_id || !template || !tess_id) { … … 1883 1884 return false; 1884 1885 } 1885 1886 1886 1887 diffRunRow *run = diffRunRowAlloc(0, 1887 1888 "reg", … … 1897 1898 true, // exposure 1898 1899 false, // magicked 1899 NULL, // software version1900 0, // mask stat npix1901 NAN, // static1902 NAN, // dynamic1903 NAN, // magic1904 NAN, // advisory 1900 NULL, // software version 1901 0, // mask stat npix 1902 NAN, // static 1903 NAN, // dynamic 1904 NAN, // magic 1905 NAN, // advisory 1905 1906 IPP_DIFF_MODE_WARP_WARP, 1906 1907 note); // Run to insert … … 1958 1959 // seem to be a way to pass in NULL for skycell_id, stack1 and stack2 1959 1960 psString dummyQuery = NULL; 1960 psStringAppend(&dummyQuery, 1961 psStringAppend(&dummyQuery, 1961 1962 "INSERT INTO diffInputSkyfile VALUES(%" PRId64 ", NULL, %s, NULL, %s, NULL, '%s', 0)", 1962 run->diff_id, 1963 run->diff_id, 1963 1964 input, // warp1 1964 1965 template, // warp2 … … 1980 1981 psFree(dummyQuery); 1981 1982 psString finishQuery = NULL; 1982 psStringAppend( &finishQuery, 1983 psStringAppend( &finishQuery, 1983 1984 "UPDATE diffRun set state ='full', dist_group = NULL, note = 'dummy run - no overlap' WHERE diff_id = %" PRId64, 1984 1985 run->diff_id); … … 2063 2064 2064 2065 if (!(label)) { 2065 PXOPT_LOOKUP_STR(label,config->args, "-input_label",true,false);2066 PXOPT_LOOKUP_STR(label,config->args, "-input_label",true,false); 2066 2067 } 2067 2068 … … 2071 2072 2072 2073 if (psListLength(stack1Where->list)) { 2073 psString whereClause = psDBGenerateWhereConditionSQL(stack1Where, NULL);2074 psStringAppend(&stack1Query, "AND %s", whereClause);2075 psFree(whereClause);2076 } 2074 psString whereClause = psDBGenerateWhereConditionSQL(stack1Where, NULL); 2075 psStringAppend(&stack1Query, "AND %s", whereClause); 2076 psFree(whereClause); 2077 } 2077 2078 psFree(stack1Where); 2078 2079 2079 2080 if (psListLength(stack2Where->list)) { 2080 psString whereClause = psDBGenerateWhereConditionSQL(stack2Where, NULL);2081 psStringAppend(&stack2Query, "AND %s", whereClause);2082 psFree(whereClause);2083 } 2081 psString whereClause = psDBGenerateWhereConditionSQL(stack2Where, NULL); 2082 psStringAppend(&stack2Query, "AND %s", whereClause); 2083 psFree(whereClause); 2084 } 2084 2085 psFree(stack2Where); 2085 2086 2086 2087 // don't queue for stacks that have already been diffed unless requested 2087 2088 psString diffQuery0 = NULL; 2088 2089 psString diffQuery1 = NULL; 2089 2090 if (! (reRun || newTemplates) ) { 2090 psStringAppend(&diffQuery0, "AND diffExp.diff_id IS NULL");2091 psStringAppend(&diffQuery1, "HAVING n_diff = 0");2092 } 2091 psStringAppend(&diffQuery0, "AND diffExp.diff_id IS NULL"); 2092 psStringAppend(&diffQuery1, "HAVING n_diff = 0"); 2093 } 2093 2094 2094 2095 // find the distinct set of data_groups and filters 2095 2096 psString query = pxDataGet("difftool_definestackstack_part0.sql"); 2096 2097 if (!query) { 2097 psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement");2098 return(false);2098 psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement"); 2099 return(false); 2099 2100 } 2100 2101 psTrace("difftool",1,query,stack2Query,stack1Query,diffQuery0,stack1Query); 2101 2102 2102 2103 if (!psDBTransaction(config->dbh)) { 2103 psError(PS_ERR_UNKNOWN, false, "database error");2104 return(false);2104 psError(PS_ERR_UNKNOWN, false, "database error"); 2105 return(false); 2105 2106 } 2106 2107 … … 2110 2111 2111 2112 if (!p_psDBRunQuery(config->dbh, query)) { 2112 psError(PS_ERR_UNKNOWN, false, "database error");2113 psFree(query);2114 if (!psDBRollback(config->dbh)) {2115 psError(PS_ERR_UNKNOWN, false, "database error");2116 }2117 return false;2113 psError(PS_ERR_UNKNOWN, false, "database error"); 2114 psFree(query); 2115 if (!psDBRollback(config->dbh)) { 2116 psError(PS_ERR_UNKNOWN, false, "database error"); 2117 } 2118 return false; 2118 2119 } 2119 2120 … … 2122 2123 psArray *output = p_psDBFetchResult(config->dbh); 2123 2124 if (!output) { 2124 psErrorCode err = psErrorCodeLast();2125 switch (err) {2126 case PS_ERR_DB_CLIENT:2127 psError(PXTOOLS_ERR_SYS, false, "database error");2128 break;2129 case PS_ERR_DB_SERVER:2130 psError(PXTOOLS_ERR_PROG, false, "database error");2131 break;2132 default:2133 psError(PXTOOLS_ERR_PROG, false, "unknown error");2134 break;2135 }2136 if (!psDBRollback(config->dbh)) {2137 psError(PS_ERR_UNKNOWN, false, "database error");2138 }2139 return false;2125 psErrorCode err = psErrorCodeLast(); 2126 switch (err) { 2127 case PS_ERR_DB_CLIENT: 2128 psError(PXTOOLS_ERR_SYS, false, "database error"); 2129 break; 2130 case PS_ERR_DB_SERVER: 2131 psError(PXTOOLS_ERR_PROG, false, "database error"); 2132 break; 2133 default: 2134 psError(PXTOOLS_ERR_PROG, false, "unknown error"); 2135 break; 2136 } 2137 if (!psDBRollback(config->dbh)) { 2138 psError(PS_ERR_UNKNOWN, false, "database error"); 2139 } 2140 return false; 2140 2141 } 2141 2142 if (!psArrayLength(output)) { 2142 psTrace("difftool", PS_LOG_INFO, "no rows found");2143 psFree(output);2144 if (!psDBCommit(config->dbh)) {2145 psError(PS_ERR_UNKNOWN, false, "database error");2146 return false;2147 }2148 return true;2149 } 2150 2151 2143 psTrace("difftool", PS_LOG_INFO, "no rows found"); 2144 psFree(output); 2145 if (!psDBCommit(config->dbh)) { 2146 psError(PS_ERR_UNKNOWN, false, "database error"); 2147 return false; 2148 } 2149 return true; 2150 } 2151 2152 2152 2153 if (pretend) { 2153 // negative simple so the default is true2154 if (!ippdbPrintMetadatas(stdout, output, "diffRunTemp", !simple)) {2155 psError(PS_ERR_UNKNOWN, false, "failed to print array");2156 psFree(output);2157 return false;2158 }2159 psFree(output);2160 return true;2154 // negative simple so the default is true 2155 if (!ippdbPrintMetadatas(stdout, output, "diffRunTemp", !simple)) { 2156 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 2157 psFree(output); 2158 return false; 2159 } 2160 psFree(output); 2161 return true; 2161 2162 } 2162 2163 … … 2165 2166 query = pxDataGet("difftool_definestackstack_part1.sql"); 2166 2167 2167 2168 psMetadata *row = output->data[i]; // Output row from query2169 bool mdok; // Status of MD lookup2170 2171 // psMetadataPrint(stderr, row, 1);2172 2173 psString tess_id = psMetadataLookupStr(&mdok,row,"INPUT_tess_id");2174 psString this_data_group = psMetadataLookupStr(&mdok,row,"INPUT_data_group");2175 psString this_dist_group = psMetadataLookupStr(&mdok,row,"INPUT_dist_group");2176 psString this_label = psMetadataLookupStr(&mdok,row,"INPUT_label");2177 2178 psString this_stack1Query = psStringCopy(stack1Query);2179 2180 psString thisWhere = psDBGenerateWhereConditionSQL(row,NULL);2181 psStringSubstitute(&thisWhere,"stackRun.","INPUT_");2182 psStringAppend(&this_stack1Query,"AND %s", thisWhere);2183 psFree(thisWhere);2184 2185 psStringSubstitute(&query, this_stack1Query, "@STACK1_QUERY@");2186 psStringSubstitute(&query, stack2Query, "@STACK2_QUERY@");2187 psStringSubstitute(&query, diffQuery1, "@DIFF1_QUERY@");2188 2189 psTrace("difftool", 1, "%s", query);2190 if (!psDBTransaction(config->dbh)) {2191 psError(PS_ERR_UNKNOWN, false, "database error");2192 return(false);2193 }2194 2195 if (!p_psDBRunQuery(config->dbh, query)) {2196 psError(PS_ERR_UNKNOWN, false, "database error");2197 psFree(query);2198 if (!psDBRollback(config->dbh)) {2199 psError(PS_ERR_UNKNOWN, false, "database error");2200 }2201 return false;2202 }2203 psFree(this_stack1Query);2204 2205 psArray *diff_id_output = p_psDBFetchResult(config->dbh);2206 if (!diff_id_output) {2207 psErrorCode err = psErrorCodeLast();2208 switch (err) {2209 case PS_ERR_DB_CLIENT:2210 psError(PXTOOLS_ERR_SYS, false, "database error");2211 break;2212 case PS_ERR_DB_SERVER:2213 psError(PXTOOLS_ERR_PROG, false, "database error");2214 break;2215 default:2216 psError(PXTOOLS_ERR_PROG, false, "unknown error");2217 break;2218 }2219 if (!psDBRollback(config->dbh)) {2220 psError(PS_ERR_UNKNOWN, false, "database error");2221 }2222 return false;2223 }2224 if (!psArrayLength(diff_id_output)) {2225 psTrace("difftool", PS_LOG_INFO, "no rows found");2226 psFree(diff_id_output);2227 if (!psDBCommit(config->dbh)) {2228 psError(PS_ERR_UNKNOWN, false, "database error");2229 return false;2230 }2231 return true;2232 }2233 2234 // ok we've got one create the diffRun2235 diffRunRow *run = diffRunRowAlloc(2236 0, // ID2237 "reg", // state2238 workdir,2239 label ? label : this_label,2240 data_group ? data_group : this_data_group,2241 dist_group ? dist_group : this_dist_group,2242 reduction,2243 NULL, // dvodb2244 registered,2245 tess_id,2246 bothways, // bothways2247 false, // exposure2248 0, // magicked2249 NULL, // software version2250 0, // mask stat npix2251 NAN, // static2252 NAN, // dynamic2253 NAN, // magic2254 NAN, // advisory 2255 IPP_DIFF_MODE_STACK_STACK, // diff_mode2256 note2257 );2258 // Commit to database2259 if (!diffRunInsertObject(config->dbh, run)) {2260 psError(PS_ERR_UNKNOWN, false, "database error");2261 psFree(run);2262 if (!psDBRollback(config->dbh)) {2263 psError(PS_ERR_UNKNOWN, false, "database error");2264 }2265 return false;2266 }2267 // diffRunPrintObject(stdout,run,1);2268 run->diff_id = psDBLastInsertID(config->dbh);2269 2270 for (long j = 0; j < diff_id_output->n; j++) {2271 psMetadata *input_row = diff_id_output->data[j]; // Output row from query2272 bool mdok;2273 psString in_skycell_id = psMetadataLookupStr(&mdok,input_row,"skycell_id");2274 psS64 in_input_stack_id = psMetadataLookupS64(&mdok,input_row,"stack_id");2275 psS64 in_template_stack_id = psMetadataLookupS64(&mdok,input_row,"max_stack_id");2276 psString in_tess_id = psMetadataLookupStr(&mdok,input_row,"tess_id");2277 psTrace("difftool",1,"%s %" PRId64 " %" PRId64 " %s\n",2278 in_skycell_id, in_input_stack_id, in_template_stack_id, in_tess_id);2279 diffInputSkyfileRow *input = diffInputSkyfileRowAlloc(2280 run->diff_id, // ID2281 in_skycell_id,2282 PS_MAX_S64, // warp1_id -> NULL2283 in_input_stack_id, // stack12284 PS_MAX_S64, // warp2_id -> NULL2285 in_template_stack_id, // stack22286 in_tess_id,2287 0 // diff_skyfile_id2288 );2289 2290 // Commit to database the input2291 if (!diffInputSkyfileInsertObject(config->dbh, input)) {2292 psError(PS_ERR_UNKNOWN, false, "database error");2293 psFree(input);2294 if (!psDBRollback(config->dbh)) {2295 psError(PS_ERR_UNKNOWN, false, "database error");2296 }2297 return false;2298 }2168 2169 psMetadata *row = output->data[i]; // Output row from query 2170 bool mdok; // Status of MD lookup 2171 2172 // psMetadataPrint(stderr, row, 1); 2173 2174 psString tess_id = psMetadataLookupStr(&mdok,row,"INPUT_tess_id"); 2175 psString this_data_group = psMetadataLookupStr(&mdok,row,"INPUT_data_group"); 2176 psString this_dist_group = psMetadataLookupStr(&mdok,row,"INPUT_dist_group"); 2177 psString this_label = psMetadataLookupStr(&mdok,row,"INPUT_label"); 2178 2179 psString this_stack1Query = psStringCopy(stack1Query); 2180 2181 psString thisWhere = psDBGenerateWhereConditionSQL(row,NULL); 2182 psStringSubstitute(&thisWhere,"stackRun.","INPUT_"); 2183 psStringAppend(&this_stack1Query,"AND %s", thisWhere); 2184 psFree(thisWhere); 2185 2186 psStringSubstitute(&query, this_stack1Query, "@STACK1_QUERY@"); 2187 psStringSubstitute(&query, stack2Query, "@STACK2_QUERY@"); 2188 psStringSubstitute(&query, diffQuery1, "@DIFF1_QUERY@"); 2189 2190 psTrace("difftool", 1, "%s", query); 2191 if (!psDBTransaction(config->dbh)) { 2192 psError(PS_ERR_UNKNOWN, false, "database error"); 2193 return(false); 2194 } 2195 2196 if (!p_psDBRunQuery(config->dbh, query)) { 2197 psError(PS_ERR_UNKNOWN, false, "database error"); 2198 psFree(query); 2199 if (!psDBRollback(config->dbh)) { 2200 psError(PS_ERR_UNKNOWN, false, "database error"); 2201 } 2202 return false; 2203 } 2204 psFree(this_stack1Query); 2205 2206 psArray *diff_id_output = p_psDBFetchResult(config->dbh); 2207 if (!diff_id_output) { 2208 psErrorCode err = psErrorCodeLast(); 2209 switch (err) { 2210 case PS_ERR_DB_CLIENT: 2211 psError(PXTOOLS_ERR_SYS, false, "database error"); 2212 break; 2213 case PS_ERR_DB_SERVER: 2214 psError(PXTOOLS_ERR_PROG, false, "database error"); 2215 break; 2216 default: 2217 psError(PXTOOLS_ERR_PROG, false, "unknown error"); 2218 break; 2219 } 2220 if (!psDBRollback(config->dbh)) { 2221 psError(PS_ERR_UNKNOWN, false, "database error"); 2222 } 2223 return false; 2224 } 2225 if (!psArrayLength(diff_id_output)) { 2226 psTrace("difftool", PS_LOG_INFO, "no rows found"); 2227 psFree(diff_id_output); 2228 if (!psDBCommit(config->dbh)) { 2229 psError(PS_ERR_UNKNOWN, false, "database error"); 2230 return false; 2231 } 2232 return true; 2233 } 2234 2235 // ok we've got one create the diffRun 2236 diffRunRow *run = diffRunRowAlloc( 2237 0, // ID 2238 "reg", // state 2239 workdir, 2240 label ? label : this_label, 2241 data_group ? data_group : this_data_group, 2242 dist_group ? dist_group : this_dist_group, 2243 reduction, 2244 NULL, // dvodb 2245 registered, 2246 tess_id, 2247 bothways, // bothways 2248 false, // exposure 2249 0, // magicked 2250 NULL, // software version 2251 0, // mask stat npix 2252 NAN, // static 2253 NAN, // dynamic 2254 NAN, // magic 2255 NAN, // advisory 2256 IPP_DIFF_MODE_STACK_STACK, // diff_mode 2257 note 2258 ); 2259 // Commit to database 2260 if (!diffRunInsertObject(config->dbh, run)) { 2261 psError(PS_ERR_UNKNOWN, false, "database error"); 2262 psFree(run); 2263 if (!psDBRollback(config->dbh)) { 2264 psError(PS_ERR_UNKNOWN, false, "database error"); 2265 } 2266 return false; 2267 } 2268 // diffRunPrintObject(stdout,run,1); 2269 run->diff_id = psDBLastInsertID(config->dbh); 2270 2271 for (long j = 0; j < diff_id_output->n; j++) { 2272 psMetadata *input_row = diff_id_output->data[j]; // Output row from query 2273 bool mdok; 2274 psString in_skycell_id = psMetadataLookupStr(&mdok,input_row,"skycell_id"); 2275 psS64 in_input_stack_id = psMetadataLookupS64(&mdok,input_row,"stack_id"); 2276 psS64 in_template_stack_id = psMetadataLookupS64(&mdok,input_row,"max_stack_id"); 2277 psString in_tess_id = psMetadataLookupStr(&mdok,input_row,"tess_id"); 2278 psTrace("difftool",1,"%s %" PRId64 " %" PRId64 " %s\n", 2279 in_skycell_id, in_input_stack_id, in_template_stack_id, in_tess_id); 2280 diffInputSkyfileRow *input = diffInputSkyfileRowAlloc( 2281 run->diff_id, // ID 2282 in_skycell_id, 2283 PS_MAX_S64, // warp1_id -> NULL 2284 in_input_stack_id, // stack1 2285 PS_MAX_S64, // warp2_id -> NULL 2286 in_template_stack_id, // stack2 2287 in_tess_id, 2288 0 // diff_skyfile_id 2289 ); 2290 2291 // Commit to database the input 2292 if (!diffInputSkyfileInsertObject(config->dbh, input)) { 2293 psError(PS_ERR_UNKNOWN, false, "database error"); 2294 psFree(input); 2295 if (!psDBRollback(config->dbh)) { 2296 psError(PS_ERR_UNKNOWN, false, "database error"); 2297 } 2298 return false; 2299 } 2299 2300 2300 2301 /* diffInputSkyfilePrintObject(stdout,input,1); */ 2301 psFree(input);2302 }2303 2304 if (!setdiffRunState(config, run->diff_id, "new", false)) {2305 psError(PS_ERR_UNKNOWN, false, "failed to change diffRun.state for diff_id: %" PRId64, run->diff_id);2306 psFree(stack1Query);2307 psFree(stack2Query);2308 psFree(diffQuery0);2309 psFree(diffQuery1);2310 psFree(run);2311 psFree(list);2312 if (!psDBRollback(config->dbh)) {2313 psError(PS_ERR_UNKNOWN, false, "database error");2314 }2315 return false;2316 }2317 psArrayAdd(list, list->n, run);2318 psFree(run);2302 psFree(input); 2303 } 2304 2305 if (!setdiffRunState(config, run->diff_id, "new", false)) { 2306 psError(PS_ERR_UNKNOWN, false, "failed to change diffRun.state for diff_id: %" PRId64, run->diff_id); 2307 psFree(stack1Query); 2308 psFree(stack2Query); 2309 psFree(diffQuery0); 2310 psFree(diffQuery1); 2311 psFree(run); 2312 psFree(list); 2313 if (!psDBRollback(config->dbh)) { 2314 psError(PS_ERR_UNKNOWN, false, "database error"); 2315 } 2316 return false; 2317 } 2318 psArrayAdd(list, list->n, run); 2319 psFree(run); 2319 2320 } 2320 2321 2321 2322 if (!psDBCommit(config->dbh)) { 2322 psError(PS_ERR_UNKNOWN, false, "database error");2323 psFree(list);2324 return false;2323 psError(PS_ERR_UNKNOWN, false, "database error"); 2324 psFree(list); 2325 return false; 2325 2326 } 2326 2327 2327 2328 if (!diffRunPrintObjects(stdout, list, !simple)) { 2328 psError(PS_ERR_UNKNOWN, false, "failed to print object");2329 psFree(list);2330 return false;2329 psError(PS_ERR_UNKNOWN, false, "failed to print object"); 2330 psFree(list); 2331 return false; 2331 2332 } 2332 2333 … … 2340 2341 2341 2342 if (!psDBCommit(config->dbh)) { 2342 psError(PS_ERR_UNKNOWN, false, "database error");2343 psFree(list);2344 return false;2343 psError(PS_ERR_UNKNOWN, false, "database error"); 2344 psFree(list); 2345 return false; 2345 2346 } 2346 2347 … … 2350 2351 static bool tosummaryMode(pxConfig *config) { 2351 2352 PS_ASSERT_PTR_NON_NULL(config, NULL); 2352 2353 2353 2354 psMetadata *where = psMetadataAlloc(); 2354 2355 PXOPT_COPY_S64(config->args, where, "-warp_id", "diffSkyfile.warp_id", "=="); … … 2366 2367 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 2367 2368 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 2368 2369 2369 2370 // find all rawImfiles matching the default query 2370 2371 psString query = pxDataGet("difftool_tosummary.sql"); … … 2381 2382 return false; 2382 2383 } 2383 2384 2384 2385 if (psListLength(where->list)) { 2385 2386 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); … … 2390 2391 return false; 2391 2392 } 2392 2393 2393 2394 if (where2) { 2394 2395 if (psListLength(where->list)) { … … 2406 2407 psFree(limitString); 2407 2408 } 2408 2409 2409 2410 if (!p_psDBRunQuery(config->dbh, query)) { 2410 2411 psError(PS_ERR_UNKNOWN, false, "database error"); … … 2425 2426 psError(PXTOOLS_ERR_PROG, false, "unknown error"); 2426 2427 } 2427 2428 2428 2429 return false; 2429 2430 } … … 2433 2434 return true; 2434 2435 } 2435 2436 2436 2437 if (psArrayLength(output)) { 2437 2438 // negative simple so the default is true … … 2442 2443 } 2443 2444 } 2444 2445 2445 2446 psFree(output); 2446 2447 return(true); … … 2464 2465 } 2465 2466 psS64 numUpdated = psDBAffectedRows(config->dbh); 2466 2467 2467 2468 if (numUpdated != 1) { 2468 2469 psError(PS_ERR_UNKNOWN, false, "should have affected 1 row"); … … 2470 2471 return false; 2471 2472 } 2472 2473 2473 2474 psFree(query); 2474 2475 2475 2476 // Print anything here? 2476 2477 2477 2478 return(true); 2478 2479 } … … 2514 2515 psString limitString = psDBGenerateLimitSQL(limit); 2515 2516 psStringAppend(&query, " %s", limitString); 2516 psStringSubstitute(&query,limitString,"@INNERLIMITS@");2517 psStringSubstitute(&query,limitString,"@INNERLIMITS@"); 2517 2518 psFree(limitString); 2518 2519 … … 3028 3029 3029 3030 PXOPT_COPY_S64(config->args, where, "-template_exp_id", "rawTemplate.exp_id", "=="); 3030 3031 3031 3032 PXOPT_LOOKUP_BOOL(template, config->args, "-template", false); 3032 3033 if (!template) { … … 3083 3084 } 3084 3085 } 3085 3086 3086 3087 // treat limit == 0 as "no limit" 3087 3088 if (limit) { … … 3148 3149 PXOPT_LOOKUP_F64(mjd_obs_begin, config->args, "-mjd_obs_begin", false, false); 3149 3150 PXOPT_LOOKUP_F64(mjd_obs_end, config->args, "-mjd_obs_end", false, false); 3150 3151 3151 3152 PXOPT_LOOKUP_BOOL(template, config->args, "-template", false); 3152 3153 … … 3200 3201 } 3201 3202 } 3202 3203 3203 3204 // treat limit == 0 as "no limit" 3204 3205 if (limit) { -
branches/eam_branches/ipp-20120905/ippTools/src/magictool.c
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/ipp-20120905/ippTools/src/stacktool.c
r34296 r34566 748 748 PXOPT_COPY_STR(config->args, where, "-state", "stackRun.state", "=="); 749 749 PXOPT_COPY_S64(config->args, where, "-sass_id", "stackAssociationMap.sass_id", "=="); 750 PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false); 750 751 if (!psListLength(where->list)) { 751 752 psFree(where); … … 756 757 //CZW join against stackAssociationMap 757 758 psString query = psStringCopy("UPDATE stackRun"); 759 760 if (fault) { 761 psStringAppend(&query, " JOIN stackSumSkyfile USING(stack_id)"); 762 PXOPT_COPY_S16(config->args, where, "-fault", "stackSumSkyfile.fault", "=="); 763 } 758 764 759 765 // pxUpdateRun gets parameters from config->args and updates -
branches/eam_branches/ipp-20120905/ippTools/src/stacktoolConfig.c
r34296 r34566 121 121 psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-state", 0, "search by state", NULL); 122 122 psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-label", 0, "search by label", 0); 123 psMetadataAddS64(updaterunArgs, PS_LIST_TAIL, "-sass_id", 0, "search by stack association ID", 0); 123 psMetadataAddS16(updaterunArgs, PS_LIST_TAIL, "-fault", 0, "search by fault code", 0); 124 psMetadataAddS64(updaterunArgs, PS_LIST_TAIL, "-sass_id", 0, "search by stack association ID", 0); 124 125 psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-set_label", 0, "define new value for label", 0); 125 126 psMetadataAddStr(updaterunArgs, PS_LIST_TAIL, "-set_state", 0, "define new state", NULL); -
branches/eam_branches/ipp-20120905/ippconfig
- Property svn:mergeinfo changed
/trunk/ippconfig merged: 34512,34528,34536,34560
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20120905/ippconfig/gpc1/psastro.config
r34148 r34566 408 408 PSASTRO.GRID.NRAW.MAX S32 2000 409 409 PSASTRO.GRID.NREF.MAX S32 2000 410 PSASTRO.MIN.INST.MAG.RAW F32 - 20.0411 PSASTRO.MAX.INST.MAG.RAW F32 -1 5.0412 PSASTRO.GRID.MIN.INST.MAG.RAW F32 - 20.0410 PSASTRO.MIN.INST.MAG.RAW F32 -19.0 411 PSASTRO.MAX.INST.MAG.RAW F32 -14.0 412 PSASTRO.GRID.MIN.INST.MAG.RAW F32 -19.0 413 413 PSASTRO.GRID.MAX.INST.MAG.RAW F32 -15.0 414 DVO.GETSTAR.MIN.MAG.INST F32 -13.0 415 END 416 414 DVO.GETSTAR.MIN.MAG.INST F32 -19.0 415 DVO.GETSTAR.MIN.MAG F32 16.0 416 417 END 418 -
branches/eam_branches/ipp-20120905/ippconfig/recipes/filerules-mef.mdc
r33979 r34566 88 88 PSPHOT.INPUT.TEXT INPUT @FILES CHIP SRCTEXT 89 89 PSPHOT.EXPNUM INPUT @FILES CHIP MASK 90 91 ## files used by psphotStack 92 PSPHOT.STACK.INPUT.RAW INPUT @FILES CHIP IMAGE 93 PSPHOT.STACK.MASK.RAW INPUT @FILES CHIP MASK 94 PSPHOT.STACK.VARIANCE.RAW INPUT @FILES CHIP VARIANCE 95 PSPHOT.STACK.EXPNUM.RAW INPUT @FILES CHIP EXPNUM 96 PSPHOT.STACK.PSF.RAW INPUT @FILES CHIP PSF 97 PSPHOT.STACK.INPUT.CNV INPUT @FILES CHIP IMAGE 98 PSPHOT.STACK.MASK.CNV INPUT @FILES CHIP MASK 99 PSPHOT.STACK.VARIANCE.CNV INPUT @FILES CHIP VARIANCE 100 PSPHOT.STACK.EXPNUM.CNV INPUT @FILES CHIP EXPNUM 101 PSPHOT.STACK.PSF.CNV INPUT @FILES CHIP PSF 102 PSPHOT.STACK.SOURCES INPUT @FILES FPA CMF 103 90 104 91 105 ## files used by psastro … … 220 234 PSPHOT.BACKSUB OUTPUT {OUTPUT}.sub.fits IMAGE NONE CHIP FALSE MEF 221 235 PSPHOT.BACKMDL OUTPUT {OUTPUT}.mdl.fits IMAGE NONE CHIP FALSE MEF 236 PSPHOT.BACKMDL.STDEV OUTPUT {OUTPUT}.mdl.std.fits IMAGE NONE CHIP FALSE MEF 222 237 PSPHOT.BACKMDL.MEF OUTPUT {OUTPUT}.mdl.fits IMAGE NONE CHIP FALSE MEF 223 238 … … 234 249 PSPHOT.SKY.CONFIG OUTPUT {OUTPUT}.psphot.mdc TEXT NONE FPA TRUE NONE 235 250 236 237 251 # outputs for psphotStack: 238 PSPHOT.CHISQ.IMAGE OUTPUT {OUTPUT}.{CHIP.NAME}.chisq.im.fits IMAGE NONE FPA TRUE SIMPLE 239 PSPHOT.CHISQ.MASK OUTPUT {OUTPUT}.{CHIP.NAME}.chisq.mk.fits MASK NONE FPA TRUE SIMPLE 240 PSPHOT.CHISQ.VARIANCE OUTPUT {OUTPUT}.{CHIP.NAME}.chisq.wt.fits VARIANCE NONE FPA TRUE SIMPLE 241 PSPHOT.STACK.OUTPUT OUTPUT {OUTPUT}.{CHIP.NAME}.sky.{FILE.ID}.cmf CMF NONE FPA TRUE NONE 252 PSPHOT.CHISQ.IMAGE OUTPUT {OUTPUT}.chisq.im.fits IMAGE NONE FPA TRUE NONE 253 PSPHOT.CHISQ.MASK OUTPUT {OUTPUT}.chisq.mk.fits MASK NONE FPA TRUE NONE 254 PSPHOT.CHISQ.VARIANCE OUTPUT {OUTPUT}.chisq.wt.fits VARIANCE NONE FPA TRUE NONE 255 PSPHOT.STACK.OUTPUT.IMAGE OUTPUT {OUTPUT}.stk.{FILE.ID}.im.fits IMAGE NONE FPA TRUE NONE 256 PSPHOT.STACK.OUTPUT.MASK OUTPUT {OUTPUT}.stk.{FILE.ID}.mk.fits MASK NONE FPA TRUE NONE 257 PSPHOT.STACK.OUTPUT.VARIANCE OUTPUT {OUTPUT}.stk.{FILE.ID}.wt.fits VARIANCE NONE FPA TRUE NONE 258 PSPHOT.STACK.OUTPUT OUTPUT {OUTPUT}.stk.{FILE.ID}.cmf CMF NONE FPA TRUE NONE 259 PSPHOT.STACK.PSF.SAVE OUTPUT {OUTPUT}.stk.{FILE.ID}.psf PSF NONE FPA TRUE NONE 260 PSPHOT.STACK.BACKMDL OUTPUT {OUTPUT}.stk.{FILE.ID}.mdl.fits IMAGE NONE FPA TRUE NONE 261 PSPHOT.STACK.BACKMDL.STDEV OUTPUT {OUTPUT}.stk.{FILE.ID}.mdl.sdv.fits IMAGE NONE FPA TRUE NONE 262 263 PSPHOT.STACK.CONFIG OUTPUT {OUTPUT}.psphotStack.mdc TEXT NONE FPA TRUE NONE 264 265 PSPHOT.STACK.RESID OUTPUT {OUTPUT}.stk.{FILE.ID}.res.fits IMAGE COMP_SUB FPA TRUE NONE 266 PSPHOT.STACK.BACKGND OUTPUT {OUTPUT}.stk.{FILE.ID}.bck.fits IMAGE COMP_IMG FPA TRUE NONE 267 PSPHOT.STACK.BACKSUB OUTPUT {OUTPUT}.stk.{FILE.ID}.sub.fits IMAGE COMP_SUB FPA TRUE NONE 268 269 # old outputs for psphotStack: 270 # I think these are wrong 271 #PSPHOT.CHISQ.IMAGE OUTPUT {OUTPUT}.{CHIP.NAME}.chisq.im.fits IMAGE NONE FPA TRUE SIMPLE 272 #PSPHOT.CHISQ.MASK OUTPUT {OUTPUT}.{CHIP.NAME}.chisq.mk.fits MASK NONE FPA TRUE SIMPLE 273 #PSPHOT.CHISQ.VARIANCE OUTPUT {OUTPUT}.{CHIP.NAME}.chisq.wt.fits VARIANCE NONE FPA TRUE SIMPLE 274 #PSPHOT.STACK.OUTPUT OUTPUT {OUTPUT}.{CHIP.NAME}.sky.{FILE.ID}.cmf CMF NONE FPA TRUE NONE 242 275 243 276 SOURCE.PLOT.MOMENTS OUTPUT {OUTPUT}.mnt.png KAPA NONE FPA TRUE NONE -
branches/eam_branches/ipp-20120905/ippconfig/recipes/filerules-simple.mdc
r33979 r34566 64 64 PSPHOT.STACK.MASK.RAW INPUT @FILES CHIP MASK 65 65 PSPHOT.STACK.VARIANCE.RAW INPUT @FILES CHIP VARIANCE 66 PSPHOT.STACK.EXPNUM.RAW INPUT @FILES CHIP MASK 66 67 PSPHOT.STACK.PSF.RAW INPUT @FILES CHIP PSF 67 68 PSPHOT.STACK.INPUT.CNV INPUT @FILES CHIP IMAGE 68 69 PSPHOT.STACK.MASK.CNV INPUT @FILES CHIP MASK 69 70 PSPHOT.STACK.VARIANCE.CNV INPUT @FILES CHIP VARIANCE 71 PSPHOT.STACK.EXPNUM.CNV INPUT @FILES CHIP MASK 70 72 PSPHOT.STACK.PSF.CNV INPUT @FILES CHIP PSF 71 73 PSPHOT.STACK.SOURCES INPUT @FILES FPA CMF … … 195 197 PSPHOT.BACKMDL OUTPUT {OUTPUT}.mdl.fits IMAGE NONE FPA TRUE SIMPLE 196 198 PSPHOT.BACKMDL.MEF OUTPUT {OUTPUT}.mdl.fits IMAGE NONE FPA TRUE SIMPLE 199 PSPHOT.BACKMDL.STDEV OUTPUT {OUTPUT}.mdl.std.fits IMAGE NONE FPA TRUE SIMPLE 197 200 198 201 PSPHOT.OUTPUT.RAW OUTPUT {OUTPUT} RAW NONE FPA TRUE NONE … … 213 216 214 217 # outputs for psphotStack: 215 PSPHOT.CHISQ.IMAGE OUTPUT {OUTPUT}.chisq.im.fits IMAGE NONE FPA TRUE NONE216 PSPHOT.CHISQ.MASK OUTPUT {OUTPUT}.chisq.mk.fits MASK NONE FPA TRUE NONE217 PSPHOT.CHISQ.VARIANCE OUTPUT {OUTPUT}.chisq.wt.fits VARIANCE NONE FPA TRUE NONE218 PSPHOT.CHISQ.IMAGE OUTPUT {OUTPUT}.chisq.im.fits IMAGE NONE FPA TRUE NONE 219 PSPHOT.CHISQ.MASK OUTPUT {OUTPUT}.chisq.mk.fits MASK NONE FPA TRUE NONE 220 PSPHOT.CHISQ.VARIANCE OUTPUT {OUTPUT}.chisq.wt.fits VARIANCE NONE FPA TRUE NONE 218 221 PSPHOT.STACK.OUTPUT.IMAGE OUTPUT {OUTPUT}.stk.{FILE.ID}.im.fits IMAGE NONE FPA TRUE NONE 219 222 PSPHOT.STACK.OUTPUT.MASK OUTPUT {OUTPUT}.stk.{FILE.ID}.mk.fits MASK NONE FPA TRUE NONE 220 223 PSPHOT.STACK.OUTPUT.VARIANCE OUTPUT {OUTPUT}.stk.{FILE.ID}.wt.fits VARIANCE NONE FPA TRUE NONE 221 224 PSPHOT.STACK.OUTPUT OUTPUT {OUTPUT}.stk.{FILE.ID}.cmf CMF NONE FPA TRUE NONE 225 PSPHOT.STACK.PSF.SAVE OUTPUT {OUTPUT}.stk.{FILE.ID}.psf PSF NONE FPA TRUE NONE 226 PSPHOT.STACK.BACKMDL OUTPUT {OUTPUT}.stk.{FILE.ID}.mdl.fits IMAGE NONE FPA TRUE NONE 227 PSPHOT.STACK.BACKMDL.STDEV OUTPUT {OUTPUT}.stk.{FILE.ID}.mdl.sdv.fits IMAGE NONE FPA TRUE NONE 228 PSPHOT.STACK.BACKGND OUTPUT {OUTPUT}.stk.{FILE.ID}.bck.fits IMAGE COMP_IMG FPA TRUE NONE 229 PSPHOT.STACK.BACKSUB OUTPUT {OUTPUT}.stk.{FILE.ID}.sub.fits IMAGE COMP_SUB FPA TRUE NONE 230 PSPHOT.STACK.RESID OUTPUT {OUTPUT}.stk.{FILE.ID}.res.fits IMAGE COMP_SUB FPA TRUE NONE 231 PSPHOT.STACK.CONFIG OUTPUT {OUTPUT}.psphotStack.mdc TEXT NONE FPA TRUE NONE 232 222 233 223 234 SOURCE.PLOT.MOMENTS OUTPUT {OUTPUT}.mnt.png KAPA NONE FPA TRUE NONE -
branches/eam_branches/ipp-20120905/ippconfig/recipes/filerules-split.mdc
r33979 r34566 131 131 PPSTAMP.INPUT.MASK INPUT @FILES CHIP MASK 132 132 PPSTAMP.INPUT.VARIANCE INPUT @FILES CHIP VARIANCE 133 PPSTAMP.INPUT.SOURCES INPUT @FILES CHIP CMF 133 134 134 135 # files used by pparith … … 214 215 PSPHOT.BACKSUB OUTPUT {OUTPUT}.{CHIP.NAME}.sub.fits IMAGE COMP_SUB CHIP TRUE NONE 215 216 PSPHOT.BACKMDL OUTPUT {OUTPUT}.{CHIP.NAME}.mdl.fits IMAGE NONE CHIP TRUE NONE 217 PSPHOT.BACKMDL.STDEV OUTPUT {OUTPUT}.{CHIP.NAME}.mdl.std.fits IMAGE NONE CHIP TRUE NONE 216 218 PSPHOT.BACKMDL.MEF OUTPUT {OUTPUT}.mdl.fits IMAGE NONE CHIP TRUE NONE 217 219 … … 235 237 PSPHOT.CHISQ.MASK OUTPUT {OUTPUT}.chisq.mk.fits MASK NONE FPA TRUE NONE 236 238 PSPHOT.CHISQ.VARIANCE OUTPUT {OUTPUT}.chisq.wt.fits VARIANCE NONE FPA TRUE NONE 237 PSPHOT.STACK.OUTPUT.IMAGE OUTPUT {OUTPUT}.stk.{FILE.ID}.im.fits IMAGE NONE FPA TRUE NONE 238 PSPHOT.STACK.OUTPUT.MASK OUTPUT {OUTPUT}.stk.{FILE.ID}.mk.fits MASK NONE FPA TRUE NONE 239 PSPHOT.STACK.OUTPUT.VARIANCE OUTPUT {OUTPUT}.stk.{FILE.ID}.wt.fits VARIANCE NONE FPA TRUE NONE 240 PSPHOT.STACK.OUTPUT OUTPUT {OUTPUT}.stk.{FILE.ID}.cmf CMF NONE FPA TRUE NONE 239 240 PSPHOT.STACK.OUTPUT.IMAGE OUTPUT {OUTPUT}.stk.{FILE.ID}.im.fits IMAGE NONE FPA TRUE NONE 241 PSPHOT.STACK.OUTPUT.MASK OUTPUT {OUTPUT}.stk.{FILE.ID}.mk.fits MASK NONE FPA TRUE NONE 242 PSPHOT.STACK.OUTPUT.VARIANCE OUTPUT {OUTPUT}.stk.{FILE.ID}.wt.fits VARIANCE NONE FPA TRUE NONE 243 PSPHOT.STACK.OUTPUT OUTPUT {OUTPUT}.stk.{FILE.ID}.cmf CMF NONE FPA TRUE NONE 244 245 PSPHOT.STACK.PSF.SAVE OUTPUT {OUTPUT}.stk.{FILE.ID}.psf PSF NONE FPA TRUE NONE 246 PSPHOT.STACK.BACKMDL OUTPUT {OUTPUT}.stk.{FILE.ID}.mdl.fits IMAGE NONE FPA TRUE NONE 247 248 PSPHOT.STACK.BACKMDL.STDEV OUTPUT {OUTPUT}.stk.{FILE.ID}.mdl.sdv.fits IMAGE NONE FPA TRUE NONE 249 PSPHOT.STACK.BACKGND OUTPUT {OUTPUT}.stk.{FILE.ID}.bck.fits IMAGE COMP_IMG FPA TRUE NONE 250 PSPHOT.STACK.BACKSUB OUTPUT {OUTPUT}.stk.{FILE.ID}.sub.fits IMAGE COMP_SUB FPA TRUE NONE 251 PSPHOT.STACK.RESID OUTPUT {OUTPUT}.stk.{FILE.ID}.res.fits IMAGE COMP_SUB FPA TRUE NONE 241 252 PSPHOT.STACK.CONFIG OUTPUT {OUTPUT}.psphotStack.mdc TEXT NONE FPA TRUE NONE 242 253 … … 333 344 PPSTAMP.OUTPUT.VARIANCE.NOCOMP OUTPUT {OUTPUT}.wt.fits VARIANCE NONE FPA TRUE NONE 334 345 PPSTAMP.OUTPUT.JPEG OUTPUT {OUTPUT}.jpg JPEG NONE FPA TRUE NONE 346 PPSTAMP.OUTPUT.SOURCES OUTPUT {OUTPUT}.cmf CMF NONE FPA TRUE NONE 335 347 # mosaic image used for making stamps of raw images. Not saved. 336 348 PPSTAMP.CHIP OUTPUT {OUTPUT}.ch.fits IMAGE NONE CHIP FALSE MEF -
branches/eam_branches/ipp-20120905/ippconfig/recipes/nightly_science.config
r34065 r34566 7 7 CLEAN_MODES METADATA 8 8 MODE STR WARP 9 #COMMAND STR warptool -dbname @DBNAME@ -updaterun -set_state goto_cleaned -state full -set_label goto_cleaned -label @LABEL@ -data_group @DATA_GROUP@10 COMMAND STR true9 COMMAND STR warptool -dbname @DBNAME@ -updaterun -set_state goto_cleaned -state full -set_label goto_cleaned -label @LABEL@ -data_group @DATA_GROUP@ 10 # COMMAND STR true 11 11 RETENTION_TIME U16 7 12 12 END -
branches/eam_branches/ipp-20120905/ippconfig/recipes/psphot.config
r34417 r34566 196 196 197 197 KRON_ITERATIONS S32 2 198 KRON_APPLY_WEIGHT BOOL FALSE199 KRON_APPLY_WINDOW BOOL FALSE200 198 KRON_SMOOTH BOOL TRUE # smooth pixels before measuring kron radii 201 199 KRON_SMOOTH_SIGMA F32 1.7 … … 289 287 # psphotFitSourcesLinear has 3 options for the weighting: CONSTANT, 290 288 # IMAGE_VAR, MODEL_VAR the first of these used to be folded into the 291 # boolean CONSTANT_PHOTOMETRIC_WEIGHTS above. 289 # boolean CONSTANT_PHOTOMETRIC_WEIGHTS above (so if _MODE set, then 290 # it overrides). 292 291 LINEAR_FIT_VARIANCE_MODE STR CONSTANT 293 292 … … 525 524 526 525 STACKPHOT_SINGLE METADATA 527 PSPHOT.STACK.USE.RAW BOOL F # since false perform photometry & morphology analysis on the convolved images 526 # while not used by psphot directly, staticsky.pl uses to decide if single filter calls psphot with convolved or unconvolved/raw input. 527 PSPHOT.STACK.USE.RAW BOOL T # if false perform photometry & morphology analysis on the convolved images 528 # NOTE: if PSPHOT.STACK.USE.RAW is set to False, KRON.SMOOTH should be 529 # set to false as well in order to get the best MOMENTS_R1 measurement. 530 KRON_SMOOTH BOOL T # smooth before kron radius measurement 531 # default is T and won't work here 528 532 SAVE.BACKMDL BOOL F 529 533 END 534 530 535 531 536 # Recipe overrides for CHIP -
branches/eam_branches/ipp-20120905/ippconfig/recipes/reductionClasses.mdc
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/ipp-20120905/ppImage/src
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/eam_branches/ipp-20120905/ppTranslate/src/ppMops.h
r34284 r34566 28 28 psString output; // Output filename 29 29 psU16 version; // Version (for parameters) 30 psString comment; // Comment associated with the first argument of the diff 31 psString obsMode; // Observation mode 32 psString difftype; // WW (Warp-Warp Diff) or WS (Warp-Stack Diff) or SW (Stack-Warp Diff) 33 float sky; // Exposure avg sky background 34 psString shutoutc; // Camera exposure shutter open (UTC) 30 35 } ppMopsArguments; 31 36 … … 51 56 psVector *ra, *dec; // Sky coordinates 52 57 psVector *raErr, *decErr; // Error in sky coordinates 58 psVector *raExt, *decExt; // Sky coordinates for RA_EXT and DEC_EXT 59 psVector *raExtErr, *decExtErr; // Error in sky coordinates for RA_EXT and DEC_EXT 53 60 psVector *mask; // Mask for detections 54 61 } ppMopsDetections; -
branches/eam_branches/ipp-20120905/ppTranslate/src/ppMopsArguments.c
r34279 r34566 44 44 psFree(args->input); 45 45 psFree(args->exp_name); 46 psFree(args->output); 46 psFree(args->comment); 47 psFree(args->obsMode); 48 psFree(args->difftype); 49 psFree(args->shutoutc); 47 50 return; 48 51 } … … 52 55 ppMopsArguments *args = psAlloc(sizeof(ppMopsArguments)); // Data to return 53 56 psMemSetDeallocator(args, (psFreeFunc)mopsArgumentsFree); 54 55 57 args->input = NULL; 56 58 args->exp_name = NULL; … … 67 69 args->output = NULL; 68 70 args->version = 1; 69 71 args->comment = NULL; 72 args->obsMode = NULL; 73 args->difftype = NULL; 74 args->sky = NAN; 75 args->shutoutc = NULL; 70 76 return args; 71 77 } … … 93 99 psMetadataAddF32(arguments, PS_LIST_TAIL, "-astrom_rms", 0, "Astrometric solution RMS", NAN); 94 100 psMetadataAddU16(arguments, PS_LIST_TAIL, "-version", 0, "CMF file version", 0); 101 psMetadataAddStr(arguments, PS_LIST_TAIL, "-comment", 0, "Exposure comment", "No comment provided"); 102 psMetadataAddStr(arguments, PS_LIST_TAIL, "-obsmode", 0, "Observation mode", "No obsmode provided"); 103 psMetadataAddStr(arguments, PS_LIST_TAIL, "-difftype", 0, "Either WW (Warp-Warp Diff) or WS (Warp-Stack Diff)", "No difftype provided"); 104 psMetadataAddF32(arguments, PS_LIST_TAIL, "-sky", 0, "Exposure avg sky background", NAN); 105 psMetadataAddStr(arguments, PS_LIST_TAIL, "-shutoutc", 0, "Camera exposure shutter open (UTC)", "No shutoutc provided"); 95 106 if (argc == 1 || !psArgumentParse(arguments, &argc, argv) || argc != 3) { 96 107 usage(argv[0], arguments); … … 120 131 args->rmsAstrom = psMetadataLookupF32(NULL, arguments, "-astrom_rms"); 121 132 args->version = psMetadataLookupU16(NULL, arguments, "-version"); 133 args->comment = psMemIncrRefCounter(psMetadataLookupStr(NULL, arguments, "-comment")); 134 args->obsMode = psMemIncrRefCounter(psMetadataLookupStr(NULL, arguments, "-obsmode")); 135 args->difftype = psMemIncrRefCounter(psMetadataLookupStr(NULL, arguments, "-difftype")); 136 args->sky = psMetadataLookupF32(NULL, arguments, "-sky"); 137 args->shutoutc = psMemIncrRefCounter(psMetadataLookupStr(NULL, arguments, "-shutoutc")); 122 138 123 139 psTrace("ppMops.args", 1, "Done parsing command-line arguments\n"); -
branches/eam_branches/ipp-20120905/ppTranslate/src/ppMopsGetSkyChipPsfVersion.c
r34279 r34566 16 16 } else if (strcmp(version, "PS1_DV3") == 0) { 17 17 psFree(headerSkyChip); 18 return 2;18 return 3; 19 19 } 20 20 psWarning("Unsupported EXTTYPE in SkyChip.psf table: [%s]", version); -
branches/eam_branches/ipp-20120905/ppTranslate/src/ppMopsMerge.c
r34279 r34566 301 301 vector->n, newLength); 302 302 } 303 304 } 303 } 305 304 // XXX IS this safe? Perhaps save in numGood? 306 305 det->num = newLength; -
branches/eam_branches/ipp-20120905/ppTranslate/src/ppMopsRead.c
r34285 r34566 1 /* 2 * 3 * 4 * 5 * 6 * 7 * 8 * 9 * 10 * 11 * 12 * 13 * 14 * 15 * 16 * 17 * 18 * 19 * 20 * 21 * 22 * 23 * 24 * 25 * 26 * 27 * 28 * 29 * 30 * THIS CODE CONTAINS DIRTY BUG FIXES! 31 * 32 * 33 * 34 * 35 * 36 * 37 * 38 * Look for "DIRTY_BUG_FIX" to know where 39 * 40 * and set the following to 0 to change the code 41 */ 42 #define DIRTY_BUG_FIX 1 43 /* 44 * 45 * 46 * 47 * 48 * 49 * 50 * 51 * 52 * 53 * 54 * 55 * 56 * 57 * 58 * 59 * 60 * 61 * 62 * 63 * 64 * 65 * 66 * 67 * 68 * 69 * 70 * 71 * 72 * 73 * 74 * 75 * 76 * 77 */ 78 1 79 #ifdef HAVE_CONFIG_H 2 80 #include <config.h> … … 8 86 #include "ppMops.h" 9 87 10 static void addDummyValues(psMetadata* md, long size );88 static void addDummyValues(psMetadata* md, long size, int version); 11 89 static void replaceDummyValuesF32(const char* colName, psMetadata* source, psMetadata* target, psVector* indexes); 90 static void replaceDummyValuesS32(const char* colName, psMetadata* source, psMetadata* target, psVector* indexes); 91 static void renameDummyValuesF32(const char* colNameSource, psMetadata* source, const char* colNameTarget, psMetadata* target, psVector* indexes); 92 #if DIRTY_BUG_FIX 93 static psVector* createDummyF32_default(long size, float default_value); 94 #endif 12 95 13 96 /* … … 24 107 for (int i = 0; i < num; i++) { 25 108 const char *name = inNames->data[i]; 109 printf("%s\n", name); 26 110 27 111 psFits *fits = psFitsOpen(name, "r"); // FITS file … … 95 179 det->az = psMetadataLookupF64(NULL, header, "FPA.AZ"); 96 180 det->mjd = psMetadataLookupF64(NULL, header, "MJD-OBS") + det->exptime / 2.0 / 3600 / 24; 97 98 det->seeing = (float) 0.5 * (psMetadataLookupF32(NULL, header, "FWHM_MAJ") + 99 psMetadataLookupF32(NULL, header, "FWHM_MIN")); 100 181 //The global SEEING is the mean of all defined FWHM_MAJ 182 det->seeing = psMetadataLookupF32(NULL, header, "FWHM_MAJ"); 101 183 det->naxis1 = psMetadataLookupS32(NULL, header, "IMNAXIS1"); // Number of columns 102 184 det->naxis2 = psMetadataLookupS32(NULL, header, "IMNAXIS2"); // Number of rows 103 104 185 psFree(header); 105 186 … … 116 197 if (skyChipPsfVersion >= 2) { 117 198 //First: append all the new columns that we want to the existing table 118 addDummyValues(det->table, size );199 addDummyValues(det->table, size, args->version); 119 200 if (!psFitsMoveExtName(fits, "SkyChip.xfit")) { 120 201 psTrace("ppMops.read", 3, "No fitted trails extension"); 121 202 } else { 122 203 psTrace("ppMops.read", 3, "Fitted trails extension found\n"); 204 psTrace("ppMops.read", 10, "Getting size?\n"); 123 205 int fittedTrailsSize = psFitsTableSize(fits); 206 psTrace("ppMops.read", 10, "size = %d\n", fittedTrailsSize); 124 207 if (fittedTrailsSize <= 0) { 125 208 psErrorStackPrint(stderr, "Unable to determine size of fitted trails extension table %d", i); … … 127 210 psErrorClear(); 128 211 } else { 212 psTrace("ppMops.read", 10, "Reading table of interest?\n"); 129 213 psMetadata* fittedTrails = psFitsReadTableAllColumns(fits); // Table of interest 214 psTrace("ppMops.read", 10, "OK for table of interest\n"); 130 215 if (!fittedTrails) { 131 216 psError(PS_ERR_IO, false, "Unable to read fittedTrails table in file %d", i); … … 133 218 } 134 219 //Iterate on the different names and types expected in the fittedTrails parameters 220 psTrace("ppMops.read", 10, "Getting IPP_IDET\n"); 135 221 psVector* idet = psMetadataLookupVector(NULL, fittedTrails, "IPP_IDET"); 136 222 replaceDummyValuesF32("X_EXT", fittedTrails, det->table, idet); … … 140 226 replaceDummyValuesF32("EXT_INST_MAG", fittedTrails, det->table, idet); 141 227 replaceDummyValuesF32("EXT_INST_MAG_SIG", fittedTrails, det->table, idet); 142 replaceDummyValues F32("NPARAMS", fittedTrails, det->table, idet);228 replaceDummyValuesS32("NPARAMS", fittedTrails, det->table, idet); 143 229 replaceDummyValuesF32("EXT_WIDTH_MAJ", fittedTrails, det->table, idet); 144 230 replaceDummyValuesF32("EXT_WIDTH_MIN", fittedTrails, det->table, idet); 145 231 replaceDummyValuesF32("EXT_THETA", fittedTrails, det->table, idet); 146 232 replaceDummyValuesF32("EXT_WIDTH_MAJ_ERR", fittedTrails, det->table, idet); 147 replaceDummyValuesF32("EXT_WIDTH_MIN_ERR", fittedTrails, det->table, idet); 233 // EXT_WIDTH_MIN_ERR is actually undefined but set to 0. in CMF files 234 // We explicitely let it set to NaN, hence the commented out 235 // following line 236 //replaceDummyValuesF32("EXT_WIDTH_MIN_ERR", fittedTrails, det->table, idet); 148 237 replaceDummyValuesF32("EXT_THETA_ERR", fittedTrails, det->table, idet); 238 psTrace("ppMops.read", 10, "Got all version 2 values\n"); 239 if (skyChipPsfVersion >= 3) { 240 psTrace("ppMops.read", 10, "Getting PS1_DV3 data\n"); 241 replaceDummyValuesF32("RA_EXT", fittedTrails, det->table, idet); 242 // Note: RA_EXT_SIGMA is computed (see det->raExtErr) 243 replaceDummyValuesF32("DEC_EXT", fittedTrails, det->table, idet); 244 // Note: DEC_EXT_SIGMA is computed (see det->decExtErr) 245 //Note: POSANG_EXT is POSANGLE in xfit 246 #if DIRTY_BUG_FIX 247 #else 248 renameDummyValuesF32("POSANGLE", fittedTrails, "POSANG_EXT", det->table, idet); 249 #endif 250 //Note: PLTSCALE_EXT in xfit is PLTSCALE 251 renameDummyValuesF32("PLTSCALE", fittedTrails, "PLTSCALE_EXT", det->table, idet); 252 renameDummyValuesF32("EXT_INST_FLUX", fittedTrails, "EXT_FLUX", det->table, idet); 253 replaceDummyValuesF32("EXT_CAL_MAG", fittedTrails, det->table, idet); 254 renameDummyValuesF32("EXT_INST_MAG_SIG", fittedTrails, "EXT_MAG_SIG", det->table, idet); 255 replaceDummyValuesF32("EXT_CHISQ", fittedTrails, det->table, idet); 256 replaceDummyValuesS32("EXT_NDOF", fittedTrails, det->table, idet); 257 psTrace("ppMops.read", 10, "Got all version 3 values\n"); 258 } 149 259 } 150 260 } 151 261 } 152 153 262 psFitsClose(fits); 154 263 … … 161 270 psVector *ra = psMetadataLookupVector(NULL, table, "RA_PSF"); 162 271 psVector *dec = psMetadataLookupVector(NULL, table, "DEC_PSF"); 163 164 272 det->raErr = psVectorAlloc(size, PS_TYPE_F64); 165 273 det->decErr = psVectorAlloc(size, PS_TYPE_F64); 274 if (skyChipPsfVersion >= 3) { 275 det->raExtErr = psVectorAlloc(size, PS_TYPE_F64); 276 det->decExtErr = psVectorAlloc(size, PS_TYPE_F64); 277 } else { 278 det->raExtErr = NULL; 279 det->decExtErr = NULL; 280 } 166 281 det->mask = psVectorAlloc(size, PS_TYPE_U8); 167 282 … … 177 292 178 293 // Add our new vectors to the table so that duplicates and masked items may be purged 294 psMetadataAddVector(table, PS_LIST_HEAD, "RA_ERR", 0, NULL, det->raErr); 179 295 psMetadataAddVector(table, PS_LIST_HEAD, "DEC_ERR", 0, NULL, det->decErr); 180 psMetadataAddVector(table, PS_LIST_HEAD, "RA_ERR", 0, NULL, det->raErr); 296 if (skyChipPsfVersion >= 3) { 297 psMetadataAddVector(table, PS_LIST_HEAD, "RA_EXT_SIGMA", 0, NULL, det->raExtErr); 298 psMetadataAddVector(table, PS_LIST_HEAD, "DEC_EXT_SIGMA", 0, NULL, det->decExtErr); 299 } 181 300 182 301 psTrace("ppMops.read", 2, "Read %ld rows from %s\n", det->num, det->component); … … 189 308 psVector *angleV = psMetadataLookupVector(NULL, table, "POSANGLE"); 190 309 psVector *flagsV = psMetadataLookupVector(NULL, table, "FLAGS"); 310 psVector *xExtErrV = NULL; 311 psVector *yExtErrV = NULL; 312 psVector *scaleExtV = NULL; 313 psVector *angleExtV = NULL; 314 if (skyChipPsfVersion >= 3) { 315 xExtErrV = psMetadataLookupVector(NULL, table, "X_EXT_SIG"); 316 yExtErrV = psMetadataLookupVector(NULL, table, "Y_EXT_SIG"); 317 scaleExtV = psMetadataLookupVector(NULL, table, "PLTSCALE_EXT"); 318 angleExtV = psMetadataLookupVector(NULL, table, "POSANG_EXT"); 319 } 191 320 192 321 double plateScale = 0.0; // Plate scale 193 322 long numGood = 0; // Number of good rows 194 323 for (long row = 0; row < size; row++) { 195 196 324 psU32 flags = flagsV->data.U32[row]; // psFitsTableGetU32(NULL, table, row, "FLAGS"); 197 325 if (flags & SOURCE_MASK) { … … 205 333 double yErr = yErrV->data.F32[row]; 206 334 double scale = scaleV->data.F32[row]; 335 #if DIRTY_BUG_FIX 336 double angle = 0. * angleV->data.F32[row]; 337 #else 207 338 double angle = angleV->data.F32[row]; 339 #endif 208 340 209 341 if (!isfinite(det->x->data.F32[row]) || !isfinite(det->y->data.F32[row]) || … … 233 365 plateScale += scale; 234 366 numGood++; 235 } 236 det->seeing *= ((float) plateScale) / ((float) numGood); 237 238 // Are we using numGood for anything outside of this function? 367 368 // Same for EXT data if version permits 369 if (skyChipPsfVersion >= 3) { 370 xErr = xExtErrV->data.F32[row]; 371 yErr = yExtErrV->data.F32[row]; 372 scale = scaleExtV->data.F32[row]/3600.; 373 #if DIRTY_BUG_FIX 374 angle = 0.; 375 #else 376 angle = angleExtV->data.F32[row]; 377 #endif 378 cosAngle = cos(angle); 379 sinAngle = sin(angle); 380 cosAngle2 = PS_SQR(cosAngle); 381 sinAngle2 = PS_SQR(sinAngle); 382 xErr2 = PS_SQR(xErr); 383 yErr2 = PS_SQR(yErr); 384 errScale = scale / 3600.0; 385 det->raExtErr->data.F64[row] = errScale * sqrt(cosAngle2 * xErr2 + sinAngle2 * yErr2); 386 det->decExtErr->data.F64[row] = errScale * sqrt(sinAngle2 * xErr2 + cosAngle2 * yErr2); 387 } 388 } 239 389 det->numGood = numGood; 240 390 … … 256 406 return dummy; 257 407 } 258 259 static void addDummyValues(psMetadata* md, long size) { 408 #if DIRTY_BUG_FIX 409 static psVector* createDummyF32_default(long size, float default_value) { 410 psVector* dummy = psVectorAlloc(size, PS_TYPE_F32); 411 psVectorInit(dummy, default_value); 412 return dummy; 413 } 414 #endif 415 static psVector* createDummyS32(long size) { 416 psVector* dummy = psVectorAlloc(size, PS_TYPE_S32); 417 psVectorInit(dummy, NAN); 418 return dummy; 419 } 420 421 static void addDummyValues(psMetadata* md, long size, int version) { 260 422 psMetadataAdd(md, PS_LIST_TAIL, "X_EXT", PS_DATA_VECTOR, "EXT model x coordinate", createDummyF32(size)); 261 423 psMetadataAdd(md, PS_LIST_TAIL, "Y_EXT", PS_DATA_VECTOR, "EXT model y coordinate", createDummyF32(size)); … … 264 426 psMetadataAdd(md, PS_LIST_TAIL, "EXT_INST_MAG", PS_DATA_VECTOR, "EXT fit instrumental magnitude", createDummyF32(size)); 265 427 psMetadataAdd(md, PS_LIST_TAIL, "EXT_INST_MAG_SIG", PS_DATA_VECTOR, "Sigma of PSF instrumental magnitude", createDummyF32(size)); 266 psMetadataAdd(md, PS_LIST_TAIL, "NPARAMS", PS_DATA_VECTOR, "Number of model parameters", createDummy F32(size));428 psMetadataAdd(md, PS_LIST_TAIL, "NPARAMS", PS_DATA_VECTOR, "Number of model parameters", createDummyS32(size)); 267 429 psMetadataAdd(md, PS_LIST_TAIL, "EXT_WIDTH_MAJ", PS_DATA_VECTOR, "EXT width (major axis), length for trail", createDummyF32(size)); 268 430 psMetadataAdd(md, PS_LIST_TAIL, "EXT_WIDTH_MIN", PS_DATA_VECTOR, "EXT width (minor axis), sigma for trail", createDummyF32(size)); … … 271 433 psMetadataAdd(md, PS_LIST_TAIL, "EXT_WIDTH_MIN_ERR", PS_DATA_VECTOR, "EXT width error (minor axis)", createDummyF32(size)); 272 434 psMetadataAdd(md, PS_LIST_TAIL, "EXT_THETA_ERR", PS_DATA_VECTOR, "EXT orientation angle (error)", createDummyF32(size)); 435 if (version >= 3) { 436 psTrace("ppMops.read", 10, "Adding columns for version PS1_DV%d\n", version); 437 psMetadataAdd(md, PS_LIST_TAIL, "RA_EXT", PS_DATA_VECTOR, "Fitted centroid RA", createDummyF32(size)); 438 /* psMetadataAdd(md, PS_LIST_TAIL, "RA_EXT_SIGMA", PS_DATA_VECTOR, "Fitted RA sigma", createDummyF32(size)); *\/ */ 439 psMetadataAdd(md, PS_LIST_TAIL, "DEC_EXT", PS_DATA_VECTOR, "Fitted centroid DEC", createDummyF32(size)); 440 /* psMetadataAdd(md, PS_LIST_TAIL, "DEC_EXT_SIGMA", PS_DATA_VECTOR, "Fitted DEC sigma", createDummyF32(size)); *\/ */ 441 #if DIRTY_BUG_FIX 442 psMetadataAdd(md, PS_LIST_TAIL, "POSANG_EXT", PS_DATA_VECTOR, "Fitted position angle", createDummyF32_default(size, 0.)); 443 #else 444 psMetadataAdd(md, PS_LIST_TAIL, "POSANG_EXT", PS_DATA_VECTOR, "Fitted position angle", createDummyF32(size)); 445 #endif 446 psMetadataAdd(md, PS_LIST_TAIL, "PLTSCALE_EXT", PS_DATA_VECTOR, "Plate scale at centroid", createDummyF32(size)); 447 psMetadataAdd(md, PS_LIST_TAIL, "EXT_FLUX", PS_DATA_VECTOR, "Fitted flux", createDummyF32(size)); 448 psMetadataAdd(md, PS_LIST_TAIL, "EXT_CAL_MAG", PS_DATA_VECTOR, "Calibrated mag", createDummyF32(size)); 449 psMetadataAdd(md, PS_LIST_TAIL, "EXT_MAG_SIG", PS_DATA_VECTOR, "Mag sigma", createDummyF32(size)); 450 psMetadataAdd(md, PS_LIST_TAIL, "EXT_CHISQ", PS_DATA_VECTOR, "Chi^2 of fit", createDummyF32(size)); 451 psMetadataAdd(md, PS_LIST_TAIL, "EXT_NDOF", PS_DATA_VECTOR, "Fit degrees of freedom", createDummyS32(size)); 452 } 273 453 } 274 454 275 455 static void replaceDummyValuesF32(const char* colName, psMetadata* source, psMetadata* target, psVector* indexes) { 456 psTrace("ppMops.read", 10, "Trying to get column %s\n", colName); 276 457 psVector* source_vector = psMetadataLookupVector(NULL, source, colName); 277 458 psVector* target_vector = psMetadataLookupVector(NULL, target, colName); … … 279 460 target_vector->data.F32[indexes->data.S64[index]] = source_vector->data.F32[index]; 280 461 } 281 } 462 psTrace("ppMops.read", 10, "OK for %s\n", colName); 463 } 464 465 static void replaceDummyValuesS32(const char* colName, psMetadata* source, psMetadata* target, psVector* indexes) { 466 psTrace("ppMops.read", 10, "Trying to get column %s\n", colName); 467 psVector* source_vector = psMetadataLookupVector(NULL, source, colName); 468 psVector* target_vector = psMetadataLookupVector(NULL, target, colName); 469 for (long index = 0; index<indexes->n; ++index) { 470 target_vector->data.S32[indexes->data.S64[index]] = source_vector->data.S32[index]; 471 } 472 psTrace("ppMops.read", 10, "OK for %s\n", colName); 473 } 474 475 static void renameDummyValuesF32(const char* colNameSource, psMetadata* source, const char* colNameTarget, psMetadata* target, psVector* indexes) { 476 psTrace("ppMops.read", 10, "Trying to rename column %s to %s\n", colNameSource, colNameTarget); 477 psVector* source_vector = psMetadataLookupVector(NULL, source, colNameSource); 478 psVector* target_vector = psMetadataLookupVector(NULL, target, colNameTarget); 479 for (long index = 0; index<indexes->n; ++index) { 480 target_vector->data.F32[indexes->data.S64[index]] = source_vector->data.F32[index]; 481 } 482 psTrace("ppMops.read", 10, "OK for %s (renamed by %s)\n", colNameSource, colNameTarget); 483 } -
branches/eam_branches/ipp-20120905/ppTranslate/src/ppMopsWrite.c
r34466 r34566 41 41 // seeings 42 42 ppMopsDetections *det = NULL; 43 int validSeeingCount = 0;44 43 for (int d = 0; d < detections->n; d++) { 45 44 if (detections->data[d] != NULL) { … … 47 46 det = detections->data[d]; 48 47 } 49 if (isfinite(((ppMopsDetections*) detections->data[d])->seeing)) { 50 validSeeingCount += 1; 51 } 52 } 53 } 48 } 49 } 50 //Get the SEEING weighted mean 51 float seeing = 0.; 52 int totalGood = 0; 53 for (int d = 0; d < detections->n; d++) { 54 if ( (detections->data[d] != NULL) && (isfinite(((ppMopsDetections*) detections->data[d])->seeing)) ) { 55 seeing += ((ppMopsDetections*) detections->data[d])->seeing; 56 totalGood += 1; 57 } 58 } 59 seeing /= (float) totalGood; 54 60 if (det != NULL) { 55 //Get the SEEING median56 psVector* seeingValues = psVectorAlloc(validSeeingCount, PS_TYPE_F32);57 psVectorInit(seeingValues, NAN);58 validSeeingCount = 0;59 for (int d = 0; d < detections->n; d++) {60 if ( (detections->data[d] != NULL) && (isfinite(((ppMopsDetections*) detections->data[d])->seeing)) ){61 seeingValues->data.F32[validSeeingCount++] = ((ppMopsDetections*) detections->data[d])->seeing;62 }63 }64 psStats *seeingStats = psStatsAlloc(PS_STAT_SAMPLE_MEDIAN);65 psVectorStats(seeingStats, seeingValues, NULL, NULL, 0);66 61 psMetadataAddF64(header, PS_LIST_TAIL, "MJD-OBS", 0, "MJD of exposure midpoint", det->mjd); 67 62 psMetadataAddStr(header, PS_LIST_TAIL, "RA", 0, "Right Ascension of boresight", det->raBoresight); … … 73 68 psMetadataAddStr(header, PS_LIST_TAIL, "FILTER", 0, "Filter name", det->filter); 74 69 psMetadataAddF32(header, PS_LIST_TAIL, "AIRMASS", 0, "Airmass of exposure", det->airmass); 75 psMetadataAddF32(header, PS_LIST_TAIL, "SEEING", 0, "Mean seeing", seeingStats->sampleMedian); 70 psMetadataAddF32(header, PS_LIST_TAIL, "SEEING", 0, "Mean seeing", seeing); 71 //MOPS want the name FWHM for SEEING 72 psMetadataAddF32(header, PS_LIST_TAIL, "FWHM", 0, "Mean seeing", seeing); 76 73 } else { 77 74 psWarning("no inputs with surviving detections. output header will be incomplete"); … … 79 76 psMetadataAddStr(header, PS_LIST_TAIL, "OBSCODE", 0, "IAU Observatory code", OBSERVATORY_CODE); 80 77 psMetadataAddF32(header, PS_LIST_TAIL, "MAGZP", 0, "Magnitude zero point", args->zp); 78 //MOPS want the name ZEROPOINT for MAGZP 79 psMetadataAddF32(header, PS_LIST_TAIL, "ZEROPOINT", 0, "Magnitude zero point", args->zp); 81 80 psMetadataAddF32(header, PS_LIST_TAIL, "MAGZPERR", 0, "Error in magnitude zero point", args->zpErr); 82 81 psMetadataAddF32(header, PS_LIST_TAIL, "ASTRORMS", 0, "RMS of astrometric fit", args->rmsAstrom); 82 psMetadataAddStr(header, PS_LIST_TAIL, "COMMENT", 0, "Exposure comment", args->comment); 83 psMetadataAddStr(header, PS_LIST_TAIL, "OBS_MODE", 0, "Exposure observation mode", args->obsMode); 84 psMetadataAddStr(header, PS_LIST_TAIL, "DIFFTYPE", 0, "WW: Warp-Warp diff / WS: Warp-Stack diff / SW: Stack-Warp diff", args->difftype); 85 psMetadataAddF32(header, PS_LIST_TAIL, "SKY", 0, "Exposure avg sky background", args->sky); 86 psMetadataAddStr(header, PS_LIST_TAIL, "SHUTOUTC", 0, "Camera exposure shutter open (UTC)", args->shutoutc); 83 87 84 88 //field in header that tells about the CMF version … … 187 191 0); 188 192 if (args->version == 3) { 189 // TODO: Write data of version 3 (see ICD) 193 // Write data of version 3 (see ICD) 194 psMetadataAdd (row, PS_LIST_TAIL, "RA_EXT", PS_DATA_F32, "Fitted centroid RA", 195 0); 196 psMetadataAdd (row, PS_LIST_TAIL, "RA_EXT_SIGMA", PS_DATA_F32, "Fitted RA sigma", 197 0); 198 psMetadataAdd (row, PS_LIST_TAIL, "DEC_EXT", PS_DATA_F32, "Fitted centroid DEC", 199 0); 200 psMetadataAdd (row, PS_LIST_TAIL, "DEC_EXT_SIGMA", PS_DATA_F32, "Fitted DEC sigma", 201 0); 202 psMetadataAdd (row, PS_LIST_TAIL, "POSANG_EXT", PS_DATA_F32, "Fitted position angle", 203 0); 204 psMetadataAdd (row, PS_LIST_TAIL, "PLTSCALE_EXT", PS_DATA_F32, "Plate scale at centroid", 205 0); 206 psMetadataAdd (row, PS_LIST_TAIL, "EXT_FLUX", PS_DATA_F32, "Fitted flux", 207 0); 208 psMetadataAdd (row, PS_LIST_TAIL, "EXT_CAL_MAG", PS_DATA_F32, "Calibrated mag", 209 0); 210 psMetadataAdd (row, PS_LIST_TAIL, "EXT_MAG_SIG", PS_DATA_F32, "Mag sigma", 211 0); 212 psMetadataAdd (row, PS_LIST_TAIL, "EXT_CHISQ", PS_DATA_F32, "Chi^2 of fit", 213 0); 214 psMetadataAdd (row, PS_LIST_TAIL, "EXT_NDOF", PS_DATA_F32, "Fit degrees of freedom", 215 0); 190 216 } 191 217 } … … 276 302 addColumn("EXT_THETA_ERR", NULL, 0); 277 303 } 304 if (args->version >= 3) { 305 addColumn("RA_EXT", NULL, 0); 306 addColumn("RA_EXT_SIGMA", NULL, 0); 307 addColumn("DEC_EXT", NULL, 0); 308 addColumn("DEC_EXT_SIGMA", NULL, 0); 309 addColumn("POSANG_EXT", NULL, 0); 310 addColumn("PLTSCALE_EXT", NULL, 0); 311 addColumn("EXT_FLUX", NULL, 0); 312 addColumn("EXT_CAL_MAG", NULL, 0); 313 addColumn("EXT_MAG_SIG", NULL, 0); 314 addColumn("EXT_CHISQ", NULL, 0); 315 addColumn("EXT_NDOF", NULL, 0); 316 } 317 278 318 if (!psFitsWriteTableAllColumns(fits, header, table, OUT_EXTNAME)) { 279 319 psError(psErrorCodeLast(), false, "Unable to write table"); -
branches/eam_branches/ipp-20120905/psvideophot
- Property svn:mergeinfo changed (with no actual effect on merging)
Note:
See TracChangeset
for help on using the changeset viewer.
