Astro-DSS-JPEG

 view release on metacpan or  search on metacpan

lib/Astro/DSS/JPEG.pm  view on Meta::CPAN

=head2 C<new>

    my $dss = Astro::DSS::JPEG->new(
        dss_url    => 'http://gsss.stsci.edu/webservices/dssjpg/dss.svc/GetImage', # Optional
        simbad_url => 'http://simbad.u-strasbg.fr/simbad/sim-id',                  # Optional
        ua         => $ua                                                          # Optional
    );
  
All parameters are optional. The constructor by default creates an L<LWP::UserAgent>,
but you can pass your own with C<ua>, while the URL to the L<STScI|https://archive.stsci.edu/dss/copyright.html>
JPEG endpoint and the L<SIMBAD|http://simbad.u-strasbg.fr/simbad/> simple identifier query
interface can be redefined (e.g. if they change in the future) from the above shown defaults.

=head1 METHODS

=head2 C<get_image>

    my $res = $dss->get_image(
        target       => $target,            # Not used if RA, Dec provided
        ra           => $ra,                # Right Ascension (in hours of angle)
        dec          => $dec,               # Declination (in degrees of angle)

lib/Astro/DSS/JPEG.pm  view on Meta::CPAN

string for a rectangle. Default is 1000 pixels (equivalent to passing C<1000> or
C<'1000,1000'> or even C<'1000x1000'>). Max possible is C<'4096,4096'> total size,
or 1 pixel / arcsecond resolution (e.g. 30*60 = 1800 pixels for 30 arcminutes), which
is the full resolution DSS plates were scanned at.

=back

=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 = {};

t/simple.t  view on Meta::CPAN

use Test2::V0;
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');



( run in 1.128 second using v1.01-cache-2.11-cpan-49f99fa48dc )