jsky.navigator
Class NavigatorFITSTable

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by javax.swing.table.DefaultTableModel
          extended by jsky.catalog.MemoryCatalog
              extended by jsky.catalog.skycat.SkycatTable
                  extended by jsky.navigator.NavigatorFITSTable
All Implemented Interfaces:
Serializable, Cloneable, TableModel, Catalog, QueryResult, TableQueryResult, Saveable, SaveableAsHTML

public class NavigatorFITSTable
extends SkycatTable

Used to read and write FITS binary tables and store catalog query results as FITS tables. This class is the bridge between the catalog classes and the FITS I/O library.

Version:
$Revision: 1.14 $
Author:
Allan Brighton
See Also:
Serialized Form

Field Summary
protected static String CATINFO
          Name of a FITS binary table containing skycat style catalog configuration information.
protected static String[] CATINFO_COLUMNS
          Table column headings for the CATINFO table (corresponds to the fields in a skycat catalog config file)
protected static int NUM_CATINFO_COLUMNS
          Number of columns in the CATINFO table
 
Fields inherited from class jsky.catalog.MemoryCatalog
DEC_COL, EQUINOX, ID_COL, RA_COL, SYMBOL, X_COL, Y_COL
 
Fields inherited from class javax.swing.table.DefaultTableModel
columnIdentifiers, dataVector
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Fields inherited from interface jsky.catalog.Catalog
ARCHIVE, CATALOG, DIRECTORY, IMAGE_SERVER, LOCAL, NAME_SERVER
 
Constructor Summary
NavigatorFITSTable(String filename, Fits fits, int hduIndex)
          Initialize from the given FITS HDU
NavigatorFITSTable(String filename, Fits fits, TableHDU hdu)
          Initialize from the given FITS HDU
 
Method Summary
protected static void deleteTable(Fits fits, String name)
          Delete the named FITS table from the given FITS file.
protected static BinaryTableHDU findBinaryTableHDU(Fits fits, String name)
          Look for a binary table with the given name and return it if found, otherwise null.
protected  SkycatConfigEntry findConfigEntry(Fits fits)
          Look for a skycat catalog configuration entry for this table in another FITS table in this file with the name "CATINFO".
protected static int findConfigEntryRow(BinaryTableHDU hdu, String name)
          Return index of the row in the given binary table who's first element contains the given string, or -1 if not found.
protected static NavigatorFITSTable findTable(String filename, Fits fits, String name)
          Find the named FITS binary table, make a NavigatorFITSTable out of it and return it.
protected static TableHDU getTableHDU(Fits fits, int hduIndex)
          Return the object for the given HDU index.
protected static void plotTable(String filename, Fits fits, Navigator navigator, String name)
          Plot the named binary table on the image.
static void plotTables(String filename, Fits fits, Navigator navigator)
          Check for any catalog tables saved as FITS binary tables and plot the ones found on the image.
static NavigatorFITSTable saveWithImage(String filename, Fits fits, TableQueryResult table)
          Save the given table as a binary FITS table in the given FITS image file and return a NavigatorFITSTable object for the new table.
protected static void updateCatInfo(Fits fits, TableQueryResult table, String name)
          Add (or update) a FITS table named CATINFO with catalog configuration information for the given catalog.
 
Methods inherited from class jsky.catalog.skycat.SkycatTable
_saveProperties, checkProperties, getCatalog, getConfigEntry, main, makeQueryResult, setConfigEntry
 
Methods inherited from class jsky.catalog.MemoryCatalog
_checkColumnClass, _init, _initColumnClasses, _initFields, _parseHeading, _parseItem, _parseProperty, _parseRow, _saveHeader, addRow, clone, compareRow, getColumnClass, getColumnClasses, getColumnDesc, getColumnIdentifiers, getColumnIndex, getColumnName, getCoordinates, getDescription, getDocURL, getFields, getFilename, getId, getName, getNumColumns, getNumParams, getParamDesc, getParamDesc, getParent, getPath, getProperties, getProperty, getQueryArgs, getRowCoordinates, getTitle, getType, getValueAt, getWCSCenter, hasCol, hasCoordinates, isCellEditable, isImageServer, isLocal, isMore, isReadOnly, makeColumnIdentifiers, print, query, saveAs, saveAs, saveAsHTML, setCatalog, setColumnClasses, setColumnIdentifiers, setDescription, setDocURL, setFields, setFilename, setId, setMore, setName, setParent, setProperties, setProperty, setQueryArgs, setReadOnly, setRegionArgs, setRowCoordinates, setTitle, sort, toString
 
Methods inherited from class javax.swing.table.DefaultTableModel
addColumn, addColumn, addColumn, addRow, convertToVector, convertToVector, getColumnCount, getDataVector, getRowCount, getValueAt, insertRow, insertRow, moveRow, newDataAvailable, newRowsAdded, removeRow, rowsRemoved, setColumnCount, setColumnIdentifiers, setDataVector, setDataVector, setNumRows, setRowCount, setValueAt
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jsky.catalog.TableQueryResult
getDataVector
 
Methods inherited from interface javax.swing.table.TableModel
addTableModelListener, getColumnCount, getRowCount, getValueAt, removeTableModelListener, setValueAt
 

Field Detail

CATINFO

protected static final String CATINFO
Name of a FITS binary table containing skycat style catalog configuration information.

See Also:
Constant Field Values

CATINFO_COLUMNS

protected static final String[] CATINFO_COLUMNS
Table column headings for the CATINFO table (corresponds to the fields in a skycat catalog config file)


NUM_CATINFO_COLUMNS

protected static final int NUM_CATINFO_COLUMNS
Number of columns in the CATINFO table

Constructor Detail

NavigatorFITSTable

public NavigatorFITSTable(String filename,
                          Fits fits,
                          TableHDU hdu)
                   throws IOException,
                          FitsException
Initialize from the given FITS HDU

Parameters:
filename - The name of the FITS file
fits - object to use for FITS I/O
hdu - the HDU containing the FITS table
Throws:
IOException
FitsException

NavigatorFITSTable

public NavigatorFITSTable(String filename,
                          Fits fits,
                          int hduIndex)
                   throws IOException,
                          FitsException
Initialize from the given FITS HDU

Parameters:
filename - The name of the FITS file
fits - object to use for FITS I/O
hduIndex - the index of the HDU containing the FITS table
Throws:
IOException
FitsException
Method Detail

getTableHDU

protected static TableHDU getTableHDU(Fits fits,
                                      int hduIndex)
                               throws IOException,
                                      FitsException
Return the object for the given HDU index.

Parameters:
fits - object to use for FITS I/O
hduIndex - the index of the HDU containing the FITS table
Throws:
IOException
FitsException

findConfigEntry

protected SkycatConfigEntry findConfigEntry(Fits fits)
                                     throws FitsException,
                                            IOException
Look for a skycat catalog configuration entry for this table in another FITS table in this file with the name "CATINFO".

Parameters:
fits - object to use for FITS I/O
Returns:
a skycat config entry for this table, or null if not found
Throws:
FitsException
IOException

findConfigEntryRow

protected static int findConfigEntryRow(BinaryTableHDU hdu,
                                        String name)
                                 throws FitsException,
                                        IOException
Return index of the row in the given binary table who's first element contains the given string, or -1 if not found.

Throws:
FitsException
IOException

findBinaryTableHDU

protected static BinaryTableHDU findBinaryTableHDU(Fits fits,
                                                   String name)
                                            throws FitsException,
                                                   IOException
Look for a binary table with the given name and return it if found, otherwise null.

Parameters:
fits - object to use for FITS I/O
Returns:
a FITS binary table, or null if not found
Throws:
FitsException
IOException

saveWithImage

public static NavigatorFITSTable saveWithImage(String filename,
                                               Fits fits,
                                               TableQueryResult table)
                                        throws FitsException,
                                               IOException
Save the given table as a binary FITS table in the given FITS image file and return a NavigatorFITSTable object for the new table.

If the table is an instance of SkycatTable, the catalog configuration information is also saved in a separate table named CATINFO.

Parameters:
filename - The name of the FITS file
fits - object to use for FITS I/O
table - contains the table data
Returns:
a NavigatorFITSTable object for the new table
Throws:
FitsException
IOException

deleteTable

protected static void deleteTable(Fits fits,
                                  String name)
                           throws FitsException,
                                  IOException
Delete the named FITS table from the given FITS file.

Parameters:
fits - object to use for FITS I/O
name - the name of the table
Throws:
FitsException
IOException

updateCatInfo

protected static void updateCatInfo(Fits fits,
                                    TableQueryResult table,
                                    String name)
                             throws FitsException,
                                    IOException
Add (or update) a FITS table named CATINFO with catalog configuration information for the given catalog. Note: This method only supports tables derived from SkycatTable.

Parameters:
fits - object to use for FITS I/O
table - contains the table data
name - the name to give the FITS table
Throws:
FitsException
IOException

plotTables

public static void plotTables(String filename,
                              Fits fits,
                              Navigator navigator)
                       throws FitsException,
                              IOException
Check for any catalog tables saved as FITS binary tables and plot the ones found on the image. Each catalog table should have an entry in the CATINFO FITS table, which describes how to plot it.

Parameters:
filename - The name of the FITS file
fits - object to use for FITS I/O
navigator - window object managing the table display and plotting
Throws:
FitsException
IOException

plotTable

protected static void plotTable(String filename,
                                Fits fits,
                                Navigator navigator,
                                String name)
                         throws FitsException,
                                IOException
Plot the named binary table on the image.

Parameters:
filename - The name of the FITS file
fits - object to use for FITS I/O
navigator - window object managing the table display and plotting
name - the name of the table to plot (FITS keyword EXTNAME)
Throws:
FitsException
IOException

findTable

protected static NavigatorFITSTable findTable(String filename,
                                              Fits fits,
                                              String name)
                                       throws FitsException,
                                              IOException
Find the named FITS binary table, make a NavigatorFITSTable out of it and return it.

Parameters:
filename - The name of the FITS file
fits - object to use for FITS I/O
name - the name of the table to plot (FITS keyword EXTNAME)
Throws:
FitsException
IOException


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.