net
Class DigitizedSkySurvey

java.lang.Object
  extended by net.DigitizedSkySurvey

public class DigitizedSkySurvey
extends Object

This class provides methods to download a DSS fits file from the world wide web. Each site uses its different format, but all methods within this class retrieve fits files or null in case of failure. All fits are read, if input streams were opened, they have been closed.


Nested Class Summary
static class DigitizedSkySurvey.Test
          Test class, retrieve a fits.
 
Field Summary
private static String CADCPATH
          The cgi-path for the default server.
private static String CADCPROTOCOL
          The protocol of the default server.
private static String CADCSERVER
          The server for the default retrieval method.
private static String DEFMETHOD
          The default method name from which to retrieve a DSS fits.
private static String ESOPATH
          The cgi-path for the default server.
private static String ESOPROTOCOL
          The protocol of the default server.
private static String ESOSERVER
          The server for the default retrieval method.
private static String STSCICGIPATH
          The cgi-path for the default server.
private static String STSCIPROTOCOL
          The protocol of the default server.
private static String STSCISERVER
          The server for the default retrieval method.
private static String STSISOURCE
          The default source for the Stsci.
private static Method[] www
          All defined methods that allow FITS retrieval.
 
Constructor Summary
DigitizedSkySurvey()
           
 
Method Summary
static nom.tam.fits.Fits getDigitizedSkySurvey(double ra, double de, double w, double h)
          Retrieves a DSS fits image from the standard server.
static nom.tam.fits.Fits getDigitizedSkySurvey(String method, double ra, double de, double w, double h)
          Retrieves a DSS fits image using the name of the method used to retrieve the FITS is stated.
private static nom.tam.fits.Fits getFromCadc(Double ra, Double dec, Double width, Double height)
          This method connects to the CADC-server in Canada.
private static nom.tam.fits.Fits getFromEso(Double ra, Double dec, Double width, Double height)
          This method connects to the ESO-archive.
private static nom.tam.fits.Fits getFromStsci(Double ra, Double dec, Double width, Double height)
          This method connects to the DSS archive on STSCISERVER.
private static String getMinSec(double deg)
          Converts degress in deg min sec string.
private static String getMinSec(double deg, boolean plus)
          Converts degress in deg min sec string.
static String[] getRetrievalMethods()
          Returns the names of all methods that allow FITS retrieval.
private static Method[] scanForMethods()
          Scan this class for all methods that return a fits and take four doubles as arguments.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFMETHOD

private static final String DEFMETHOD
The default method name from which to retrieve a DSS fits.

See Also:
Constant Field Values

STSCIPROTOCOL

private static final String STSCIPROTOCOL
The protocol of the default server.

See Also:
Constant Field Values

STSCISERVER

private static final String STSCISERVER
The server for the default retrieval method.

See Also:
Constant Field Values

STSCICGIPATH

private static final String STSCICGIPATH
The cgi-path for the default server.

See Also:
Constant Field Values

STSISOURCE

private static final String STSISOURCE
The default source for the Stsci.

See Also:
Constant Field Values

ESOPROTOCOL

private static final String ESOPROTOCOL
The protocol of the default server.

See Also:
Constant Field Values

ESOSERVER

private static final String ESOSERVER
The server for the default retrieval method.

See Also:
Constant Field Values

ESOPATH

private static final String ESOPATH
The cgi-path for the default server.

See Also:
Constant Field Values

CADCPROTOCOL

private static final String CADCPROTOCOL
The protocol of the default server.

See Also:
Constant Field Values

CADCSERVER

private static final String CADCSERVER
The server for the default retrieval method.

See Also:
Constant Field Values

CADCPATH

private static final String CADCPATH
The cgi-path for the default server.

See Also:
Constant Field Values

www

private static Method[] www
All defined methods that allow FITS retrieval. Scanned at class load.

Constructor Detail

DigitizedSkySurvey

public DigitizedSkySurvey()
Method Detail

getDigitizedSkySurvey

public static nom.tam.fits.Fits getDigitizedSkySurvey(double ra,
                                                      double de,
                                                      double w,
                                                      double h)
Retrieves a DSS fits image from the standard server. The FITS file is read, and all streams are closed.

Parameters:
ra - Right ascension of center of field in degrees
de - Declination of center of field in degrees.
w - Width of field in degrees.
h - Height of field in degrees.

getDigitizedSkySurvey

public static nom.tam.fits.Fits getDigitizedSkySurvey(String method,
                                                      double ra,
                                                      double de,
                                                      double w,
                                                      double h)
Retrieves a DSS fits image using the name of the method used to retrieve the FITS is stated. The FITS file is read, and all streams are closed.

Parameters:
ra - Right ascension of center of field in degrees
de - Declination of center of field in degrees.
w - Width of field in degrees.
h - Height of field in degrees.

getRetrievalMethods

public static String[] getRetrievalMethods()
Returns the names of all methods that allow FITS retrieval.


scanForMethods

private static final Method[] scanForMethods()
Scan this class for all methods that return a fits and take four doubles as arguments. These methods are considered to allow fits retrieval.


getFromStsci

private static nom.tam.fits.Fits getFromStsci(Double ra,
                                              Double dec,
                                              Double width,
                                              Double height)
This method connects to the DSS archive on STSCISERVER. If the format changes, this class must be re-compiled. The server expects a form in a GET field.


getFromEso

private static nom.tam.fits.Fits getFromEso(Double ra,
                                            Double dec,
                                            Double width,
                                            Double height)
This method connects to the ESO-archive. The server expects a form in POST.


getFromCadc

private static nom.tam.fits.Fits getFromCadc(Double ra,
                                             Double dec,
                                             Double width,
                                             Double height)
This method connects to the CADC-server in Canada. The server expects a form in POST.


getMinSec

private static String getMinSec(double deg)
Converts degress in deg min sec string. Plus signa are omitted


getMinSec

private static String getMinSec(double deg,
                                boolean plus)
Converts degress in deg min sec string. If the second argument is true, a plus sign is inserted at the leading edge if the angle is positive.