Astro-DSS-JPEG
view release on metacpan or search on metacpan
lib/Astro/DSS/JPEG.pm view on Meta::CPAN
);
#In one go, save Andromeda Galaxy to andromeda.jpg
Astro::DSS::JPEG->new->get_image(target=>'Andromeda Galaxy', filename=>'andromeda.jpg');
=head1 DESCRIPTION
Astro::DSS::JPEG downloads JPEG images for any location in the sky from the L<Digitized Sky Survey (DSS)|https://archive.stsci.edu/dss/>.
It is meant to be a simple stand alone module to access a fast JPEG-only API that
provides color composites made from the blue and red DSS surveys.
In comparison, there is an old/not updated L<Astro::DSS> module that would provide
access to the slow FITS/GIF interface of the separate DSS1/DSS2 surveys.
Optionally, L<SIMBAD|http://simbad.u-strasbg.fr/simbad/> is used if you'd like to use
an object name/id instead of coordinates.
=head1 CONSTRUCTOR METHODS
=head2 C<new>
my $dss = Astro::DSS::JPEG->new(
lib/Astro/DSS/JPEG.pm view on Meta::CPAN
=head1 NOTES
Some artifacts can be seen at the borders of separate "stripes" of the survey and
also the particular JPEG endpoint used sometimes can leave the corners as plain black
squares (depending on the selected frame size, as it is to do with the way it does
segmentation), so if you want to make sure you have a frame with no corner gaps,
request some more angular size than you want and crop.
Note that the module test suite won't actually fetch data from either DSS or SIMBAD.
This is mainly to ensure it will not fail even if the DSS & SIMBAD endpoints change,
as you can still use the module by passing the updated urls to the constructor. It
also avoids unneeded strain to those free services.
=cut
sub new {
my ($class, %opts) = @_;
my $self = {};
bless($self, $class);
use Test2::Mock;
use Test::MockObject;
use Astro::DSS::JPEG;
use LWP::UserAgent;
use utf8;
# The test won't actually fetch data over the internet. This is to ensure it will
# not fail even if the DSS & SIMBAD endpoints change - you can still use the module
# by passing the updated urls to the constructor.
my $dss = Astro::DSS::JPEG->new(
dss_url => 'xxx',
simbad_url => 'xxx',
ua => LWP::UserAgent->new()
);
ok($dss, 'Object OK');
subtest '_convert_coordinates' => sub {
( run in 0.379 second using v1.01-cache-2.11-cpan-0a6323c29d9 )