Changeset 24342 for trunk/ippScripts/scripts/ds9_cmf_regions.pl
- Timestamp:
- Jun 5, 2009, 12:53:48 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/ds9_cmf_regions.pl (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/ds9_cmf_regions.pl
r24341 r24342 47 47 'flag-colour=s' => \$flag_colour, 48 48 'flag=o' => \$flag, 49 'mag-radius' => $mag_radius,49 'mag-radius' => \$mag_radius, 50 50 'radius=f' => \$radius, 51 51 'save-temps' => \$save_temps, # Save temporary files? … … 75 75 $fits->read_col(TFLOAT, $yCol, 1, 1, $numRows, 0, $y, undef, $status) and check_fitsio($status); 76 76 $fits->read_col(TINT, $flagCol, 1, 1, $numRows, 0, $flags, undef, $status) and check_fitsio($status); 77 $fits->read_col(T INT, $magCol, 1, 1, $numRows, 0, $mag, undef, $status) and check_fitsio($status);77 $fits->read_col(TFLOAT, $magCol, 1, 1, $numRows, 0, $mag, undef, $status) and check_fitsio($status); 78 78 $fits->close_file($status); 79 79 … … 81 81 if ($mag_radius) { 82 82 foreach my $m (@$mag) { 83 next unless defined $m ;83 next unless defined $m and $m < "inf" and $m > "-inf"; 84 84 unless (defined $mag_min and defined $mag_max) { 85 85 $mag_min = $m; … … 97 97 my $numBad = 0; # Number of bad sources 98 98 my $radius_scale = $radius / ($mag_min - $mag_max + 1.0); # Scaling for radius 99 print "Scaling: $mag_min --> $mag_max ==> $radius_scale\n"; 99 100 for (my $i = 0; $i < $numRows; $i++) { 100 101 my $col; # Colour to use … … 107 108 } 108 109 my $r = $radius; # Radius of circle 110 next if defined $mag_radius and (not defined $$mag[$i] or $$mag[$i] == "inf" or $$mag[$i] == "-inf"); 109 111 $r -= ($$mag[$i] - $mag_min) * $radius_scale if defined $mag_radius; 110 112 print $coordFile "image; circle(" . ($$x[$i] + 1) . ',' . ($$y[$i] + 1) . ",$r) \# color = $col\n"; 113 print "image; circle(" . ($$x[$i] + 1) . ',' . ($$y[$i] + 1) . ",$r) \# color = $col\n"; 111 114 } 112 115 close $coordFile;
Note:
See TracChangeset
for help on using the changeset viewer.
