jview
Class JFitsFactory

java.lang.Object
  extended by jview.JFitsFactory

public class JFitsFactory
extends Object

This class provides static methods for retrieving fits from DSS archives and getting WCS information out of it.


Nested Class Summary
static class JFitsFactory.Get
           
static class JFitsFactory.Method
          Known retrieval methods.
 
Field Summary
private static JFitsFactory.Method current
          Current active retrieval method..
static int DSS1
          Get DSS-1.
static int DSS2BLUE
          Get DSS-2-blue.
static int DSS2IR
          Get DSS-2-infra-red.
static int DSS2RED
          Get DSS-2-red.
private static String ESOCGIPATH
           
private static String ESODSS1
           
private static String ESODSS2BLUE
           
private static String ESODSS2IR
           
private static String ESODSS2RED
           
private static String ESODSSDEFAULT
           
private static double ESOMAXSIZE
           
private static String ESOSERVER
           
private static String HTTP
           
private static String LOCALPATH
           
private static int LOCALPORT
           
private static String LOCALSERVER
           
private static String NAOJPCGIPATH
           
private static String NAOJPDSS1
           
private static String NAOJPDSS2BLUE
           
private static String NAOJPDSS2IR
           
private static String NAOJPDSS2RED
           
private static String NAOJPDSSDEFAULT
           
private static double NAOJPMAXSIZE
           
private static String NAOJPSERVER
           
private static String STSCICGIPATH
           
private static String STSCIDSS1
           
private static String STSCIDSS2BLUE
           
private static String STSCIDSS2IR
           
private static String STSCIDSS2RED
           
private static String STSCIDSSDEFAULT
           
private static double STSCIMAXSIZE
           
private static String STSCISERVER
           
 
Constructor Summary
JFitsFactory()
           
 
Method Summary
private static String getCgiForStsci(double ra, double dec, double width, double height, int dss)
          This method prepares an url according to the CGI-requirements of the STScI dss-server.
static JFitsFactory.Method getCurrent()
           
private static URL getDownloadUrl(JFitsFactory.Method how, double ra, double dec, double width, double height, int source)
          Returns the URL from which the image can be retrieved.
static nom.tam.fits.Fits getDssFits(double ra, double dec, double width, double height)
          Downloads the DSS-fits image from an url.
static nom.tam.fits.Fits getDssFits(double ra, double dec, double width, double height, JFitsFactory.Method how, int format)
          Downloads the DSS-fits image from an url.
private static URL getDssFromEso(double ra, double dec, double width, double height, int dss)
           
private static URL getDssFromNaoJp(double ra, double dec, double width, double height, int dss)
           
private static URL getDssFromStsci(double ra, double dec, double width, double height, int dss)
          This method prepares an url according to the CGI-requirements of the STScI dss-server.
static CoordinateTransforming parseWcs(nom.tam.fits.Fits fits)
          Tries to infer a CoordinateTransforming isntance from a Fits file.
private static CoordinateTransforming parseWcsFromImageHeader(nom.tam.fits.ImageHDU hdu)
          Scans the image header for a WCS.
private static nom.tam.fits.Fits servletFits(double ra, double dec, double width, double height, int source)
           
static void setCurrent(JFitsFactory.Method current)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

current

private static JFitsFactory.Method current
Current active retrieval method..


DSS1

public static final int DSS1
Get DSS-1.

See Also:
Constant Field Values

DSS2RED

public static final int DSS2RED
Get DSS-2-red. Default.

See Also:
Constant Field Values

DSS2BLUE

public static final int DSS2BLUE
Get DSS-2-blue.

See Also:
Constant Field Values

DSS2IR

public static final int DSS2IR
Get DSS-2-infra-red.

See Also:
Constant Field Values

HTTP

private static final String HTTP
See Also:
Constant Field Values

STSCIMAXSIZE

private static final double STSCIMAXSIZE
See Also:
Constant Field Values

STSCISERVER

private static final String STSCISERVER
See Also:
Constant Field Values

STSCICGIPATH

private static final String STSCICGIPATH
See Also:
Constant Field Values

STSCIDSS2RED

private static final String STSCIDSS2RED
See Also:
Constant Field Values

STSCIDSS2BLUE

private static final String STSCIDSS2BLUE
See Also:
Constant Field Values

STSCIDSS2IR

private static final String STSCIDSS2IR
See Also:
Constant Field Values

STSCIDSS1

private static final String STSCIDSS1
See Also:
Constant Field Values

STSCIDSSDEFAULT

private static final String STSCIDSSDEFAULT
See Also:
Constant Field Values

NAOJPMAXSIZE

private static final double NAOJPMAXSIZE
See Also:
Constant Field Values

NAOJPSERVER

private static final String NAOJPSERVER
See Also:
Constant Field Values

NAOJPCGIPATH

private static final String NAOJPCGIPATH
See Also:
Constant Field Values

NAOJPDSS1

private static final String NAOJPDSS1
See Also:
Constant Field Values

NAOJPDSS2RED

private static final String NAOJPDSS2RED
See Also:
Constant Field Values

NAOJPDSS2BLUE

private static final String NAOJPDSS2BLUE
See Also:
Constant Field Values

NAOJPDSS2IR

private static final String NAOJPDSS2IR
See Also:
Constant Field Values

NAOJPDSSDEFAULT

private static final String NAOJPDSSDEFAULT
See Also:
Constant Field Values

ESOMAXSIZE

private static final double ESOMAXSIZE
See Also:
Constant Field Values

ESOSERVER

private static final String ESOSERVER
See Also:
Constant Field Values

ESOCGIPATH

private static final String ESOCGIPATH
See Also:
Constant Field Values

ESODSS1

private static final String ESODSS1
See Also:
Constant Field Values

ESODSS2RED

private static final String ESODSS2RED
See Also:
Constant Field Values

ESODSS2BLUE

private static final String ESODSS2BLUE
See Also:
Constant Field Values

ESODSS2IR

private static final String ESODSS2IR
See Also:
Constant Field Values

ESODSSDEFAULT

private static final String ESODSSDEFAULT
See Also:
Constant Field Values

LOCALSERVER

private static final String LOCALSERVER
See Also:
Constant Field Values

LOCALPATH

private static final String LOCALPATH
See Also:
Constant Field Values

LOCALPORT

private static final int LOCALPORT
See Also:
Constant Field Values
Constructor Detail

JFitsFactory

public JFitsFactory()
Method Detail

setCurrent

public static void setCurrent(JFitsFactory.Method current)

getCurrent

public static JFitsFactory.Method getCurrent()

getDssFits

public static nom.tam.fits.Fits getDssFits(double ra,
                                           double dec,
                                           double width,
                                           double height)
Downloads the DSS-fits image from an url.

Parameters:
ra - Right ascension of the center of the image in degrees.
dec - Declination of the center of the image in degrees.
width - Width of the image in degrees.
height - Height of the image in degrees.
Returns:
The fits image, also stores it

getDssFits

public static nom.tam.fits.Fits getDssFits(double ra,
                                           double dec,
                                           double width,
                                           double height,
                                           JFitsFactory.Method how,
                                           int format)
Downloads the DSS-fits image from an url.

Parameters:
ra - Right ascension of the center of the image in degrees.
dec - Declination of the center of the image in degrees.
width - Width of the image in degrees.
height - Height of the image in degrees.
Returns:
The fits image, also stores it

parseWcs

public static CoordinateTransforming parseWcs(nom.tam.fits.Fits fits)
Tries to infer a CoordinateTransforming isntance from a Fits file. This is done by reading WCS-relevant header keywords and trying to get the transformation out of it. It is losely based on the org.eso.fits.FitsWCS class.


servletFits

private static nom.tam.fits.Fits servletFits(double ra,
                                             double dec,
                                             double width,
                                             double height,
                                             int source)

parseWcsFromImageHeader

private static final CoordinateTransforming parseWcsFromImageHeader(nom.tam.fits.ImageHDU hdu)
Scans the image header for a WCS.


getDownloadUrl

private static URL getDownloadUrl(JFitsFactory.Method how,
                                  double ra,
                                  double dec,
                                  double width,
                                  double height,
                                  int source)
Returns the URL from which the image can be retrieved. This method uses the #KEY_URLMETHOD property to fork into the appropriate method.

Parameters:
ra - Right ascension of the center of the image in degrees.
dec - Declination of the center of the image in degrees.
width - Width of the image in degrees.
height - Height of the image in degrees.

getDssFromStsci

private static URL getDssFromStsci(double ra,
                                   double dec,
                                   double width,
                                   double height,
                                   int dss)
This method prepares an url according to the CGI-requirements of the STScI dss-server. In particular, an URL is created from a string similar to http://stdatu.stsci.edu/cgi-bin/dss_search?v=poss2ukstu&r=16+00+00& d=-20+00+00&e=J2000&h=15.0&w=15.0&f=gif&s=true&c=none&fov=NONE&v3= . Here, poss2ukstu is the default #KEY_SOURCE of the image, r is right ascension in hours, minutes and seconds, d the declination in degrees, minutes and seconds separated with '+' that replace ' '. Height and width are in arcminutes. Retrieval format is 'fits'. No compression, field-of-view, or rotation angle is allowed.

The image requested has integer width and height (arcmin).

Parameters:
ra - Right ascension of object, 2000.0, in degrees.
dec - Declination of object, 2000.0, in degrees.
width - Width of the fits image, in degrees.
height - Height of the fits image, in degrees.

getCgiForStsci

private static String getCgiForStsci(double ra,
                                     double dec,
                                     double width,
                                     double height,
                                     int dss)
This method prepares an url according to the CGI-requirements of the STScI dss-server. In particular, an URL is created from a string similar to http://stdatu.stsci.edu/cgi-bin/dss_search?v=poss2ukstu&r=16+00+00& d=-20+00+00&e=J2000&h=15.0&w=15.0&f=gif&s=true&c=none&fov=NONE&v3= . Here, poss2ukstu is the default #KEY_SOURCE of the image, r is right ascension in hours, minutes and seconds, d the declination in degrees, minutes and seconds separated with '+' that replace ' '. Height and width are in arcminutes. Retrieval format is 'fits'. No compression, field-of-view, or rotation angle is allowed.

The image requested has integer width and height (arcmin).

Parameters:
ra - Right ascension of object, 2000.0, in degrees.
dec - Declination of object, 2000.0, in degrees.
width - Width of the fits image, in degrees.
height - Height of the fits image, in degrees.

getDssFromNaoJp

private static URL getDssFromNaoJp(double ra,
                                   double dec,
                                   double width,
                                   double height,
                                   int dss)

getDssFromEso

private static URL getDssFromEso(double ra,
                                 double dec,
                                 double width,
                                 double height,
                                 int dss)