public class MagnitudeGraph
extends javax.swing.JComponent
implements java.awt.print.Printable
The brightness measurements may be inaccurate because of noise in the image. The outer ring around each blob is measured to determine the background level in the vicinity. That process includes calculating the standard deviation (ϭ0) of the mean background level which, because the ring is small, is predominantly due to the noise. It is a reasonable assumption that if the star were not present in the central measurement disc the same mean background level would continue across it, with the same standard deviation. Therefore the measurement of each star's brightness, B, is subject to the same errors at each pixel as in the outer ring. In calculating that brightness we add up the brightnesses of every pixel after subtracting from them the mean background level (that is done separately in each channel if it is a coloured image). So at each pixel we are subtracting pairs of values that are subject to the same possible error. The result therefore has a larger error, perhaps by as much as a factor of 2. My guess is that a fair estimate would be to multiply the background standard error (S0, standard deviation over root number of samples) by root 2 at each point to get the standard error of the star brightness levels.
If n0 is the number of pixels measured in the background ring, the standard error of the mean background is
S0 = ϭ0 / √n0 by definition.
Then using similar symbols but with subscript B for each star brightness measurement:
SB = 1.414 S0 at each pixel, so for the whole brightness integration
SB = 1.414 √nB S0
(The standard error means we can quote values of brightness as being B ± SB.)
The least-squares straight line fitting uses log10 B. We can estimate the standard error for that as
SLB = (log10 (B + SB) - log10 (B - SB)) / 2
From that we get standard deviation values to feed into the fitting for each reference star:
ϭLB = √nB SLB
The fitting algorithm finds gradient g and intercept c of the linear relationship between brightness B and magnitude M:
B = gM + c
It also returns values for the standard deviations of g and c, ϭg and ϭc respectively.
The fitting is done for nR reference stars so we can find the standard errors of g and c:
Sg = ϭg / √nR and
Sc = ϭc / √nR
The unknown magnitude is then calculated as the inverse of the linear relationship:
M = (B - c) / g
We want to be able to quote M ± SM
The standard error SM can be estimated by using the inverse linear relationship on the 4 values g ± Sg and c ± Sc and taking half the difference between the extreme results as the value of SM.
The sample sizes for both the background ring and the star brightness disc will always be larger than 10 (typically there are 100 or more pixels in each) so we can safely multiply the standard error by 2 to get 95% confidence intervals and that will be done on the magnitude estimation graph. There is quite a good description at http://jcb.rupress.org/cgi/content/full/177/1/7 of the difference between standard deviation, standard error and confidence intervals and why the latter are often preferable in reporting experimental results.
javax.swing.JComponent.AccessibleJComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
MagnitudeGraph(ImFrame parent,
java.lang.String title,
BlobMeasList meases,
MagnitudeBands bands,
java.lang.String filePath,
TimeInterval timeSpan)
Any BlobMeas objects that have a star with an id but no magnitude will
have magnitudes estimated by least squares fitting.
|
Modifier and Type | Method and Description |
---|---|
protected void |
draw(java.awt.Graphics2D g2,
int xOffset,
int yOffset) |
static javax.print.attribute.HashPrintRequestAttributeSet |
getAtts() |
boolean |
isAccurate()
Find out whether the graph was created using accurate brightness
measurements (rather than the less accurate brightnesses as initially
detected).
|
void |
paintComponent(java.awt.Graphics g) |
int |
print(java.awt.Graphics g,
java.awt.print.PageFormat pf,
int pageNo) |
void |
saveDataAsXML()
Save the measured results as an XML file, designed to be easy to
incorporate into a larger XML file of several such measurements.
|
void |
showGraph() |
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public MagnitudeGraph(ImFrame parent, java.lang.String title, BlobMeasList meases, MagnitudeBands bands, java.lang.String filePath, TimeInterval timeSpan) throws InadequateDataException
InadequateDataException
public boolean isAccurate()
protected void draw(java.awt.Graphics2D g2, int xOffset, int yOffset)
public void paintComponent(java.awt.Graphics g)
paintComponent
in class javax.swing.JComponent
public int print(java.awt.Graphics g, java.awt.print.PageFormat pf, int pageNo) throws java.awt.print.PrinterException
print
in interface java.awt.print.Printable
java.awt.print.PrinterException
public static javax.print.attribute.HashPrintRequestAttributeSet getAtts()
public void showGraph()
public void saveDataAsXML()