[Previous]
[Next]
NAME:
t3d_oblique
PURPOSE:
Implements 3D transformation matrix for oblique projections
CATEGORY:
gen/idl/math
CALLING SEQUENCE:
t3d_oblique, Array, /reset, oblique=oblique
INPUTS:
Array array[4,4]; type: any
Matrix used as the starting transformation.
If omitted !P.T is used; not used if /reset is set.
OPTIONAL INPUTS:
/reset if set start out with the identity matrix
matrix=matrix
if set to a named variable, the result is returned in this
parameter and !P.T is not modified.
oblique=oblique
A two-element vector of oblique projection parameters.
Points are projected onto the XY plane at Z=0 as follows:
x' = x + z(d COS(a)), and y' = y + z(d SIN(a)).
where oblique[0] = d, and oblique[1] = a.
OUTPUTS:
!P.T unless the keyword MATRIX is supplied, in which case the result
is returned in MATRIX and !P.T is not affected.
CALLED BY:
setup3d
SIDE EFFECTS:
!P.T is changed if the keyword MATRIX is not set.
PROCEDURE:
Modidifies the oblique projection in IDL t3d.pro by settinr
r[2,2] = 1.0 instead of 0.0
This preserves the z-component in an oblique projection.
MODIFICATION HISTORY:
JUN-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
TagArray
PURPOSE:
(First check whether the IDL functions strjoin and/or
STRSPLIT can do what you need)
Combine string arrays into single string separated by
separator character, or v.v.
CATEGORY:
Toolbox: generic
CALLING SEQUENCE:
FUNCTION TagArray, tag_in, sep, nonull=nonull, split=split
INPUTS:
tag scalar, array; type: string
if scalar, or /split keyword set:
the string is decomposed into elements separated by the
'sep' character(s). The result is returned as a string array
with one dimension more than the input array: the leading
dimension is the number of tags found (see RESTRICTIONS).
if array: the elements in the array are
concatenated, separated by the 'sep' character
OPTIONAL INPUT PARAMETERS:
sep scalar, or array; type: 1-char string: default is a scalar and depends on OS
if /split is used then 'sep' can be an array of 1-char separator strings
/nonull if extracting tags, discard null-string tags
/split if 'tag' is an array that needs to be decomposed then
split needs to be set (by default, arrays are
concatenated; a scalar is always decomposed, even
if /split is not set).
OUTPUTS:
R either a string array of tags, or a scalar string
of concatenated tags.
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
InitVar, IsType
CALLED BY:
TimeSplit
RESTRICTIONS:
If keyword /split is set than the first elements in the 'tag' array is analyzed
for the presence of separators. The result is applied to all strings. So all
strings in 'tag' must have the same structure: same length and separators in the
same positions.
SIDE EFFECTS:
Note that an array[1] is treated differently from a scalar.
An array[1] is returned unmodified as a scalar
it is NOT decomposed if it contains 'sep' characters.
EXAMPLE:
t = tagarray('1998:337:23:53.000',[':','.']
results in:
t =['1998','337','23','53','000']
PROCEDURE:
The default separator is a comma on 'Win32', a colon on 'linux'
On other OS it is a colon (as on linux).
MODIFICATION HISTORY:
NOV-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
TAGSIZE
AUTHOR:
Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
craigm@lheamail.gsfc.nasa.gov
PURPOSE:
Compute SIZE descriptors for each tag in a structure
CALLING SEQUENCE:
SIZES = TAGSIZE(STRUCT, N_TAGS=ntags, TAG_NAMES=tagnames,
STRUCTURE_NAME=structname, STATUS=status, LENGTH=length)
DESCRIPTION:
The TAGSIZE function determines the types and sizes of each tag in
a structure. This is not as easy as it may seem, because IDL
makes it very, *very* difficult to find out the true dimensions of
a structure element.
Here is a brief explanation. It is known that IDL drops trailing
dimensions of size 1 in many situations. Also, for structures
only, arrays of any dimensionality which have only one element are
RETURNED AS SCALARS. Thus, if you are doing any heavy duty work
with structures, copying and querying individual elements between
structures, etc., you will find that you will lose some crucial
dimensions which you can't normally regain.
TAGSIZE attempts to work around all of these limitations to
present the true dimensions of all elements in a structure.
It returns an 11xNTAGS array, which contains a SIZE-style vector
for each element in the structure. Eleven elements is the largest
array size needed to describe any IDL data type using SIZE. Thus,
to extract information about the second tag in structure X
(element number 1 starting from zero), you would use the following
code:
SIZES = TAGSIZE(X) ;; Extract type information from structure X
SIZE_1 = SIZES(*,1) ;; Extract type information about the 2nd element
SIZE_1 = SIZE_1(0:SIZE_1(0)+2) ;; Trim the array if desired
The last command is optional, but trims the resulting array to be
a true SIZE-style result.
TAGSIZE also has several convenience keywords to extract other
relevant information about a structure.
INPUTS:
STRUCTURE - any structure to examine. If the value is not a
structure then an error is reported.
KEYWORDS:
N_TAGS - upon return, the number of tags in the structure is
stored in this keyword.
TAG_NAMES - upon return, the names of each tag are stored in this
keyword, as an array of strings.
STRUCTURE_NAME - upon return, the name of the structure is stored
in this keyword. If the structure is anonymous
then the empty string ('') is returned.
LENGTH - upon return, the size in bytes of each tag element in the
structure is stored in this keyword, as an array of
integers.
STATUS - upon return, the status is stored in this keyword. A
value of 1 indicates success, 0 indicates failure.
RETURNS:
A two dimensional array, with dimensions LONARR(11,NTAGS),
containing the size information of all tag elements in the
structure. SIZES(*,i) is the SIZE-style vector for tag element i.
CALLED BY:
CMSAVE, CMSV_WVTYPE
EXAMPLE:
Compute the sizes of the elements in X, defined here.
IDL> x = {a: [1], b: intarr(2,2), c: reform(strarr(2,1),2,1)}
IDL> help, /struct, x
** Structure <818c8b4>, 3 tags, length=28, refs=1:
A INT Array[1]
B INT Array[2, 2]
C STRING Array[2, 1]
IDL> print, byte(tagsize(x))
1 [1] 2 1 0 0 0 0 0 0 0
2 [2 2] 2 4 0 0 0 0 0 0
2 [2 1] 7 2 0 0 0 0 0 0
[ Array dimensions are emphasized with brackets ]
Compare this to the type information returned by HELP, which is
incorrect for tags A and C.
IDL> help, x.a, x.b, x.c
<Expression> INT = 1
<Expression> INT = Array[2, 2]
<Expression> STRING = Array[2]
CALLS: ***
STR_SEP
SEE ALSO:
HELP, HELPFORM, INPUTFORM, N_TAGS, SIZE, TAG_NAMES
MODIFICATION HISTORY:
Written, CM, 13 May 2000
Documented, 05 Jul 2000
Small documentation changes, CM, 31 Aug 2000
Signficant cleanup of HELP parsing, CM, 04 Dec 2000
Added case for array of structures with new parsing, CM 12 Jan
2001
$Id: tagsize.pro,v 1.4 2001/02/09 04:57:42 craigm Exp $
[Previous]
[Next]
NAME:
tailplot
CALLING SEQUENCE:
PRO tailplot
CALLS: ***
FINDBULK, grd_read
[Previous]
[Next]
NAME:
tbad
CALLING SEQUENCE:
PRO tbad, tbeg
INCLUDE:
@compile_opt.pro
CALLS: ***
InitVar, TimeGet, TimeSet, TimeSystem, TimeUnit, smei_hdr_get
[Previous]
[Next]
NAME:
telescope_sizes
PURPOSE:
CALLING SEQUENCE:
PRO telescope_sizes, data_file, $
file = file , $
xysize = xysize , $
silent = silent , $
time_ago = time_ago , $
start_time = start_time , $
stop_time = stop_time , $
charsize = charsize , $
unlabeled = unlabeled , $
refresh = refresh , $
show_gaps = show_gaps , $
cdf = cdf , $
ratio = ratio , $
_extra = _extra
INPUT:
data_file fully-qualified name with the list of telescope file
names on which the plot are based.
Default: telescope_duty_cycle.txt
file filename on which names of graphics output
files are based.
OPTIONAL INPUTS:
/cdf
start_time=start_time
start time for graphs; default: earliest file
stop_time=stop_time
stop time of graphs; default: latest file
time_ago=time_ago
instead of start_time, specify a time range:
start_time then becomes stop_time-time_ago
/unlabeled omit labeling
/show_gaps used for duty cycle plot to emphasize times were
no data are present: these time ranges are explicitly
erased with a final polyfill. This can have the
unwelcome side effect that very small gaps (less
then one pixel) are shown as a full pixel wide.
charsize=charsize
character size for labeling
INCLUDE:
@compile_opt.pro
CALLS: ***
GetFileSpec, InitVar, IsTime, IsType, MEAN, PlotBars, TimeGet, TimeSet, TimeUnit
TimeXAxis, get_page, merge_ranges, set_page, txt_read, who_am_i
MODIFICATION HISTORY:
MAR-2017, started adding documentation
[Previous]
[Next]
NAME:
test_dumbbell
CALLING SEQUENCE:
PRO test_dumbbell
CALLS: ***
WhatIs, flt_string, smei_zld_dumbbell, twin, view
[Previous]
[Next]
NAME:
test_sky
CALLING SEQUENCE:
pro test_sky
INCLUDE:
@compile_opt.pro
CALLS: ***
CARRINGTONT, FILEPATH, SKYIMAGE, TimeGet, WhatIs, vu_read
[Previous]
[Next]
NAME:
test_td
CALLING SEQUENCE:
pro test_td
INCLUDE:
@compile_opt.pro
CALLS: ***
CARRINGTONT, FILEPATH, GetFileSpec, NewcombSun, SKY_VOLUMECOLORS, SetFileSpec
Sky_ColorView [1], Sky_ColorView [2], TimeGet, WhatIs, flt_string, vu_read
[Previous]
[Next]
NAME:
test_tmo
CALLING SEQUENCE:
pro test_tmo
INCLUDE:
@compile_opt.pro
CALLS: ***
INTERPOL, POLY_FIT, bin_read, smei_camera
[Previous]
[Next]
NAME:
testnic
CALLING SEQUENCE:
pro testnic, flat=flat, dark=dark
INCLUDE:
@compile_opt.pro
CALLS: ***
Find2DGlitch, MEAN, POLY_FIT, STDDEV, WRITE_GIF, WhatIs, bargraph, img_read, twin, view
[Previous]
[Next]
NAME:
testsmei
CALLING SEQUENCE:
pro testsmei, new=new
INCLUDE:
@compile_opt.pro
CALLS: ***
FILEPATH, InitVar, SuperArray, WhatIs, bin_read, bin_write, img_read
[Previous]
[Next]
NAME:
thomson_common
PURPOSE:
Contains common block definition used by
Thomson scattering functions
CATEGORY:
Physics: Thomson scattering
CALLING SEQUENCE:
@thomson_common.pro
INCLUDED BY:
ThomsonLOSDensity, ThomsonSetupLOS
PROCEDURE:
MODIFICATION HISTORY:
JULY-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
Thomson_doc
PURPOSE:
Documentation only. Collects all links to the Thomson scattering
package and a link to a pdf with additional information.
CATEGORY:
Documentation
SEE ALSO:
ThomsonBase, ThomsonBrightness, ThomsonElectron, ThomsonElectronFar
ThomsonLOSDensity, ThomsonLOSFar, ThomsonLOSRomb, ThomsonLOSStep
ThomsonMidpoint, ThomsonMidpointFar, ThomsonMidpointFnc, ThomsonPDistance
ThomsonPDistanceFar, ThomsonRadialFilter, ThomsonS10, ThomsonSetupLOS
ThomsonSetupRomb, ThomsonSolarFlux, ThomsonSoup, ThomsonTang, ThomsonTangMRad
thomson_common
PROCEDURE:
See http://supercat.ucsd.edu/reports/thomson.pdf
MODIFICATION HISTORY:
JUL-2002, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
ThomsonBase
PURPOSE:
(Used internally only)
Determines the intensity scattered from single coronal electron by Thomson scattering
CALLING SEQUENCE:
FUNCTION ThomsonBase, ElSun, SinChi, U, P, It, Itr
INPUTS:
ElSun array distance Sun-observer (in solar radii)
SinChi array sine of angle Sun-Electron-Observer
U array limb darkening coefficient
OUTPUTS:
Result array scattered intensity
P array polarization; P=Itr/ThomsonBase (-1<=P<=1)
Itr array tangential minus radial intensity; same units as ThomsonBase.
It array radial intensity; same units as ThomsonBase
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
ThomsonSoup
CALLED BY:
ThomsonElectron, ThomsonLOSStep, ThomsonTang, ThomsonTangMRad
PROCEDURE:
> Based on Chapter 6, Section B of Billings' "A guide to the solar corona" (p. 150)
Sigma = Thomson cross section=7.96x10^-26 cm^2/sterad
Omega = angular size of Sun from electron
Chi = angle Sun-Electron-Observer
I0 = intensity at disk center
RSun = solar radius = 7x10^10 cm
Billings specifies the scattered intensity in the form
I=0.5*Pi*Sigma*I0*Func(Omega,Chi) (erg/s/sterad)
This subroutine only deals with Func(Omega,Chi):
From Eq. 18: It = (1-u)*CC+u*DD
From Eq. 19: Itr = sin^2(Chi)*[(1-u)AA+u*DD]
> The last two arguments (It, Itr) are returned for use by function ThomsonIntegral.
MODIFICATION HISTORY:
JUL-1996, Paul Hick (UCSD)
[Previous]
[Next]
NAME:
ThomsonBrightness
PURPOSE:
Calculates weights for integrating Thomson scattering signal
CATEGORY:
Physics: Thomson scattering
CALLING SEQUENCE:
FUNCTION ThomsonBrightness, rr_earth, R, F, f3darg, $
ut_earth = ut_earth , $
pa_earth = pa_earth , $
elo_earth = elo_earth , $
elo_sun = elo_sun , $
degrees = degrees
INPUTS:
rr_earth array[3] NOT USED; for 'plain' sky map
array[3,N] NOT USED; for 'transit' sky map
NOT USED; heliographic coordinates of Earth for lines of sight
R array[3,N,L,M] (N,L may be 1 or absent)
locations of all segments for all lines of sight
in spherical coordinates (usually heliographic)
This can be a grid of NxL lines of sight with M
segments along each line of sight
R[0,*,*,*] : longitude
R[1,*,*,*] : latitude
R[2,*,*,*] : heliocentric distance (AU)
F array[N,L,M] normalized densities n*(r/r0)^2 at los segments (electrons/cm^-3)
f3darg array[4] f3darg[0] Line of sight step size (AU)
f3darg[1] Limb darkening constant
f3darg[2] Apparent magnitude Sun at 1 AU
f3darg[3] 0=Intensity; 1: Tangential; 2: Tang-Rad
f3darg[4] normalization for density (default: 2)
OPTIONAL INPUT PARAMETERS:
/degrees if set all input angles should be in degrees (default: radians)
ut_earth array[1] not used
pa_earth array[N,L,M] not used
elo_earth array[N,L,M] angle Sun-Earth-LOS segment (i.e. conventional elongation angle)
elo_sun array[N,L,M] angle Earth-Sun-LOS segment
OUTPUTS:
R array[N,L,M] weight factors W(s) at location s along line of sight in S10
Intensity B = Sum( W(s) ) = Sum( I(s)n(s)ds )
INCLUDE:
@compile_opt.pro ; On error, return to caller
EXTERNAL BY:
RemoteView_Display2D, vu_coronagraph, vu_earthskymap, vu_lineofsight
vu_thomson_antifish, vu_thomson_hammer
CALLS: ***
SubArray, ThomsonElectron, ToRadians
CALLED BY:
thomsonfig
PROCEDURE:
ThomsonElectron returns 10^-26 S10. Multiply by the step size along the line
of sight in cm (f3darg[0]*!sun.au*10^13) and multiply with the remaining
10^-13. The value returned is a brightness in S10 for each line of sight segment.
MODIFICATION HISTORY:
SEP-1999, Paul Hick (UCSD/CASS)
SEP-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
Removed restriction on dimensions of R,F,elo_earth,elo_sun.
F, elo_earth, elo_sun should all have the same structure, while
R should have an additional leading dimension of size 3.
[Previous]
[Next]
NAME:
ThomsonElectron
PURPOSE:
Determines the Thomson scattering intensity from single coronal electron.
If /S10 is set then return brightness of one electron per square degree
of sky in S10 units
CALLING SEQUENCE:
FUNCTION ThomsonElectron, SinChi, P, rsun=RSun, au=au, udark=udark, apm=APM, s10=S10, tangonly=tangonly, tangmrad=tangmrad
INPUTS:
SinChi array; type: float
sine of angle Sun-Electron-Observer
OPTIONAL INPUT PARAMETERS:
rsun=RSun array; type: float; default: 1 AU
distance Sun-Electron
udark=idark array; type: float; default: 0
limb darkening coefficient
/au if set all distances are in AU (default: solar radii)
/s10 if set then return brightness is in S10
apm=APM apparent magnitude of Sun (only needed if /S10 is set)
/tangonly return tangential intensity, It
/tangmrad return tangential - radial intensity, Itr
OUTPUTS:
Result array; type: float
scattered intensity; units depend on setting of /S10
/S10 NOT set: 10^-26 times the flux from the solar disk incident
on the electron (effectively the units are 10^-26 cm^2/sterad)
/S10 set; 10^-26 S10 units
P array: type: float
polarization (-1<=P<=1)
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
InitVar, IsType, ThomsonBase, ThomsonS10, ThomsonSolarFlux, ToSolarRadii
CALLED BY:
ThomsonBrightness
PROCEDURE:
Based on Chapter 6, Section B of Billings' "A guide to the solar corona" (p. 150)
Sigma = Thomson cross section=7.96x10^-26 cm^2/sterad
Omega = angular size of Sun from electron
Chi = angle Sun-Electron-Observer
I0 = intensity at disk center
Rs = solar radius = 7x10^10 cm
Billings specifies the scattered intensity in the form
I=0.5*Pi*Sigma*I0*Func(Omega,Chi) (erg/s/sterad)
The average intensity coming from the solar disk is
i=(Pi*Rs^2)*I0*(1-U/3) (erg/s/sterad)
The flux incident on the electron at distance Rsun is
F=i/RSun^2=Pi*I0*(1-U/3)*(Rs/RSun)^2 (erg/s/cm^2)
If /S10 NOT set then the ratio
I/F = 0.5*Sigma*Func(Omega,Chi)/( (Rs/RSun)^2*(1-U/3) )
is returned here, except for a factor 10^-26 (from Sigma).
> The flux received from the solar disk by an observer at distance RObs
(rather than the electron) is i/RObs^2 = F*(RSun/RObs)^2 (erg/s/cm^2).
The scattered flux from the electron incident on the observer is
I/S^2 (erg/s/cm^2). The ratio (I/F)*(RObs/(RSun*S))^2 gives
the flux received from the electron in units of the flux received by
the observer from the solar disk.
> The conversion to S10 is done by multiplying with the conversion
factor returned by ThomsonS10
MODIFICATION HISTORY:
JUL-1996, Paul Hick (UCSD)
[Previous]
[Next]
NAME:
ThomsonElectronFar
PURPOSE:
Determines the intensity scattered from single coronal electron
by Thomson scattering in the limit of large electron-Sun distance
(limit Omega->0; ElSun->Infinity)
Get Thomson scattering brightness of one electron per square degree
of sky in S10 units in limit of large electron-Sun distance
CALLING SEQUENCE:
FUNCTION ThomsonElectronFar, SinChi, P, rsun=RSun, au=au, apm=APM, s10=S10
INPUTS:
SinChi array; type: float
sine of angle Sun-Electron-Observer
OPTIONAL INPUT PARAMETERS:
APM array; type: float
apparent magnitude of the Sun
rsun=RSun array; type: float
distance Sun-Electron (in solar radii)
OUTPUTS:
Result array; type: float
scattered intensity; units depend on /S10 setting
S10 NOT set: 10^-26 times the flux from the solar disk incident on the electron
S10 set : 10^-26 S10
P array polarization (-1<=P<=1)
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
InitVar, ThomsonS10, ToSolarRadii
PROCEDURE:
> Based on Chapter 6, Section B of Billings' "A guide to the solar
corona" (p. 150)
Sigma = Thomson cross section=7.96x10^-26 cm^2/sterad
Omega = angular size of Sun from electron
Chi = angle Sun-Electron-Observer
I0 = intensity at disk center
RSun = solar radius = 7x10^10 cm
Billings specifies the scattered intensity in the form
I=0.5*Pi*Sigma*I0*Func(Omega,Chi) (erg/s/sterad)
The average intensity coming from the solar disk is
i=(Pi*RSun^2)*I0*(1-U/3) (erg/s/sterad)
The flux incident on the electron is F=i/ElSun^2 (erg/s/cm^2)
The ratio
I/F = 0.5*Sigma*Func(Omega,Chi)/( (RSun/ElSun)^2*(1-U/3) )
is returned here, except for a factor 10^-26 (from Sigma).
> The flux received from the solar disk by the observer (rather than the
electron) is i/ScSun^2 = F*(ElSun/ScSun)^2 (erg/s/cm^2).
The scattered flux from the electron incident on the observer is
I/ScEl^2 (erg/s/cm^2). The ratio (I/F)*(ScSun/(ElSun*ScEl))^2 gives
the flux received from the electron in units of the flux received by
the observer from the solar disk.
> An S10 unit is `the brightness of one 10th magnitude star per square
degree of sky'. Replace the star by an electron at the same location
in the sky, and at distance ScEl away from the observer. The electron
is radiating by Thomson scattering of sunlight.
> STEP 1: Calculate the intensity (erg/s/sterad) -emitted- by the electron
in units of the flux -incident- at 1 AU from the solar
disk (erg/s/cm^2) (compare ThomsonElectron; the only difference
is that ElSun is replaced by r0=1 AU in the unit determination)
> STEP 2: Convert to units of the flux -incident- at 1 AU from a 10th
magnitude star: multiply by 10^((10-M)/2.5). (Apparent
magnitude, M=-2.5*log(Flux)).
!!! M is an apparent magnitude as observed at 1 AU. This is why
1 AU was used in step 2, rather than the observer-Sun
distance ScSun.
> 10^-48 = 10^-26*10^-26*10^4:
10^-26 from Sigma; 10^-26 from 1/ScEl^2; 10^4 from 10^(10/2.5)
MODIFICATION HISTORY:
JUL-1996, Paul Hick (UCSD)
[Previous]
[Next]
NAME:
thomsonfig
CALLING SEQUENCE:
PRO thomsonfig, figure, s10=s10, xysize=xysize, _extra=_extra, charsize=chars, type=type
INCLUDE:
@compile_opt.pro
CALLS: ***
ARROW, CvPointOnLos, Distance2Sun, GetColors [1], GetColors [2], GetColors [3]
InitVar, IsType, PlotCurve, SubArray, SuperArray, ThomsonBrightness, ThomsonLOSFar
ThomsonLOSRomb, ThomsonSolarFlux, ThomsonSoup, ThomsonUBVConst, ToRadians, WhatIs
destroyvar, get_page, gridgen, plot3darc, plot3dline, set_page, setup3d, twin
[Previous]
[Next]
NAME:
ThomsonLOSDensity
PURPOSE:
CATEGORY:
sat/idl/toolbox/thomson
CALLING SEQUENCE:
FUNCTION ThomsonLOSDensity, S
INPUTS:
S array[k]; type: float
topocentric distance electron-observer (in solar radii)
OUTPUTS:
F array; type: float
density at electron location (in electrons/cm^-3)
INCLUDE:
@compile_opt.pro ; On error, return to caller
@thomson_common.pro ; Dummy comment
CALLS: ***
CvPointOnLos, EulerRotate, IsType, REVERSE, SuperArray, boost, destroyvar
CALLED BY:
ThomsonLOSStep, ThomsonTang, ThomsonTangMRad
PROCEDURE:
> The observer locations and directions of the lines of sight are
first setup in a common block by ThomsonSetupLOS.
> The distance along the lines of sight 'S', in combination with
the common block variables are used to get the heliocentric coordinates
of all line-of-sight locations.
> The function 'density' is a user-defined function, which returns the
density for a given heliocentric location.
The function is called using the IDL call_function routine.
> If no density function is specified than a 1/r^2 density with a
1 electrons/cm^3 density at 1 AU is used.
MODIFICATION HISTORY:
JAN-1998, Paul Hick (UCSD)
JUN-2001, Paul Hick (UCSD/CASS)
Added /grid keyword
JUL-2008, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
Removed /grid keyword again
Added some code to allow calculation to work for observers
out of the ecliptic (i.e. with ecliptic latitude
not zero).
[Previous]
[Next]
NAME:
ThomsonLOSFar
PURPOSE:
Determines the integrated intensity along a line of sight for electron
Thomson scattering in a 1/r^2 density distribution in the limit of
small angular size of the Sun (with density at 1 AU of 1 electron/cm^-3)
CALLING SEQUENCE:
F = ThomsonLOSFar(RSun, Elo, P, lower=lower, upper=upper, /degrees, /au, apm=apm, /s10)
INPUTS:
RSun array[n]; type: float
distance of observer from Sun
Elo array[m]; type: float
elongation of line of sight (l.o.s.)
(Elo=0 is the direction to the Sun)
OPTIONAL INPUT PARAMETERS:
lower=lower
array; type: float; default: 0
lower lmit of integration along line of sight
upper=upper
array; type: float: default: !values.f_inifinity
upper limit of integration along line of sight
(negative value integrates up to infinity)
/degrees if set all angles are in degrees (default:radians)
/au if set all distance are in AU (default: solar radii)
/s10 return brightness in S10 units
apm=apm apparent magnitude of Sun at 1 AU
(needed only if /S10 is set)
OUTPUTS:
Result array[n,m]; type: float
Integrated Thomson scattering intensity;
units depend on setting of /S10:
/S10 NOT set: per sterad in units of 10^-16 times the flux received
from the solar disk (at the observer location
/S10 set: S10 units
P array[n,m]; type: float
polarization
CALLS: ***
InfiniteValue, InitVar, IsType, SyncArgs, ThomsonFarY, ThomsonS10, ToRadians
ToSolarRadii, boost, destroyvar
CALLED BY:
thomsonfig
SEE ALSO:
ThomsonLOSRomb, ThomsonLOSStep
PROCEDURE:
> Calculates an analytical expression for the integral along the
entire line of sight in the limit of small angular size of the Sun.
> The integrated intensity incident on the observer has cgs units of
erg/s/cm^2/sterad. The flux from the Sun incident on the observer has
cgs units of erg/s/cm^2, so the ratio will have units 1/sterad.
> The electron density in the solar wind at 1 AU (cm^-3) is set to 1 cm^-3.
> Coronal density n(s) = n0*(r0/r(s))^2 (r0=a AU)
Intensity/electron I(s) = 0.5*Pi*Sigma*I0*Func(Omega,Chi)
The integral has the form
B = Integral[0,inf]{n(s)I(s)ds}
= 0.5*Pi*Sigma*I0*Integral[0,inf]{n(s) Func(Omega,Chi) ds}
> The result is expressed in units of the flux received from the solar
disk by the observer:
F = (Pi*Rs^2)*I0*(1-U/3) / RSun^2 (erg/s/cm^2)
= Pi*I0*(1-U/3)* (Rs/RSun)^2
> 10^-13 = 10^-26*10^13
Factor 10^-26 is from the Thomson cross section, Sigma
Factor 10^13 is from the integration step size
MODIFICATION HISTORY:
1990, Paul Hick (UCSD)
[Previous]
[Next]
NAME:
ThomsonLOSRomb
PURPOSE:
Calculates integrated line-of-sight intensity for
Thomson scattering using Romberg integration.
CATEGORY:
Physics: Thomson scattering
CALLING SEQUENCE:
FUNCTION ThomsonLOSRomb, pos, los, P, $
lower = lower , $
upper = upper , $
density = density , $
degrees = degrees , $
au = au , $
udark = udark , $
apm = apm , $
s10 = S10
INPUTS:
pos array[3,n]; type: float
heliocentric location of observer:
(ecliptic) longitude and latitude; and heliocentric distance
(a scalar 'pos' is interpreted as [0,0,pos])
los array[2,m]; type: float
topocentric (ecliptic) longitude and latitude of line of sight
relative to Sun-observer direction
(a scalar 'los' is interpreted as [los,0])
OPTIONAL INPUT PARAMETERS:
/s10 if set intensities are returned in S10 units
In this case the apparent magnitude APM MUST BE SPECIFIED
udark=udark scalar; type: float; default: 0
limb darkening constant
apm=apm scalar; type: float
apparent magnitude of Sun
density=density
scalar; type: string; default: undefined
name of function used to calculate the electron density.
Keyword is passed to ThomsonSetupLOS.
lower=lower
scalar; type: float; default: 0
Lower limit of los integration (solar radii)
If Lower <=0 then Lower = 0 is used.
upper=upper
scalar; type: float; default: 9000 solar radii
Upper limit of los integration (solar radii)
If Lower <=0 then Upper = 9000.0 solar radii (~40 AU) is used.
/degrees if set all angles are in degrees (default: radians)
/au if set all distances are in AU (default: solar radii)
OUTPUTS:
Result scalar[n,m]; type: float
Integrated Thomson scattering intensity;
units depend on setting of /S10:
/S10 NOT set: per sterad in units of 10^-16 times the flux received
from the solar disk (at the observer location
/S10 set: S10 units
P[n,m] scalar; type: float
polarization
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
InfiniteValue, InitVar, IsType, SyncArgs, SyncDims, ThomsonS10, ThomsonSetupLOS
ThomsonSetupRomb, ThomsonSolarFlux, ToRadians, ToSolarRadii, boost, destroyvar
sphere_distance
EXTERNAL:
ThomsonTang, ThomsonTangMRad
CALLED BY:
ThomsonMidpoint, ThomsonMidpointFnc, thomsonfig
SEE ALSO:
ThomsonLOSStep
PROCEDURE:
> The lower and upper limits can actually be 1-dim arrays, but that is
probably not useful.
> If no 'density' function is specified then a 1/r^2 density is used with
density of 1 at 1 AU.
MODIFICATION HISTORY:
SEP-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
ThomsonLOSStep
PURPOSE:
Calculates integrated line-of-sight intensity for Thomson scattering.
Integration is implemented as a sum over steps of equal size.
CATEGORY:
Physics: Thomson scattering
CALLING SEQUENCE:
FUNCTION ThomsonLOSStep, Pos_, Dir_, P, $
lower = Lower , $
upper = Upper , $
nstep = nstep , $
density = density , $
degrees = degrees , $
au = au , $
apm = APM , $
udark = udark , $
s10 = S10
INPUTS:
Pos_ array[3,n]; type: float
heliocentric location of observer:
(ecliptic) longitude and latitude; and heliocentric
distance
(the 2nd dim can be absent, or can represent multiple
dimensions)
Dir_ array[2,m]; type: float
topocentric (ecliptic) longitude and latitude of line of sight
relative to Sun-observer direction
(the 2nd dim can be absent, or can represent multiple
dimensions)
OPTIONAL INPUT PARAMETERS:
/s10 if set intensities are returned in S10 units
In this case the apparent magnitude APM MUST BE SPECIFIED
udark=udark scalar; type: float; default: 0
limb darkening constant
apm=APM scalar; type: float
apparent magnitude of Sun
density=density
scalar; type: string; default: undefined
name of function used to calculate the electron density.
Keyword is passed to ThomsonSetupLOS.
lower=Lower
scalar; type: float; default: 0
Lower limit of los integration (solar radii)
If Lower <=0 then Lower = 0 is used.
upper=Upper
scalar; type: float; default: 9000 solar radii
Upper limit of los integration (solar radii)
If Lower <=0 then Upper = 9000.0 solar radii (~40 AU) is used.
nstep=nstep
scalar; type: integer; default: 100
number of elements in which to divide the range [Lower, Upper]
/degrees if set all angles are in degrees (default: radians)
/au if set all distances are in AU (default: solar radii)
OUTPUTS:
Result array[n,m]; type: double
Integrated Thomson scattering intensity;
units depend on setting of /S10:
/S10 NOT set: per sterad in units of 10^-16 times the flux received
from the solar disk (at the observer location
/S10 set: S10 units
P array[n,m]; type: float
Polarization
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
Distance2Sun, InitVar, IsType, SuperArray, ThomsonBase, ThomsonLOSDensity
ThomsonS10, ThomsonSetupLOS, ThomsonSolarFlux, ToRadians, ToSolarRadii, boost
destroyvar, gridgen, sphere_distance
SEE ALSO:
ThomsonLOSFar, ThomsonLOSRomb
PROCEDURE:
Densities are calculated by ThomsonLOSDensity.
MODIFICATION HISTORY:
SEP-1999, Paul Hick (UCSD/CASS)
AUG-2008, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
Observer location can now also be an array.
In addition the observer does not have to be in the ecliptic
anymore.
[Previous]
[Next]
NAME:
ThomsonMidpoint
PURPOSE:
Calculate position along line of sight where the integrated intensity
is half of the intensity integrated along the entire line of sight
CALLING SEQUENCE:
FUNCTION ThomsonMidpoint, ScSun,Elo, udark=udark, degrees=degrees, au=au
INPUTS:
ScSun scalar distance of spacecraft from Sun
Elo scalar elongation of s/c line of sight (l.o.s.) in degrees.
Elo=0 is the direction to the Sun
OPTIONAL INPUT PARAMETERS:
udark=udark scalar; type: float; default: 0
limb darkening constant
/degrees if set all angles are in degrees (default is radians)
/au if set all distances are in AU (default: solar radii)
OUTPUTS:
ThomsonMidPoint
scalar point on l.o.s. where intensity is half the total
integrated intensity
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
InitVar, ThomsonLOSRomb, ToRadians, ToSolarRadii, nrZBrent, nrZbrac
EXTERNAL:
ThomsonMidpointFnc
PROCEDURE:
First nrZbrac is used to bracket the zero of function ThomsonMidpointFnc.
Then nrZBrent is used to locate the zero.
MODIFICATION HISTORY:
JAN-1997, Paul Hick (UCSD)
[Previous]
[Next]
NAME:
ThomsonMidpointFar
PURPOSE:
Calculate position along line of sight where the integrated
intensity is half of the intensity integrated along the
entire line of sight (treating the Sun as a point source
CALLING SEQUENCE:
S = ThomsonMidpoint(ScSun,Elo,U,/degrees)
INPUTS:
ScSun array distance of spacecraft from Sun in AU
Elo array elongation of s/c line of sight (l.o.s.) in degrees.
Elo=0 is the direction to the Sun
OUTPUTS:
ThomsonMidPointFar
array point on l.o.s. where intensity is half the total
integrated intensity
CALLS: ***
BadValue, SyncArgs, ThomsonMidFar, ToRadians, nrZBrent, nrZbrac
EXTERNAL:
RESTRICTIONS:
PROCEDURE:
MODIFICATION HISTORY:
JAN-1997, Paul Hick (UCSD)
[Previous]
[Next]
NAME:
ThomsonMidpointFnc
PURPOSE:
Internal use by ThomsonMidpoint.
CALLING SEQUENCE:
FUNCTION ThomsonMidpointFnc, S, arg ; Internal use only
INPUTS:
S scalar; type: float
distance along line of sight in solar radii
arg array(4}; type: float
[R,E,udark,halfint]
R = heliocentric distance observer in solar radii
E = elongation in radians
udark = limb darkening constant
halfint = half the intensity from 0 to infinity
OUTPUTS:
R scalar; type: float
integrated intensity upto distance S - halfint
INCLUDE:
@compile_opt.pro ; On error, return to caller
EXTERNAL BY:
ThomsonMidpoint
CALLS: ***
ThomsonLOSRomb
PROCEDURE:
Returns the difference between line-of-sight integrated intensity
up to specified distance S and half the integrated intensity over the
entire line of sight. I.e. the distance S which makes this function zero is
what ThomsonMidpoint is looking for.
No density function is passed to ThomsonLOSRomb, so a 1/r^2 density is assumed.
MODIFICATION HISTORY:
JAN-1997, Paul Hick (UCSD)
[Previous]
[Next]
NAME:
ThomsonPDistance
PURPOSE:
Find the distance to the plane of the sky where a single electron
would have a given polarization.
CALLING SEQUENCE:
FUNCTION ThomsonPDistance, ElSun, U, P
INPUTS:
ElSun array distance Sun-Electron (in solar radii)
U array limb darkening coefficient
P array polarization (-1<=P<=1)
OUTPUTS:
ThomsonPDistance
array distance to the plane of the sky (solar radii) (>=0)
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
BadValue, SyncArgs, ThomsonSoup
PROCEDURE:
> The distance to the plane of the sky is given as a positive number.
There are two locations on either side of the plane of the sky
which match the polarization.
> An electron can only produce a positive polarization. If a negative
polarization is specified, then D=-1. is returned
> An electron can only produce a polarization below a certain maximum
(less than one). If a polarization above the maximum value is specified
the D=-1. is returned.
MODIFICATION HISTORY:
JUL-1996, Paul Hick (UCSD)
[Previous]
[Next]
NAME:
ThomsonPDistanceFar
PURPOSE:
Find the distance to the plane of the sky where a single electron
would have a given polarization in the limit of large electron-Sun
distance
CALLING SEQUENCE:
FUNCTION ThomsonPDistanceFar, ElSun, P
INPUTS:
ElSun array distance Sun-Electron (in solar radii)
P array polarization (-1<=P<=1)
OUTPUTS:
ThomsonPDistance
array distance to the plane of the sky (in solar radii) (>=0)
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
BadValue, SyncArgs
PROCEDURE:
> The distance to the plane of the sky is given as a positive number.
There are two locations on either side of the plane of the sky
which match the polarization.
> An electron can only produce a positive polarization. If a negative
polarization is specified, then D=-1. is returned
> An electron can only produce a polarization below a certain maximum
(less than one). If a polarization above the maximum value is specified
the D=-1. is returned.
MODIFICATION HISTORY:
JUL-1996, Paul Hick (UCSD)
[Previous]
[Next]
NAME:
ThomsonRadialFilter
PURPOSE:
CATEGORY:
sat/idl/toolbox/thomson
CALLING SEQUENCE:
FUNCTION ThomsonRadialFilter, elo_sun, degrees=degrees, elo_one=elo_one
INPUTS:
elo_sun array; type: float
elongations (angle between line of sight and
direction to Sun).
OPTIONAL INPUT PARAMETERS:
elo_one=elo_one
scalar; type: float: default: 90 degrees
elongation at which radial filter has value of unity.
i.e. the filter scales to equivalent brightness at
this elongation
/degrees if set, then elo_sun should be in degrees
OUTPUTS:
F array of same type as 'elo_sun'; type: float
radial filter; dividing by F should remove the steep dropoff
in the Thomson scattering brightness.
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
IsType, ToRadians
CALLED BY:
GetColors [2], GetColors [3], PlotEarthSkymap [3], PlotEarthSkymap [4]
RemoteView_Display2D, vu_coronagraph, vu_earthskymap, vu_elotime
vu_thomson_antifish, vu_thomson_hammer
PROCEDURE:
Currently the radial filter is the dropoff with elongation in a 1/r^2
density in the limit of small angular size of the Sun.
MODIFICATION HISTORY:
FEB-2002, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
ThomsonS10
PURPOSE:
(Internal use only) Convert to S10 units
CALLING SEQUENCE:
FUNCTION ThomsonS10, DSun, APM
INPUTS:
DSun array; type: float
distance to Sun (in solar radii)
APM array; type: float
apparent magnitude Sun at 1 AU
OUTPUTS:
R array; type: float
Conversion factor to S10 units. If F is a flux in units of the
flux incident from the solar disk at heliocentric distance DSun
then R*F is the same flux in S10 units.
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLED BY:
ThomsonElectron, ThomsonElectronFar, ThomsonLOSFar, ThomsonLOSRomb
ThomsonLOSStep
PROCEDURE:
An S10 unit is `the brightness of one 10th magnitude star per square
degree of sky'. Replace the star by an electron at the same location
in the sky, and at distance S away from the observer. The electron
is radiating by Thomson scattering of sunlight.
The conversion is done in two steps:
> STEP 1: Convert to units of the flux -incident- at r0 = 1 AU from the
solar disk: multiply by (r0/DSun)^2
(M is an apparent magnitude as observed at 1 AU. This is why
1 AU is used, rather than the observer-Sun distance RObs).
> STEP 2: Convert to units of the flux -incident- at 1 AU from a 10th
magnitude star: multiply by 10^((10-M)/2.5). (Apparent
magnitude, M=-2.5*log(Flux)).
MODIFICATION HISTORY:
JUL-1996, Paul Hick (UCSD)
[Previous]
[Next]
NAME:
ThomsonSetupLOS
PURPOSE:
Sets up common block used by ThomsonLOSDensity to
calculate electron density at specified locations
CATEGORY:
Physics: Thomson scattering
CALLING SEQUENCE:
PRO ThomsonSetupLOS, PosIn, DirIn, density=densityIn
INPUTS:
Pos array[3,n]; type: float
heliocentric location(s) of observer:
(longitude and latitude in radians;
and heliocentric distance in solar radii)
Dir array[2,m]; type: float
topocentric longitude and latitude of
lines of sight relative to Sun-observer
direction (in radians)
OPTIONAL INPUT PARAMETERS:
density=density
scalar; type: string; default: undefined
name of function to be called to calculate
the electron density. This function takes
a single argument:
R array[3,n]; type: float
heliocentric locations where density is
to be evaluated, usually
ecliptic longitude and latitude (radians)
and heliocentric distance (solar radii)
OUTPUTS:
(stored in common block)
INCLUDE:
@compile_opt.pro ; On error, return to caller
@thomson_common.pro ; Dummy comment
CALLS: ***
IsType, boost, destroyvar
CALLED BY:
ThomsonLOSRomb, ThomsonLOSStep
SEE ALSO:
ThomsonLOSDensity
PROCEDURE:
The input is stored in common block thomson_common.
ThomsonLOSDensity uses these together with an input
argument S (1-dim array[k]) specifying distances
along the line of sight, and calculates densities
at locations Loc[k,m,n] (k locations on m lines
of sight at n locations.
MODIFICATION HISTORY:
JAN-1998, Paul Hick (UCSD)
[Previous]
[Next]
NAME:
ThomsonSetupRomb
PURPOSE:
Controls Romberg integration in ThomsonLOSRomb
Internal use only
CATEGORY:
Physics: Thomson scattering
CALLING SEQUENCE:
PRO ThomsonSetupRomb, RSun_, Elo_, U_
INPUTS:
RSun scalar: type: float
Observer-Sun distance (solar radii)
Elo scalar; type: float
Elongation (radians)
U scalar; type: float
Limb darkening constant
OUTPUTS:
(stored in common block)
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLED BY:
ThomsonLOSRomb
COMMON BLOCKS:
common ThomsonIntegrand, RSun, Elo, U
PROCEDURE:
ThomsonSetupIntegrand sets up the common block accessed by
ThomsonTang and ThomsonTangMRad (these two functions
are used as arguments to the IDL QRomb and QRomo functions.
MODIFICATION HISTORY:
SEP-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
ThomsonSolarFlux
PURPOSE:
Calculates the flux from the solar disk incident on
an observer at given distance from Sun
CATEGORY:
Thomson scattering
CALLING SEQUENCE:
FUNCTION ThomsonSolarFlux, R, U
INPUTS:
R array; type: float; default: 1 AU
distance from Sun (in solar radii)
U array; type: float; default: zero
limb darkening constant
OUTPUTS:
Flux array; type: float
flux from the solar disk in units of pi*I0
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
InitVar
CALLED BY:
ThomsonElectron, ThomsonLOSRomb, ThomsonLOSStep, thomsonfig
PROCEDURE:
The flux from the solar disk expressed in the intensity at
the center of the disk, I0, is pi*I0*(1-u/3)*(Rsun/R)^2.
MODIFICATION HISTORY:
AUG-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
ThomsonSoup
PURPOSE:
(Used internally only).
Calculates constant needed for calculating Thomson scattering intensities
CALLING SEQUENCE:
PRO ThomsonSoup, ElSun, U, It, Itr, aa=AA,bb=BB,cc=CC,dd=DD
INPUTS:
ElSun array[*] Electron-Sun distance in solar radii (=1./sine(Omega))
U array[*],scalar limb darkening constant
OUTPUTS:
rIt,rItr real constants
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLED BY:
ThomsonBase, ThomsonPDistance, thomsonfig
RESTRICTIONS:
Distance ElSun must be greater than one solar radii
(if its smaller then ElSun=1 is used)
PROCEDURE:
> See Billings, Guide to the solar corona (Chapter 6, p. 150) Academic Press (1966)
> The constants are functions of the angular size, Omega, of the Sun as seen from the
electron, and the limb darkening constant U. Sin(Omega)=RSun[cm]/dElectronSun[cm].
MODIFICATION HISTORY:
JUL-1996, Paul Hick (UCSD)
[Previous]
[Next]
NAME:
ThomsonTang
PURPOSE:
Controls Romberg integration in ThomsonLOSRomb
Internal use only
CATEGORY:
Physics: Thomson scattering
CALLING SEQUENCE:
FUNCTION ThomsonTang, S
INPUTS:
S
OUTPUTS:
INCLUDE:
@compile_opt.pro ; On error, return to caller
EXTERNAL BY:
ThomsonLOSRomb
COMMON BLOCKS:
common ThomsonIntegrand, RSun, Elo, U
CALLS: ***
Distance2Sun, ThomsonBase, ThomsonLOSDensity
PROCEDURE:
ThomsonSetupRomb sets up the common block accessed by ThomsonTang
and ThomsonTangMRad (these two functions are used as arguments to the
IDL QRomb and QRomo functions).
MODIFICATION HISTORY:
SEP-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
ThomsonTangMRad
PURPOSE:
Controls Romberg integration in ThomsonLOSRomb
Internal use only
CATEGORY:
Physics: Thomson scattering
CALLING SEQUENCE:
FUNCTION ThomsonTangMRad, S
INPUTS:
S
OUTPUTS:
INCLUDE:
@compile_opt.pro ; On error, return to caller
EXTERNAL BY:
ThomsonLOSRomb
COMMON BLOCKS:
common ThomsonIntegrand, RSun, Elo, U
CALLS: ***
Distance2Sun, ThomsonBase, ThomsonLOSDensity
PROCEDURE:
ThomsonSetupRomb sets up the common block accessed by
ThomsonTang and ThomsonTangMRad (these two functions are
used as arguments to the IDL QRomb and QRomo functions).
MODIFICATION HISTORY:
SEP-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
ThomsonUBVConst
PURPOSE:
Defines apparent solar magnitudes and limb darkening
constants to be used for the Helios UBV system
CALLING SEQUENCE:
FUNCTION ThomsonUBVConst, C
INPUTS:
C scalar; type: integer
1,2,3 for U,B,V light, resp.
OUTPUTS:
R array[2]; type: float
R[0]: limb darkening constant
R[1]: apparent magnitude of the Sun
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLED BY:
RemoteView_Display2D, thomsonfig, vu_coronagraph, vu_earthskymap, vu_elotime
vu_lineofsight
RESTRICTIONS:
1<=C<=3; if C out of range then C=1 is used
PROCEDURE:
> UHOS(LT) is the limb darkening coefficient for Helios photometer
light from the U/B/V filter (C=1,2,3). From a graph in
RAUMFAHRTFORSCHUNG by LEINERT et al. LAMBDA=3650,4300,5250 A for U,B,V
light. From Allen (1985), p. 171, U=0.80,0.77,0.62 by linear
interpolation.
> LUM is the luminosity of the solar disk in E14 S10 units:
LUM = LSUN/LS10 = 10**((10-MSUN)/2.5), with MSUN (from Allen)
-25.96,-26.09,-26.73 for U,B and V light respectively.
MODIFICATION HISTORY:
JUL-1996, Paul Hick (UCSD)
[Previous]
[Next]
NAME:
TimeArray
PURPOSE:
Converts time structure to array and v.v.
CATEGORY:
gen/idl/toolbox/time
CALLING SEQUENCE:
u = TimeArray(t [,/linear])
INPUTS:
t array; type: time structure array, or non-structure
array[2,*], array[*]
time to be converted from array to structure or v.v.
OPTIONAL INPUT PARAMETERS:
/linear returns scalar integer instead of 2-element integer
OUTPUTS:
u array; type: array[2,*] or time structure
converted time
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
InitVar, IsType, SubArray, SuperArray, TimePieces, TimeStandardize
CALLED BY:
Carrington, IsBadTime, TimeOrigin
PROCEDURE:
> If the input time is a structure array[*] then it is returned as an
integer array[2,*] (with days and fract-day units) If /linear is set
then an integer array[*] is returned in fract-day units
> If an non-structure array is input then it should be an array[2,*]
(leading dimension of 2) if /linear NOT set, or an array[1,*] if
/linear is set. This is returned as a structure array.
MODIFICATION HISTORY:
JAN-2004, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
TimeDay
PURPOSE:
Converts numerical day value to time structure and v.v
CATEGORY:
gen/idl/toolbox/time
CALLING SEQUENCE:
FUNCTION TimeDay, t
INPUTS:
t array; type: time structure or any numerical type
OUTPUTS:
Result array; type: nummerical or time structure
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
IsTime, TimePieces, TimeStandardize
CALLED BY:
TimeGet, TimeSet
RESTRICTIONS:
This function is for use in TimeGet and TimeSet only.
Other code should make calls to TimeGet or TimeSet:
u = TimeSet(day=t,/diff)
u = TimeGet(day=t,/diff)
SIDE EFFECTS:
Accesses !TimeUnits.in_day
PROCEDURE:
> If the input is of type structure than an integer array is
returned if all the fractions of a day are zero, or else a
double array is returned
> If the input is a numerical array then it is converted to
a time structure with the integer part as the number of days,
and the fraction as time of day.
MODIFICATION HISTORY:
JAN-2004, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
TimeEaster
PURPOSE:
Get date for Easter in given year
CATEGORY:
gen/idl/toolbox/time
CALLING SEQUENCE:
FUNCTION TimeEaster, T
INPUTS:
T scalar or array; type: numerical or time structure
OPTIONAL INPUT PARAMETERS:
/scalar passed to TimeSet
OUTPUTS:
Result
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
IsTime, TimeGet, TimeSet, TimeUnit
PROCEDURE:
From http://charon.nmsu.edu/~lhuber/leaphist.html
MODIFICATION HISTORY:
JUL-2008, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
TimeFixYear
PURPOSE:
Complete year specified in 2 digits
CATEGORY:
Tricks
CALLING SEQUENCE:
Y = TimeFixYear(Yr)
INPUTS:
Yr array; type: integer
OUTPUTS:
Y array; type integer
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLED BY:
InsituTimeSeries, TimeSplit, getipssources, getnagoyasources, getootyasources
nagoya_glevel, sgp4_eph, sgp4_tle, smei_last_tle
PROCEDURE:
Where 0<=Yr<=50, Yr is changed to 2000+Yr
Where 50<Yr<100, Yr is changed to 1900+Yr
Everywhere else Yr is unmodified
MODIFICATION HISTORY:
AUG-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
TimeGet
PURPOSE:
Get information from time structure
CATEGORY:
gen/idl/toolbox/time
CALLING SEQUENCE:
FUNCTION TimeGet, t, unit , $
difference = difference , $
full = full , $
d2000 = d2000 , $
jd = jd , $
mjd = mjd , $
njd = njd , $
jepoch = jepoch , $
bepoch = bepoch , $
djepoch = djepoch , $
dbepoch = dbepoch , $
smei = smei , $
carrington_ = carrington_ , $
unix = unix , $
botime = botime , $
eotime = eotime , $
bomonth = bomonth , $
eomonth = eomonth , $
fotime = fotime , $
roundt = roundt , $
dow = dow , $
month = month , $
dom = dom , $
doy = doy , $
yrmd = yrmd , $
yrdoy = yrdoy , $
dhms = dhms , $
scalar = scalar , $
year = year , $
;yr = yr , $ ; ambiguous keyword
day = day , $
hour = hour , $
hr = hr , $
minute = minute , $
sec = sec , $
msec = msec , $
ydoy = ydoy , $
ymd = ymd , $
sys = sys , $
vms = vms , $
iso8601 = iso8601 , $
_ymd = _ymd , $
_ydoy = _ydoy , $
format = format , $
_extra = _extra
INPUTS:
t array[*]; type: time structure
input times
unit scalar; type: integer; default: none
integer identifying one of the time units year,
day, hour, minute, sec or msec. Should be a return
value of the fnc TimeUnit.
Alternatively, setting one of the keywords /year, /day, /hour,
/minute, /sec or /msec accomplishes the same.
/hr is the same as /hour.
'unit' must be set for keywords /full, /botime, /roundt.
If 'unit' is set without any of these keywords present then
the associated time unit is extracted from 't'.
OPTIONAL INPUT PARAMETERS:
/difference by default the input time is treated as an absolute
time, i.e. a time relative to the time origin !TimeZero.
If /difference is set then the input time is treated
as a time difference, i.e. the returned values will be
be independent of !TimeZero.
The distinction is significant if !TimeZero is set to an
irregular time, e.g. if the time origin is 2000 Jan 1,
00:00:03, and t = 0, then
TimeGet(/sec ) returns 3 while
TimeGet(/sec, /diff) returns 0.
Internally the difference is that by default the time
!TimeZero+t is processed, while with /diff set only the
input time t is processed Note that !TimeZero+t is the
number of days elapsed since 2000 Jan 1, 0 UT.
For keywords extracting calendar date information
setting /difference is somewhat tricky because the calculation
assumes that time is specified relative to 2000 Jan 1, 0 UT
(i.e. !TimeZero+t). Setting /difference would produce wrong
results unless the input t itself already has !TimeZero added to it.
/full used only if 'unit' is set
converts to units of 'unit'
/botime used only if 'unit' is set
truncates to 'unit'
roundt=roundt If one of the TimeString keywords (see below)
is set:
/roundt is passed to TimeString
If none of the TimeString keywords is set:
used only if 'unit' is set,
and rounds to 'unit'
/d2000 ?? undocumented (extract days since current origin, usually 2000.0??
/jd extract Julian date
/mjd extract modified Julian date
/njd extract days since 2000 Jan 1.5
/jepoch extract Julian epoch
/djepoch extract Julian epoch - 2000
/bepoch extract Besselian epoch
/dbepoch extract Besselian epoch - 1900
/d2000 extract days since 2000/01/01 00 UT (???)
/dow extract day of week
/month extract month (integer between 1 and 12)
to convert to 3-char strings, see TimeMonth
/dom extract day of month (with fraction for time of day)
/doy extract day of year (with fraction for time of day)
/scalar if set and only one time is specified (i.e. T is array[1])
then the result is output as a scalar (by default the
output will also be an array[1] (note: this only applies if
the output is not a time structure, since structures are
always arrays).
Any one of the following keywords trigger a conversion of
the input to string format. See TimeString for more information.
format=format
/ydoy
/ymd
/sys
/vms
/iso8601
/_ymd
/_ydoy
OUTPUTS:
u = TimeGet( t, /dhms [, /difference])
u array[5,*]; type: integer
input time split into days, hours, minutes, sec and msec
u[0,*] days
u[1,*] hours
u[2,*] minutes
u[3,*] seconds
u[4,*] milli-seconds
u = TimeGet( t, /full [, /difference, $
[unit, /year, /day, /hour, /minute, /sec, /msec]])
u array[*]; type: numerical type, usually double
input time in units of 'unit'
/year time converted to Julian years
/day time converted to days
/hour time converted to hours
/minute time converted to minutes
/sec time converted to seconds
/msec time converted to milli-seconds
Internally a recursive call to TimeGet is made with /difference
and /dhms set.
u = TimeGet( t, /botime [, /difference, $
[unit, /year, /day, /hour, /minute, /sec, /msec]])
u = TimeGet( t, /eotime [, /difference, $
[unit, /year, /day, /hour, /minute, /sec, /msec]])
u array[*]; type: time structure
input time truncate to 'unit'
/year time truncated to start/end of year (doy=1.0)
(though technically legal you probably don't want
to specify /difference with this keyword).
/day time truncated to start/end of day
/hour time truncated to start/end of hour
/minute time truncated to start/end of minute
/sec time truncated to start/end of second
/msec time truncated to start/end of milli-second
If /difference is NOT set then 'u' is returned relative to
the internal time origin !TimeZero (i.e. !TimeZero is subtracted
after the truncation has been done).
u = TimeGet( t, /bomonth [, /difference)
u = TimeGet( t, /eomonth [, /difference)
u array[*]; type: time structure
input time truncate to start/end of month
If /difference is NOT set then 'u' is returned relative to
the internal time origin !TimeZero (i.e. !TimeZero is subtracted
after the truncation has been done).
u = TimeGet( t, /fotime [, /difference, /full, $
[unit, /year, /day, /hour, /minute, /sec, /msec]])
u array[*]; type: time structure (/full NOT set) or numerical
(/full SET).
fraction of time left after subtracting the result
of TimeGet(t,/botime).
/year fraction of year left
/day fraction of day left
/hour fraction of hour left
/minute fraction of minute left
/sec fraction of second left
/msec fraction of milli-second left
If /full is SET then the remaining fraction is converted
into time units 'unit'. This is a shortcut for two TimeGet calls:
u = TimeGet(t, /fotime, /day, /full)
is the same as:
u = TimeGet(t, /fotime, /day)
u = TimeGet(u, /diff, /full, /day)
u = TimeGet( t, unit, roundt=roundt [, /difference])
u = TimeGet( t, /roundt [, /difference, $
[year=year, day=day, hour=hour, minute=minute, sec=sec, msec=msec]])
u array[*]; type: time structure
rounded input time
year = year time rounded to 'year' Julian years
(same as setting day=365.25d0)
day = day time rounded to 'day' days
hour = hour time rounded to 'hour' hours
minute = minute time rounded to 'minute' minutes
sec = sec time rounded to 'sec' seconds
msec = msec time rounded to 'msec' milli-second
Setting e.g. /day is the same as day=1, i.e. rounding occurs
to the nearest unit of time specified.
If /difference is NOT set then 'u' is returned relative to
the internal time origin !TimeZero (i.e. !TimeZero is subtracted
after the rounding has been done).
u = TimeGet( t [, /difference, $
[unit, /year, /day, /hour, /minute, /sec, /msec]])
u array[*]; type: integer
specified time-component extracted from 'u'
year = year year (integer array)
day = day day of year (integer array)
The calendar keywords /julian and jul2greg affect
the result (see TimeYDoy).
(though technically legal you probably don't want
to specify /difference with these two keywords).
hour = hour hours
minute = minute minutes
sec = sec seconds
msec = msec milli-seconds
These four are implemented as recursive calls to
TimeGet with /difference and /dhms set.
u = TimeGet( t, /d2000 [ , /difference] ) # days since 2000 Jan 1, 0 UT
u = TimeGet( t, /jd [ , /difference] ) Julian days
u = TimeGet( t, /mjd [ , /difference] ) Modified Julian days, JD-2400000
u = TimeGet( t, /njd [ , /difference] ) New Julian days = days since 2000 Jan 1, 12 UT
u = TimeGet( t, /jepoch [ , /difference] ) Julian epoch
u = TimeGet( t, /bepoch [ , /difference] ) Besselian epoch
u array[*]; type; numerical
calendar date 't' converted to indicated format
If /difference is used, make sure that t reflects elapsed times since
2000 Jan 1, 0 UT.
u = TimeGet( t, /dow [ , /difference] )
u array[*]; type: string
day of week as 2-char string, 'SUN','MON', etc.
If /difference is used, make sure that t reflects elapsed times since
2000 Jan 1, 0 UT.
u = TimeGet( t, /month [ , /difference] )
u array[*]; type: integer
month as integer 1-12. To convert to 3-char strings,
'JAN','FEB', etc.; see TimeMonth).
If /difference is used, make sure that t reflects elapsed
times since 2000 Jan 1, 0 UT.
The calendar keywords /julian and jul2greg affect the result
(see TimeYDoy).
u = TimeGet( t, /dom [ , /difference] )
u = TimeGet( t, /doy [ , /difference] )
array[*]; type: numerical
day of the month or year with fraction for time of day.
If /difference is used, make sure that t reflects elapsed
times since 2000 Jan 1, 0 UT.
The calendar keywords /julian and jul2greg affect the result
(see TimeYDoy).
u = TimeGet( t, /yrmd [ , /difference] )
array[3,*]; type: numerical
year, month and day of the month (with fraction for time of day).
If /difference is used, make sure that t reflects elapsed
times since 2000 Jan 1, 0 UT.
The calendar keywords /julian and jul2greg affect the result
(see TimeYDoy).
u = TimeGet( t, /yrdoy [ , /difference] )
array[*]; type: numerical
year and day of the year (with fraction for time of day).
If /difference is used, make sure that t reflects elapsed
times since 2000 Jan 1, 0 UT.
The calendar keywords /julian and jul2greg affect the result
(see TimeYDoy).
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLED BY:
CvSky_Equatorial, CvSky_GSM, CvSky_Geographic, CvSky_HEEQ, CvSky_Heliographic
CvSky_IHG, CvSky_Precess, GeographicInfo, GetColors [2], GetColors [3], HOSOrbit
InSitu, InsituTimeSeries, KeplerOrbit, MessengerOrbit, NewcombSun, PA_Pole
PlotCoronagraph, PlotEarthSkymap [1], PlotEarthSkymap [3], PlotEarthSkymap [4]
PlotEloTimeMap, PlotPlanarCut, PlotPolarSkymap, PlotSolarDisk, PlotSphereCut
RemoteView_BodyLoc, RemoteView_CMEDensity, RemoteView_Display2D
RemoteView_Display3D, RemoteView_FOV, SkyDriveIn, SkyForecast, Sky_ColorView [1]
Sky_ColorView [2], StereoAOrbit, StereoBOrbit, TimeEaster, TimeGST, TimeOp, TimeSet
TimeSplit, TimeString, TimeSystem, TimeXAxis, TimeYDate, TimeYDoy, UlyssesOrbit
ark_duty_cycle, aurora, clock, coriolis_map, fileset_sizes, forecast, forecast_html
forecast_info, forecast_movie, getipssources, getnagoyasources, getootyasources
getsmeisources, img_read, jpl_eph, krill_request_bars, krill_request_stats
lsqLinearFit, maygeometry, mk_celias, mpc_comets, mpc_eph, mpc_minor_planets
mpc_orbit_eph, nagoya_glevel, orb_comp, packet_size_update, plot_ipv6_fraction
plot_traffic, qEphem, qImage_cw_Property, qImage_cw_Where, qLine_Curve
qLine_FitPlot, qRemoteView, qRemoteView_Calculate, qRemoteView_ChangeTimes
qRemoteView_Pick, qnagoya, qnagoya_pointsources, qnew_2007_013, qsmei_sky_pick
ra_fictitious_sun, skyd_cat, skyd_version, smei_base_testcase, smei_buf
smei_buf_get, smei_buf_getframe, smei_buf_prep, smei_buf_read, smei_coriolis
smei_filename, smei_filepath, smei_frm_base, smei_frm_cp, smei_frm_cvhdr
smei_frm_eclipse, smei_frm_findpoint, smei_frm_info, smei_frm_read
smei_frm_smoothdark, smei_frm_summary, smei_frm_track, smei_frm_where
smei_getfile, smei_hdr_c3maskupload, smei_hdr_get, smei_hdr_make, smei_hdr_plot
smei_hdr_update, smei_mkbase, smei_mkcal, smei_mkcal_auto, smei_mkdrives
smei_mkmask, smei_mkorb, smei_mkorb_auto, smei_mksidereal, smei_mksky, smei_normal
smei_orbit_stats, smei_plot_timeseries, smei_rewind, smei_sgp4_orbits
smei_shutterwrong, smei_sky_atlocation, smei_sky_getmask, smei_sky_track
smei_star_fit, smei_star_remove, smei_star_show, smei_star_showsmooth
smei_star_writepnt, smei_www_skymaps, smei_zld_remove [1], smei_zld_remove [2]
smei_zld_weekly, smeidb_mounted, stardistance, stopwatch, tbad, telescope_sizes
test_sky, test_td, tplot, usno_eph, view3d, vlist, vu_coronagraph, vu_earthskymap
vu_elotime, vu_extract, vu_get_page, vu_getdata, vu_image, vu_insitu
vu_insitu_persist, vu_insitu_raw, vu_insitucurve, vu_linecut, vu_lineofsight
vu_localskymap, vu_mean, vu_movie, vu_nagoyasourcemap, vu_new_time, vu_planarcut
vu_radialcut, vu_read, vu_remoteview, vu_select, vu_solardisk, vu_spherecut
vu_stereoview, vu_synopticmap, vu_thomson_antifish, vu_thomson_hammer
vu_update_hours, vu_update_marker, vu_vox_write, vu_whatis, vu_write, wso_read
www_help_tree
RESTRICTIONS:
If the return value is a one-element non-structure it is returned as a 1-element array,
unless /scalar is set.
CALLS: ***
Carrington, InitVar, IsType, SubArray, SuperArray, TimeDay, TimeOp, TimePieces, TimeSet
TimeShift, TimeStandardize, TimeString, TimeUnit, TimeYDate, TimeYDoy, smei_coriolis
PROCEDURE:
MODIFICATION HISTORY:
SEP-1999, Paul Hick (UCSD/CASS)
NOV-2003, Paul Hick (UCSD/CASS)
Fixed bug in use of /botime keyword
JAN-2004, Paul Hick (UCSD/CASS)
Fairly substantial rewrite, converting from the old time structure
with year,doy,h,m,s,msec fields to the new structure with two integer fields.
APR-2004, Paul Hick (UCSD/CASS)
Fixed bug with /roundt for rounding to hours, minutes, seconds or milliseconds
JUL-2004, Paul Hick (UCSD/CASS)
Added /eotime keyword
JUL-2007, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
If input arg t is a string it is now converted to a time
structure using TimeSet.
Renamed keyword /ydoy to /yrdoy (to avoid conflict with
keyword /ydoy of function TimeString).
Added a list of keywords passed to TimeString:
/ydoy, /ymd, /sys, /vms, /_ymd, /_ydoy, format=format
If any one of these keywords is set then TimeString is called
with the same keyword.
With this change it should no longer be necessary to call
TimeString directly. Instead call TimeGet with the same keywords.
Removed keyword /stringt (not needed anymore)
JUL-2008, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
Added /bomonth and /eomonth keywords.
JUL-2009, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
Added keyword /unix.
[Previous]
[Next]
NAME:
TimeGST
PURPOSE:
Calculate Greenwich Sidereal Time from UT
Good for years 1901 through 2099. Accuracy is 0.006 degree.
CATEGORY:
Celestial mechanics
CALLING SEQUENCE:
gst = TimeGST(T, /degrees)
INPUTS:
T array; type: time structure
universal time (UT)
OPTIONAL INPUT PARAMETERS:
/degrees if set output is in degrees (default: radians)
OUTPUTS:
gst array; type: double
Greenwich sidereal time
INCLUDE:
@compile_opt.pro ; Return to caller
CALLS: ***
TimeGet, TimeOp, TimeSet, TimeUnit, ToDegrees
CALLED BY:
EarthTransit3DLoc, GeographicInfo
RESTRICTIONS:
Only valid for years 1901 through 2099
PROCEDURE:
Local Sidereal Time (LST) is defined as the Hour Angle of the
vernal equinox. GST is RA of local meridian at Greenwich
MODIFICATION HISTORY:
See: C.T. Russell, Geophysical Coordinate Transformations,
in: Cosmic Electrodynamics 2 (1971) 184-196
[Previous]
[Next]
NAME:
TimeInterpol
PURPOSE:
Interpolation of a function of time.
CATEGORY:
Tell time
CALLING SEQUENCE:
F = TimeInterpol(FF, TT, T, Unit, _extra=_extra)
INPUTS:
FF array[n]; type: any numerical array
list of function values
TT array[n]; type: time structure
list of times where function values FF are supplied
T array[m]; type: time structure
list of times where interpolates are needed
OPTIONAL INPUT PARAMETERS:
Unit scalar; type: integer; default: TimeUnit(/days)
time units used for the interpolation (see PROCEDURE)
_extra=_extra
extra keyword passed to IDL function 'interpol'
OUTPUTS:
F array[n]; type: same as FF
list of interpolated values at times T
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
INTERPOL, InitVar, IsType, SyncDims, TimeOp, TimeUnit
CALLED BY:
dusan_earth, mpc_eph, vu_atlocation, vu_gettime, vu_insitu_persist, vu_insitu_raw
vu_mean, vu_remoteview, vu_timeseries
PROCEDURE:
Input arrays TT and T are converted to time differences relative to
TT[0] in units specified by the Unit argument. Interpolation is done
with the IDL interpol function using these time difference arrays.
MODIFICATION HISTORY:
MAR-2001, Paul Hick (UCSD/CASS)
SEP-2001, Paul Hick (UCSD/CASS)
Added interpolation on multidimensional arrays
JAN-2004, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
Added check for new time of time structure
[Previous]
[Next]
NAME:
TimeLimits
PURPOSE:
Extract information about a array of times
CATEGORY:
Tell time
CALLING SEQUENCE:
FUNCTION TimeLimits, T, unit, $
mint = mint , $
maxt = maxt , $
bounds = bounds, $
range = range , $
mid = mid , $
t0 = t0
INPUTS:
T array; type: time structure
times to be processed
OPTIONAL INPUT PARAMETERS:
unit scalar; type: integer
If'unit' is not specified all times are returned
as a time structure
If 'unit' ist specified then times are returned
as a difference from T[0] in units of 'unit'.
/mint return earliest time
/maxt return latest time
/mid return center time
/bounds return earliest and latest time
(earliest time = R[0], latest time = R[1])
This is the default if no keyword is specified.
/range (use only with chronological or reverse
chronological arrays, SEE RESTRICTIONS)
return earliest and latest time,
The pair of times is returned in the
same order as they occur in the input array T,
e.g. if the array is in reverse chronological order
than R[0] is the latest, and R[1] the earliest time.
(this keyword is primarily use in plotting routines
to reverse the time axis).
OUTPUTS:
R array[1], array[2]; type: time structure of float
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
InitVar, IsType, MEAN, TimeOp, TimeUnit
CALLED BY:
InsituTimeSeries, TimeLInterpol, TimeXAxis, lsqLinearFit, mpc_eph, qLine_Curve
qView_GetData, sgp4_eph, sgp4_tle, smei_buf_getframe, smei_buf_prep, smei_buf_read
smei_frm_eclipse, smei_frm_findpoint, smei_frm_smoothdark, smei_frm_summary
smei_getfile, smei_hdr_get, smei_hdr_plot, smei_hdr_update, smei_mkcal, smei_mkorb
smei_sky, smei_star_fit, smei_star_show, vu_insitucurve
RESTRICTIONS:
If the min and max time is required for an input array T that is
not (reverse) chronological the /range keyword can produce unexpected
results (the minimum time may end up in R[1], not R[0]).
Use trange = TimeLimits(T,/bounds) if you need to be sure
that the minimum time is R[0] and the maximum time R[1].
PROCEDURE:
R = TimeLimits(T, /mint [, unit])
R = TimeLimits(T, /maxt [, unit])
R = TimeLimits(T, /mid [, unit])
R = TimeLimits(T, /bounds[, unit])
R = TimeLimits(T, /range [, unit])
MODIFICATION HISTORY:
NOV-1999, Paul Hick (UCSD/CASS)
SEP-2005, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
Added /bounds keyword
[Previous]
[Next]
NAME:
TimeLInterpol
PURPOSE:
Linear interpolation on a function of time
CATEGORY:
gen/idl/toolbox/time
CALLING SEQUENCE:
FUNCTION TimeLInterpol, ff, tt, t, unit, $
scalar = scalar , $
inear = inear , $
dtnear = dtnear , $
ilow = ilow , $
dtlow = dtlow , $
fraction= fraction , $
ihigh = ihigh , $
dthigh = dthigh
INPUTS:
ff array[n]; type: any
function values
if ff does not exist then the array index
lindgen(n) is used
tt array[n]; type: time structure
UT times
t array[m]; type: time structure
times were interpolated values are needed
OPTIONAL INPUTS:
/scalar if n=1 then return values will be scalars instead
of array[1]
OUTPUTS:
inear = inear
dtnear = dtnear
ilow = ilow
dtlow = dtlow
ihigh = ihigh
dthigh = dthigh
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
ArrayLocation, InitVar, IsType, TimeLimits, TimeOp, TimeUnit
CALLED BY:
smei_coriolis, smei_mkorb
PROCEDURE:
MODIFICATION HISTORY:
DEC-2005, Paul Hick (UCSD/CASS)
[Previous]
[Next]
NAME:
TimeMonth
PURPOSE:
Converts integer month to 3-char month and v.v.
CATEGORY:
gen/idl/toolbox/time
CALLING SEQUENCE:
FUNCTION TimeMonth, month, check=check, year=year, full=full, mixed=mixed, lowcase=lowcase
INPUTS:
month scalar or array; type: integer or string
if integer then values must be between 1 and 12
if char then values must be one of
JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC
(case insensitive).
OPTIONAL INPUT PARAMETERS:
/check if set then no conversion is done, but the input
array is checked to make sure all entries are valid.
The input array must be numeric (usually integer).
year=year if /check is set, or numeric input is converted to string
then months outside the range 1-12 are mapped back
into the range 1-12. In this case 'year' is updated
accordingly where the month was changed.
(e.g. if month=14 and year=2003 on input, then
month=2 and year=2004 is returned).
OUTPUTS:
mon same array type as input; type; string or integer
converted month array
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
InitVar, IsType, SyncArgs
CALLED BY:
TimeSet, TimeString, TimeYDate, smei_www_skymaps
PROCEDURE:
MODIFICATION HISTORY:
JAN-2004, Paul Hick (UCSD/CASS)
MAY-2008, Paul Hick (UCSD/CASS)
Integer month input is now mapped to range 1,12
instead of aborting when outside this range.
JUL-2008, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
Added keyword 'year'.
[Previous]
[Next]
NAME:
TimeOp
PURPOSE:
Simple operations on times
CATEGORY:
gen/idl/toolbox/time
CALLING SEQUENCE:
FUNCTION TimeOp, t, u, unit , $
add = add , $
subtract = subtract , $
meant = meant , $
times = times , $
divide = divide , $
wt = wt , $
wu = wu , $
units = units , $
old_units = old_units , $
new_units = new_units , $
signdiff = signdiff
v = TimeOp(t,u, /add)
v = TimeOp(t,u, /subtract)
v = TimeOp(t,u, /meant, wt=wt, wu=wu)
u = TimeOp(t, /units, old_units=old_units, new_units=new_units)
INPUTS:
t array; type: time structure
u array; type: time structure
OPTIONAL INPUT PARAMETERS:
/add if set, add t and u (not that u in this case is interpreted
as a time difference
/subtract if set, get the time difference t-u
/meant return a weighted mean of t and u (with weights wt and wu)
/times
/divide
/units if set convert from 'old_units' to 'new_units'
If none of the above keywords is set then /subtract is assumed.
wt=wt scalar or array; type: double; default: 1.0d0-wu or 0.5d0
weight for first time array (t)
wu=wu scalar or array; type: double; default: 1.0d0-wt or 0.5d0
weight for second time array (u)
Input is converted to double if necessary
old_units=old_units
scalar; type: integer; default: !TimeUnits.in_day
# times per day currently stored in t
new_units=new_units
scalar; type: integer; default: !TimeUnits.tiny
new units
OUTPUTS:
u array; type: time structure
added times
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
InitVar, IsType, TimeGet, TimePieces, TimeSet, TimeStandardize, TimeUnit
CALLED BY:
Carrington, EarthTransit3DLoc, GeographicInfo, InsituTimeSeries, IsBadTime
PlotCurve, PlotPrep, RemoteView_BodyLoc, RemoteView_CMEDensity
RemoteView_Init_FOV, SkyForecast, TimeGST, TimeGet, TimeInterpol, TimeLInterpol
TimeLimits, TimeOrigin, TimeScale, TimeSet, TimeShift, TimeSplit, TimeSystem
TimeXAxis, big_orbit, coriolis_map, dusan_earth, even_light, forecast, forecast_ice
forecast_info, forecast_movie, getipssources, getnagoyasources, getootyasources
getsmeisources, grayburst, gridgen, gridgen1d, ipv6_packets, jpl_eph, jpl_test
laserjet, mpc_eph, nso_fe_plot, orb_comp, parseooty, plot_ipv6_fraction
plot_traffic, qImage_cw_DrawEphem, qLine_Curve, qView_UpdateTime, run_map
sgp4_eph, sgp4_orbit_axis, sgp4_tle, skyd_cat, smei_base_testcase, smei_buf
smei_buf_getframe, smei_buf_prep, smei_buf_read, smei_buf_splitfile
smei_camera_gain, smei_coriolis, smei_filepath, smei_frm_cp, smei_frm_cvhdr
smei_frm_darkfit, smei_frm_findpoint, smei_frm_info, smei_frm_read
smei_frm_smoothdark, smei_frm_summary, smei_getfile, smei_hdr_get, smei_hdr_make
smei_hdr_plot, smei_hdr_update, smei_mkbase, smei_mkdrives, smei_mkorb
smei_mkorb_auto, smei_mksky, smei_normal, smei_orbit_stats, smei_rewind
smei_sgp4_orbits, smei_sky_atlocation, smei_sky_read, smei_sky_track
smei_star_fit, smei_star_remove, smei_star_showsmooth, smei_star_split
smei_star_test, smei_zld_remove [1], smei_zld_remove [2], smei_zld_weekly
stardistance, stopwatch, view3d, vu_atlocation, vu_elotime, vu_getdata, vu_gettime
vu_header, vu_insitu, vu_insitu_persist, vu_insitu_raw, vu_insitucurve
vu_is_sequence, vu_localskymap, vu_mean, vu_movie, vu_nagoyasourcemap, vu_new_time
vu_select, vu_timeseries, vu_update_hours, vu_update_marker, vu_vox_draworbit
vu_vox_write, vu_weight, vu_whatis, www_help_tree
PROCEDURE:
/meant set:
If neither wu nor wt are specified then the unweighted mean time
(t+u)/2 is returned.
If only one weight is defined then the other weight is set to
1-(specified) weight, i.e. a weighted mean is calculated:
wt*t+(1-wt(u)) or (1-wu)*t+wu*t
If both weights are specified the wt*t+wu*u is returned.
Uses !TimeUnits
Note that the units in the returned time are not necessarily consistent
anymore with !TimeUnits.in_day. It is the users responsibility to make
sure that this does not lead to mayhem.
MODIFICATION HISTORY:
JAN-2004, Paul Hick (UCSD/CASS)
APR-2004, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
Fixed bug in calculation of signdiff
Added keyword /scalar to TimeGet call used to get signdiff.
Signdiff is now a returned as a scalar if both t and u are
1-element time structure arrays.
[Previous]
[Next]
NAME:
TimeOrigin
PURPOSE:
Converts time structure to array and v.v.
CATEGORY:
gen/idl/toolbox/time
CALLING SEQUENCE:
u = TimeOrigin(t)
INPUTS:
t0 /get NOT set:
array[1]; type: time structure
time origin additional offset to the origin
defined in keywords /d2000, /jd, /mjd, /njd
OPTIONAL INPUT PARAMETERS:
/get if set then the current settings are returned in t0
/time do not change the origin, only change time units
/d2000 if set then the origin is set to 2000 Jan 1, 0 UT
(plus t0 if specified).
/jd if set then the origin is set to JD=0
(plus t0 if specified)
/mjd if set then the origin is set to JD=2400000
(plus t0 if specified)
/njd if set then the origin is set to 2000 Jan 1, 12 UT
(plus t0 if specified)
units_in_day=units_in_day
scalar; type: integer; default: !TimeUnits.in_day
# times per day
OUTPUTS:
u array; type: array[2,*] or time structure
converted time
OPTIONAL OUTPUT PARAMETERS:
t0 /get SET: current settings of time origin and time units
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
InitVar, IsType, TimeArray, TimeOp
CALLED BY:
Carrington, TimeShift
PROCEDURE:
Uses structure definition in !TheTime
MODIFICATION HISTORY:
JAN-2004, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
TimePieces
PURPOSE:
Manipulate time structures
CATEGORY:
gen/idl/toolbox/time
CALLING SEQUENCE:
FUNCTION TimePieces, t, p, days=days, tiny=tiny, units=units, add=add
INPUTS:
t array; type: time structure; default: !TheTime
times
p array; type: integer
time component to be entered into 't'
OPTIONAL INPUT PARAMETERS:
/days return # whole days in t
/units return fraction of day in current units
/tiny return fractions of day in smallest permitted
time units (as set in !TimeU.tiny)
OUTPUTS:
v array; type: integer
returns a part of the input time.
If /days and /tiny NOT set:
fraction of day in current units
(as set by !TimeUnits.in_day)
If /day SET:
# whole days in t
If /tiny SET:
fraction of day in smallest permitted units
(as set by !TimeUnits.tiny)
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
InitVar, IsType
CALLED BY:
TimeArray, TimeDay, TimeGet, TimeOp, TimeSet, TimeStandardize
RESTRICTIONS:
The assumption is made that !TimeUnits.tiny is an
integer multiple of TimeUnits.in_day. If this is not the case
integer truncation occurs, with probably pretty nasty side effects.
PROCEDURE:
As much as possible all access to the fields in the time
structure should be channelled through this function.
MODIFICATION HISTORY:
JAN-2004, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
timeposn
PURPOSE:
Finds location of time in string
CATEGORY:
gen/idl/toolbox/time
CALLING SEQUENCE:
FUNCTION timeposn, names_, $
front = front , $
back = back , $
time = time , $
cbreak = cbreak, $
format = format, $
extract = extract,$
part = part , $
length = length
INPUTS:
names array; type: string
strings containing times
OPTIONAL INPUT PARAMETERS:
cbreak=cbreak scalar or 2-element array; type: string; default: '_' (underscore)
separator between time fields. The 2nd, if present is
used as separator between hrs, min and seconds fields.
part=part scalar; type: string
usually part='name'. 'names' is treated as
a file name and only part 'part' of the name
is processed (e.g. GetFileSpec(names,part=part)
only processed the file name part after stripping
directory and extension)
/extract return times (i.e. as also returned in keyword 'time')
OUTPUTS:
p array; type: long
position in 'names' where the time starts
-1 if no time was found
OPTIONAL OUTPUT PARAMETERS:
time=time array; type: time structure
times extracted from 'names'.
Set to !TheTime if no time was found
front=front array; type: string
part of 'names' preceeding the time
back=back array; type: string
part of 'names' trailing the time
format=format array; type: string
format string used to extract the time with TimeSet
length=length array; type: integer
format length, i.e. strlen(format)
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
GetFileSpec, InitVar, IsType, SyncArgs, TimePosn_add, TimePosn_backcheck
TimePosn_test, TimeSet, UNIQ, boost, strposn
CALLED BY:
skyd_cat, smei_buf_splitfile, smei_coriolis, smei_filename, smei_frm_read
smei_getfile, smei_hdr_update, smei_mkorb, smei_property, smeidb_mounted
PROCEDURE:
YMD and YDOY type formats are accepted:
YYYY[_DOY_HHMMSS] and YYYY[_MN_DD_HHMMSS]
where the parts between brackets are optional.
The date and time of day can be separated by a space (instead
of a cbreak char. A separate cbreak can be specified for the
hours, minutes and seconds field (usually a colon).
IF a millisecond field is present it can be separated from
the minutes field by a dot.
EXAMPLE:
Format YYYY/MN/DD hh:mm:ss.fff is detected with cbreak=['/',':']
MODIFICATION HISTORY:
JUL-2005, Paul Hick (UCSD/CASS)
DEC-2007, Paul Hick (UCSD/CASS)
Added /reverse_order to TimePosn_test call that searches
for the year field.
MAR-2008, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
Added keywords /extract, part=part and length=length.
Added code to process cbreak='' (null_string)
[Previous]
[Next]
NAME:
TimePosn_add
PURPOSE:
Internal use for TimePosn only
INPUTS:
format
times
back
slack
piece scalar; type: string
piece of format string for time (e.g. 'YYYY')
CALLING SEQUENCE:
PRO TimePosn_add, format,times,back,slack,f,b,trail,cc,is_too, piece
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLED BY:
timeposn
MODIFICATION HISTORY:
[Previous]
[Next]
NAME:
TimePosn_backcheck
PURPOSE:
Internal use for TimePosn only
CALLING SEQUENCE:
FUNCTION TimePosn_backcheck, back, check
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLED BY:
timeposn
MODIFICATION HISTORY:
[Previous]
[Next]
NAME:
TimePosn_test
PURPOSE:
(Internal use by timeposn only)
Tests for a number of ntest chars in ctest
CATEGORY:
gen/idl/toolbox/time
CALLING SEQUENCE:
FUNCTION TimePosn_test, ctest, ntest, cbreak, trail, lead, $
complement = complement , $
reverse_order = reverse_order , $
test_null = test_null
INPUTS:
ctest array; type: string
array of strings to be tested
Typically ctest is the "front" return argument of a call
to strposn called with /frontdefault set, i.e.
ctest will end with the cbreak char, or is the remaining
part of the string tested with strposn if no cbreak
was present.
ntest scalar; type: integer
we are looking for isolated sequence of ntest numbers
at the start (/reverse_order NOT set) or the end of
ctest (/reverse_order SET).
cbreak scalar; type: string
The break char used in the strposn call (usually '_')
(only used if /reverse_order SET)
OPTIONAL INPUT PARAMETERS:
OUTPUTS:
result array; type: integer
indices in ctest where strmid(ctest,0,ntest)
is a self-contained number (i.e. numerical chars
only, NOT followed by another numerical char)
ctest array; type: string
ctest[result] contains the self-contained
numbers (i.e. the length of these substrings
is ntest). The other entries in ctest are
unmodified.
lead array; type: string
if /reverse_order is NOT set: array of null strings.
if /reverse_order SET: part of ctest preceeding
an isolated sequence of numbers.
trail array; type: string
trail[result] is the trailing part (not
returned in ctest[result]. The other entries
in trail are blank strings
OPTIONAL OUTPUT PARAMETERS:
complement=complement
complement of the return index array
i.e. indices in ctest that do not contain an
isolated sequence of numbers
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
InitVar, strreverse, where_common
CALLED BY:
timeposn
PROCEDURE:
MODIFICATION HISTORY:
JUL-2005, Paul Hick (UCSD/CASS)
DEC-2007, Paul Hick (UCSD/CASS)
Added keyword /reverse_order
MAR-2008, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
Added keyword /test_null
[Previous]
[Next]
NAME:
TimeReadMe
PURPOSE:
Help file for time variables in SMEI IDL software
CATEGORY:
gen/idl/toolbox/time
SEE ALSO:
TimePieces, defsysv_smei
PROCEDURE:
Three system variables are defined at startup (in defsysv_smei.pro)
to control the handling of time variables:
IDL> help, /structure, !timeunits
** Structure TIMEUNITS, 2 tags, length=8, data length=8:
IN_DAY LONG 86400000
TINY LONG 86400000
IDL> help, /structure, !thetime
** Structure THETIME, 2 tags, length=8, data length=8:
DAYS LONG 0
UNITS LONG 0
IDL> help, /structure, !timezero
** Structure THETIME, 2 tags, length=8, data length=8:
DAYS LONG 0
UNITS LONG 0
!TimeUnits has two integer fields:
!TimeUnits.in_days defines the unit used to keep track of the time of day
in !TheTime.units. It is the number of these time units in one whole day.
Currently this unit is milli-second, i.e. !TimeUnits.in_day = 86,400,000
Other allowed values are 24 (time-of-day units are hours), 1440 (units are
minutes) or 86400 (units are seconds).
!TimeUnits.tiny defines the smallest allowed time units allowed for the
time of day. Currently this also is milli-second, i.e.
!TimeUnits.tiny=!TimeUnits.in_day.
!TimeUnits.tiny is used primarily in rounding operations
(see the /roundt keyword on TimeGet).
All time variables are defined as arrays of !TheTime structures.
!TheTime has two long integer fields that together define the time elapsed since
some reference time (time origin).
!TheTime.days keeps track of integer days.
!TheTime.units keeps track of the time of day in units defined by !TimeUnits.in_day.
i.e. the time (in days) elapsed since the reference time is
!TheTime.days+!TheTime.units/!TimeUnits.in_day.
By default the reference time is set in !TimeZero.
!TimeZero itself is a !TheTime structure, and defines the time elapsed since
the 'absolute time origin' 2000, Jan 1, 0 UT. The default for !TimeZero is {0,0}
i.e. the current origin is set by default to the absolute origin.
TimeOrigin:
The function TimeOrigin is used to manipulate !TimeZero, and the setting
of !TimeUnits.in_day (!TimeUnits.tiny is never changed).
TimeShift:
A change of origin usually means that time variables need to be modified to
reflect the new origin. This is done with TimeShift.
TimeSet:
Most common real-life times can be converted to a !TheTime structure using
TimeSet. Examples are yr,mon,day triplets, yr,doy pair, (Modified) Julian Days,
Julian epochs, various string formats, etc.
TimeGet:
This function is used to extract real-life data from a !TheTime structure.
Examples are year, day of year, day of week, day of month, Julian day, etc.
It also provides additional services, such as rounding of times.
Usage:
In principle, every routine that takes a time structure as input,
should assume that the time specifies time elapsed since the origin
!TimeZero.
MODIFICATION HISTORY:
FEB-2004, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
TimeRound
PURPOSE:
Find rounded values bracketing the specified time range
CATEGORY:
Tell time
CALLING SEQUENCE:
R = TimeRound(dT,Unit)
INPUTS:
dT array; type: integer or float
times (in unit of 'Unit')
Unit array; type: integer
determines the time units of dT
(set by TimeUnit)
OUTPUTS:
R array[2]; type: float
two times bracketing dT (in units of 'Unit')
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLED BY:
TimeXAxis
PROCEDURE:
Tricky and imperfect
MODIFICATION HISTORY:
???-????, Paul Hick (pphick@ucsd.edu)
[Previous]
[Next]
NAME:
TimeScale
PURPOSE:
Returns range of time axis to data units established by
a previous call to TimeXAxis
CATEGORY:
Telling time
CALLING SEQUENCE:
R = TimeScale(t)
INPUTS:
t array; type: time structure
time array to be converted to data units
OPTIONAL INPUT PARAMETERS:
OUTPUTS:
R array; type: float
times converted to data units
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
TimeOp
CALLED BY:
TimeXAxis, ark_duty_cycle, plot_ipv6_fraction, plot_traffic, qLine_FitPlot
smei_frm_summary, smei_hdr_plot
COMMON BLOCKS:
common TimeScale, torigin, trange, tunit, texact
PROCEDURE:
> The common block is set by a call to TimeXAxis.
MODIFICATION HISTORY:
JULY-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
TimeSet
PURPOSE:
Convert real-world time units to time structure.
CATEGORY:
gen/idl/toolbox/time
CALLING SEQUENCE:
T = TimeSet(Tunit,unit)
T = TimeSet(/diff, year=year, day=day
[, hour=hour, minute=minute, sec=sec, msec=msec])
T = TimeSet(year=year, doy=doy
[, hour=hour, minute=minute, sec=sec, msec=msec])
T = TimeSet(year=year, month=month, day=day
[, hour=hour, minute=minute, sec=sec, msec=msec])
T = TimeSet(Tunit, T0, format=format
See TimeSplit
INPUTS:
For time differences:
--------------------
The calculation does not involve the internal time origin !TimeZero,
although the time can still be interpreted as the time elapsed
since !TimeZero)
T = TimeSet(Tunit, unit)
Tunit array; type: any numerical type
times specified in units of 'unit'
unit scalar; type: integer; default: none
integer indicating the time units of 'Tunit'
Should be a return value of fnc TimeUnit.
The input 'Tunit' in units of 'unit' are converted
to a standard time structure.
T = TimeSet(/diff, year=year, day=day, hour=hour, $
minute=minute, sec=sec, msec=msec)
The arguments can be a combination of scalars and arrays
of any numerical type (incl. float or double).
Input units are combined into standard time structure.
Years are interpreted as Julian years of 365.25 days.
The /diff keyword is optional, but more robust. If omitted a list
of checks for 'calendar keywords' (see below) is done; if none is
found then a recursive call with /difference SET follows.
For specific dates ('calendar times'):
--------------------------------------
Calendar times can be set in a number of different 'calendar keywords'.
In addition to the keywords specified below, the time-of-day keywords hour,
minute, sec and msec are permitted. The associated elapsed time (i.e. a time
difference calculated internally by a recursive call to TimeSet with /diff set)
is added to the time calculated from the main keywords.
The resulting time is returned relative to the current origin !TimeZero,
i.e. the returned value T depends on the setting of !TimeZero with
!TimeZero+T the time elapsed since 2000 Jan 1, 0 UT.
T = TimeSet(year=year, doy=doy)
Specify Year and Day Of Year.
The year is an integer; if omitted it is set using the system time;
doy (day of year) MUST be specified and can include a fraction for
the time of day. Calendar related keywords /julian and /jul2greg are
permitted (see TimeYDoy)
T = TimeSet(year=year, month=month, day=day)
Specify Year, Month, Day Of Month.
The year is an integer; if omitted it is set using the system time;
the month MUST be present either as an integer (1-12) or as a 3-char string
('jan', 'feb', etc.; case insensitive); the day of the month, if not defined,
is set to 1, and it can include a fraction for the time of day.
Calendar related keywords /julian and /jul2greg are permitted
(see TimeYDoy, TimeYDate).
T = TimeSet(jd =jd )
T = TimeSet(mjd=mjd)
T = TimeSet(njd=njd)
Specify a Julian day (number of days elapsed since noon of a specific date)
'jd' is the conventional Julian day (e.g. jd=2451545 is 2000 Jan 1, 12 UT)
'mjd' is the modified Julian day, JD-2400000, i.e.the first two digits of
the Julian day are dropped; e.g. mjd=51545 is 2000 Jan 1, 12 UT)
'njd' is the new Julian day, JD-2451545, (e.g. njd=0 is 2000 Jan 1, 12 UT)
Specify an epoch:
T = TimeSet(jepoch=jepoch [, /diff])
T = TimeSet(bepoch=bepoch [, /diff])
Specify time as Julian epoch and Besselian epoch. These are typically
specified as double arrays.
String times for specific dates:
T = TimeSet(TT, [T0 , format=format, $
year=year, day=day, hour=hour,minute=minute, sec=sec, msec=msec])
With TT a time in string time representation and T0 a time origin
(see TimeSplit). The string time is converted to a time structure
by a call to TimeSplit (using T0 and 'format'). The additional
keywords are added to the resulting time.
OPTIONAL INPUT PARAMETERS:
/difference if set, initialize a time difference
/stringt if set, a call to TimeString is made, resulting in
the return of a time in string representation.
OUTPUTS:
T array; type: standard time structure or string
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
Carrington, InitVar, IsType, SyncArgs, TimeDay, TimeGet, TimeMonth, TimeOp, TimePieces
TimeShift, TimeSplit, TimeStandardize, TimeString, TimeSystem, TimeUnit, TimeYDate
TimeYDoy, smei_coriolis
CALLED BY:
Carrington, CvSky_Galactic, EarthTransit3DLoc, FUNCTION smeilatest lastorbit
GeographicInfo, GetColors [2], GetColors [3], InSitu, InsituTimeSeries
MessengerOrbit, PlotCurve, PlotEarthSkymap [2], PlotEarthSkymap [3]
PlotEarthSkymap [4], PlotEloTimeMap, PlotPrep, RemoteView_BodyLoc, SkyDriveIn
SkyForecast, Sky_ColorView [1], Sky_ColorView [2], StereoAOrbit, StereoBOrbit
TimeEaster, TimeGST, TimeGet, TimeOp, TimeSplit, TimeString, TimeSystem, TimeXAxis
TimeYDate, TimeYDoy, UlyssesOrbit, allsky [1], allsky [2], allsky [3], allsky_f
ark_duty_cycle, aurora, big_eph, big_orbit, clock, coriolis_map, cv, dusan_earth
fileset_sizes, forecast_cfg, forecast_ice, forecast_info, getipssources
getnagoyasources, getootyasources, getsmeisources, grayburst, gridgen, gridgen1d
haystack_2006, ipv6_packets, ipv6_traffic, jpl_eph, jpl_test, krill_request_stats
laserjet, losgeometry, makemovie [1], makemovie [2], maygeometry, mk_celias
mpc_comets, mpc_eph, mpc_eph_range, mpc_orbit_eph, mpc_packed_date, nagoya_glevel
nso_fe_plot, nso_fe_start, packet_size_update, parseooty, plot_ipv6_fraction
plot_traffic, qEphem_State, qImage_cw_DrawEphem, qImage_cw_Ephem
qImage_cw_Where, qLine_Curve, qRemoteView_ChangeCoordinates
qRemoteView_ChangeTimes, qRemoteView_Time, qView_ApplyGain, qView_GetData
qView_PlotSeries, qView_PlotTrack, qView_Save2File, qView_UpdateTime
qnagoya_pointsources, qnagoya_skymap, run_forecast_insitu, sgp4_eph
sgp4_orbit_axis, sgp4_tle, skyd_cat, skyd_version, smei_base_testcase
smei_buf_get, smei_buf_getframe, smei_buf_prep, smei_buf_splitfile
smei_camera_gain, smei_coriolis, smei_filename, smei_filepath, smei_findpnt
smei_frm_cp, smei_frm_cvhdr, smei_frm_darkfit, smei_frm_drive, smei_frm_eclipse
smei_frm_findpoint, smei_frm_mask, smei_frm_smoothdark, smei_frm_summary
smei_getfile, smei_hdr_c3maskupload, smei_hdr_get, smei_hdr_make, smei_hdr_plot
smei_hdr_update, smei_last_tle, smei_mkbase, smei_mkcal, smei_mkdrives
smei_mkmask, smei_mkorb, smei_mkorb_auto, smei_mksidereal, smei_mksky, smei_normal
smei_orbit_stats, smei_plot_timeseries, smei_property, smei_rewind
smei_sgp4_orbits, smei_sky, smei_sky_atlocation, smei_sky_read, smei_sky_track
smei_star_fit, smei_star_show, smei_star_showsmooth, smei_star_split
smei_star_test, smei_www_skymaps, smei_zld_remove [1], smei_zld_remove [2]
smei_zld_weekly, smeidb_mounted, stardistance, tbad, telescope_sizes, timeposn
tplot, ulysses_passage, usno_eph, view3d, vlist, vu_elotime, vu_header, vu_insitu
vu_insitu_persist, vu_insitu_raw, vu_insitucurve, vu_localskymap, vu_los, vu_movie
vu_nagoyasourcemap, vu_new_time, vu_set_time_entry, vu_thomson_antifish
vu_thomson_hammer, vu_update_hours, vu_vox_draworbit, vu_vox_read, vu_vox_write
vu_weight, wso_read
PROCEDURE:
Messy, but it works
MODIFICATION HISTORY:
SEP-1999, Paul Hick (UCSD/CASS)
AUG-2000, Paul Hick (UCSD/CASS)
Introduced keyword Month, which accepts both integer and character
specifications. This makes keywords iMon (for integer input) and
cMon (for character input) obsolete.
JUL-2003, Paul Hick (UCSD/CASS)
If Doy of Day is specified without a year then the current year is used.
DEC-2003, Paul Hick (UCSD/CASS)
Fixed problem with keyword month. Only types string and integer were
acceptable. Anything else would cause an error. Now if is neither string
nor integer, it is converted to integer by rounding.
JAN-2004, Paul Hick (UCSD/CASS)
Fairly substantial rewrite, converting from the old time structure
with year,doy,h,m,s,msec fields to the new structure with two integer fields.
JUN-2004, Paul Hick (UCSD/CASS)
Added processing of string times. Hopefully this elimates the necessity to
call TimeSplit and TimeString directly.
OCT-2007, Paul Hick (UCSD/CASS)
Added keyword fmtspec (see TimeSplit)
JUL-2009, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
Added keyword /unix
[Previous]
[Next]
NAME:
TimeShift
PURPOSE:
Converts between various possible origins
CATEGORY:
gen/idl/toolbox/time
CALLING SEQUENCE:
u = TimeShift(from_time=from_time, from_d2000=from_d2000, from_jd=from_jd, $
from_mjd=from_mjd, from_njd=from_njd, /to_time, /to_d2000, /to_jd, /to_mjd, /to_njd
INPUTS:
from_time=from_time current origin
from_y200=from_d2000 2000 Jan 1, 0 UT
from_jd=from_jd JD = 0
from_mjd=from_mjd JD = 2400000
from_njd=from_njd 2000 Jan 1, 12 UT
array; type: time structure
times relative to implied origin
/to_time if set return time relative to 2000 Jan 1, 0 UT
/to_d2000
/to_jd
/to_mjd
/to_njd
OUTPUTS:
u array; type: time structure
converted times
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
InitVar, IsType, TimeOp, TimeOrigin
CALLED BY:
TimeGet, TimeSet
PROCEDURE:
MODIFICATION HISTORY:
JAN-2004, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
TimeSplit
PURPOSE:
Convert times from string to numerical
CATEGORY:
gen/idl/toolbox/time
CALLING SEQUENCE:
FUNCTION TimeSplit, TSS, T0, $
template = template , $
format = format , $
rational = rational , $
fmtspec = fmtspec
INPUTS:
TS array; type: string
times in string form
T0 array[1]; type: time structure
time origin
OPTIONAL INPUTS:
format=format
scalar; type: sting; default: none
string template specifying the time format, e.g. 'YEAR/MN/DD hh:mm:ss.mss'
Valid components are:
YEAR for 4-digit year
YY for 2-digit year (converted using TimeFixYear)
DOY for the day of year
MON for 3-char month ('jan')
MN for 2-digit month (01-12)
DD for the day of the month
hh for the hour of the day
mm for the minutes
ss for the seconds
mss for the milliseconds
OUTPUTS:
T array; type: time structure
output times with numerical values for the
seperate components of the time array
If an error occurs then T = -1 is returned.
The function IsTime(T) can be used to check for an
error condition.
OPTIONAL OUTPUTS:
fmtspec=fmtspec
scalar; type: string
if format NOT set: format string used to interpret
the input strings.
if format SET: specfmt is same as input format
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
InitVar, IsType, SyncDims, TagArray, TimeFixYear, TimeGet, TimeOp, TimeSet, TimeUnit
destroyvar, flt_string
CALLED BY:
TimeSet, fileset_sizes
RESTRICTIONS:
The first element of the TS array is used to analyze the exact string format.
This format is used to decompose all string elements in their constituent parts.
Hence, if TS is a string array, all entries must have exactly the same format!!!
PROCEDURE:
The string times in TS do not have to be complete.
Missing parts are taken from the time origin T0
Four types of strings can be entered:
1999:300:00:00:00.000
1999/11/20 00:00:00.000 (YMD format)
SAT JAN 10 00:00:00 1991 (SYS format)
19-NOV-1999 23:48:11.00 (VMS format)
03-23-2000 23:48:11 (SMEI format)
2003_023_234811000 (L1A format)
2003-10-11T23:48:11.000 (ISO-8601 format)
MODIFICATION HISTORY:
AUG-1998, Paul Hick (UCSD/CASS)
NOV-1999, Paul Hick (UCSD/CASS)
Added VMS format, fairly substantial rewrite
APR-2000, Paul Hick (UCSD/CASS)
Added SMEI format '03-23-2000 23:48:11'
MAR-2003, Paul Hick (UCSD/CASS)
Added processing of strings like 2003_175_123456789
OCT-2003, Paul Hick (UCSD/CASS)
Added processing of strings like 2003_10_02_123456789
NOV-2003, Paul Hick (UCSD/CASS)
Added keyword 'template'
JUN-2005, Paul Hick (UCSD/CASS)
Rename keyword 'template' to 'format'.
SEP-2007, Paul Hick (UCSD/CASS)
Added some code to handle ISO-8601 compliant times
OCT-2007, Paul Hick (UCSD/CASS)
Added output format spec keyword 'fmtspec'
DEC-2008, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
Added code to allow input of fractional units in
day of month, hour, minutes, seconds, e.g.
'2003/10/10.5' or '2003/10/10 12.5'
[Previous]
[Next]
NAME:
TimeStandardize
PURPOSE:
Standardize times
CATEGORY:
gen/idl/toolbox/time
CALLING SEQUENCE:
FUNCTION TimeStandardize, t
INPUTS:
t array; type: time structure
times
OUTPUTS:
t array; type: time structure
standardized times
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
TimePieces
CALLED BY:
TimeArray, TimeDay, TimeGet, TimeOp, TimeSet
SIDE EFFECTS:
Uses !TimeUnits.in_day
PROCEDURE:
Makes sure that the fraction of days stored in t.units
is a positive fraction and less than one day.
MODIFICATION HISTORY:
JAN-2004, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
TimeString
PURPOSE:
Converts times intro string form
CATEGORY:
Tell time
CALLING SEQUENCE:
FUNCTION TimeString, TT , $
ydoy = ydoy , $
ymd = ymd , $
sys = sys , $
vms = vms , $
iso8601 = iso8601 , $
_ymd = _ymd , $
_ydoy = _ydoy , $
from = from , $
upto = upto , $
part = part , $
roundt = roundt , $
format = format
INPUTS:
T array; type: time structure
times to be converted to string form
OPTIONAL INPUTS:
/ydoy returns string in form '1999:201:00:00:00.000'
/ymd returns string in form '1999/11/22 00:00:00.000'
/sys if set, a PC-style system string is returned (in uppercase)
/vms if set, a VMS-style system string is returned (in uppercase)
/iso8601 if set, a ISO-8601 compliant format is used:
i.e. 2007-01-01T01:01:01.000
/_ydoy returns string in form 1999_201_000000000'
/_ymd returns string in form 1999_11_22_000000'
part scalar; type: integer
same as specifying 'from' and 'upto' with the same argument
from scalar; type: integer
should be set using the return value of TimeUnit.
If 'format' is NOT set then the time string will start
at the indicated time unit.
If 'format' is SET then 'from' is ignored.
upto scalar; type: integer
should be set using the return value of TimeUnit.
If 'format' is NOT set then the time string will end
indicated time unit. If in addition /roundt is set then
TT is rounded to unit 'upto' before being turned into a string.
If 'format' is SET, and in addition /roundt is set, then
'upto' is used for roundoff only.
format=format
scalar; type: string; default: none
string format specifying the time format, e.g. 'YEAR/MN/DD hh:mm:ss.mss'
The format can combine any of the following sections in any order:
YEAR insert 4-digit year
YY insert 2-digit year
DOY insert day of year
MON insert month as 3-char string ('jan')
MONTH insert full name of month
MN insert month as 2-digit integer (1-12)
DD insert day of month as 2-digit integer
DOW insert day of week as 3-char string ('sat')
hh insert hour of day
mm insert minutes
ss insert seconds
mss,fff insert milliseconds
OUTPUTS:
R array; type: string
times in string form
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
InitVar, IsType, SyncDims, TimeGet, TimeMonth, TimeSet, TimeUnit
CALLED BY:
GetColors [2], GetColors [3], PlotEarthSkymap [2], PlotEarthSkymap [3]
PlotEarthSkymap [4], Sky_ColorView [1], Sky_ColorView [2], TimeGet, TimeSet
allsky [1], allsky [2], allsky [3], grayburst, ipsv [1], ipsv [2], ipsv [3]
krill_request_bars, parseooty, vu_thomson_antifish, vu_thomson_fisheye
vu_thomson_hammer
SEE ALSO:
TimeSplit
SIDE EFFECTS:
An earlier version of TimeString did not have the 'roundt' keyword.
It would always round when upto was set to units of hours or smaller,
and not round for units of years or days.
PROCEDURE:
If 'format' is NOT set the following formats are supported:
YDOY format: '0000:000:00:00:00.000' (default)
YMD format: '0000/00/00 00:00:00.000'
SYS format: 'SAT JAN 10 00:00:00 1991'
VMS format: '19-NOV-1999 23:48:11.00'
_YDOY format: '0000_000_000000000'
_YMD format: '0000_00_00_000000000'
The 'format' keyword obviously is a more transparent way of setting
a specific time format. The only reason to use one of the specific
formats above is the 'from' keyword, which is not implemented (yet??)
for the 'format' keyword (other than explicitly mutilating the
'format' itself).
MODIFICATION HISTORY:
AUG-1998, Paul Hick (UCSD/CASS)
NOV-1999, Paul Hick (UCSD/CASS)
Added VMS keyword
MAR-2003, Paul Hick (UCSD/CASS)
Added /fsys keyword
OCT-2003, Paul Hick (UCSD/CASS)
Renamed /fsys to /_ydoy. Added /_ymd.
NOV-2003, Paul Hick (UCSD/CASS)
Added keyword 'template'.
JAN-2003, Paul Hick (UCSD/CASS)
Removed /fsys keyword.
Added keyword /roundt. Rounding was automatic for 'upto' units
of hours or smaller. Rounding needs to be specified explicitly
for all units now.
OCT-2004, Paul Hick (UCSD/CASS)
Fixed bug in processing of seconds and msec. If the template
contained 'hhmmss' to represent hour, minute, seconds then the
trailing 'mss' would be interpreted as millisecond. This is fixed
by clearing portion of the template after they have been used.
JUN-2005, Paul Hick (UCSD/CASS)
Changed 'template' keyword to 'format'. 'template' is still supported
(for now).
JUL-2007, Paul Hick (UCSD/CASS)
Removed keyword 'template'
SEP-2007, Paul Hick (UCSD/CASS)
Added keyword /iso8601 to make string in ISO8601-compliant form
APR-2011, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
Added option to use 'month' in format to be substituted by
full name of month (e.g. 'January' instead of 'JAN')
[Previous]
[Next]
NAME:
TimeSystem
PURPOSE:
Convert system time to UT
CATEGORY:
Time
CALLING SEQUENCE:
ut = TimeSystem(local2ut)
INPUTS:
local2ut scalar; type:integer; default: 0
offset between local time and UT
OPTIONAL INPUT PARAMETERS:
/utc (this keyword was introduced in IDL 5.4)
passed to the IDL function systime
If this keyword is set then systime already
returns UT. If /utc is used then local2ut should
be set to zero.
OUTPUTS:
ut scalar; type: time structure
current universal time
INCLUDE:
@compile_opt.pro ; Return to caller
CALLS: ***
InitVar, IsType, TimeGet, TimeOp, TimeSet
CALLED BY:
RemoteView_FOV, RemoteView_Init_Matrix, RemoteView_Init_View, TimeSet, big_eph
coriolis_map, even_light, forecast, forecast_html, forecast_ice, forecast_movie
krill_request_bars, krill_request_stats, mk_celias, qEphem, qRemoteView, qnagoya
run_map, sgp4_orbit_axis, smei_buf, smei_findpnt, smei_frm_summary, smei_getfile
smei_hdr_plot, smei_hdr_update, smei_mkcal, smei_mksky, smei_orbit_stats
smei_star_remove, smei_star_writepnt, smei_www_skymaps, smei_zld_remove [1]
smei_zld_remove [2], smei_zldsky, stopwatch, tbad, vu_write, www_help_tree
PROCEDURE:
The system time is retrieved using the IDL systime function,
and is assumed to set to the local time.
UT is calculated by adding 'local2ut' hours to the system time.
Note that this means that local2ut=0 simply returns the system time.
MODIFICATION HISTORY:
NOV-1999, Paul Hick (UCSD/CASS)
JUL-2002, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
Fixed version problem reported by Dick Altrock.
Embedded the 'systime' call containing the /utc keyword inside
a 'call_function' call to avoid compilation problems on
pre-5.4 versions of IDL.
[Previous]
[Next]
NAME:
TimeUnit
PURPOSE:
Provides information about time units used in time structures
CATEGORY:
Tell time
CALLING SEQUENCE:
FUNCTION TimeUnit, tunit, $
nextup = nextup , $
mmsec = mmsec , $
all = all , $
years = years , $
yrs = yrs , $
days = days , $
hours = hours , $
hrs = hrs , $
minutes = minutes , $
seconds = seconds , $
mseconds= mseconds
T = TimeUnit( [/all,/years,/days,/hours,/minutes,/seconds,/mseconds])
T = TimeUnit(/NextUp,[/all,/years,/days,/hours,/minutes,/seconds,/mseconds])
T = TimeUnit(/msec ,[/all,/years,/days,/hours,/minutes,/seconds,/mseconds])
INPUTS:
tunit scalar; type: integer
if tunit exist the corresponding name for the unit of time
is returned (tag name of time structure, i.e. Y,M,D,H,M,S,MS)
OPTIONAL INPUT PARAMETERS:
/years,/days,/hours,/minutes,/seconds,/mseconds
sets time unit for which information is needed (set only one at a time)
/all returns information for all time units
If /all is not set and no time unit keyword is set, then /day is assumed
/nextup return the number of units in the next larger time unit
e.g. if /hours is set the value is 24 (24 hours in a day)
/mmsec returns number of mseconds (smallest time unit) in time unit
e.g. if /hours is set the value is 60*60*100=3600000
If neither /nextup nor /mmsec is set the position of the time unit tag in the
structure is returned.
OUTPUTS:
T scalar, if one of the time unit keywords is set.
array[7] if /all is set
The array is a long integer array if tag numbers are returned;
or double precision if /nextup or /mmsec are used
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
InitVar, IsType
CALLED BY:
AngleUnits, Carrington, CvSky_HEEQ, CvSky_Heliographic, CvSky_IHG
EarthTransit3DLoc, GeographicInfo, GetColors [2], GetColors [3], InSitu
InsituTimeSeries, IsBadTime, PA_Pole, PlotCoronagraph, PlotEarthSkymap [1]
PlotEarthSkymap [2], PlotEarthSkymap [3], PlotEarthSkymap [4], PlotPolarSkymap
PlotSynopticMap, RemoteView_CMEDensity, RemoteView_Display2D
RemoteView_Display3D, RemoteView_FOV, RemoteView_Init_FOV, TimeEaster, TimeGST
TimeGet, TimeInterpol, TimeLInterpol, TimeLimits, TimeOp, TimeSet, TimeSplit
TimeString, TimeXAxis, allsky [1], allsky [2], allsky [3], ark_duty_cycle, aurora
big_orbit, coriolis_map, dusan_earth, even_light, fileset_sizes, forecast
forecast_cfg, forecast_info, forecast_movie, getipssources, getnagoyasources
getootyasources, getsmeisources, grayburst, gridgen, gridgen1d, img_read
ipv6_packets, jpl_eph, jpl_test, krill_request_bars, krill_request_stats, laserjet
lsqLinearFit, makemovie [1], makemovie [2], maygeometry, mk_celias, mpc_eph
mpc_eph_range, nagoya_glevel, orb_comp, plot_ipv6_fraction, plot_traffic, qEphem
qImage_cw_DrawEphem, qLine_Curve, qLine_FitPlot, qRemoteView, qView_Save2File
qView_UpdateTime, qnagoya, qnagoya_pointsources, qnew_2007_013
run_forecast_insitu, run_map, sgp4_eph, sgp4_orbit_axis, sgp4_tle, skyd_cat
skyd_version, smei_base_testcase, smei_buf, smei_buf_get, smei_buf_getframe
smei_buf_prep, smei_buf_read, smei_camera_gain, smei_filename, smei_filepath
smei_frm_base, smei_frm_cp, smei_frm_cvhdr, smei_frm_darkfit, smei_frm_eclipse
smei_frm_findpoint, smei_frm_hbar, smei_frm_info, smei_frm_read
smei_frm_smoothdark, smei_frm_summary, smei_frm_track, smei_getfile
smei_hdr_c3maskupload, smei_hdr_get, smei_hdr_make, smei_hdr_plot
smei_hdr_update, smei_mkbase, smei_mkcal, smei_mkcal_auto, smei_mkdrives
smei_mkmask, smei_mkorb, smei_mkorb_auto, smei_mksidereal, smei_mksky, smei_normal
smei_orbit_stats, smei_plot_timeseries, smei_rewind, smei_sgp4_orbits
smei_shutterwrong, smei_sky_atlocation, smei_sky_getmask, smei_sky_track
smei_star_fit, smei_star_remove, smei_star_show, smei_star_showsmooth
smei_star_split, smei_star_test, smei_www_skymaps, smei_zld_remove [1]
smei_zld_remove [2], smei_zld_weekly, stopwatch, tbad, telescope_sizes, view3d
vu_atlocation, vu_coronagraph, vu_earthskymap, vu_elotime, vu_get_page, vu_getdata
vu_gettime, vu_header, vu_image, vu_insitu, vu_insitu_persist, vu_insitu_raw
vu_insitucurve, vu_is_sequence, vu_linecut, vu_lineofsight, vu_localskymap
vu_mean, vu_movie, vu_new_time, vu_planarcut, vu_radialcut, vu_remoteview, vu_select
vu_solardisk, vu_spherecut, vu_stereoview, vu_synopticmap, vu_thomson_antifish
vu_thomson_fisheye, vu_thomson_hammer, vu_timeseries, vu_update_hours
vu_update_marker, vu_vox_write, vu_weight, vu_whatis, vu_write, wso_read
www_help_tree
PROCEDURE:
MODIFICATION HISTORY:
SEP-1998, Paul Hick (UCSD/CASS)
OCT-1998, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
Added tunit argument
[Previous]
[Next]
NAME:
TimeXAxis
PURPOSE:
Plot horizontal time axis
CATEGORY:
Plotting
CALLING SEQUENCE:
PRO TimeXAxis, TR, unit, $
t0 = T0 , $
same_T0 = same_T0 , $
exact = exact , $
noxtitle= noxtitle , $
yrxtitle= yrxtitle , $
tick_get= tick_get , $
axis_only=axis_only , $
xaxis = xaxis , $
starttime=starttime , $
nmajor = nmajor , $
from = from , $
upto = upto , $
trim = trim , $
xminor = xminor , $
xtickn = xtickn , $
xtickv = xtickv , $
xstyle = xstyle , $
ydoy = ydoy , $
_ydoy = _ydoy , $
_extra = _extra ;, title=title
INPUT PARAMETERS:
TR array; type: float or time structure
(must have at least two elements)
Defines range of times to be plotted
If TR is a float array then TR is a time relative to the
time origin T0 in units of 'unit'.
If T0 is not specified then TR MUST be an array
of time structures (T0 will be set internally using TR)
Only min(TR) and max(TR) are used.
Unit scalar; type: integer; default: TimeUnit(/days)
Determines the units of TR (if TR is a float array)
Use function TimeUnit to specify unit
Graphics keywords to the PLOT command are used using the _extra mechanism.
OPTIONAL INPUT PARAMETERS:
t0=T0 scalar; type: time structure
Time origin. MUST be set if TR is specified as a float array
/same_T0
if set then the time origin from a previous call to TimeXAxis
is used. If there is no origin available then the keyword is
ignored. If there is an origin available then this keyword
overrides the t0 keyword.
/exact forces time axis to cover exactly min(TR) to max(TR)
/noxtitle
suppress title for time axis
title=title NOT TRUE
title for time axis. If omitted and /noxtitle is not set then
the title is time at the start of the time axis is used as title.
from, upto
if set these keywords determine which time units are used in
the axis labels.
/axis_only
by default, the IDL plot procedure with the /nodata keyword
is used to plot the axis. If /axis_only is used then the
IDL axis procedure is used.
nmajor=nmajor
# of major tickmarks on time axis.
xstyle=xstyle
IDL xstyle keyword, but MUST be an even number
(internally 1 is added; keyword /exact controls whether
the time axis is exact or not)
/ydoy plot DOY along x-axis instead of Month/Day of Month
Usually the labels are calculated internally from the specified time array.
Override this by explicitly setting the xtickv keyword (and, optional,
the xtickn keyword:
xtickv=xtickv
xtickn=xtickv
OPTIONAL OUTPUT PARAMETERS:
starttime=starttime
scalar; type: string
time at beginning of time axis.
tick_get=tick_get
array; type: float
tickmark labels used (i.e. value of keyword xtickv
on IDL plot or axis procedures)
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLED BY:
InSitu, PlotCurve, PlotEloTimeMap, PlotPrep, PlotSynopticMap, ark_duty_cycle
fileset_sizes, jpl_test, laserjet, qLine_Curve, smei_frm_summary, smei_hdr_plot
telescope_sizes, vu_insitucurve
COMMON BLOCKS:
common TimeScale, torigin, trange, tunit, texact
CALLS: ***
InitVar, IsTime, IsType, REVERSE, TimeGet, TimeLimits, TimeOp, TimeRound, TimeScale
TimeSet, TimeUnit, UNIQ, destroyvar, gridgen
PROCEDURE:
The common block stores the time origin (as a time structure) and the
time units used to generate the time axis. These are used by PlotCurve
to plot data points if the first argument to PlotCurve is a time
structure.
MODIFICATION HISTORY:
MAY-1991, Paul Hick (ARC)
Cribbed from the UTPLOT package
SEP-1998, Paul Hick (UCSD/CASS)
Introduced time structures
JAN-2001, Paul Hick (UCSD/CASS)
Renamed from TimeAxis to TimeXAxis to avoid conflict in SSW
MAY-2007, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
Added /ydoy keyword
[Previous]
[Next]
NAME:
TimeYDate
PURPOSE:
Gets day of year from year, month day, or gets month and
day from year and day of year
CATEGORY:
gen/idl/toolbox/time
CALLING SEQUENCE:
PRO TimeYDate, yr, month, day, doy, get_date=get_date, julian=julian, jul2greg=jul2greg
INPUTS:
yr scalar or array; type: integer
year
/get_date NOT set:
month scalar or array; type: integer or string
month as integer in 1-12 or strings of type
'JAN','FEB', etc. (case-insensitive)
day scalar or array; type: any
day of month, possibly including a fraction for
the time of day.
/get_date SET:
doy scalar or array; type: any
day of year, possibly including a fraction for
the time of day.
OPTIONAL INPUT PARAMETERS:
/get_date by default, yr, month and day are assumed to be input
and the doy is returned. If /get_date is set then
yr and doy are input and month and day are output.
/julian interpret yr,doy and yr,mon,day as dates in Julian calendar
/jul2greg
jul2greg=jul2greg
array[1]; type: time structure
time at which the transition from Julian to Gregorian
calendar is made.
/jul2greg is the same as jul2greg=TimeSet(yr=1582, mon='oct', day=15)
OUTPUTS:
/get_date set:
month scalar or array; type: integer or string
month as integer in 1-12
(use TimeMonth to get 3-char strings)
day scalar or array; type: same as input doy
day of month, with the fraction from the input
doy added (if present)
/get_date NOT set:
doy scalar or array; type: same as input day
day of year, with the fraction from the input
day added (if present).
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLED BY:
TimeGet, TimeSet
SIDE EFFECTS:
yr is converted to integer if it isn't already. None of the
other input variables are modified.
CALLS: ***
InitVar, IsTime, IsType, SyncArgs, TimeGet, TimeMonth, TimeSet, TimeYDoy
PROCEDURE:
For the input arguments combinations of scalars and arrays are permitted.
If integer day and doy are used the conversion is exact. For floating input
the fraction is moved from day to doy or v.v., i.e. it is not exact.
The relation between yr,month,day and yr,doy depends only on
whether yr is a leap year or not.
Two calendar schemes are implemented. In the Julian calendar
(/julian SET) every multiple of 4 is a leap year. In the Gregrorian
calendar (/julian NOT set) every multiple of 4 is a leap year, except
when the year is a centennial year that is not a multiple of 400
(i.e. 1700, 1800, 1900 are not leap years, but 1600 and 2000 are),.
See also documentation of TimeYDoy
MODIFICATION HISTORY:
JAN-2004, Paul Hick (UCSD/CASS)
JUL-2008, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
If /get_date NOT set (and yr, month, day are input), and
month is integer, outside the range 1-12, then month is now
mapped back into the range 1-12 and yr is increased/decreased
accordingly. This is used in TimeGet when the /eomonth
(end of month) keyword is set to bridge into the next year.
[Previous]
[Next]
NAME:
TimeYDoy
PURPOSE:
Converts date in yr, doy to number of days elapsed
since 2000 Jan 1, 0 UT and v.v.
CATEGORY:
gen/idl/toolbox/time
CALLING SEQUENCE:
PRO TimeYDoy, yr, doy, day, get_date=get_date, julian=julian, jul2greg=jul2greg
INPUTS:
/get_date NOT set:
yr scalar or array; type: integer
year
doy scalar or array; type: any
day of year, possibly including a fraction for
the time of day.
/get_date SET:
day scalar or array: type: any
number of days elapsed since 2000 Jan 1, UT (Gregorian)
possibly including a fraction for the time of day.
Use TimeShift(d2000=TimeSet(day=day), /to_time) to convert
to a time structure (relative to current origin).
OPTIONAL INPUT PARAMETERS:
/get_date by default the number of days elapsed is calculated from
the date. If /get_date is set than the date is obtained
from the number of days elapsed since 2000 Jan 1, 0 UT.
(Gregorian).
/julian interpret yr, doy as date in Julian calendar
/jul2greg
jul2greg=jul2greg
array[1]; type: time structure
time at which the transition from Julian to Gregorian
calendar is made.
/jul2greg is the same as jul2greg=TimeSet(yr=1582, mon='oct', day=15)
OUTPUTS:
/get_date NOT set:
day scalar or array: type: double
number of days elapsed since 200 Jan 1, UT (Gregorian).
the fraction of day is copied from the input day of year
(if present)
/get_date SET:
yr scalar or array; type: integer
year
doy scalar or array; type: same as input 'day'
day of year, the fraction of day is copied from the
input day (if present)
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
InitVar, IsTime, IsType, TimeGet, TimeSet
CALLED BY:
TimeGet, TimeSet, TimeYDate
SIDE EFFECTS:
If /get_date NOT set then yr is converted to integer if it isn't already.
PROCEDURE:
The date yr,doy is a Julian date (if /julian SET) or a Gregorian date
(/julian NOT set). 'day' always is # days since 2000 Jan 1.0 (Gregorian)
i.e. Julian days minus 2451544.5
JD = 2451557.5 = 2000 Jan 14.0 (Gregorian) = 2000 Jan 1.0 (Julian)
JD = 2451544.5 = 2000 Jan 1.0 (Gregorian)
JD = 2299160.5 = 1582 Oct 15.0 (Gregorian) = 1582 Oct 5.0 (Julian)
(= -152384.0 days from 2000 Jan 1.0, Gregorian)
JD = 2361221.5 = 1752 Sep 14.0 (Gregorian) = 1752 Sep 3.0 (Julian)
The keyword jul2greg can be used to automatically switch from
Julian to Gregorian calendar. In general jul2greg is defined as
a UT standard time structure. If specified as keyword /jul2greg
then the time 1582 Oct 15.0 (Gregorian is used). The gap between
calendars at that time was 10 days.
Another useful transition would be 1752 Sep 14.0 (Gregorian).
The Britisch empire switched from 1752, Sep 2 to 1752 Sep 14
(11 day gap; the extra day comes from the year 1700 which is a leap
year in the Julian calendar but not in the Gregorian calendar).
MODIFICATION HISTORY:
JAN-2004, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
TMO_skymotion
PURPOSE:
Corrects positions on CCD for skymotion during transit
CATEGORY:
SMEI prototype camera: TMO
CALLING SEQUENCE:
rr_out = TMO_skymotion(rr [, p_axis, frame, /degrees, to_zenith=to_zenith, $
fov=fov, vv=vv, plotx=plotx
INPUTS:
rr array[2,n]; type: float
positions on ccd as pairs off azimuthal angle (along long
dimension of fov), and radius
p_axis array[2]; type: float; default: [0,0]
position of optical axis on ccd: azimuthal angle and radius
Currently only p_axis[0] is used.
frame array[m]; type: any; default: 1
list of frame numbers (see PROCEDURE)
OPTIONAL INPUT PARAMETERS:
/south if set, the south position (19.5 south of zenith) is assumed
/north if set, the north position (10.0 north of zenith) is assumed
/degrees if set, all angles are in degrees (default: radians)
/plotx plot results
OUTPUTS:
rr_out array[2,n,m]; type: float
positions rr, corrected for motion across the sky
OPTIONAL OUTPUT PARAMETERS:
fov=fov array[*]; CCD azimuth angle (-30,..,+30) of points along
long dimension of fov
vv=vv array[*]; type: float
skymotion at positions 'fov' in pixels/minute
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLED BY:
SMEI_cr_removal, TMO_tracksky
RESTRICTIONS:
No check is made whether the locations rr are actually inside the fov
CALLS: ***
BadValue, INTERPOL, InitVar, MEAN, SubArray, SuperArray, SyncDims, ToRadians, gridgen
PROCEDURE:
> The SMEI fov is assumed to be along the local meridian
> The motion of stars during transit are calculated in pixels/minute
under the assumption that the 3 degree fov is covered by 27.16 pixels, and
that the geographic latitude of TMO is 34.382 degree.
> The 'frame' array is used to define the time axis in units of minutes.
(TMO data were taken at a 1 minute cadence). Usually 'frame' will be an
integer array of frame numbers, but the effective cadence time can be adjusted
by multiplication of the 'frame' array with the cadence time in minutes.
> For each location 'rr' on the CCD inside the fov, the corrected position is
the position of 'rr' after a time 'frame' minutes has elapsed.
> Only the radial component r[1,*] is corrected, i.e. stars are assumed to
transit on the CCD in the radial direction.
MODIFICATION HISTORY:
JUL-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
TMO_tracksky
PURPOSE:
CATEGORY:
SMEI prototype camera: TMO
CALLING SEQUENCE:
INPUTS:
box array[2,2]; type: integer; default: defined in smei_camera
defines two corners of box in the form [ [x1,y1], [x2,y2] ]
relative to the lowerleft corner of a full image
The box contains nx by ny pixels (nx=x2-x1+1, ny=y2-y1+1)
OPTIONAL INPUT PARAMETERS:
center=center array[2]; type: float; default: defined in smei_camera
'center' must be defined relative to the same origin as 'box'
p_axis=p_axis array[2]; type: float; default: defined in smei_camera
frame=frame array[m]; type: integer; default: 1
/plotx
OUTPUTS:
rfov array[2,nx,ny,m]; type: float
rectangular coordinates of all pixels in box corrected for skymotion
relative to the same origin as 'box' and 'center'
OPTIONAL OUTPUT PARAMETERS:
pfov array[2,nx,ny,m]; type: float
polar coordinates of all pixels in box corrected for skymotion
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
BadValue, CV_COORD, Inside_Wedge, SuperArray, TMO_skymotion, gridgen, smei_camera
view
CALLED BY:
qView_TMO_tracksky
PROCEDURE:
For each of the pixels in 'box' the position in each frame is calculated after
correcting it for skymotion.
MODIFICATION HISTORY:
JULY-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
ToDegrees
PURPOSE:
Get conversion factor needed to convert angles to degrees,
depending on setting of keyword Degrees
CATEGORY:
Number strangling
CALLING SEQUENCE:
degrees_per_mystery_unit = ToRadians(degrees=Degrees)
OPTIONAL INPUT PARAMETERS:
/degrees indicates whether input angles are in
radians (not set) or degrees (set)
OUTPUTS:
degrees_per_mystery_unit
= !radeg if Degrees not set
= 1.0 if Degrees set
Result is returned in double precision
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLED BY:
AngleUnits, ColorEloTimeBox, ColorPolarBox, ColorSkybox, CvSky, CvSky_Equatorial
CvSky_GSM, CvSky_Geographic, CvSky_HEEQ, CvSky_Heliographic, CvSky_IHG
CvSky_Precess, CvSky_Solar_EloPa, GetColors [2], GetColors [3], HOSOrbit
MessengerOrbit, PlotCoronagraph, PlotEarthSkymap [1], PlotEarthSkymap [2]
PlotEarthSkymap [3], PlotEarthSkymap [4], PlotEloTimeMap, PlotPolarSkymap
PlotSphereCut, PlotSynopticMap, StereoAOrbit, StereoBOrbit, TimeGST, UlyssesOrbit
allsky [1], allsky [2], allsky [3], cvsmei, cvsmei_init, eclipsed_area, forecast_cfg
getipssources, getnagoyasources, getootyasources, getsmeisources, jpl_test
mpc_comets, mpc_minor_planets, ra_fictitious_sun, smei_camera, smei_ccd2sky
smei_frm_where, smei_sky, smei_sky2ccd, smei_sky_cleanedge_fov
smei_sky_hdr2range, smei_sky_read, smei_sky_track, smei_star_fit
smei_star_standard, smei_star_stdmaps, smei_zld_dumbbell, smei_zld_weekly
smei_zldsky, sphere_smooth, vu_coronagraph, vu_elotime, vu_extract, vu_get
vu_linecut, vu_planarcut, vu_point_source, vu_set, vu_stereoview
vu_thomson_antifish, vu_thomson_hammer
SEE ALSO:
ToRadians
PROCEDURE:
Many procedures which process angles allow the keyword /Degrees
to indicate that the input and/or output angles are in degrees,
rather than the default radians. This function returns the
conversion factor required to convert to radians. Usually
this function is used at the beginning of the procedure to convert
all angles from the input units to radians, and at the end to convert
back from radians to the input units.
MODIFICATION HISTORY:
SEP-2001, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
tolowcase
CALLING SEQUENCE:
PRO tolowcase, filter, version=version, _extra=_extra
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
CheckDir, FindAllFiles, GetFileSpec, InitVar, SetFileSpec, do_file
[Previous]
[Next]
NAME:
tomography_sp
CALLING SEQUENCE:
PRO tomography_sp, figure
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
CV_COORD, InitVar, REVERSE, gridgen, plot3darc, plot3dline, setup3d, twin, view
[Previous]
[Next]
NAME:
tomographyfig
CALLING SEQUENCE:
pro tomographyfig, figure
INCLUDE:
@compile_opt.pro
CALLS: ***
twin
[Previous]
[Next]
NAME:
ToRadians
PURPOSE:
Get conversion factor needed to convert angles to radians,
depending on setting of keyword Degrees
CATEGORY:
Number strangling
CALLING SEQUENCE:
radians_per_mystery_unit = ToRadians(degrees=Degrees)
OPTIONAL INPUT PARAMETERS:
/degrees indicates whether input angles are in
radians (not set) or degrees (set)
OUTPUTS:
radians_per_mystery_unit
= 1.0 if Degrees not set
= 1.0/!radeg if Degrees set
Results is double precision
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLED BY:
AngleRange, Carrington, ColorEloTimeBox, ColorPolarBox, ColorSkybox, CvPointOnLos
CvRotation, CvSky_GSM, CvT3d, Distance2Sun, EarthSky3DLoc, EarthTransit3DLoc
EulerRotate, FishEye, FitKeplerOrbit, GeographicInfo, GetColors [2], GetColors [3]
HammerAitoff, IPS_velocity, InterpolateHeliosphere, KeplerOrbit, NewcombSun
PA_Pole, PlotCoronagraph, PlotEarthSkymap [1], PlotEarthSkymap [2]
PlotEarthSkymap [3], PlotEarthSkymap [4], PlotEloTimeMap, PlotPolarSkymap
PlotSphereCut, PlotSynopticMap, RemoteView_BodySize, RemoteView_CMEDensity
RemoteView_FovTilt, RemoteView_Init_Matrix, RemoteView_Init_View
RemoteView_StereoStates, RemoteView_ZEclipticPlane, RotationMeasure
TMO_skymotion, ThomsonBrightness, ThomsonLOSFar, ThomsonLOSRomb, ThomsonLOSStep
ThomsonMidpoint, ThomsonMidpointFar, ThomsonRadialFilter, allsky [1], allsky [2]
allsky [3], allsky_f, aurora, coriolis_map, cvsmei, eclipsed_area, flat_centerofmass
ipv6_packets, jpl_mag, jpl_phase, jpl_sizeofsun, lospos, maygeometry, plot3darc
plot_ipv6_fraction, plot_traffic, refine_pointing, smei_cam2angle, smei_camera
smei_ccd2sky, smei_frm_where, smei_sky, smei_sky2cam, smei_sky2ccd
smei_sky_cleanedge_fov, smei_sky_read, smei_sky_track, smei_star_corepsf
smei_star_fit, smei_star_stdmaps, smei_zld_dumbbell, smei_zld_model, smei_zldsky
sphere_distance, sphere_great_arc, sphere_smooth, thomsonfig, vu_coronagraph
vu_elotime, vu_lineofsight, vu_remoteview, vu_solardisk, vu_spherecut
vu_synopticmap, vu_thomson_antifish, vu_thomson_hammer, wedge_bounding_box
SEE ALSO:
ToDegrees
PROCEDURE:
Many procedures which process angles allow the keyword /Degrees
to indicate that the input and/or output angles are in degrees,
rather than the default radians. This function returns the
conversion factor required to convert to radians. Usually
this function is used at the beginning of the procedure to convert
all angles from the input units to radians, and at the end to convert
back from radians to the input units.
MODIFICATION HISTORY:
JAN-1998, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
ToSolarRadii
PURPOSE:
Returns factor needed to convert distance to solar radii
CATEGORY:
Thomson scattering
CALLING SEQUENCE:
FUNCTION ToSolarRadii, au=au
OPTIONAL INPUT PARAMETERS:
au=au if not set then rpau=1 is returned
if set then the number of au per solar radii is returned
OUTPUTS:
Result multiplicative factor to convert to solar radii
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
InitVar
CALLED BY:
ThomsonElectron, ThomsonElectronFar, ThomsonLOSFar, ThomsonLOSRomb
ThomsonLOSStep, ThomsonMidpoint
PROCEDURE:
Many of the Thomson scattering procedures have a keyword /au to indicate
that in- and output distances are in AU rather than the default units of
solar radii. This function provides the conversion factor needed to
convert to solar radii irrespective of the setting of keyword /au.
MODIFICATION HISTORY:
FEB-2002, Paul Hick (UCSD/CASS; pphick@ucsd.edu
[Previous]
[Next]
NAME:
tplot
CALLING SEQUENCE:
PRO tplot
INCLUDE:
@compile_opt.pro
CALLS: ***
IsType, TimeGet, TimeSet, smei_hdr_get, smei_hdr_update
[Previous]
[Next]
NAME:
tryg
CALLING SEQUENCE:
pro tryg, ggg=ggg , vvv=vvv
INCLUDE:
@compile_opt.pro
CALLS: ***
CORRELATE, NORMALFIT, WhatIs, bargraph, flt_string, twin
[Previous]
[Next]
NAME:
trypleiades
CALLING SEQUENCE:
pro trypleiades, pedimg
INCLUDE:
@compile_opt.pro
CALLS: ***
ArrayLocation, FILEPATH, Find2DGlitch, FindStars, SuperArray, WhatIs, bin_read, twin
view
[Previous]
[Next]
NAME:
twin
PURPOSE:
'TEK': Switch between alphanumeric and graphics screen
'X': Hide or show graphics window
'REGIS': Nothing
CALLING SEQUENCE:
PRO twin, mode, $
hide = hidewin, $
show = showwin, $
reset = reset, $
tl = topleft, $
tr = topright, $
br = bottomright, $
bl = bottomleft, $
center = center, $
cl = centerleft, $
tc = topcenter, $
cr = centerright, $
bc = bottomcenter, $
winnr = winnr, $
newwin = newwin, $
delete = delete, $
allwin = allwin, $
copywin = copywin, $
stackwin = stackwin, $
title = win_title, $
quarterscreen = QuarterScreen, $
onethirdscreen = OneThirdScreen,$
xsize = win_xsize, $
ysize = win_ysize, $
xysize = win_xysize, $
aspectratio = aspectratio, $
infowin = infowin, $
winmodes = winmodes, $
windex = windex, $
winwall = winwall, $
nocoordinates = nocoordinates,$
wallpaper = WallPaper, $
scream = scream
OPTIONAL INPUT:
mode 1 = restore graphics screen
2 = restore alphanumeric screen
if omitted the procedure works as a switch between both screens
In X-windows only:
The following keywords are used only when a window is created (in the
first call to Twin for the window):
/hide show window (equivalent of mode=2)
/show hide window (equivalent of mode=1)
title=title
if set and non-zero, used as title for window
xsize=xsize
horizontal window size
ysize=ysize
vertical window size
/quarter_screen
defines a window size of one quarterscreen (half screen
high/wide) (i.e. /tl,/tr,/bl,/br windows would fill up screen)
/onethird_screen
defines a window size of one-third screen high/wide
(i.e. all nine windows together would fill up screen)
/nocoordinates
by default, every time a 'show' is executed, the data
coordinates are set equal to device coordinates for the new
active window (!x.s and !y.s are modified directly).
If the /nocoordinates keyword !x and !y remain unchanged.
Keywords for selection of windows (if keyword WallPaper is NOT set):
/tl manipulates window in top-left corner
/tr manipulates window in top-right corner
/br manipulates window in bottom-right corner
/bl manipulates window in botton-left corner
/c manipulates window in center of screen
/cl manipulates window at center-left of screen
/tc manipulates window at top-center of screen
/cr manipulates window at center-right of screen
/bc manipulates window at bottom-center of screen
/newwin the next unused window is opened (ignored if /stackwin is used)
the position of the new window is topleft for /tl, etc.
/stackwin
same as newwin, but tries to stack the windows side by side
(left to right and top to bottom)
winnr=winnr
array of integers in the range [0,8], corresponding to the
windows /tl,/tr,..,etc.
The above window selection keywords work accumulative. E.g. the command
twin,/new,/tl,winnr=winnr
will manipulate the topleft window, plus the `winnr' windows, and it
will create the next available unused window.
/allwin selects all existing windows; or, if no windows exist yet,
selects all nine windows. /allwin is ignored if one of the
above keywords for window selection is used.
If none of the above keywords is used for selection, then the active
window is used (if it is one of the nine TWIN windows).
If there is no active window, then the first window is used.
/delete the specified window(s) is deleted
if both xsize and ysize are specified the window is deleted
only if the specified values differ from the window dimensions;
To find out whether or not the window has been deleted,
check the return value of DELETE (=0 if the window was not
deleted; =1 if the window was deleted)
Keywords for WallPaper option:
/wallpaper
fill up screen with small windows side by side until screen
is full
/wallpaper,/delete
delete all windows created with previous /wallpaper call
/wallpaper,show=number
makes panel `number' the active window and establishes
data coordinates which are identical to device coordinates.
OPTIONAL OUTPUT: (only if keyword DELETE is used)
delete = 0: No window deleted, =1: window deleted
windex
winmodes
CALLS: ***
InitVar, IsDisplay, IsType, IsWindowSystem, wvalid
CALLED BY:
FindStars, PRO test_magnify, RemoteView_Display2D, RemoteView_Display3D
RemoteView_PlotVertices, brachistochrone, cvplot_figures, even_light
even_light_corrections, even_light_figures, even_light_info
even_light_photometry, even_light_plot, even_light_registration, fan_plot, fancy
get_page, ipsv [1], ipsv [2], ipsv [3], jpl_test, los_weight, losgeometry, miscfig
nagoya_glevel, projfig, qView_Wall, qimage_fig, set_page, smei_star_fit, smeifig
square_on_sky, ss_map, test_dumbbell, testnic, thomsonfig, tomography_sp
tomographyfig, tryg, trypleiades, view
PROCEDURE:
> 'TEK': Print escape sequences ("<ESC>[0/w" and "<ESC)[2/w") as given
on page 20.2 of the HDS programmers manual
> 'X': Calls to wset and wshow
> Windows are created with backing store enabled.
> The number in the window title is the TWIN number (0,..,8; which can
be used in the 'winnr' keyword), or, if the wallpaper option is used,
it's the panel number (0,..; which can be used in the /show keyword
to set the active panel window).
INCLUDE:
@compile_opt.pro ; On error, return to caller
COMMON BLOCKS:
common save_twin, old_mode,nr_window,xs_window,ys_window,nwall,xwall,ywall,nr_wall,ti_window
WARNING:
> The title of the window contains a number which is NOT THE IDL WINDOW ID
(!D.WINDOW). Every time a `wset' is executed the new !D.WINDOW value
is printed in the text window.
> In the first call to TWIN or during a /reset all existing windows are
nuked (including windows not created by TWIN).
> If TWIN encounters an active window not created by TWIN, the active
window is assimilated (and is treated as a TWIN window in following
calls to TWIN).
RESTRICTIONS:
> If called without the 'mode' argument, it may be necessary to call the
procedure twice to effect the desired change
> If TWIN is called without the /wallpaper keyword, then existing
wallpaper is removed before continuing (the reverse is not true:
wallpaper can be created, while TWIN windows are present.
MODIFICATION HISTORY:
DEC-1993, Paul Hick (UCSD)
JUL-2000, Paul Hick (UCSD); added call to 'wvalid' to make sure that the
requested window still exists before calling wshow or wset
[Previous]
[Next]
NAME:
twirl
PURPOSE:
Rotating relative to normal coordinates [0.5,0.5,0.5] (center
of display rather than the origin [0,0,0]
CALLING SEQUENCE:
twirl, rotate=rotate
INPUTS:
rotate 3 element vector
CALLS: ***
T3D
PROCEDURE:
Translates center to origin, rotates, and translates back to center
MODIFICATION HISTORY:
MAR-2000, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
txt_block_read
PURPOSE:
Read blocks of numerical data into multi-dimensional
data array
CALLING SEQUENCE:
FUNCTION txt_block_read, InFile , $
yy = yy , $
dd = dd , $
primary_column = primary_column, $
missing_value = missing_value , $
group = group , $
get_main_label = get_main_label, $
get_sub_label = get_sub_label , $
drop_main_label = drop_main_label,$
drop_sub_label = drop_sub_label, $
label = label , $
trail = trail , $
main_label = main_label , $
int_label = int_label , $
sub_label = sub_label , $
header = header , $
commentchar = commentchar , $
silent = silent , $
integer = integer , $
double_precision= double_precision
INPUTS:
InFile scalar; type: string
name of file
OPTIONAL INPUTS:
primary_column = primary_column
scalar; type: integer (see PROCEDURE)
silent = silent
/integer
/double_precision
passed to flt_string. This determines the type of
the outupt arrays yy and dd. If neither is
specified the type is float.
group = group
scalar; type: integer; default: 0
if set to a positive integer, then the blocks are
subcategorized in 'Kmain' labels, each with a set
of 'Ksub' subcategories (see PROCEDURE)
get_main_label = get_main_label
array; type: string; default: none
names of main labels to extract
get_sub_label = get_sub_label
array; type: string; default: none
only if group > 0, names of sub labels to extract
OUTPUTS:
status scalar; type: integer
0 : error
1 : success
OPTIONAL OUTPUTS:
header = header
array, type: string
header array (i.e. lines preceeding the blocks
of numbers).
yy = yy
array[ny]; type: numeric (see keywords /integer
and /double_precision)
If group=0:
dd = dd
array[N,Mk,K]
array; type: numeric (see keywords /integer
and /double_precision)
label = label[K]
The strings in the line preceeding each of the blocks
(with leading integers, if present, stripped
off; see keyword int_label)
int_label = int_label
array[K]
If all the lines preceeding each of the blocks
start with "<int>: ", then the integers are
extracted into int_label.
trail = trail[K]
The strings in the line following each of the
blocks (for 'closed' blocks only)
If group > 0:
dd = dd
array[N,Mk,Ksub,Kmain]
label = label[Ksub,Kmin]
The full strings preceding each of the blocks
(with leading integers, if present, stripped
off; see keyword int_label)
trail = trail[Ksub,Kmain]
The strings in the line following each of the
blocks (for 'closed' blocks only)
main_label = main_label
array[Kmain]
The first 'group' words of the strings in the line
preceeding each of the blocks are extracted.
Only unique values are retained
int_label = int_label
array[Kmain]
If all the lines preceeding each of the blocks
start with "<int>: ", then the integers are
extracted into int_label. Note that it is
assumed that each main label entry in the file
has the same integer value associated with it.
sub_label = sub_label
array[Ksub]
Everything after the first 'group' words of the
strings in the line preceeding each of the blocks
is extracted. Only unique values are retained.
INCLUDE:
@compile_opt.pro
CALLS: ***
BadValue, InitVar, IsType, UNIQ, boost, destroyvar, flt_string, strbreak, strposn
txt_read, where_common
CALLED BY:
krill_request_bars, krill_request_stats
PROCEDURE:
The file needs to be structured in the following way:
1. header; all lines start with the specified
comment char (default is a semicolon, ';')
2. single line starting with the comment char
This line is returned in the array 'label'
3. block of M1 lines containg N numbers, NOT starting
with the comment char.
This group of lines is run through flt_string
to return an array B1[N,M1].
4. optional, a single line starting with comment char,
terminating the block of numbers. If present,
it is returned in the array 'trail'.
Repeat 2,3,4 any number of times for a total
of K blocks. Note that the number of lines in the
blocks, Mk (k=0,K-1) can vary from block to block,
but the number of values in each line, N, is the same.
One column 0 <= n <= N is assigned the role of primary
column (the first colum, n=0, is the default).
All values in the primary column in each individual
block must be unique, but will overlap between blocks
(in the simplest case the primary column will contain
the same numbers in each block).
A list of unique values is constructed from the numbers
Bk[n,0..Mk-1],k=0,K-1.
in the primary columns across all blocks. The number
of values, MK, will be at least the largest of the Mk
(k=0,K-1). This list of unique values is returned in
the array yy[MK].
The remaining columns for all blocks are returned
in the array dd[N,MK,K].
For block k the primary column values Bk[n,0..Mk-1]
and the remaining columns B[*,0..Mk-1,k]
are mapped into the same position in yy and the
2nd dimension of dd, respectively.
If group is set to a positive (non-zero) integer, an
attempt is made to divide the K blocks further into
Kmain main categories with Ksub subcategories
with Kmain x Ksub = K.
The names of the main categories are the first
'group' words in the array 'label'. The names of
the subcategories are the remaining unused words
in label.
MODIFICATION HISTORY:
DEC-2012, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
[Previous]
[Next]
NAME:
txt_read
PURPOSE:
Read entire ascii file into character array
CATEGORY:
I/O
CALLING SEQUENCE:
FUNCTION txt_read, InFile, data, $
approx_recl = approx_recl , $
range_recl = range_recl , $
recl = recl , $
nrec = nrec , $
silent = silent , $
delete = delete , $
test = test
INPUTS:
file scalar; type: string
fully qualified file name
OPTIONAL INPUT PARAMETERS:
approx_recl=approx_recl
scalar; type: integer
approximate record length in bytes
(passed to GuessRecs)
range_recl=range_recl
scalar: type: integer: default: 1
range of recordlength tested is approx_recl +/- range
(passed to GuessRecs)
OUTPUTS:
status scalar: type: byte
0: file not read
1: file read, data returned in 'data' array
data array[n]; type: string
array containing all records in file
(only if status=1)
OPTIONAL OUTPUT PARAMETERS:
recl=recl scalar: type: integer
guess at record length in bytes (= file size/# records)
(-1 if not succesful; output from GuessRecs)
nrec=nrec scalar: type: integer
# records on file
(nrec=-1 if opening of the file fails)
INCLUDE:
@compile_opt.pro ; On error, return to caller
CALLS: ***
GuessRecs, InitVar, IsType, destroyvar, do_file, gunzip_file, hide_env
CALLED BY:
FUNCTION smeilatest lastorbit, PRO bolstrip, Plot_Helios_Br, Plot_g_level1
Plot_velocity, ark_duty_cycle, aurora, badpix, clean_loc_smei, cv, env_slashes
fileset_sizes, forecast_info, getipssources, getnagoyasources, getootyasources
ipv6_packets, ipv6_traffic, mk_celias, mpc_comets, mpc_minor_planets
nagoya_glevel, physics_constant, sgp4_eph, sgp4_tle, skyd_cat, skyd_pass2make
skyd_reverse, smei_base_testcase, smei_blocked, smei_buf, smei_buf_get
smei_buf_prep, smei_coriolis, smei_cv_catalogue, smei_fixpnt, smei_frm_mask
smei_last_tle, smei_mkbase, smei_mkcal, smei_mkcal_auto, smei_mkorb
smei_mkorb_auto, smei_mksky, smei_orbit_stats, smei_rewind, smei_setup_roi
smei_sgp4_orbits, smei_star_cleanlist, smei_star_cleanup, smei_star_list
smei_www_skymaps, telescope_sizes, txt_block_read, vox_update, xhcs
PROCEDURE:
If the approximate record length is specified then GuessRecs is called
to determine the record length. This will give only correct results for
fixed record length files.
If the approximate record length is not specified then the file is
pre-read to determine the record length. This will also work for
files with a variable record length.
MODIFICATION HISTORY:
JUL-2000, Paul Hick (UCSD/CASS)
JUL-2000, Paul Hick (UCSD/CASS)
Added capability to read gzipped files
DEC-2006, Paul Hick (UCSD/CASS)
Bug fix. If /test is set and guessrecs failed, then
errormessage was not defined.
SEP-2007, Paul Hick (UCSD/CASS)
Bugfix. Test after GuessRecs changed from nrec EQ 0
nrec LE 0.
APR-2008, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
Bugfix. If approx_recl was used on an empty file
errormessage was not defined.