jview
Class JFitsFrame

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by jview.JExitFrame
                          extended by jview.JConfirmExitFrame
                              extended by jview.JBorderFrame
                                  extended by jview.JOpenFrame
                                      extended by jview.JFitsFrame
All Implemented Interfaces:
ActionListener, ItemListener, ImageObserver, MenuContainer, Serializable, Remote, EventListener, Accessible, ChangeListener, RootPaneContainer, WindowConstants, BorderLabels, Displayable, FitsFrameLabels, FitsLabels, PickListener, Initializable, LocalizedAware, LocalizedComposed, ImageOperation, Savable
Direct Known Subclasses:
JCamera

public class JFitsFrame
extends JOpenFrame
implements FitsFrameLabels, ChangeListener, ItemListener, ImageOperation, Savable, PickListener

A class that allows displays fits files.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class jview.JOpenFrame
JOpenFrame.Show
 
Nested classes/interfaces inherited from class javax.swing.JFrame
JFrame.AccessibleJFrame
 
Nested classes/interfaces inherited from class java.awt.Frame
Frame.AccessibleAWTFrame
 
Nested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
private  List<ShapeListener> adumeasure
          The list of ShapeListeners
private  List<FitsShapeProviding> apertures
          The list of FitsShapeProviders.
private  JButton bias
          Apply bias button, disabled after subtraction.
static String BIASACTION
          The action-event command for bias subtract button.
private  boolean color
          Colorize the image if true.
static String COLORACTION
          The action-event command for colorize check box.
private  JCheckBox colorbox
          The colorize check box.
private  Kernel convolve
          If we have a kernel, we apply it.
private  JButton dark
          Apply dark button, disabled after subtraction.
static String DARKACTION
          The action-event command for dark subtract button.
private static String DEFBINDNAME
          The name to bind my services.
private static boolean DEFCOLORIZE
          Default negative display.
private static String DEFFALSEPALETTE
          Default false-color palette as a binary LUT.
private static String DEFFILEACTIONS
          The action commands used for identfiying file menu actions.
private static Dimension DEFFITSBINNING
          Default binning.
private static Point DEFFITSOFFSET
          Default offset.
private static double DEFGAUSSFWHM
          The default gauss fwhm at start.
private static double DEFGAUSSMAXFWHM
          The default gauss fwhm at start.
private static double DEFGAUSSMAXTRUNC
          The default gauss fwhm at start.
private static double DEFGAUSSTRUNC
          The default gauss fwhm at start.
private static boolean DEFINCLUDESTATUS
          Default without status.
private static String DEFLOCALDIR
          The name of the local directory.
private static boolean DEFNEGATIVE
          Default negative display.
private static String DEFRESOURCEBUNDLES
          The resource bundles for localized labels and text.
private static String DEFSCPCOMMAND
          The scp command to copy to local directory.
private static long DEFSCPTIMEOUT
          The scp command to copy to local directory timeout.
private static boolean DEFSHOWGAUSS
          And we show gauss.
private static boolean DEFSHOWTABLE
           
private static String DEFTIMEDLOAD
          The name of the local directory.
private static String DEFTMPDIR
          The name of the tmp directory.
private static String DEFTMPFITS
          The name of the tmp file for decompressing.
private static String DEFURLRESOURCES
          The default resources.
private static boolean DEFWORKBACKGROUND
          The fits is a background not a viewport image.
private static boolean DEFZOOMDISPLAYED
          And we zoom this.
private  JFitsComponent fits
          Central panel is the fits canvas plus the brightness/contrast adjust.
private  List<String> fitskeys
          The list of keys.
private  JTable fitstable
          The fits header table.
private  JButton flat
          Apply flat button, disabled after subtraction.
static String FLATACTION
          The action-event command for flat-fileding button.
static String GAUSSACTION
          The action-event command for gauss-filtering button.
private  JFractionalSlider gaussfwhm
          The slider for the Gauss fwhm value in pixel.
private  JFractionalSlider gausstrunc
          The slider for the Gauss truncation value in pixel.
private  JFormattedTextField histmax
          If the user enters min/max values rather than a keep level.
private  JFormattedTextField histmin
          If the user enters min/max values rather than a keep level.
static String HISTOGRAMACTION
          The action-event command for histogram button.
static String HORIZONTALCUTACTION
          The action-event command for horizontal cut button.
private  JSpinner horsize
          The spinner that defines the pixel size of the horizontal cut.
private  JCheckBox invert
          The invert check box.
static String INVERTACTION
          The action-event command for invert check box.
private  JRationalSlider keep
          The slider for percentage of counts kept.
static String KEY_BIASFITS
          The key pointing to the bias fits file.
static String KEY_BINDNAME
          The name to bind my services.
static String KEY_COLORIZE
          The default color value.
static String KEY_DARKFITS
          The key pointing to the debiased dark fits, scaled to 1 sec exposure.
static String KEY_FALSEPALETTE
          The name of the false-color palette to use.
static String KEY_FITSBINNING
          The default fits binning, override with header entries.
static String KEY_FITSOFFSET
          The default offset of the fits image, override with header entries.
static String KEY_FLATTABLE
          The key pointing to the filter-to-flat fits lookup table.
static String KEY_GAUSSFWHM
          The key to the start gauss fwhm.
static String KEY_GAUSSMAXFWHM
          The key to the maximum gauss fwhm.
static String KEY_GAUSSMAXTRUNC
          The key to the maximum gauss truncation.
static String KEY_GAUSSTRUNC
          The key to the start gauss truncation.
static String KEY_HEADERKEYS
          The list of header keyword to display.
static String KEY_INCLUDESTATUS
          If true, we include a status panel.
static String KEY_LOCALDIR
          The name of the local directory.
static String KEY_NEGATIVE
          The default negative value.
static String KEY_SCPCOMMAND
          The scp command to copy to local directory.
static String KEY_SCPTIMEOUT
          The scp command to copy to local directory timeout.
static String KEY_SHOWGAUSS
          The key to the maximum gauss fwhm.
static String KEY_SHOWTABLE
          If true, we include a table of fits keys panel.
static String KEY_TELESCOPECHAR
          The telescope ID char for pick listening.
static String KEY_TIMEDLOAD
          The name of the local directory.
static String KEY_TMPDIR
          The name of the tmp directory.
static String KEY_TMPFITS
          The name of the tmp file for decompressing.
private  int lastcut
          Last cut button that was pressed.
private  boolean negative
          Invert colors if true.
static String NEXTXTENSIONACTION
          The action-event command for next extension button.
private  JFormattedTextField precise
          The text field bound to the percentage slider.
static String PREVXTENSIONACTION
          The action-event command for next extension button.
private  Map<String,FitsShapeProviding> providers
          Lookup table linking shape provider ids to the provider.
private  JLabel ra1de
          If a WCS was found, we also display right ascension and dec.
private  JLabel rade1
          If a WCS was found, we also display right ascension and dec.
static String REDRAWACTION
          The action-event command for redraw button.
static String RESETACTION
          The action-event command for reset button.
static String RESETPROPERTY
          The reset property change event string.
private  JComboBox scaling
          The scaling combo box.
private  JLabel value
          The value in the fits file at the mouse position.
private  NumberFormat valuef
          And the decimal formatter to it.
static String VERTICALCUTACTION
          The action-event command for vertical cut button.
private  JSpinner vertsize
          The spinner that defines the pixel size of the vertical cut.
private  List<List<nom.tam.fits.HeaderCard>> xcards
          All the header keys reader, for all HDU's.
private  JButton xnext
          For cycling multiple extensions.
private  JButton xprev
          For cycling multiple extensions.
private  JLabel xtend
          If multiple extension, this show the current.
static String XTENSION
          XTENSION counter.
 
Fields inherited from class jview.JOpenFrame
EMPTYACTION, EXITACTION, EXPORTACTION, KEY_FILEACTIONS, KEY_FILEHOME, OPENACTION, PRINTACTION, SAVEACTION
 
Fields inherited from class jview.JBorderFrame
DATACLEANSE, KEY_ABOUTURL, KEY_ACTIONCLASS, KEY_AIPLOGO, KEY_BIGGERSTRUT, KEY_DATAANALYSER, KEY_EASTALIGNMENT, KEY_FITTERS, KEY_FITTERTIPS, KEY_HELPSIZE, KEY_LESSERSTRUT, KEY_NOLOGO, KEY_NORTHALIGNMENT, KEY_SOUTHALIGNMENT, KEY_WESTALIGNMENT, MODELFITTER
 
Fields inherited from class javax.swing.JFrame
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface jview.FitsFrameLabels
KEY_BIASFRAME, KEY_BIASFRAMETIP, KEY_DARKFRAME, KEY_DARKFRAMETIP, KEY_FITSERROR, KEY_FITSTITLE, KEY_FLATFRAME, KEY_FLATFRAMETIP, KEY_HISTOGRAM, KEY_HISTOGRAMTIP, KEY_HORIZONTALCUT, KEY_HORIZONTALCUTTIP, KEY_NEXTFRAME, KEY_NEXTFRAMETIP, KEY_PREVFRAME, KEY_PREVFRAMETIP, KEY_VERTICALCUT, KEY_VERTICALCUTTIP, KEY_VIEWPORTTIP
 
Fields inherited from interface jview.FitsLabels
KEY_COLORLABEL, KEY_COLORTIP, KEY_GAUSSLABEL, KEY_GAUSSTIP, KEY_INVERTLABEL, KEY_INVERTTIP, KEY_KEEPTIP, KEY_REDRAWLABEL, KEY_REDRAWTIP, KEY_RESETLABEL, KEY_RESETTIP, KEY_SCALELABEL, KEY_SCALETIP
 
Fields inherited from interface jview.BorderLabels
KEY_ABOUT, KEY_ABOUTACC, KEY_FILEACCS, KEY_FILEITEMS, KEY_FILEMENU, KEY_FILEMNEMONIC, KEY_HELPMENU, KEY_HELPMNEMONIC, KEY_HELPTITLE, KEY_NOHELP, KEY_NOURLACCESS, KEY_TITLE
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
JFitsFrame(LocalizedSupplying prop)
          Constructs a new camera from properties.
JFitsFrame(Map<String,String> prop)
          Constructs a generic peripheral from a property container.
 
Method Summary
 void actionPerformed(ActionEvent ae)
          Action events are issued by the scaling list and the buttons.
private  BufferedImage colorize(BufferedImage show)
          Colorizes the image by looking up the properties for a LUT.
protected  JFitsCanvas createFitsCanvas(ResourceSupplying info)
          Subclasses that may need a special canvas can intervene here.
private  void cursorShape(Shape clear)
           
 void doFits(nom.tam.fits.Fits readed, int xoff, int yoff, int xbin, int ybin)
           
private  nom.tam.fits.Fits getBiasFor(nom.tam.fits.Fits src)
          Uses the fits file and scans for an appropriate bias file.
protected  List<Object> getBottomItems()
          No status display, if status=false
private  nom.tam.fits.Fits getDarkFor(nom.tam.fits.Fits src)
          Uses the fits file and scans for an appropriate dark file.
 Map<String,Object> getDisplayMap()
           
protected  JFitsCanvas getFitsCanvas()
          Returns direct acces to the fits canvas for daughters.
private  nom.tam.fits.Fits getFlatFor(nom.tam.fits.Fits src)
          Uses the fits file and tries to return an appropriate flat field.
protected  List<Object> getLeftItems()
          Returns the list of items to add to the west box.
 FileFilter getOpenFilter()
          Returns a file filter allowing only fits files.
 Component getRepresentation()
          The representation is a JFitsComponent that allows adjustment of the contrast and the brightness.
protected  List<Object> getRightItems()
          Returns the list of components to be placed below the aip logo.
 BufferedImage getSaveBuffer()
          Returns the buffered image from the fits canvas.
protected  Component getSaveRepresentation()
          For saving, we return the central component.
 void init()
          Initializes the jcamera.
private  void initFitsCanvas(ResourceSupplying info)
          Initializes the central fits canvas.
 boolean isColorized()
          Returns true if the current image is false-colorized.
 boolean isNegative()
          Returns the current status of the negative image flag.
 void itemStateChanged(ItemEvent ie)
          Called when the state of the checkboxes changes.
static void main(String[] arg)
          The command line argument is the fits file, followed by the xtension to display.
protected  boolean openFile(File fitsfile)
          Opens a pre-recorded file for display.
 BufferedImage prepareToDisplay(BufferedImage src)
          Rescales the image to display the new brightness and contrast.
 boolean processPick(HistoryAware.Pick pick)
          Processes a pick, displaying the raw file.
 void reset()
          Resets values of scaling, brightness, contrast, negative, colorize and percentage of points to keep to the values stored in the properties.
private  void resetShapeCursor()
          Resets the shape cursor.
 void setComposedProperties(LocalizedSupplying prop)
          Sets a LocalizedSupplying object as a composite of the canvas.
private  void showHistogram()
          Shows the count histogram.
 void stateChanged(ChangeEvent ce)
          Called when the state of the percentage level slider changes.
private  Thread threadLoad(String unique)
          Tries to load a fitz file from a unique identifier.
 boolean toggleColorize()
          Toggles the colorization of the image.
 boolean toggleNegative()
          Toggles the image to be its negative.
 
Methods inherited from class jview.JOpenFrame
createCheckBoxMenuItem, createLocalizedCheckBoxMenuItem, createLocalizedMenu, createLocalizedMenuItem, createLocalizedRadioButtonMenuItem, createMenu, createMenuItem, createRadioButtonMenuItem, exportCenter, getExportRepresentation, getHelpActions, getMenus, getPrintRepresentation, getSaveFilter, populateMenu, printCenter, saveFile
 
Methods inherited from class jview.JBorderFrame
analyserListenTo, createButton, createCheckBox, createDataAnalysers, createFitters, createHelp, createLabel, createLocalizedButton, createLocalizedCheckBox, createLocalizedHelp, createLocalizedLabel, createLocalizedRadioButton, createRadioButton, createStatus, getAboutAction, getActiveFit, getBiggerStrut, getComposedProperties, getDataAnalysers, getFitterButtonGroup, getFitterComboBox, getIcon, getLesserStrut, getModelFittings, getStatusField, getTopItems, hasFired, printAlignment, setAlignment, setFired
 
Methods inherited from class jview.JConfirmExitFrame
disposeAndExit, disposeImmediately
 
Methods inherited from class jview.JExitFrame
setVisible
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
 
Methods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface util.LocalizedComposed
getComposedProperties
 
Methods inherited from interface jview.Displayable
getIcon
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

RESETPROPERTY

public static final String RESETPROPERTY
The reset property change event string.

See Also:
Constant Field Values

BIASACTION

public static final String BIASACTION
The action-event command for bias subtract button.

See Also:
Constant Field Values

DARKACTION

public static final String DARKACTION
The action-event command for dark subtract button.

See Also:
Constant Field Values

FLATACTION

public static final String FLATACTION
The action-event command for flat-fileding button.

See Also:
Constant Field Values

GAUSSACTION

public static final String GAUSSACTION
The action-event command for gauss-filtering button.

See Also:
Constant Field Values

NEXTXTENSIONACTION

public static final String NEXTXTENSIONACTION
The action-event command for next extension button.

See Also:
Constant Field Values

PREVXTENSIONACTION

public static final String PREVXTENSIONACTION
The action-event command for next extension button.

See Also:
Constant Field Values

HISTOGRAMACTION

public static final String HISTOGRAMACTION
The action-event command for histogram button.

See Also:
Constant Field Values

VERTICALCUTACTION

public static final String VERTICALCUTACTION
The action-event command for vertical cut button.

See Also:
Constant Field Values

HORIZONTALCUTACTION

public static final String HORIZONTALCUTACTION
The action-event command for horizontal cut button.

See Also:
Constant Field Values

INVERTACTION

public static final String INVERTACTION
The action-event command for invert check box.

See Also:
Constant Field Values

COLORACTION

public static final String COLORACTION
The action-event command for colorize check box.

See Also:
Constant Field Values

RESETACTION

public static final String RESETACTION
The action-event command for reset button.

See Also:
Constant Field Values

REDRAWACTION

public static final String REDRAWACTION
The action-event command for redraw button.

See Also:
Constant Field Values

XTENSION

public static final String XTENSION
XTENSION counter.

See Also:
Constant Field Values

KEY_BIASFITS

public static final String KEY_BIASFITS
The key pointing to the bias fits file.

See Also:
Constant Field Values

KEY_DARKFITS

public static final String KEY_DARKFITS
The key pointing to the debiased dark fits, scaled to 1 sec exposure.

See Also:
Constant Field Values

KEY_FLATTABLE

public static final String KEY_FLATTABLE
The key pointing to the filter-to-flat fits lookup table.

See Also:
Constant Field Values

KEY_HEADERKEYS

public static final String KEY_HEADERKEYS
The list of header keyword to display.

See Also:
Constant Field Values

KEY_NEGATIVE

public static final String KEY_NEGATIVE
The default negative value.

See Also:
Constant Field Values

KEY_COLORIZE

public static final String KEY_COLORIZE
The default color value.

See Also:
Constant Field Values

KEY_FALSEPALETTE

public static final String KEY_FALSEPALETTE
The name of the false-color palette to use.

See Also:
Constant Field Values

KEY_SHOWGAUSS

public static final String KEY_SHOWGAUSS
The key to the maximum gauss fwhm.

See Also:
Constant Field Values

KEY_GAUSSMAXFWHM

public static final String KEY_GAUSSMAXFWHM
The key to the maximum gauss fwhm.

See Also:
Constant Field Values

KEY_GAUSSFWHM

public static final String KEY_GAUSSFWHM
The key to the start gauss fwhm.

See Also:
Constant Field Values

KEY_GAUSSMAXTRUNC

public static final String KEY_GAUSSMAXTRUNC
The key to the maximum gauss truncation.

See Also:
Constant Field Values

KEY_GAUSSTRUNC

public static final String KEY_GAUSSTRUNC
The key to the start gauss truncation.

See Also:
Constant Field Values

KEY_FITSOFFSET

public static final String KEY_FITSOFFSET
The default offset of the fits image, override with header entries.

See Also:
Constant Field Values

KEY_FITSBINNING

public static final String KEY_FITSBINNING
The default fits binning, override with header entries.

See Also:
Constant Field Values

KEY_BINDNAME

public static final String KEY_BINDNAME
The name to bind my services.

See Also:
Constant Field Values

KEY_LOCALDIR

public static final String KEY_LOCALDIR
The name of the local directory.

See Also:
Constant Field Values

KEY_TMPDIR

public static final String KEY_TMPDIR
The name of the tmp directory.

See Also:
Constant Field Values

KEY_TMPFITS

public static final String KEY_TMPFITS
The name of the tmp file for decompressing.

See Also:
Constant Field Values

KEY_TIMEDLOAD

public static final String KEY_TIMEDLOAD
The name of the local directory.

See Also:
Constant Field Values

KEY_SCPCOMMAND

public static final String KEY_SCPCOMMAND
The scp command to copy to local directory.

See Also:
Constant Field Values

KEY_SCPTIMEOUT

public static final String KEY_SCPTIMEOUT
The scp command to copy to local directory timeout.

See Also:
Constant Field Values

KEY_TELESCOPECHAR

public static final String KEY_TELESCOPECHAR
The telescope ID char for pick listening.

See Also:
Constant Field Values

KEY_INCLUDESTATUS

public static final String KEY_INCLUDESTATUS
If true, we include a status panel.

See Also:
Constant Field Values

KEY_SHOWTABLE

public static final String KEY_SHOWTABLE
If true, we include a table of fits keys panel.

See Also:
Constant Field Values

DEFRESOURCEBUNDLES

private static final String DEFRESOURCEBUNDLES
The resource bundles for localized labels and text.

See Also:
Constant Field Values

DEFURLRESOURCES

private static final String DEFURLRESOURCES
The default resources.

See Also:
Constant Field Values

DEFWORKBACKGROUND

private static final boolean DEFWORKBACKGROUND
The fits is a background not a viewport image.

See Also:
Constant Field Values

DEFZOOMDISPLAYED

private static final boolean DEFZOOMDISPLAYED
And we zoom this.

See Also:
Constant Field Values

DEFSHOWGAUSS

private static final boolean DEFSHOWGAUSS
And we show gauss.

See Also:
Constant Field Values

DEFGAUSSMAXFWHM

private static final double DEFGAUSSMAXFWHM
The default gauss fwhm at start.

See Also:
Constant Field Values

DEFGAUSSFWHM

private static final double DEFGAUSSFWHM
The default gauss fwhm at start.

See Also:
Constant Field Values

DEFGAUSSMAXTRUNC

private static final double DEFGAUSSMAXTRUNC
The default gauss fwhm at start.

See Also:
Constant Field Values

DEFGAUSSTRUNC

private static final double DEFGAUSSTRUNC
The default gauss fwhm at start.

See Also:
Constant Field Values

DEFNEGATIVE

private static final boolean DEFNEGATIVE
Default negative display.

See Also:
Constant Field Values

DEFCOLORIZE

private static final boolean DEFCOLORIZE
Default negative display.

See Also:
Constant Field Values

DEFINCLUDESTATUS

private static final boolean DEFINCLUDESTATUS
Default without status.

See Also:
Constant Field Values

DEFFITSBINNING

private static final Dimension DEFFITSBINNING
Default binning.


DEFFITSOFFSET

private static final Point DEFFITSOFFSET
Default offset.


DEFFALSEPALETTE

private static final String DEFFALSEPALETTE
Default false-color palette as a binary LUT.

See Also:
Constant Field Values

DEFFILEACTIONS

private static final String DEFFILEACTIONS
The action commands used for identfiying file menu actions.

See Also:
Constant Field Values

DEFBINDNAME

private static final String DEFBINDNAME
The name to bind my services.

See Also:
Constant Field Values

DEFLOCALDIR

private static final String DEFLOCALDIR
The name of the local directory.

See Also:
Constant Field Values

DEFTMPDIR

private static final String DEFTMPDIR
The name of the tmp directory.

See Also:
Constant Field Values

DEFTMPFITS

private static final String DEFTMPFITS
The name of the tmp file for decompressing.

See Also:
Constant Field Values

DEFTIMEDLOAD

private static final String DEFTIMEDLOAD
The name of the local directory.

See Also:
Constant Field Values

DEFSCPCOMMAND

private static final String DEFSCPCOMMAND
The scp command to copy to local directory.

See Also:
Constant Field Values

DEFSCPTIMEOUT

private static final long DEFSCPTIMEOUT
The scp command to copy to local directory timeout.

See Also:
Constant Field Values

DEFSHOWTABLE

private static final boolean DEFSHOWTABLE
See Also:
Constant Field Values

fits

private JFitsComponent fits
Central panel is the fits canvas plus the brightness/contrast adjust.


xcards

private List<List<nom.tam.fits.HeaderCard>> xcards
All the header keys reader, for all HDU's.


value

private JLabel value
The value in the fits file at the mouse position.


valuef

private NumberFormat valuef
And the decimal formatter to it.


ra1de

private JLabel ra1de
If a WCS was found, we also display right ascension and dec.


rade1

private JLabel rade1
If a WCS was found, we also display right ascension and dec.


keep

private JRationalSlider keep
The slider for percentage of counts kept.


precise

private JFormattedTextField precise
The text field bound to the percentage slider.


histmin

private JFormattedTextField histmin
If the user enters min/max values rather than a keep level.


histmax

private JFormattedTextField histmax
If the user enters min/max values rather than a keep level.


scaling

private JComboBox scaling
The scaling combo box.


colorbox

private JCheckBox colorbox
The colorize check box.


invert

private JCheckBox invert
The invert check box.


negative

private boolean negative
Invert colors if true.


color

private boolean color
Colorize the image if true.


convolve

private Kernel convolve
If we have a kernel, we apply it.


gaussfwhm

private JFractionalSlider gaussfwhm
The slider for the Gauss fwhm value in pixel.


gausstrunc

private JFractionalSlider gausstrunc
The slider for the Gauss truncation value in pixel.


xtend

private JLabel xtend
If multiple extension, this show the current.


xnext

private JButton xnext
For cycling multiple extensions.


xprev

private JButton xprev
For cycling multiple extensions.


bias

private JButton bias
Apply bias button, disabled after subtraction.


dark

private JButton dark
Apply dark button, disabled after subtraction.


flat

private JButton flat
Apply flat button, disabled after subtraction.


vertsize

private JSpinner vertsize
The spinner that defines the pixel size of the vertical cut.


horsize

private JSpinner horsize
The spinner that defines the pixel size of the horizontal cut.


fitstable

private JTable fitstable
The fits header table.


fitskeys

private List<String> fitskeys
The list of keys.


apertures

private List<FitsShapeProviding> apertures
The list of FitsShapeProviders.


adumeasure

private List<ShapeListener> adumeasure
The list of ShapeListeners


providers

private Map<String,FitsShapeProviding> providers
Lookup table linking shape provider ids to the provider.


lastcut

private int lastcut
Last cut button that was pressed.

Constructor Detail

JFitsFrame

public JFitsFrame(LocalizedSupplying prop)
Constructs a new camera from properties. The initialization is done in the init() section


JFitsFrame

public JFitsFrame(Map<String,String> prop)
Constructs a generic peripheral from a property container.

Method Detail

reset

public void reset()
Resets values of scaling, brightness, contrast, negative, colorize and percentage of points to keep to the values stored in the properties. This fires a PropertyChangeEvent to registered listeners.


getDisplayMap

public Map<String,Object> getDisplayMap()

setComposedProperties

public void setComposedProperties(LocalizedSupplying prop)
Sets a LocalizedSupplying object as a composite of the canvas. Defaults the necessary parameter.

Specified by:
setComposedProperties in interface LocalizedAware
Overrides:
setComposedProperties in class JOpenFrame

init

public void init()
Initializes the jcamera. This method calls the super class init after its necessary setup has been generated. This includes constructing the fits canvas and the camera driver.

Specified by:
init in interface Initializable
Overrides:
init in class JOpenFrame

isNegative

public boolean isNegative()
Returns the current status of the negative image flag. Should be queried in conjuncture with toggleNegative() if control over negative colors is desired.


toggleNegative

public boolean toggleNegative()
Toggles the image to be its negative. Applied two times restores the original image. If total control over negative is needed, use in conjuncture with isNegative().

Returns:
The new state of the negative flag.

isColorized

public boolean isColorized()
Returns true if the current image is false-colorized. Should be queried in conjuncture with toggleColorize() if total control is needed.


toggleColorize

public boolean toggleColorize()
Toggles the colorization of the image. If the current image is gray, we use the KEY_FALSEPALETTE key to grab a look-up table to convert the gary to color. Otherwise we revert from fits.

Returns:
The new state of the colorization flag.

prepareToDisplay

public BufferedImage prepareToDisplay(BufferedImage src)
Rescales the image to display the new brightness and contrast.

Specified by:
prepareToDisplay in interface ImageOperation

initFitsCanvas

private void initFitsCanvas(ResourceSupplying info)
Initializes the central fits canvas. Mouse motions are captured for updating the counts number, clicks for changing the vertical cut and horizontal cuts.


createFitsCanvas

protected JFitsCanvas createFitsCanvas(ResourceSupplying info)
Subclasses that may need a special canvas can intervene here.


getSaveBuffer

public BufferedImage getSaveBuffer()
Returns the buffered image from the fits canvas.

Specified by:
getSaveBuffer in interface Savable

getRepresentation

public Component getRepresentation()
The representation is a JFitsComponent that allows adjustment of the contrast and the brightness.

Specified by:
getRepresentation in interface Displayable
Overrides:
getRepresentation in class JBorderFrame

getSaveRepresentation

protected Component getSaveRepresentation()
For saving, we return the central component.

Overrides:
getSaveRepresentation in class JOpenFrame

stateChanged

public void stateChanged(ChangeEvent ce)
Called when the state of the percentage level slider changes.

Specified by:
stateChanged in interface ChangeListener

itemStateChanged

public void itemStateChanged(ItemEvent ie)
Called when the state of the checkboxes changes. These are the invert and colorize check boxes.

Specified by:
itemStateChanged in interface ItemListener

actionPerformed

public void actionPerformed(ActionEvent ae)
Action events are issued by the scaling list and the buttons.

Specified by:
actionPerformed in interface ActionListener
Overrides:
actionPerformed in class JOpenFrame

resetShapeCursor

private void resetShapeCursor()
Resets the shape cursor.


cursorShape

private void cursorShape(Shape clear)

getRightItems

protected List<Object> getRightItems()
Returns the list of components to be placed below the aip logo. This is a JViewportButton to allow resetting of the ccd frame, a button that pops up the histogramm, cut graph pop-up buttons and a field where the cursor can put its coordinates for proper reading.

Overrides:
getRightItems in class JBorderFrame

getLeftItems

protected List<Object> getLeftItems()
Returns the list of items to add to the west box.

Overrides:
getLeftItems in class JBorderFrame

getBottomItems

protected List<Object> getBottomItems()
No status display, if status=false

Overrides:
getBottomItems in class JBorderFrame

getOpenFilter

public FileFilter getOpenFilter()
Returns a file filter allowing only fits files.

Overrides:
getOpenFilter in class JOpenFrame

processPick

public boolean processPick(HistoryAware.Pick pick)
                    throws RemoteException
Processes a pick, displaying the raw file.

Specified by:
processPick in interface PickListener
Returns:
True, if the pick can be processed.
Throws:
RemoteException

threadLoad

private Thread threadLoad(String unique)
Tries to load a fitz file from a unique identifier.


getFitsCanvas

protected JFitsCanvas getFitsCanvas()
Returns direct acces to the fits canvas for daughters.


doFits

public void doFits(nom.tam.fits.Fits readed,
                   int xoff,
                   int yoff,
                   int xbin,
                   int ybin)

openFile

protected boolean openFile(File fitsfile)
Opens a pre-recorded file for display.

Specified by:
openFile in class JOpenFrame

getBiasFor

private nom.tam.fits.Fits getBiasFor(nom.tam.fits.Fits src)
Uses the fits file and scans for an appropriate bias file.


colorize

private BufferedImage colorize(BufferedImage show)
Colorizes the image by looking up the properties for a LUT.


getDarkFor

private nom.tam.fits.Fits getDarkFor(nom.tam.fits.Fits src)
Uses the fits file and scans for an appropriate dark file.


getFlatFor

private nom.tam.fits.Fits getFlatFor(nom.tam.fits.Fits src)
Uses the fits file and tries to return an appropriate flat field.


showHistogram

private void showHistogram()
Shows the count histogram.


main

public static void main(String[] arg)
                 throws ParseException,
                        IOException
The command line argument is the fits file, followed by the xtension to display.

Throws:
ParseException
IOException