Astro-Catalog

 view release on metacpan or  search on metacpan

lib/Astro/Catalog/IO/ASSM.pm  view on Meta::CPAN


        # and push it into the Astro::Catalog::Item object
        $star->coords($coords);

        # Go through the passbands and create the Astro::Flux object for
        # this magnitude.
        my $waveband;
        my $filtnum = 2;
        my @mags;
        foreach my $filter (@allfilters) {
            print "Filter=$filter, " if $DEBUG;
            $waveband = new Astro::WaveBand(Filter => $filter);
            # Create the Astro::Flux object for this magnitude.
            my $flux = new Astro::Flux(
                new Number::Uncertainty(Value => $fields[$filtnum]),
                'MAG_CATALOG',
                $waveband);
            push @mags, $flux;
            $filtnum++;
        }
        print "\n" if $DEBUG;
        my $fluxes = new Astro::Fluxes(@mags);
        # and push the fluxes into the catalog
        $star->fluxes($fluxes);
        $star->preferred_magnitude_type('MAG_CATALOG');

        # get the sptype, strip out underscores
        my $spectype = $fields[5];
        $spectype =~ s/_//g;
        print "Spectype=$spectype\n" if $DEBUG;
        # and push into object
        $star->spectype($spectype);

        # push the source column into the Comment field
        $star->comment($fields[6]);

        # push id number
        $star->id($starnum);
        # push it onto the stack
        $catalog->pushstar($star);

        $starnum++;
    }

    $catalog->origin('IO::ASSM');
    return $catalog;
}

1;

__END__

=back

=head1 SEE ALSO

L<Astro::Catalog>, L<Astro::Catalog::IO::Simple>

=head1 FORMAT

The ASSM format is defined as follows: Any line that looks like

RAdeg Decdeg filter1mag filter2mag filter3mag sp. type source

=head1 COPYRIGHT

Copyright (C) 2012 Las Cumbres Observatory Global Telescope Network.
All Rights Reserved.

This module is free software;
you can redistribute it and/or modify it under the terms of the GNU
Public License.

=head1 AUTHORS

Tim Lister E<lt>tlister@lcogt.netE<gt>

=cut



( run in 1.595 second using v1.01-cache-2.11-cpan-d8267643d1d )