utility
Class ExpTime

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 utility.ExpTime
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class ExpTime
extends java.awt.Frame

See Also:
Serialized Form

Field Summary
static int cb
           
static int ci
           
static int cr
           
 java.awt.Choice ctimeZone
           
static int cu
           
static int cv
           
 Sixty dec
           
 double elev
           
static double[] ergs_cm2_s_A
           
static java.lang.String[] filters
          Photon flux of magnitude 0 object.
 boolean isArcsec
           
 boolean isMagnitude
           
 Sixty lat
           
 java.util.Vector latAndLong
           
 JulianDate localJD
           
 Sixty longit
           
 java.awt.Button now
           
static boolean objDown
           
 java.awt.Panel pbot
           
 Sixty ra
           
static java.text.SimpleDateFormat sdf
           
static java.text.SimpleDateFormat sdfTZ
           
 java.awt.Button setTime
           
static double[] skyValues
           
static double surfBrightB
           
static double surfBrightI
           
static double surfBrightR
           
static double surfBrightU
           
static double surfBrightV
           
 java.awt.TextField tonDate
           
 WhatData wd
           
 
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 java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
ExpTime(WhatData wd2)
           
 
Method Summary
 void addCancelButton()
           
 void doCalc()
           
static void doMainMenu(WhatData wd)
          Loops through the main menu prompt, and calls the appropiate methods
 double fluxToMag(double flux)
           
static double fluxToMag(double flux, java.lang.String filt)
           
static double getConversionConst(java.lang.String filter)
           
static double getExpTime(double sigToNoise, double mag, double seeing, double zeropoint, java.lang.String filter, double sky)
          calculates the exposture time and rounds to multiples of 5, 15, or 60
static double getExpTime(double sigToNoise, double mag, double seeing, double zeropoint, java.lang.String filter, JulianDate jd, Sixty ra, Sixty dec, Sixty lat, Sixty longit, double elev)
          calculates the exposture time and rounds to multiples of 5, 15, or 60.
static void getExtinction(double[] k, double al, double rh, double m, double la, double te, int index)
          calculate the extinction coefficients
static void getSky(double[] b, double y, double z, double zm, double zs, double rm, double rs, double am, double[] k, int index)
          Calculates the sky brightness.
static double getSurfBright(java.lang.String filter)
           
 double getTZOffset(java.util.TimeZone timeZone, JulianDate julDate)
          get the offset from UT in days for a timezone
 double magToFlux(double mag)
           
static double magToFlux(double mag, java.lang.String filter)
           
static void main(java.lang.String[] args)
           
static void printEachFilter(double[] da)
          Prints filters[i]=da[i] (ie.
static double roundToSigFigs(double d, int sigFigs)
           
static void setCandidate(WhatData wd, java.lang.String[] cand, double[] mags)
          changes the object
static void setDate(WhatData wd)
          Changes the session date
static void setLocAndSky(WhatData wd, double[] zps)
           
static void setLocation(WhatData wd, double[] zps)
          Changes the session location
static void setMagnitudes(WhatData wd, java.lang.String cand, double[] mags)
           
static void setSky(JulianDate jd, Sixty ra, Sixty dec, Sixty lat, Sixty longit, double elev)
          Calculates the sky brightness.
static double setSky(JulianDate jd, Sixty ra, Sixty dec, Sixty lat, Sixty longit, double elev, java.lang.String filter)
          Calculates the sky brightness in one filter.
static void setSurfBright(WhatData wd, java.lang.String cand)
           
static WhatData setUpWD(java.sql.Connection con)
          set up the WhatData Object
static void setZPs(WhatData wd, double[] zps)
           
 
Methods inherited from class java.awt.Frame
addNotify, getAccessibleContext, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setIconImage, 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, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationByPlatform, setLocationRelativeTo, 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, paint, paintComponents, preferredSize, print, printComponents, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, 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, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

filters

public static java.lang.String[] filters
Photon flux of magnitude 0 object. To convert to another magnitdue the ratio is 10**-0.4*m, where m is the SN magnitude.


cu

public static int cu

cb

public static int cb

cv

public static int cv

cr

public static int cr

ci

public static int ci

ergs_cm2_s_A

public static final double[] ergs_cm2_s_A

surfBrightU

public static double surfBrightU

surfBrightB

public static double surfBrightB

surfBrightV

public static double surfBrightV

surfBrightR

public static double surfBrightR

surfBrightI

public static double surfBrightI

skyValues

public static double[] skyValues

sdf

public static java.text.SimpleDateFormat sdf

sdfTZ

public static java.text.SimpleDateFormat sdfTZ

wd

public WhatData wd

isMagnitude

public boolean isMagnitude

isArcsec

public boolean isArcsec

ra

public Sixty ra

dec

public Sixty dec

lat

public Sixty lat

longit

public Sixty longit

elev

public double elev

latAndLong

public java.util.Vector latAndLong

localJD

public JulianDate localJD

tonDate

public java.awt.TextField tonDate

pbot

public java.awt.Panel pbot

setTime

public java.awt.Button setTime

now

public java.awt.Button now

objDown

public static boolean objDown

ctimeZone

public java.awt.Choice ctimeZone
Constructor Detail

ExpTime

public ExpTime(WhatData wd2)
Method Detail

addCancelButton

public void addCancelButton()

main

public static void main(java.lang.String[] args)

setUpWD

public static WhatData setUpWD(java.sql.Connection con)
set up the WhatData Object


getExpTime

public static double getExpTime(double sigToNoise,
                                double mag,
                                double seeing,
                                double zeropoint,
                                java.lang.String filter,
                                double sky)
calculates the exposture time and rounds to multiples of 5, 15, or 60


getExpTime

public static double getExpTime(double sigToNoise,
                                double mag,
                                double seeing,
                                double zeropoint,
                                java.lang.String filter,
                                JulianDate jd,
                                Sixty ra,
                                Sixty dec,
                                Sixty lat,
                                Sixty longit,
                                double elev)
calculates the exposture time and rounds to multiples of 5, 15, or 60. Factors in the effects of the moon on the sky brightness.


getSurfBright

public static double getSurfBright(java.lang.String filter)

roundToSigFigs

public static double roundToSigFigs(double d,
                                    int sigFigs)

fluxToMag

public double fluxToMag(double flux)

fluxToMag

public static double fluxToMag(double flux,
                               java.lang.String filt)

magToFlux

public double magToFlux(double mag)

magToFlux

public static double magToFlux(double mag,
                               java.lang.String filter)

getConversionConst

public static double getConversionConst(java.lang.String filter)

setSky

public static void setSky(JulianDate jd,
                          Sixty ra,
                          Sixty dec,
                          Sixty lat,
                          Sixty longit,
                          double elev)
Calculates the sky brightness.


setSky

public static double setSky(JulianDate jd,
                            Sixty ra,
                            Sixty dec,
                            Sixty lat,
                            Sixty longit,
                            double elev,
                            java.lang.String filter)
Calculates the sky brightness in one filter.


getSky

public static void getSky(double[] b,
                          double y,
                          double z,
                          double zm,
                          double zs,
                          double rm,
                          double rs,
                          double am,
                          double[] k,
                          int index)
Calculates the sky brightness. Code ported from Brad Schaefer's fortran version. Assumes b[] is UBVRI.

Parameters:
b - is the returned sky brightness in each filter
y - is the year (eg 1972)
z - is object zenith angle (degrees)
zm - is moon zenith angle (degrees)
zs - is sun zenith angle (degrees)
rm - Angular distance of object to Moon (degrees)
rs - Angular distance of object to Sun (degrees)
am - Moon phase (0=>FM,90=>FQ/LQ,180=>NM)
k - is the extinction coefficient array

getExtinction

public static void getExtinction(double[] k,
                                 double al,
                                 double rh,
                                 double m,
                                 double la,
                                 double te,
                                 int index)
calculate the extinction coefficients


doCalc

public void doCalc()

getTZOffset

public double getTZOffset(java.util.TimeZone timeZone,
                          JulianDate julDate)
get the offset from UT in days for a timezone


doMainMenu

public static void doMainMenu(WhatData wd)
Loops through the main menu prompt, and calls the appropiate methods


printEachFilter

public static void printEachFilter(double[] da)
Prints filters[i]=da[i] (ie. U=20.3) for each filter


setLocation

public static void setLocation(WhatData wd,
                               double[] zps)
Changes the session location


setCandidate

public static void setCandidate(WhatData wd,
                                java.lang.String[] cand,
                                double[] mags)
changes the object


setDate

public static void setDate(WhatData wd)
Changes the session date


setMagnitudes

public static void setMagnitudes(WhatData wd,
                                 java.lang.String cand,
                                 double[] mags)

setSurfBright

public static void setSurfBright(WhatData wd,
                                 java.lang.String cand)

setZPs

public static void setZPs(WhatData wd,
                          double[] zps)

setLocAndSky

public static void setLocAndSky(WhatData wd,
                                double[] zps)