PRO defsysv_, name, value, read_only @compile_opt.pro ; On error, return to caller defsysv, name, exists=exists IF NOT exists THEN BEGIN defsysv, name, value, n_elements(read_only) ne 0 ;message, /info, 'defining system variable "'+name+'"' ENDIF RETURN & END PRO defsysv_smei ;+ ; NAME: ; defsysv_smei ; PURPOSE: ; Defines a number of useful constants as system variables ; CATEGORY: ; Environment ; CALLING SEQUENCE: ; defsysv_smei ; INPUTS: ; (none) ; OUTPUTS: ; Defines system variables ; INCLUDE: @compile_opt.pro ; On error, return to caller ; PROCEDURE: ; > For all system variables the IDL defsysv procedure is called only if the variable ; doesn't exist yet. A 2nd call to this procedure does nothing useful. ; ; > !TheForegroundColor and !TheBackgroundColor ; The idea is to set !TheForegroundColor to black and !TheBackgroundColor to white. ; IDL sets the foreground to white (color index !d.n_colors-1) and the background to ; black (index 0) everytime the plot device is switched with 'set_plot'. This can be ; reversed by calling 'reset_colors' (which uses the two new color-related system ; variables). ; ; > !TheTerminal, !ThePrinter ; Typically the terminal device (e.g. X or WIN) and the printer device (e.g. HP, EPS) ; remain the same during an IDL session. To assist in switching back to either device ; after a 'set_plot' call the device names are stored in two system variables. ; !TheTerminal can be set here since IDL sets the proper !d.name on startup. ; !ThePrinter is set here to the generic windows 'PRINTER' device, just to make sure it ; exists. For other platforms dependent it should be updated in the IDL_postop_* procedures. ; ; > !ThePlotFile ; !ThePlotFile is used by 'set_page' and 'spitplot' do keep track of the current plotfile. ; ; The constants are stored in several structures: !sun, !earth, !physics ; MODIFICATION HISTORY: ; SEP-1999, Paul Hick (UCSD/CASS) ; OCT-2002, Paul Hick (UCSD/CASS) ; Added JulianYr to !earth ; JAN-2004, Paul Hick (UCSD/CASS; pphick@ucsd.edu) ; Added !TheTime ;- defsysv_, '!TheForegroundColor', 0, 1 defsysv_, '!TheBackgroundColor', 1, 1 ; Define time origin and units for fraction of day ; The entries greg_jd and greg_dap are used in Time2YDoy and Time2YDate ; to control the transition from Julian to Gregorian calendar. defsysv_, '!TheTime', {TheTime, $ days : 0L , $ units: 0L }, 1 defsysv_, '!TimeZero', !TheTime !TimeZero.days = 0L !TimeZero.units = 0L defsysv_, '!TimeUnits', {TimeUnits, $ in_day : 86400000L , $ tiny : 86400000L } ; The final values of !TheTerminal and !ThePrinter depend on postop routines. defsysv_, '!TheTerminal', !d.name defsysv_, '!ThePrinter' , 'PRINTER' defsysv_, '!ThePlotFile', '' defsysv_, '!sun',{SUN_CONSTANTS, $ R : 6.9599 , $ ; Solar radius 10^10 cm RAu : 0.004652406d0 , $ ; Solar radius AU AU : 1.4959787061d0 , $ ; Astronomical unit 10^13 cm M : 1.9891 , $ ; Solar mass 10^33 gr GM : 1.32712438d0 , $ ; Grav const x Mass Sun 10^26 cm^3 s^-2 Omega : 2.865 , $ ; Ang. velocity Sun 10^-6 rad/s SynodicP: 27.2753d0 , $ ; Synodic rot. period days SiderealP: 25.38d0 , $ ; Sidereal rot. period days Spiral : 68.2134744988644d0, $ ; Fractional rotation*(km/s)/AU: (50*Sun.AU*Sun.Omega)/!Pi MJDtoJD : 2400000.5d0 } ; Conversion MJD to JD defsysv_, '!earth',{EARTH_CONSTANTS, $ SiderealP:0.9972697d0 , $ ; 23h 56m 04.1s RAu : 4.2560766d-05 , $ ; Earth radius in AU R : 6367d0 , $ RMoon : 1738.2d0 , $ JulianYr: 365.25 } defsysv_, '!physics',{PHYSICS_CONSTANTS,$ ThomsonCrossSection:7.940791d0, $ ; Thomson cross section 10^-26 cm^2/sterad SpeedOfLight : 2.99792458d0, $ ; Speed of light 10^-10 cm MassOfElectron : 9.10938188d0, $ ; Mass of electron 10^-28 g ChargeOfElectron: 4.80320420d0 } ; Charge of electron 10^-9 esu RETURN & END