IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 5, 2009, 12:53:48 PM (17 years ago)
Author:
Paul Price
Message:

Fixing magnitude radius scaling.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippScripts/scripts/ds9_cmf_regions.pl

    r24341 r24342  
    4747           'flag-colour=s' => \$flag_colour,
    4848           'flag=o' => \$flag,
    49     'mag-radius' => $mag_radius,
     49    'mag-radius' => \$mag_radius,
    5050           'radius=f' => \$radius,
    5151           'save-temps'        => \$save_temps, # Save temporary files?
     
    7575$fits->read_col(TFLOAT, $yCol, 1, 1, $numRows, 0, $y, undef, $status) and check_fitsio($status);
    7676$fits->read_col(TINT, $flagCol, 1, 1, $numRows, 0, $flags, undef, $status) and check_fitsio($status);
    77 $fits->read_col(TINT, $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);
    7878$fits->close_file($status);
    7979
     
    8181if ($mag_radius) {
    8282    foreach my $m (@$mag) {
    83         next unless defined $m;
     83        next unless defined $m and $m < "inf" and $m > "-inf";
    8484        unless (defined $mag_min and defined $mag_max) {
    8585            $mag_min = $m;
     
    9797my $numBad = 0;                 # Number of bad sources
    9898my $radius_scale = $radius / ($mag_min - $mag_max + 1.0); # Scaling for radius
     99print "Scaling: $mag_min --> $mag_max ==> $radius_scale\n";
    99100for (my $i = 0; $i < $numRows; $i++) {
    100101    my $col;                    # Colour to use
     
    107108    }
    108109    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");
    109111    $r -= ($$mag[$i] - $mag_min) * $radius_scale if defined $mag_radius;
    110112    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";
    111114}
    112115close $coordFile;
Note: See TracChangeset for help on using the changeset viewer.