Changeset 28534
- Timestamp:
- Jun 28, 2010, 8:11:04 PM (16 years ago)
- Location:
- branches/pap
- Files:
-
- 25 edited
-
. (modified) (1 prop)
-
Nebulous-Server/bin/neb-host (modified) (2 diffs)
-
Nebulous-Server/bin/nebdiskd (modified) (3 diffs)
-
Nebulous-Server/lib/Nebulous/Server.pm (modified) (2 diffs)
-
Nebulous/bin/neb-ls (modified) (7 diffs)
-
Nebulous/lib/Nebulous/Client.pm (modified) (2 diffs)
-
ippScripts/scripts/automate_stacks.pl (modified) (1 diff)
-
ippScripts/scripts/dqstats_bundle.pl (modified) (3 diffs)
-
ippTasks/dqstats.pro (modified) (3 diffs)
-
ippTasks/ipphosts.mhpcc.config (modified) (1 diff)
-
ippToPsps/scripts/createDb.pl (modified) (5 diffs)
-
ippToPsps/scripts/ippToPsps_run.pl (modified) (6 diffs)
-
ippToPsps/src/ippToPsps.c (modified) (5 diffs)
-
ippToPsps/src/ippToPsps.h (modified) (2 diffs)
-
ippToPsps/src/ippToPspsBatchDetection.c (modified) (1 diff)
-
ippToPsps/src/ippToPspsBatchTest.c (modified) (1 diff)
-
ippTools/src/bgtool.c (modified) (1 diff)
-
ippTools/src/bgtoolConfig.c (modified) (1 diff)
-
ippTools/src/magictool.c (modified) (1 diff)
-
magic/remove/src/streaksremove.c (modified) (4 diffs)
-
psLib/src/fits/psFitsImage.c (modified) (1 diff)
-
psLib/src/fits/psFitsTable.c (modified) (4 diffs)
-
psModules/src/objects/pmSourceMatch.c (modified) (1 diff)
-
psModules/src/objects/pmSourcePhotometry.c (modified) (1 diff)
-
psphot/src/psphotApResid.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/pap
- Property svn:mergeinfo changed
/trunk (added) merged: 28500,28502,28507,28509-28512,28514,28516-28518,28520,28522,28524-28532
- Property svn:mergeinfo changed
-
branches/pap/Nebulous-Server/bin/neb-host
r28492 r28534 159 159 160 160 neb-host [<nebulous host> <nebulous state>] 161 [--note '<status note>'] 161 162 [--host <nebulous host>] [--state <up|down|repair>] 162 163 [--dbhost <database host>] [--db <database name>] … … 174 175 =over 4 175 176 177 =item * --note <status note> 178 179 Set a status note for the specified volume. 180 176 181 =item * --host <nebulous host> 177 182 -
branches/pap/Nebulous-Server/bin/nebdiskd
r28492 r28534 53 53 # set the process name for easy pgrep-ability 54 54 $0 = 'nebdiskd'; 55 my $rcfile = "$ENV{HOME}/.nebdiskrc"; 55 #my $rcfile = "$ENV{HOME}/.nebdiskrc"; 56 my $rcfile = $ENV{NEBDISKDRC}; 57 unless (defined($rcfile)) { 58 $rcfile = '/etc/nebdiskd.rc'; 59 } 56 60 $rcfile = File::Spec->canonpath($rcfile); 57 61 … … 71 75 my %host_removed = (); 72 76 my $failure_limit = 5; 73 74 75 77 76 78 #my $mounts = $c->get_mounts; … … 143 145 $SIG{HUP} = sub { $c = read_rcfile($rcfile) }; 144 146 147 my $date = localtime(); 148 $log->warn("BEGIN: $date with RCFILE: $rcfile"); 145 149 146 150 while (1) { -
branches/pap/Nebulous-Server/lib/Nebulous/Server.pm
r28446 r28534 9 9 no warnings qw( uninitialized ); 10 10 11 our $VERSION = '0.1 7';11 our $VERSION = '0.18'; 12 12 13 13 use base qw( Class::Accessor::Fast ); … … 1508 1508 1509 1509 return \@keys; 1510 } 1511 1512 sub find_objects_wildcard 1513 { 1514 my $self = shift; 1515 1516 my $log = $self->log; 1517 $log->debug( "entered - @_" ); 1518 1519 my ($pattern) = validate_pos( @_, 1520 { 1521 type => SCALAR, 1522 optional => 1, 1523 }, 1524 ); 1525 1526 my $sql = $self->sql; 1527 my $db = $self->_db_for_index(0); 1528 1529 # validate that we have a key to deal with 1530 eval { 1531 $pattern = parse_neb_key($pattern) if defined $pattern; 1532 }; 1533 $log->logdie("$@") if $@; 1534 1535 unless (defined $pattern) { 1536 $log->debug( "leaving" ); 1537 $log->logdie("no keys found"); 1538 } 1539 1540 # parse out the directory we're working in, and decide if we are a directory 1541 my $dir_id = $self->_resolve_dir_parent_id(key => $pattern, dir_id => 1); 1542 my $work_dir; 1543 my $file_pattern; 1544 if (defined $dir_id) { 1545 $work_dir = $pattern; 1546 $file_pattern = '%'; 1547 } 1548 else { 1549 my $dir_plain = dirname($pattern); 1550 if ($dir_plain eq 'neb:') { 1551 $dir_plain = 'neb:///'; 1552 } 1553 if ($dir_plain) { 1554 $work_dir = parse_neb_key($dir_plain); 1555 } 1556 else { 1557 $work_dir = parse_neb_key('/'); 1558 } 1559 $file_pattern = basename $pattern; 1560 unless ($file_pattern) { 1561 $file_pattern = '%'; 1562 } 1563 1564 $dir_id = $self->_resolve_dir_parent_id(key => $work_dir, dir_id => 1); 1565 unless (defined $dir_id) { 1566 $log->logdie("pattern $work_dir does not match any key or directory"); 1567 } 1568 } 1569 1570 # find dirs under dir 1571 my @dir_keys; 1572 1573 eval { 1574 $log->debug("looking for directories under dir: $dir_id"); 1575 my $query = $db->prepare_cached( $sql->find_dir_by_parent_id . " AND dirname LIKE ? "); 1576 $query->execute( $dir_id, $file_pattern ); 1577 1578 while ( my $row = $query->fetchrow_hashref ) { 1579 next if $row->{'dir_id'} == 1; 1580 my $dir = $row->{'dirname'}; 1581 if ($dir_id == 1) { 1582 push @dir_keys, $dir . '/' if $dir; 1583 } else { 1584 push @dir_keys, $work_dir->path . '/' . $dir . '/' if $dir; 1585 } 1586 $log->debug( "matched $dir" ) if $dir; 1587 } 1588 }; 1589 $log->logdie("database error: $@") if $@; 1590 1591 # find files under dir 1592 my @keys; 1593 eval { 1594 $log->debug("looking for objects under dir: $dir_id"); 1595 my $query = $db->prepare_cached( $sql->find_object_by_dir_id . " AND ext_id_basename LIKE ? "); 1596 $query->execute( $dir_id , $file_pattern); 1597 1598 while ( my $row = $query->fetchrow_hashref ) { 1599 my $key = $row->{ 'ext_id' }; 1600 push @keys, $key if $key; 1601 $log->debug( "matched $key" ) if $key; 1602 } 1603 }; 1604 $log->logdie("database error: $@") if $@; 1605 1606 $log->debug( "leaving" ); 1607 1608 return [sort(@dir_keys), sort(@keys)]; 1609 1510 1610 } 1511 1611 -
branches/pap/Nebulous/bin/neb-ls
r24346 r28534 1 1 #!/usr/bin/env perl 2 2 3 # Copyright (C) 2007-2009 Joshua Hoblitt 3 # Copyright (C) 2007-2009 Joshua Hoblitt, 2010 Chris Waters 4 4 5 5 use strict; … … 16 16 my ( 17 17 $server, 18 $ long,19 # $recursive,18 $path, 19 $column, 20 20 ); 21 21 22 22 $server = $ENV{'NEB_SERVER'} unless $server; 23 23 24 # make --long the default25 $long = 1;26 24 27 25 GetOptions( 28 26 'server|s=s' => \$server, 29 # 'recursive|r' => \$recursive,30 ' l|1' => \$long,27 'path|p' => \$path, 28 'column|c' => \$column, 31 29 ) || pod2usage( 2 ); 30 31 # twiddle column so that it does it by default. 32 33 $column = not $column; 32 34 33 35 my $pattern = shift; … … 47 49 $pattern ||= "/"; 48 50 49 #if ($recursive) { 50 # $pattern = "^" . $pattern . ".*"; 51 #} else { 52 # $pattern = "^" . $pattern . "\$"; 53 #} 51 my $keys = $neb->find_objects_wildcard($pattern); 54 52 55 my $keys = $neb->find_objects($pattern); 56 53 if ($path) { 54 my @files; 55 foreach my $key (@{ $keys }) { 56 my $uris = $neb->find_instances($key); 57 if (defined $uris) { 58 push @files, URI->new(@$uris[0])->file; 59 } 60 } 61 @{ $keys } = @files; 62 } 57 63 if ($keys) { 58 if ($long) { 59 print join("\n", @{ $keys }), "\n"; 60 } else { 61 print join(" ", @{ $keys }), "\n"; 64 if ($column) { 65 open(COLUMN,"|column") || die "Cannot open column command."; 66 print COLUMN join("\n", @{ $keys }), "\n"; 67 close(COLUMN); 68 } 69 else { 70 print join("\n", @{ $keys }), "\n"; 62 71 } 63 72 } 73 64 74 65 75 __END__ … … 73 83 =head1 SYNOPSIS 74 84 75 neb-ls [--server <URL>] [- l|-1] [--recursive] <pattern>85 neb-ls [--server <URL>] [-c] [-p] <pattern> 76 86 77 87 =head1 DESCRIPTION 78 88 79 89 This program list Nebulous keys matched by C<<pattern>>. Call it with no 80 arguments is equival anet to searching with the pattern C<.*>. Where81 C<<pattern>> is a POSIX 1003.2 compatable regular repression.90 arguments is equivalent to searching with the pattern C<neb://>. SQL like 91 wildcards are supported to select out certain files. 82 92 83 93 =head1 OPTIONS … … 85 95 =over 4 86 96 87 =item * - l|-197 =item * --path|-p 88 98 89 Use a long listing format. 99 Find the disk files corresponding to the keys found. 100 101 =item * --column|-c 102 103 Disable column formatting, and output results one to a line. 90 104 91 105 Optional 92 106 93 =cut94 #=item * --recursive|-r95 #96 #By default C<neb-ls> will only try to match the exact string provided to it.97 #With this option set all keys which match C<<pattern>> as a REGEX or substring98 #will be returned.99 #100 #Optional101 #102 107 =item * --server|-s <URL> 103 108 … … 122 127 =back 123 128 124 =head1 CREDITS125 126 Just me, myself, and I.127 128 129 =head1 SUPPORT 129 130 … … 132 133 =head1 AUTHOR 133 134 134 Joshua Hoblitt <jhoblitt@cpan.org> 135 Joshua Hoblitt <jhoblitt@cpan.org>, Chris Waters 135 136 136 137 =head1 COPYRIGHT 137 138 138 Copyright (C) 2007-20 09 Joshua Hoblitt. All rights reserved.139 Copyright (C) 2007-2010 Joshua Hoblitt / Chris Waters. All rights reserved. 139 140 140 141 This program is free software; you can redistribute it and/or modify it under -
branches/pap/Nebulous/lib/Nebulous/Client.pm
r28446 r28534 9 9 no warnings qw( uninitialized ); 10 10 11 our $VERSION = '0.1 7';11 our $VERSION = '0.18'; 12 12 13 13 use Digest::MD5; … … 741 741 } 742 742 743 sub find_objects_wildcard 744 { 745 my $self = shift; 746 747 my @args = validate_pos( @_, 748 { 749 type => SCALAR, 750 optional => 1, 751 }, 752 ); 753 754 $log->debug( "entered - @_" ); 755 756 my $response = $self->{ 'server' }->find_objects_wildcard( @args ); 757 if ( $response->fault ) { 758 $self->set_err($response->faultstring); 759 760 if ($response->faultstring =~ /no keys found/) { 761 $log->debug( "leaving" ); 762 return; 763 } 764 if ($response->faultstring =~ /does not match any key or directory/) { 765 $log->debug( "leaving" ); 766 return; 767 } 768 769 $log->logdie("unhandled fault - ", $self->err); 770 } 771 772 my $keys = $response->result; 773 774 $log->debug( "server found: @$keys" ); 775 776 # foreach my $path ( @{ $uris } ) { 777 # $path = _get_file_path( $path ); 778 # } 779 780 $log->debug( "leaving" ); 781 782 return $keys; 783 } 784 743 785 744 786 sub find_instances -
branches/pap/ippScripts/scripts/automate_stacks.pl
r28444 r28534 766 766 $cmd .= " -workdir $workdir "; 767 767 $cmd .= " -label $label "; 768 $cmd .= " -use_begin ${date}T00:00:00 -use_end ${date}T23:59:59 "; 768 769 if ($maxN > 0) { 769 770 $cmd .= " -random_subset -random_limit $maxN "; -
branches/pap/ippScripts/scripts/dqstats_bundle.pl
r27718 r28534 73 73 # Output products 74 74 unless (defined($uri)) { 75 $uri = "/ data/${host}.0/tmp/dqstats.${dqstats_id}.fits";75 $uri = "/tmp/dqstats.${dqstats_id}.fits"; 76 76 } 77 77 #$ipprc->outroot_prepare($uri); # hm....need to think more here. … … 90 90 unless ($success) { 91 91 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 92 unlink($uri); 92 93 &my_die("Unable to create the bundle.: $error_code", $dqstats_id, $error_code); 93 94 } … … 106 107 unless ($success) { 107 108 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR); 109 unlink($uri); 108 110 &my_die("Unable to register the bundle.: $error_code", $dqstats_id, $error_code); 109 111 } -
branches/pap/ippTasks/dqstats.pro
r27304 r28534 37 37 task dqstats.revert 38 38 active false 39 end 40 end 41 42 macro dqstats.revert.on 43 task dqstats.revert 44 active true 45 end 46 end 47 48 macro dqstats.revert.off 49 task dqstats.revert 50 active true 39 51 end 40 52 end … … 109 121 110 122 ## we want only a single outstanding dqstats job. 111 host local112 123 npending 1 113 124 … … 187 198 periods -timeout 120.0 188 199 npending 1 200 active false 189 201 190 202 stdout NULL -
branches/pap/ippTasks/ipphosts.mhpcc.config
r28438 r28534 253 253 END 254 254 255 # this list is no longer used 256 # XXX : delete if this does not cause trouble 257 ## ipphosts METADATA 258 ## camera STR distribution 259 ## count S32 26 260 ## 0 STR ipp021 261 ## 1 STR ipp023 262 ## 2 STR ipp024 263 ## 3 STR ipp026 264 ## 4 STR ipp028 265 ## 5 STR ipp029 266 ## 6 STR ipp030 267 ## 7 STR ipp031 268 ## 8 STR ipp032 269 ## 9 STR ipp033 270 ## 10 STR ipp034 271 ## 11 STR ipp035 272 ## 12 STR ipp036 273 ## 13 STR ipp038 274 ## 14 STR ipp039 275 ## 15 STR ipp040 276 ## 16 STR ipp041 277 ## 17 STR ipp043 278 ## 18 STR ipp044 279 ## 19 STR ipp045 280 ## 20 STR ipp046 281 ## 21 STR ipp047 282 ## 22 STR ipp048 283 ## 23 STR ipp050 284 ## 24 STR ipp051 285 ## 25 STR ipp052 286 ## END 255 ipphosts METADATA 256 camera STR distribution 257 count S32 26 258 0 STR ipp021 259 1 STR ipp023 260 2 STR ipp024 261 3 STR ipp026 262 4 STR ipp028 263 5 STR ipp029 264 6 STR ipp030 265 7 STR ipp031 266 8 STR ipp032 267 9 STR ipp033 268 10 STR ipp034 269 11 STR ipp035 270 12 STR ipp036 271 13 STR ipp038 272 14 STR ipp039 273 15 STR ipp040 274 16 STR ipp041 275 17 STR ipp043 276 18 STR ipp044 277 19 STR ipp045 278 20 STR ipp046 279 21 STR ipp047 280 22 STR ipp048 281 23 STR ipp050 282 24 STR ipp051 283 25 STR ipp052 284 END 287 285 288 286 ipphosts METADATA -
branches/pap/ippToPsps/scripts/createDb.pl
r28206 r28534 25 25 print "* Connected to '$dbname' on 'dbserver'\n"; 26 26 27 if (!doesTableExist("revision")) { 28 createRevision_1(); 27 my $currentRevision = -1; 28 29 my $latestRevision = 3; 30 print "* Latest revision = $latestRevision\n"; 31 32 while ($currentRevision != $latestRevision) { 33 34 $currentRevision = getRevision(); 35 print "* Current revision = $currentRevision\n"; 36 37 if ($currentRevision == 0) {createRevision_1();} 38 elsif ($currentRevision == 1) {createRevision_2();} 39 elsif ($currentRevision == 2) {createRevision_3();} 40 29 41 } 30 31 32 42 $db->disconnect(); 33 43 print "* Disconnected from '$dbname' on 'dbserver'\n"; 34 44 print "*\n*******************************************************************************\n\n"; 45 35 46 36 47 ####################################################################################### … … 50 61 primary key (revision) 51 62 ); 52 SQL53 $query->execute;54 55 $query = $db->prepare(<<SQL);56 INSERT INTO revision (revision) VALUES (1);57 63 SQL 58 64 $query->execute; … … 77 83 $query->execute; 78 84 85 setRevision(1); 86 87 } 88 89 ####################################################################################### 90 # 91 # Create revision 2 of the database 92 # 93 ####################################################################################### 94 sub createRevision_2 { 95 96 print "* Creating revision 2 of '$dbname'\n"; 97 98 my $query = $db->prepare(<<SQL); 99 100 ALTER TABLE batches 101 ADD COLUMN merged TINYINT DEFAULT 0 102 SQL 103 $query->execute; 104 105 setRevision(2); 106 } 107 108 ####################################################################################### 109 # 110 # Create revision 3 of the database 111 # 112 ####################################################################################### 113 sub createRevision_3 { 114 115 print "* Creating revision 3 of '$dbname'\n"; 116 117 my $query = $db->prepare(<<SQL); 118 119 ALTER TABLE batches 120 ADD COLUMN total_detections BIGINT DEFAULT 0 121 SQL 122 $query->execute; 123 124 setRevision(3); 125 } 126 127 128 ####################################################################################### 129 # 130 # Sets current revision of ippToPsps database 131 # 132 ####################################################################################### 133 sub setRevision { 134 my ($revision) = @_; 135 136 my $query = $db->prepare(<<SQL); 137 INSERT INTO revision (revision) VALUES ($revision); 138 SQL 139 $query->execute; 79 140 } 80 141 … … 82 143 # 83 144 # Gets current revision of ippToPsps database 145 # 146 ####################################################################################### 147 sub getRevision { 148 149 if (!doesTableExist("revision")) {return 0;} 150 151 my $query = $db->prepare(<<SQL); 152 153 SELECT revision 154 FROM revision 155 ORDER BY revision DESC LIMIT 1; 156 SQL 157 $query->execute; 158 my @row = $query->fetchrow_array(); 159 160 return $row[0]; 161 } 162 163 ####################################################################################### 164 # 165 # Checks whether a certain table exists 84 166 # 85 167 ####################################################################################### … … 99 181 my $count = $query->fetchrow_array(); 100 182 101 printf( "* Table '$table' %s\n", $count ? "exists" : "does not exist");102 103 183 return $count; 104 184 } -
branches/pap/ippToPsps/scripts/ippToPsps_run.pl
r28260 r28534 10 10 use constant DB_SOCKET => '/var/run/mysqld/mysqld.sock'; 11 11 use File::Temp qw(tempfile); 12 use XML::LibXML; 12 13 13 14 # globals … … 73 74 74 75 # make a temporary file for saving results 75 my ($resultsFile, $resultsFile Name) = tempfile( "/tmp/ippToPsps_results.XXXX", UNLINK => !$save_temps);76 my ($resultsFile, $resultsFilePath) = tempfile( "/tmp/ippToPsps_results.XXXX", UNLINK => !$save_temps); 76 77 77 78 process(); … … 118 119 } 119 120 120 121 121 ####################################################################################### 122 122 # … … 160 160 AND chipRun.exp_id = rawExp.exp_id 161 161 AND camRun.dist_group = '$survey' 162 AND rawExp.dateobs >= '2010-02-20' 162 163 GROUP BY rawExp.exp_id 163 164 ORDER BY rawExp.exp_id ASC; … … 457 458 458 459 # read results 459 open (MYFILE, $resultsFileName); 460 my $i = 0; 461 462 # detection results 463 my $minObjId; 464 my $maxObjId; 465 my $filename; 466 if($batchType eq 'det') { 467 468 while (<MYFILE>) { 469 chomp; 470 if ($i == 0) { $filename = $_; } 471 if ($i == 1) { $minObjId = $_; } 472 if ($i == 2) { $maxObjId = $_; } 473 $i++; 474 } 475 } 476 close (MYFILE); 460 my $parser = XML::LibXML->new; 461 my $doc = $parser->parse_file($resultsFilePath); 462 my $filename = $doc->findvalue('//filename'); 463 my $minObjId = $doc->findvalue('//minObjID'); 464 my $maxObjId = $doc->findvalue('//maxObjID'); 477 465 478 466 # create XML file … … 794 782 $command .= " -survey $surveyType"; 795 783 $command .= " -batch $batchType"; 796 $command .= " -results $resultsFile Name";784 $command .= " -results $resultsFilePath"; 797 785 798 786 # run command -
branches/pap/ippToPsps/src/ippToPsps.c
r28249 r28534 53 53 } 54 54 55 // save XML document for results 56 if (this->resultsXmlDoc) { 57 58 xmlSaveFormatFileEnc(this->resultsPath, this->resultsXmlDoc, "UTF-8", 1); 59 60 xmlFreeDoc(this->resultsXmlDoc); 61 xmlCleanupParser(); 62 xmlMemoryDump(); 63 } 64 55 65 psFree(this->fitsInPath); 56 66 psFree(this->resultsPath); … … 59 69 psFree(this->pmconfig); 60 70 61 if (this->resultsFile) fclose(this->resultsFile);62 71 63 72 for(uint32_t i=0; i<this->numOfInputFiles; i++) … … 246 255 this->fitsInPath = NULL; 247 256 this->resultsPath = NULL; 248 this->results File= NULL;257 this->resultsXmlDoc = NULL; 249 258 this->numOfInputFiles = 0; 250 259 this->inputFiles = NULL; … … 304 313 } 305 314 315 // create a config object 306 316 this->config = ippToPspsConfig_Constructor(this->configsDir); 307 317 if (this->config == NULL) { … … 311 321 } 312 322 313 // ready results file, if necessary323 // create XML document for results 314 324 if (this->resultsPath) { 315 325 316 this->resultsFile = fopen (this->resultsPath, "w+"); 317 318 if (this->resultsFile == NULL) { 319 320 psError(PS_ERR_UNKNOWN, false, "Unable to open results file at %s", this->resultsPath); 321 // not essential to write results, so don't bail out 322 } 323 else { 324 if (fprintf(this->resultsFile, "%s\n", outputName) < 1 ) 325 psError(PS_ERR_IO, false, "Unable to write FITS output filename to'%s'\n", this->resultsPath); 326 } 326 this->resultsXmlDoc = xmlNewDoc(BAD_CAST "1.0"); 327 xmlNodePtr rootNode = xmlNewNode(NULL, BAD_CAST "ippToPsps_Results"); 328 xmlDocSetRootElement(this->resultsXmlDoc, rootNode); 329 xmlNewChild(rootNode, NULL, BAD_CAST "filename", BAD_CAST outputName); 327 330 } 328 331 -
branches/pap/ippToPsps/src/ippToPsps.h
r28249 r28534 15 15 #include <dvo_util.h> 16 16 #include "ippToPspsConfig.h" 17 #include <libxml/parser.h> 18 #include <libxml/tree.h> 17 19 18 20 #define MAXDETECT 30000 //TODO limit ok? … … 20 22 typedef struct { 21 23 22 uint32_t expId; // the exposure ID to be used23 psString expName; // the exposure name24 psString surveyType; // the survey type, eg 3PI, MD01, STS, SSS25 uint8_t batchType; // PSPS batch type26 psString fitsInPath; // path to FITS input27 psString resultsPath; // path to results file28 FILE* resultsFile; // file for results29 uint16_t numOfInputFiles; // number of input files30 char** inputFiles; // array of input file names31 psString fitsOutPath; // path to FITS output32 fitsfile *fitsOut; // output FITS file33 psString configsDir; // path to IPP/PSPS mapping file34 pmConfig* pmconfig; // pmConfig35 dvoConfig* dvoConfig; // dvo database36 IppToPspsConfig* config; // config structure37 int exitCode; // ps exit code24 uint32_t expId; // the exposure ID to be used 25 psString expName; // the exposure name 26 psString surveyType; // the survey type, eg 3PI, MD01, STS, SSS 27 uint8_t batchType; // PSPS batch type 28 psString fitsInPath; // path to FITS input 29 psString resultsPath; // path to results file 30 xmlDocPtr resultsXmlDoc; // pointer to XML document for results 31 uint16_t numOfInputFiles; // number of input files 32 char** inputFiles; // array of input file names 33 psString fitsOutPath; // path to FITS output 34 fitsfile *fitsOut; // output FITS file 35 psString configsDir; // path to IPP/PSPS mapping file 36 pmConfig* pmconfig; // pmConfig 37 dvoConfig* dvoConfig; // dvo database 38 IppToPspsConfig* config; // config structure 39 int exitCode; // ps exit code 38 40 39 41 int (*run)(); -
branches/pap/ippToPsps/src/ippToPspsBatchDetection.c
r28424 r28534 386 386 387 387 // write results 388 if (this->resultsFile) { 389 390 if (fprintf(this->resultsFile, "%ld\n", minObjID) < 1 ) 391 psError(PS_ERR_IO, false, "Unable to write min Object ID to'%s'\n", this->resultsPath); 392 if (fprintf(this->resultsFile, "%ld\n", maxObjID) < 1 ) 393 psError(PS_ERR_IO, false, "Unable to write max Object ID to'%s'\n", this->resultsPath); 394 if (fprintf(this->resultsFile, "%ld\n", totalDetectionsOut) < 1 ) 395 psError(PS_ERR_IO, false, "Unable to write totalDetectionsOut to'%s'\n", this->resultsPath); 388 if (this->resultsXmlDoc) { 389 390 xmlNodePtr rootNode = xmlDocGetRootElement(this->resultsXmlDoc); 391 char tmp[100]; 392 sprintf(tmp, "%ld", minObjID); 393 xmlNewChild(rootNode, NULL, BAD_CAST "minObjID", BAD_CAST tmp); 394 sprintf(tmp, "%ld", maxObjID); 395 xmlNewChild(rootNode, NULL, BAD_CAST "maxObjID", BAD_CAST tmp); 396 sprintf(tmp, "%ld", totalDetectionsOut); 397 xmlNewChild(rootNode, NULL, BAD_CAST "totalDetections", BAD_CAST tmp); 396 398 } 397 399 -
branches/pap/ippToPsps/src/ippToPspsBatchTest.c
r27809 r28534 331 331 if (fits_close_file(fitsIn, &status)) fits_report_error(stderr, status); 332 332 333 // write results334 if (this->resultsFile) {335 336 if (fprintf(this->resultsFile, "%ld\n", minObjID) < 1 )337 psError(PS_ERR_IO, false, "Unable to write min Object ID to'%s'\n", this->resultsPath);338 if (fprintf(this->resultsFile, "%ld\n", maxObjID) < 1 )339 psError(PS_ERR_IO, false, "Unable to write max Object ID to'%s'\n", this->resultsPath);340 }341 342 333 psLogMsg("ippToPsps", PS_LOG_INFO, "Data written for a total of %d chips/OTAs", nOta); 343 334 -
branches/pap/ippTools/src/bgtool.c
r28486 r28534 1078 1078 PXOPT_COPY_F32(config->args, where, "-sun_angle_max", "rawExp.sun_angle", "<"); 1079 1079 pxAddLabelSearchArgs(config, where, "-warp_label", "warpRun.label", "=="); 1080 pxAddLabelSearchArgs(config, where, "- bg_label","chipBackgroundRun.label", "==");1080 pxAddLabelSearchArgs(config, where, "-chip_label", "chipBackgroundRun.label", "=="); 1081 1081 1082 1082 if (!psListLength(where->list) && !psMetadataLookupBool(NULL, config->args, "-all")) { -
branches/pap/ippTools/src/bgtoolConfig.c
r28486 r28534 249 249 psMetadataAddF32(definewarpArgs, PS_LIST_TAIL, "-sun_angle_max", 0, "search by max solar angle", NAN); 250 250 psMetadataAddStr(definewarpArgs, PS_LIST_TAIL, "-warp_label", PS_META_DUPLICATE_OK, "search on warpRun label", NULL); 251 psMetadataAddStr(definewarpArgs, PS_LIST_TAIL, "- bg_label", PS_META_DUPLICATE_OK, "search on warpBackgroundRun label", NULL);251 psMetadataAddStr(definewarpArgs, PS_LIST_TAIL, "-chip_label", PS_META_DUPLICATE_OK, "search on chipBackgroundRun label", NULL); 252 252 psMetadataAddBool(definewarpArgs, PS_LIST_TAIL, "-rerun", 0, "rerun data?", false); 253 253 psMetadataAddStr(definewarpArgs, PS_LIST_TAIL, "-set_workdir", 0, "define workdir", NULL); -
branches/pap/ippTools/src/magictool.c
r28279 r28534 1365 1365 // check that state is a valid string value 1366 1366 if (!( 1367 (strncmp(state, "new", 4) == 0)1368 || (strncmp(state, "full", 5) == 0)1369 || (strncmp(state, "drop", 5) == 0)1370 || (strncmp(state, "reg", 4) == 0)1367 (strncmp(state, "new", 3) == 0) 1368 || (strncmp(state, "full", 4) == 0) 1369 || (strncmp(state, "drop", 4) == 0) 1370 || (strncmp(state, "reg", 3) == 0) 1371 1371 ) 1372 1372 ) { -
branches/pap/magic/remove/src/streaksremove.c
r28275 r28534 577 577 } 578 578 579 static void 579 static void 580 580 setStreakBits(psImage *maskImage, psU32 maskStreak) 581 581 { … … 644 644 if (exciseAll) { 645 645 strkGetMaskValues(sf); 646 646 647 647 // add the STREAK bit to the mask image pixels 648 648 setStreakBits(sf->inMask->image, sf->maskStreak); … … 941 941 psArray *inTable = psFitsReadTable(in->fits); 942 942 if (!inTable) { 943 psErrorStackPrint(stderr, "failed to read tablle in %s", in->resolved_name); 944 streaksExit("", PS_EXIT_DATA_ERROR); 945 } 946 if (!inTable->n) { 947 psErrorStackPrint(stderr, "table in %s is empty", in->resolved_name); 943 psErrorStackPrint(stderr, "failed to read table in %s", in->resolved_name); 948 944 streaksExit("", PS_EXIT_DATA_ERROR); 949 945 } … … 983 979 streaksExit("", PS_EXIT_DATA_ERROR); 984 980 } 981 } else if (psArrayLength(inTable) == 0) { 982 printf("No input sources\n"); 983 // We'd like to write a blank table, but this is as good as it gets without more work to parse the 984 // header and create dummy columns. 985 if (!psFitsWriteBlank(out->fits, header, extname)) { 986 psErrorStackPrint(stderr, "failed to write empty header to %s", out->resolved_name); 987 streaksExit("", PS_EXIT_DATA_ERROR); 988 } 985 989 } else { 986 990 printf("Censored ALL %d sources\n", numCensored); -
branches/pap/psLib/src/fits/psFitsImage.c
r27313 r28534 415 415 if (fits_read_subset(fits->fd, info->fitsDatatype, info->firstPixel, info->lastPixel, 416 416 info->increment, nullValue, output->data.V[0], &anynull, &status) != 0) { 417 psFitsError(status, true, "Reading FITS file failed.");417 psFitsError(status, true, "Reading FITS file %s failed.", fits->fd->Fptr->filename); 418 418 return false; 419 419 } -
branches/pap/psLib/src/fits/psFitsTable.c
r28216 r28534 39 39 40 40 int status = 0; // CFITSIO status 41 42 // Check for empty table, which looks like an image 43 int hdutype; // Type of HDU 44 fits_get_hdu_type(fits->fd, &hdutype, &status); 45 if (psFitsError(status, true, "Could not determine the HDU type.")) { 46 return -1; 47 } 48 if (hdutype == IMAGE_HDU) { 49 // It could be an empty table 50 int naxis = 0; // Dimensions of image 51 if (fits_get_img_dim(fits->fd, &naxis, &status) != 0) { 52 psFitsError(status, true, "Unable to determine dimension for table."); 53 return -1; 54 } 55 if (naxis != 0) { 56 psFitsError(PS_ERR_BAD_FITS, true, "Current FITS HDU is not a table."); 57 return -1; 58 } 59 return 0; 60 } 61 41 62 long numRows; // Number of rows 42 63 if (fits_get_num_rows(fits->fd, &numRows, &status)) { … … 48 69 } 49 70 71 50 72 // Check the FITS file in preparation for reading a table 51 73 static bool readTableCheck(const psFits *fits // FITS file 52 74 ) 53 75 { 54 PS_ASSERT_FITS_NON_NULL(fits, NULL);76 PS_ASSERT_FITS_NON_NULL(fits, false); 55 77 56 78 if (psFitsGetExtNum(fits) == 0 && !psFitsMoveExtNum(fits, 1, false)) { … … 58 80 return false; 59 81 } 60 61 82 62 83 // check that we are positioned on a table HDU … … 67 88 return false; 68 89 } 69 if (hdutype != ASCII_TBL && hdutype != BINARY_TBL) { 70 psError(PS_ERR_IO, true, _("Current FITS HDU is not a table.")); 90 if (hdutype == IMAGE_HDU) { 91 // It could be an empty table 92 int naxis = 0; // Dimensions of image 93 if (fits_get_img_dim(fits->fd, &naxis, &status) != 0) { 94 psFitsError(status, true, "Unable to determine dimension for table."); 95 return false; 96 } 97 if (naxis != 0) { 98 psFitsError(PS_ERR_BAD_FITS, true, "Current FITS HDU is not a table."); 99 return false; 100 } 101 } else if (hdutype != ASCII_TBL && hdutype != BINARY_TBL) { 102 psError(PS_ERR_BAD_FITS, true, _("Current FITS HDU is not a table.")); 71 103 return false; 72 104 } -
branches/pap/psModules/src/objects/pmSourceMatch.c
r28119 r28534 227 227 } 228 228 229 numMaster = size; 229 230 xMaster->n = size; 230 231 yMaster->n = size; -
branches/pap/psModules/src/objects/pmSourcePhotometry.c
r28426 r28534 393 393 psImage *mask = source->maskObj; 394 394 395 if (!flux || !variance || !mask) { 396 return false; 397 } 398 395 399 for (int iy = 0; iy < flux->numRows; iy++) { 396 400 for (int ix = 0; ix < flux->numCols; ix++) { -
branches/pap/psphot/src/psphotApResid.c
r28405 r28534 328 328 psMetadataAdd (readout->analysis, PS_LIST_TAIL, "DAPMIFIT", PS_DATA_F32 | PS_META_REPLACE, "ap residual scatter", psf->dApResid); 329 329 psMetadataAdd (readout->analysis, PS_LIST_TAIL, "NAPMIFIT", PS_DATA_S32 | PS_META_REPLACE, "number of apresid stars", psf->nApResid); 330 psMetadataAdd (readout->analysis, PS_LIST_TAIL, "APLOSS", PS_DATA_F32 | PS_META_REPLACE, "aperture loss (mag)", psf->growth ->apLoss);330 psMetadataAdd (readout->analysis, PS_LIST_TAIL, "APLOSS", PS_DATA_F32 | PS_META_REPLACE, "aperture loss (mag)", psf->growth ? psf->growth->apLoss : NAN); 331 331 332 332 psLogMsg ("psphot.apresid", PS_LOG_DETAIL, "aperture residual: %f +/- %f\n", psf->ApResid, psf->dApResid);
Note:
See TracChangeset
for help on using the changeset viewer.
