Changeset 27443 for trunk/tools/microtest.pl
- Timestamp:
- Mar 24, 2010, 5:39:14 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/tools/microtest.pl (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/microtest.pl
r27442 r27443 9 9 use IPC::Cmd 0.36 qw( can_run run ); 10 10 use File::Temp qw( tempfile ); 11 use PS::IPP::Config; 11 12 12 13 my $ppCoord = can_run('ppCoord') or die "Can't find ppCoord"; … … 35 36 and defined $label; 36 37 38 my $ipprc = PS::IPP::Config->new() or die "Unable to set up IPP configuration"; 39 37 40 # Database connection 38 41 my $db = DBI->connect( "DBI:mysql:database=$db_name;host=$db_host;mysql_socket=" . DB_SOCKET(), … … 44 47 # Exposures of interest 45 48 my $exps = $db->selectall_arrayref( 46 "SELECT exp_id, exp_name, magic_id, magicRun.outroot AS magic_path, camProcessedExp.path_base AS cam_path FROM magicRun JOIN rawExp USING(exp_id) WHERElabel = '$label' AND magicRun.state = 'full'",47 Slice => {}48 ) or die "Unable to execute SQL: $DBI::errstr";49 "SELECT DISTINCT exp_id, exp_name, magic_id, magicRun.workdir AS magic_path, camProcessedExp.path_base AS cam_path FROM magicRun JOIN rawExp USING(exp_id) JOIN diffRun USING(diff_id) JOIN diffInputSkyfile USING(diff_id) JOIN warpRun ON warpRun.warp_id = diffInputSkyfile.warp1 JOIN fakeRun USING(fake_id) JOIN camProcessedExp USING(cam_id) WHERE magicRun.label = '$label' AND magicRun.state = 'full'", 50 { Slice => {} } 51 ) or die "Unable to execute SQL: $DBI::errstr"; 49 52 50 53 foreach my $exp (@$exps) { … … 56 59 57 60 my $clusters = "${magic_path}/$id/$id.mgc.$magic.verify/${id}_clusterPos.txt"; # File with cluster RA,Dec 58 die "Cannot find clusters file $clusters" unless -e $clusters;61 die "Cannot find clusters file $clusters" unless $ipprc->file_exists($clusters); 59 62 60 63 my $astrom = "${cam_path}.smf"; # Astrometry file 61 die "Cannot find astrometry file $astrom" unless -e $astrom;64 die "Cannot find astrometry file $astrom" unless $ipprc->file_exists($astrom); 62 65 63 66 # Format the clusters file … … 69 72 $line =~ s/^\s*//; 70 73 my ($ra, $dec) = split /\s+/, $line; 71 print $radecFile "$ra $dec\n" if defined $ra and defined $dec and $ra !~ /\w/ and $dec !~ /\w/; 74 print $radecFile "$ra $dec\n" if 75 defined $ra and defined $dec and $ra !~ /[[:alpha:]]/ and $dec !~ /[[:alpha:]]/; 72 76 } 73 77 close $clustersFile; … … 77 81 die "Unable to execute SQL: $DBI::errstr"; 78 82 79 open my $outFile, " ${name}_clusters.xy" or die "Cannot open output file: $!";83 open my $outFile, "> $label.${name}.clusters.xy" or die "Cannot open output file: $!"; 80 84 foreach my $raw (@$raws) { 81 85 # my $resolved = `neb-locate --path $raw`; # Resolved filename … … 85 89 die "Unable to run ppCoord" unless $success; 86 90 87 foreach my $line (@$stdout_buf) { 91 my @lines = split(/\n/, join("", @$stdout_buf)); 92 foreach my $line (@lines) { 88 93 my @line = split /\s+/, $line; 89 94
Note:
See TracChangeset
for help on using the changeset viewer.
