spv.spectrum
Class SpectrumSpecification

java.lang.Object
  extended by spv.spectrum.SpectrumSpecification
Direct Known Subclasses:
ACSSpectrumSpecification, DefaultSpectrumSpecification, Fits3DTableSpectrumSpecification, GenericFitsTableSpectrumSpecification, GHRSFOSSpectrumSpecification, SPCSpectrumSpecification, STIS2DSpectrumSpecification

public abstract class SpectrumSpecification
extends java.lang.Object

Super class of all classes used to store and manipulate objects that act as references to be used by the SpectrumFileFactory class when building spectra.

This class is necessary since there might be around some file types that store more than one spectra per file. So the file name alone cannot be used to fully specify a spectrum, and more information is required. The prototypical case are spectra stored in HST-specific formats, such as spectra from the STIS, GHRS and FOS instruments.

The typical spectrum specification consists of a URL plus additional information that enables the spectrum(a) to be located within the file pointed to by the URL.

Version:
2.0 - 05Apr05, 1.2 - 01Apr02, 1.1 - 27Feb01, 1.0 - 12Feb98
Author:
Ivo Busko (Space Telescope Science Institute)

Field Summary
protected  java.lang.String axes
           
protected  int extension
           
protected  java.lang.String filename
           
protected  nom.tam.fits.Fits fits_file
           
protected  int i1
           
protected  int i2
           
protected  javax.swing.table.TableModel model
           
protected  int row
           
protected  int[] rows
           
protected  java.lang.String ss
           
protected  java.util.Map ucds
           
protected  java.lang.String units
           
protected  java.net.URL url
           
 
Constructor Summary
SpectrumSpecification()
           
 
Method Summary
 java.lang.String getAxes()
          Gets the axis spec from the SSAP table model.
protected static java.lang.String GetCleanString(java.lang.String is)
          Returns the substring before the first occurrence of the '[' character.
protected static java.net.URL GetCleanURL(java.net.URL url)
          Returns a cleaned up URL.
 int getExtension()
          Returns the extension.
 java.lang.String getFileName()
          Returns the file name part of the URL, without any suffixes.
 nom.tam.fits.Fits getFits()
          Returns the fits object.
 javax.swing.table.TableModel getModel()
          Gets the SSAP table model.
 int getRow()
          Gets the index that accesses a row in the SSAP table model.
 java.lang.String getSSAPParameter(java.lang.String name)
          Gets an SSAP parameter, given its name.
 java.util.Map getUcds()
          Gets the map with the SSAP UCDs.
 java.lang.String getUnits()
          Gets the units spec from the SSAP table model.
 java.net.URL getURL()
          Returns the url.
protected  void parseRowSpecification()
          Parses the row specification string.
protected  void parseURLWithExtensionSpec(java.net.URL url)
          This method performs the initial parsing of a spectrum specification string that consists of a URL plus a bracket-enclosed extension spec.
 void setRowInModel(int row)
           
 void setTableModel(javax.swing.table.TableModel model)
           
 void setUCDMap(java.util.Map ucds)
           
 java.lang.String toString()
          Returns a string representation of this.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ss

protected java.lang.String ss

url

protected java.net.URL url

filename

protected java.lang.String filename

fits_file

protected nom.tam.fits.Fits fits_file

extension

protected int extension

rows

protected int[] rows

i1

protected int i1

i2

protected int i2

axes

protected java.lang.String axes

units

protected java.lang.String units

model

protected javax.swing.table.TableModel model

row

protected int row

ucds

protected java.util.Map ucds
Constructor Detail

SpectrumSpecification

public SpectrumSpecification()
Method Detail

toString

public java.lang.String toString()
Returns a string representation of this.

Overrides:
toString in class java.lang.Object
Returns:
a string representation of this

getFileName

public java.lang.String getFileName()
Returns the file name part of the URL, without any suffixes.

Returns:
the

getURL

public java.net.URL getURL()
Returns the url.

Returns:
the url

getFits

public nom.tam.fits.Fits getFits()
Returns the fits object.

Returns:
the fits object

getExtension

public int getExtension()
Returns the extension.

Returns:
the extension

getSSAPParameter

public java.lang.String getSSAPParameter(java.lang.String name)
Gets an SSAP parameter, given its name.

Parameters:
name - the parameter name
Returns:
the parameter value

getUcds

public java.util.Map getUcds()
Gets the map with the SSAP UCDs.

Returns:
the map with the SSAP UCDs

getModel

public javax.swing.table.TableModel getModel()
Gets the SSAP table model.

Returns:
the SSAP table model.

getRow

public int getRow()
Gets the index that accesses a row in the SSAP table model.

Returns:
the index that accesses a row in the SSAP table model

getAxes

public java.lang.String getAxes()
Gets the axis spec from the SSAP table model.

Returns:
the axis spec from the SSAP table model

getUnits

public java.lang.String getUnits()
Gets the units spec from the SSAP table model.

Returns:
the units spec from the SSAP table model

GetCleanString

protected static java.lang.String GetCleanString(java.lang.String is)
Returns the substring before the first occurrence of the '[' character.

Parameters:
is - the input string
Returns:
the cleaned string

GetCleanURL

protected static java.net.URL GetCleanURL(java.net.URL url)
Returns a cleaned up URL.

This method assumes that the input URL was already checked for consistency, so no exceptions are thrown.

Parameters:
url - the input URL
Returns:
the cleaned URL

parseURLWithExtensionSpec

protected void parseURLWithExtensionSpec(java.net.URL url)
                                  throws java.lang.NumberFormatException
This method performs the initial parsing of a spectrum specification string that consists of a URL plus a bracket-enclosed extension spec.

Parameters:
url - the url to be parsed
Throws:
java.lang.NumberFormatException

parseRowSpecification

protected void parseRowSpecification()
Parses the row specification string.


setTableModel

public void setTableModel(javax.swing.table.TableModel model)

setRowInModel

public void setRowInModel(int row)

setUCDMap

public void setUCDMap(java.util.Map ucds)