This page was created by the IDL library routine
mk_html_help2.
Last modified: Thu Oct 7 03:02:20 1999.
NAME:
3d_structure
PURPOSE:
Documentation for the 3d structure.
This is NOT a procedure or a function. It is ONLY Documentation. don't
try to run it!
The 3d structure is the standard structure that contains all information
necessary to do data analysis on a particle distribution function.
The following is an example structure obtained from the WIND data set:
** Structure <1b689b0>, 29 tags, length=35304, refs=1:
PROJECT_NAME STRING 'Wind 3D Plasma'
DATA_NAME STRING 'Eesa Low'
UNITS_NAME STRING 'Counts' Current Units.
TIME DOUBLE 8.2313292e+08 Sample start. Secs since 1970
END_TIME DOUBLE 8.2313292e+08 Sample End. Secs since 1970.
INTEG_T DOUBLE 3.0000000 Integration Time. Seconds.
NBINS INT 88 number of angle bins.
NENERGY INT 15 number of energy bins.
MAP INT Array(32, 32) bin map (req'd only for plot3d)
DATA FLOAT Array(15, 88)
ENERGY FLOAT Array(15, 88)
THETA FLOAT Array(15, 88)
PHI FLOAT Array(15, 88)
GEOM FLOAT Array(15, 88) Req'd by convert_esa_units
DENERGY FLOAT Array(15, 88)
DTHETA FLOAT Array(15, 88)
DPHI FLOAT Array(15, 88)
DOMEGA FLOAT Array(15, 88)
EFF FLOAT Array(15, 88) Req'd by convert_esa_units
FEFF FLOAT Array(15, 88) Req'd by convert_esa_units
MASS DOUBLE 5.6856593e-06
GEOMFACTOR DOUBLE 0.00039375000 Req'd by convert_esa_units
VALID LONG 1
SPIN LONG 17152 (Optional)
UNITS_PROCEDURE STRING 'convert_esa_units'
MAGF FLOAT Array(3) (Optional magnetic field vec.)
VSW FLOAT Array(3) (Optional flow velocity vec.)
The following functions will return a 3d structure:
For the WIND data set: ("LOAD_3DP_DATA" must be called first.)
"GET_EL", "GET_PL","GET_EH","GET_PH","GET_PLB","GET_PHB","GET_ELB",
"GET_EHS","GET_SF","GET_SO","GET_SFB","GET_SOB"
For the GIOTTO data set:
"GET_GI"
For the CLUSTER data set:
In Progress....
For the FAST data set:
In Progress....
Once the 3d structure is obtained then it can be displayed with the following
routines:
"SPEC3D", "PLOT3D", "CONT3D"
The following routines are useful for manipulating the data:
"CONV_UNITS", "CONVERT_VFRAME", "PAD"
(See idlUtil/windGeneral/science/3d_structure.pro)
PROCEDURE: add_bdir,dat,source
PURPOSE:
Adds magnetic field direction [theta,phi] to a 3d structure
The new structure element will be a two element vector [theta,phi]
with the tag name 'bdir'.
INPUT:
dat: 3D data structure (i.e. from 'GET_EL')
[source] : String index that points to magnetic field data.
Notes:
Magnetic field data must be loaded first.
See 'GET_MFI'
(See idlUtil/windGeneral/science/add_bdir.pro)
PRO: ADD_BTOT
PURPOSE: Adds Btot and B_Spin_angle to MagDC structure.
CALLING: add_btot, MagDC
Pretty simple!
INPUTS: A valid MadDC structure, ie MagDC = get_fa_fields('MagDC, /all).
KEYWORD PARAMETERS: NSMOOTH, set to 0 if you do not want to smooth.
OUTPUTS: Added th MagDC structure.
SIDE EFFECTS: May blow memory.
INITIAL VERSION: REE 96-11-20
MODIFICATION HISTORY:
Space Scienes Lab, UCBerkeley
(See idlUtil/fast/add_btot.pro)
PROCEDURE: add_str_element, struct, tag_name, value PURPOSE: add an element to a structure (or change an element) INPUT: struct: structure to be created, added to, or changed tag_name: string, tag name. value: (anything) value of new element. SEE ALSO: "str_element" Warning: This procedure is slow when adding elements to large structures. CREATED BY: Davin Larson LAST MODIFICATION: @(#)add_str_element.pro 1.16 97/02/05
(See idlUtil/windGeneral/misc/add_str_element.pro)
FUNCTION: ALLOCATEARRAY DESCRIPTION: function to allocate an array of a given type and size. The types are those defined for the FAST SDT to IDL interface. CALLING SEQUENCE: data = allocatearray (type, nDims, dim(3)) ARGUMENTS: type: Specifies the type of array to allocate: 1 = BYTE 2 = INT 3 = LONG 4 = FLOAT 5 = DOUBLE nDims: gives the number of dimensions for the output array, 3 max. dims(3): gives the size of each dimension. RETURN VALUE: Upon success, the resulting array is returned, filled with 0's. Upon failure, scaler INT is returned set to -1 REVISION HISTORY: @(#)allocatearray.pro 1.1 06/15/95 Originally written by Jonathan M. Loran, University of California at Berkeley, Space Sciences Lab. June '95
(See idlUtil/arrayUtil/allocatearray.pro)
FUNCTION: angle_to_bin(dat,an) INPUT: dat: structure, 2d data structure filled by get_fa_ees, get_fa_eeb, etc. an: real,fltarr(i), 2D - real or float array of pitch angle values fltarr(i,2), 3D - theta=fltarr(*,0), phi=fltarr(*,1) KEYWORD: EBIN int,intarr(i) optional, energy bins corresponding to "an" used when angles depend upon energy bin PURPOSE: Returns the angle bin numbers in "dat" nearest to "an" CREATED BY: J.McFadden LAST MODIFICATION: 96-4-23 J.McFadden 96-8-27 J.McFadden Changed algorithm to include (mod 360.) and handle arbitrary order in dat.theta or dat.phi 98-4-24 J.McFadden Corrected typos in documentation
(See idlUtil/science/angle_to_bin.pro)
FUNCTION: angle_to_bins(dat,an,EBIN=ebin) INPUT: dat: structure, 2d data structure filled by get_eesa_surv, get_eesa_burst, etc. an: fltarr(2), 2D - min,max pitch angle limits (0-360 deg) fltarr(2,2), 3D - array of (theta,phi) angle values theta min,max (0,0),(1,0) -90<theta<90, thmin<thmax phi min,max (0,1),(1,1) 0<phi<360 KEYWORD: EBIN int optional, energy bin corresponding to "an" used when angles depend upon energy bin PURPOSE: Returns the angle "bins" array defined by "an" limits CREATED BY: J.McFadden LAST MODIFICATION: 96-4-25 J.McFadden 96-8-27 J.McFadden Changed algorithm to include (mod 360.) and handle arbitrary order in dat.theta or dat.phi
(See idlUtil/science/angle_to_bins.pro)
PROCEDURE:
anima_sumplot
PURPOSE:
The fastest CDF viewer in the west. Saves a series of summary plots
in memory for later rolodex-style viewing using the widget-based
routine xinteranimate.
USAGE:
After invoking anima_sumplot, minimize the window until the
procedure is ready to display all plots. Three beeps means it is
ready. Restore the window and hit any key to start viewing. Pause
the animation, click on the frame slider, and then use the cursor
keys to flip through the plots. Pixmaps are purged from memory upon
quitting.
You can view eESA and iESA plots separately (qty='ees' or 'ies') or
together (qty='esa'). The latter method will display eESA and iESA
sequentially for each orbit.
ACF and DCF may not be presented in tandem like the ESA plots.
You cannot change the plot interval of the static frames using
tlimit.
Note well the functionality of the ZOOM keyword. It is very useful.
INPUTS:
qty A string: 'ees', 'ies', 'esa', 'tms', 'acf', 'dcf'
firstorb The first orbit in the display sequence.
lastorb The last orbit.
KEYWORDS:
ZOOM Set this keyword to check for two data collection
periods per orbit. If two distinct intervals of data
are detected, the data is divided into two frames,
eliminating the gap. An 'N' or 'S' will be placed in
the upper right corner of the frame depending on
whether the frame is the first or second in a pair.
Setting this keyword when viewing CDFs containing only
one data collection period wastes memory. For this,
zoom is not recommended for orbits prior to 2493.
This keyword does not work when viewing ACF plots.
CREATED:
1997/7/17
by J. Rauchleiba
(See idlUtil/fast/anima_sumplot.pro)
NAME: bitplot PURPOSE: Plots 'ON' bits for housekeeping type data. Can be used by "tplot". See "_tplot_example" and "_get_example_dat" for an example.
(See idlUtil/windGeneral/tplot/bitplot.pro)
Computes the mean value of Y in each X bin. XRANGE and BINSIZE keywords control the binning, result is plotted by default, and can be returned in XBINS and BMEAN keywords.
(See idlUtil/misc/bmean.pro)
FUNCTION: bytescale(array)
PURPOSE: Takes an array or image and scales it to bytes
INPUT: array of numeric values.
KEYWORDS:
RANGE: Two element vector specifying the range of array to be used.
Defaults to the min and max values in the array.
ZERO: Forces range(0) to zero
TOP: Maximum byte value (default is !d.table_size-2)
BOTTOM: Minimum byte value (default is 1)
MIN_VALUE: autoranging ignores all numbers below this value
MAX_VALUE: autoranging ignores all numbers above this value
MISSING: Byte value for missing data. (values outside of MIN_VALUE,
MAX_VALUE range) If the value is less than 0 then !p.background is used.
LOG: sets logrithmic scaling
CREATED BY: Davin Larson
LAST MODIFICATION: @(#)bytescale.pro 1.21 96/09/09
(See idlUtil/windGeneral/misc/bytescale.pro)
PROCEDURE: cart_to_sphere, x, y, z, r, theta, phi
PURPOSE:
transform from cartesian to spherical coordinates
INPUTS: x, y, z (array or scalor)
OUTPUTS: r, theta, phi (same as x,y,z)
KEYWORDS: ph_0_360: if positive, 0<=phi<=360, if zero, -180<=phi<=180,
***if negative, best guess phi range returned***
ph_hist: a two element array of max and min values for phi.
eg: if ph_0_360 is not set, and ph_hist=[-220,220]
then if d(phi)/dt is positive near 180, then
phi => phi+360 when phi passes the 180/-180
discontinuity until phi reaches 220.
CO_LATITUDE: If set theta will be in co-latitude. (0<=theta<=180)
MIN_VALUE:
MAX_VALUE:
CREATED BY: Davin Larson
LAST MODIFICATION: @(#)cart_to_sphere.pro 1.12 96/11/18
NOTES:
-90 < theta < 90 (latitude not co-lat)
(See idlUtil/windGeneral/misc/cart_to_sphere.pro)
FUNCTION: cdf_attr_exists, cdf, attrname
PURPOSE:
determines if a specified CDF file has an attribute with a specified name
INPUTS:
cdf:
either the cdf_id of an open CDF file, or the name of a CDF file
attrname:
name of the attribute to be asked about
KEYWORDS:
scope:
if set, return the scope of the attribute (if it is present). The scope
may be either of the strings 'GLOBAL_SCOPE' or 'VARIABLE_SCOPE'.
The value of this variable is only meaningful if the return value is 1.
OUTPUTS:
return value is 1 if yes, 0 if no
CREATED BY: Vince Saba
LAST MODIFICATION: @(#)cdf_attr_exists.pro 1.1 09/08/96
(See idlUtil/misc/cdf_attr_exists.pro)
NAME: cdf_info FUNCTION: cdf_info(id) PURPOSE: Returns a structure with useful information about a CDF file. In particular the number of file records is returned in this structure.
(See idlUtil/windGeneral/key_param/cdf_info.pro)
FUNCTION: cdf_var_exists, cdf, varname
PURPOSE:
determines if a specified CDF file has a variable with a specified name
INPUTS:
cdf:
either the cdf_id of an open CDF file, or the name of a CDF file
attrname:
name of the variable to be asked about
KEYWORDS:
OUTPUTS:
return value is 1 if yes, 0 if no
CREATED BY: Vince Saba
LAST MODIFICATION: @(#)cdf_var_exists.pro 1.2 10/23/96
(See idlUtil/misc/cdf_var_exists.pro)
IDL BATCHFILE:
check_late_cdfs.pro
PURPOSE:
Calls compare_cdf_ats.pro to check timespans of recently produced
CDFs. Meant to be called from a script run as a daily cron job.
CALLING SEQUENCE:
idl check_late_cdfs
ENVIRONMENT VARIABLES:
QUANTITY 'ees', 'ies', 'tms', 'acf', 'dcf'
ONTIMES Full path to file containing nominal data collection
periods against which to compare CDF timespans.
FIRSTORB The first orbit in the interval to check.
LASTORB The last orbit to check.
DANETDIR Required to build the name of the output file.
(See idlUtil/fast/check_late_cdfs.pro)
COMMON BLOCK colors_com WARNING! Don't rely on this file to remain stable! USE "get_colors" to get color information. SEE ALSO: "get_colors","bytescale","loadct2" CREATED BY: Davin Larson File: 96/08/30 Version: 1.2 Last Mod: colors_com.pro
(See idlUtil/windGeneral/misc/colors_com.pro)
PROCEDURE: compare_cdf_ats
PURPOSE: Compares timespans of CDf files to instrument turnons
and checks them for gaps. Works on any given array of
orbits, or a specified range of orbits.
KEYWORDS:
QTY String: ees, ies, tms, acf, dcf.
ONTIMES (OPTIONAL) The name of the file containing the
instrument turnon times. The file is searched for in
the directory: $FAST_CDF_HOME/cdf_status/timespans
If not set, a timespan/gap characterization is done
for the CDFs, without the comparison to turnon times.
ORBARRAY If set, the first argument is taken as an array of
orbits instead of the first orbit in a range. The
second argument is ignored.
TROUBLE Set this to a named variable which will be set to an
array of orbits for which CDFs
OUT If set, the name of the output file.
APPEND Appends to the output file instead of overwriting it.
ARGUMENTS:
FIRST The first orbit in the range.
LAST The last orbit in the range.
OUTPUT:
The timespan of the CDF; the total number of minutes occupied by
actual data; the deviation of start and finish times from
instrument turnons; data gaps.
The three numbers after the "NAN" label describe the data gaps in
the CDF file. The first number is the total number of gaps,
however small. This number should be less than about 20 for a
good CDF. The second is the total number of gaps lasting between
1 and 20 minutes. A good CDF has zero such gaps. The third
number is the number of gaps longer than 20 minutes. Any gap this
long almost always represents the interval between northern and
southern data collection periods. Thus, there should never be
more than one such gap in a CDF file.
Example:
orbit CDF date start finish data stt dev. fin dev. Gap(n,1,20min)
---- ---------- -------- -------- ---- -------- -------- -----------
4038 TS: 1997-08-29 19:22:23 20:42:46 (80) beg: -63 end: 0 NAN: 11,0,1
4039 TS: 1997-08-29 21:35:01 22:06:17 (31) beg: 0 end: -46 NAN: 11,0,0
4040 CDF not found
4041 TS: 1997-08-30 01:56:15 03:15:06 (78) beg: 0 end: 0 NAN: 12,1,1
4042 TS: 1997-08-30 04:06:04 05:27:54 (81) beg: 0 end: 0 NAN: 4,0,1
CREATED: By J.Rauchlieba
(See idlUtil/fast/compare_cdf_ats.pro)
PROCEDURE: compare_cdf_db
PURPOSE: Compares timespans of CDf files to instrument turnons
and checks them for gaps. Works on any given array of
orbits, or a specified range of orbits.
KEYWORDS:
QTY String: ees, ies, tms, acf, dcf.
VERSION If set to a 2-char string, looks for a specific version
number in the CDF filename. If that version is not found,
the CDF is deemed bad. Default is '??'.
ONTIMES (OPTIONAL) The name of the file containing the
instrument turnon times.
If not set, a timespan/gap characterization is done
for the CDFs, without the comparison to turnon times.
ORBARRAY If set, the first argument is taken as an array of
orbits instead of the first orbit in a range. The
second argument is ignored.
TROUBLE Set this to a named variable which will be set to an
array of orbits for which CDFs were less than perfect.
OUT If set, the name of the output file.
APPEND Appends to the output file instead of overwriting it.
ARGUMENTS:
FIRST The first orbit in the range or an array of orbits.
LAST The last orbit in the range.
OUTPUT:
The timespan of the CDF; the total number of minutes occupied by
actual data; the deviation of start and finish times from
instrument turnons; data gaps.
The three numbers after the "NAN" label describe the data gaps in
the CDF file. The first number is the total number of gaps,
however small. This number should be less than about 20 for a
good CDF. The second is the total number of gaps lasting between
1 and 20 minutes. A good CDF has zero such gaps. The third
number is the number of gaps longer than 20 minutes. Any gap this
long almost always represents the interval between northern and
southern data collection periods. Thus, there should never be
more than one such gap in a CDF file.
Example:
orbit CDF date start finish data stt dev. fin dev. Gap(n,1,20min)
---- ---------- -------- -------- ---- -------- -------- -----------
4038 TS: 1997-08-29 19:22:23 20:42:46 (80) beg: -63 end: 0 NAN: 11,0,1
4039 TS: 1997-08-29 21:35:01 22:06:17 (31) beg: 0 end: -46 NAN: 11,0,0
4040 CDF not found
4041 TS: 1997-08-30 01:56:15 03:15:06 (78) beg: 0 end: 0 NAN: 12,1,1
4042 TS: 1997-08-30 04:06:04 05:27:54 (81) beg: 0 end: 0 NAN: 4,0,1
CREATED: By J.Rauchlieba
(See idlUtil/fast/compare_cdf_db.pro)
PROCEDURE: compare_orbits
PURPOSE: Propagates multiple orbits. Used to compare evolution
of nearby orbits.
INPUTS: Accepts any of three classes of input:
DEFAULT KEPLER VECTOR
------- ------ ------
apogee semi-major axis X
perigee eccentricity Y
inclination inclination Z
ascending node ascending node VX
arg of perigee arg of perigee VY
mean anomaly mean anomaly VZ
Input is received through ASCII files or interactive
prompting. See INPUT_FILES keyword. Set
KEPLER_INPUT or VECTOR_INPUT to use a parameter set
other than the default. The only difference between
the default and Keplerian sets is that apogee and
perigee are traded for semi-major axis and
eccentricity.
Apogee and perigee are in kilometers relative to the
Earth's surface. Semi-major axis is in kilometers.
Inclination, ascending node, argument of perigee,
and mean anomaly are all in degrees. Position and
velocity are in Geocentric Equatorial Inertial (GEI)
kilometers.
OUTPUTS: Files containing position and velocity vectors (in
GEI km) over the requested timespan. There will be
one file for each orbit requested. See OUTPUT_FILES
keyword.
Also, unless the NO_STORE keyword is set, all
quantities available from get_fa_orbit.pro will be
stored in tplot structures with numbered suffixes
appended to their names. (This process must have
permission to create files in the current
directory.)
ARGUMENTS:
(none)
KEYWORDS:
KEPLER_INPUT Set this keyword if inputs are Keplerian orbit elements.
VECTOR_INPUT Set this keyword if inputs are position and velocity vectors.
NO_STORE Disables storage of tplot structures.
NO_FILES Disables writing of propagated vectors to ASCII files.
DURATION The orbits will be propagated DURATION seconds.
DELTA_T Spacing in seconds of computed orbit vectors (default=20s).
REFERENCE Set this to a string or double float time. It will
be used as the starting point for the propagation.
Since time is arbitrary and has no bearing on the
calculation, this keyword is optional and defaults
to '2000-1-1/00:00:00.000'.
OUTPUT_FILES Set this to a scalar string to be used for constructing
the names of the output files. An index number will
be appended to the name to designate which orbit the
file corresponds to. The default is 'propagation.n'
The output files will contain a one-line header
followed by rows containing the following fields:
TIME X Y Z VX VY VZ
(Position and velocity are in GEI km.)
INPUT_FILES Scalar string or string array. Set this keyword to the
names of files containing the input parameters. The
wildcard character `*' is acceptible. There should
be one file for each orbit to be propagated. There
are three possible file formats, described below.
(If this keyword is unset, the user will be prompted
interactively for the input parameters.)
Default File Format:
With the KEPLER_INPUT and VECTOR_INPUT keywords both
unset, the input files should be similar to the
following:
; Orbital elements
Apogee: 4179.70
Perigee: 352.270
Inclination: 82.9672945710076
Ascending Node: 178.334008234324
Arg of Perigee: 161.781356303097
Mean Anomaly: 207.607698658954
CAUTION: It is the order of the entries that matters
-- not the labels. The labels are totally arbitrary
and optional, included for the user's sake. The
colon delimits the label from the value. Empty
lines and those beginning with `;' are ignored.
Apogee and perigee are in kilometers relative to
Earth's surface. Inclination, ascending node,
argument of perigee, and mean anomaly are in
degrees.
Keplerian File Format:
With the KEPLER_INPUT keyword set, the input files
should be similar to this:
; Keplerian elements
Semi-major axis: 8644.08502992716
Eccentricity: 0.221390443436394
Inclination: 82.9672945710076
Ascending Node: 178.334008234324
Arg of Perigee: 161.781356303097
Mean Anomaly: 207.607698658954
Vector File Format:
This file should contain two lines. The first
consists of the position vector elements delimited
by whitespace, the second consists of the velocity
vector elements. Both vectors are in Geocentric
Equatorial Inertial (GEI) kilometers. Empty lines
and those beginning with `;' are ignored.
; Initial position and velocity vectors
-5507.04834742092 -3977.33940791809 1.16138517269934e-05
0.998998200041123 -0.546989517973328 8.35870064323739
(See idlUtil/fast/compare_orbits.pro)
PROCEDURE: contour2d,data
PURPOSE:
Produces contour plots of pitch angle dist.s from 2D data structures.
INPUTS:
data - structure containing 2d data (obtained from get_fa_???() routine)
e.g. "get_fa_ees, get_fa_ies, etc."
KEYWORDS:
LIMITS - A structure containing limits and display options.
see: "options", "xlim" and "ylim", to change limits
UNITS - convert to given data units before plotting
MSEC - Subtitle will include milliseconds
TITLE - Title to be plotted,
- set title=' ' for NO Title!
- set title='1' for just the time in the title
XTITLE - xtitle to be plotted,
- set xtitle=' ' for NO xtitle!, default determined by VEL keyword
YTITLE - ytitle to be plotted,
- set ytitle=' ' for NO ytitle!, default=data.units_name
RETRACE - set to number of retrace steps removed,
- typically set to 1 for FAST esas
- minus number will remove -(retrace) steps from end of sweep
VEL - If set, x-axis is velocity km/s -- Default is Energy (eV)
NCONT - Number of contours to be plotted, default = 8
LEVELS - Explicit contour levels, default levels spaced down
from max by 10^.5
FILL - If set, contours are filled with solid color or gray scale
BW - If set, contours are white, no affect on fill plots
PURE - If set, 6 pure colors are cycled through for levels
POLAR - Makes a polar plot
ROTATE - Exchanges x and y axes for non-polar plots
LABEL - Labels the contour levels
LAB_0 - Puts 0 in center of plot (default is 90). Labels pitch angles with 90 degree increments.
LAB_90 - Puts 90 in center of plot (default is 90). Labels pitch angles with 90 degree increments.
LAB_180 - Puts 180 in center of plot (default is 90). Labels pitch angles with 90 degree increments.
XMARGIN - Change xmargin from default
YMARGIN - Change ymargin from default
See "pitch2d" for another means of plotting data.
See "conv_units" to change units.
CREATED BY: J. McFadden 96-8-31
FILE: contour2d.pro
VERSION 1.
MODIFICATIONS:
McFadden 96-9-3 More keywords added
Delory Polar keyword
McFadden 97-11-20 Lab_0,LAB_180 keywords
McFadden 98-3-3 xmargin, ymargin keywords
(See idlUtil/science/contour2d.pro)
PROCEDURE: convert_esa_units PURPOSE: to convert units of data from any of the eesa or pesa instruments. INPUT: data: A 3d structure such as those generated by get_el,get_pl,etc. units: A string telling the procedure which units to convert to, such as ncounts,rate,nrate,eflux,flux,df KEYWORDS: scale: A named variable that will return the scale used to convert CREATED BY: Davin Larson LAST MODIFICATION: @(#)convert_esa_units.pro 1.6 95/11/07
(See idlUtil/windGeneral/science/convert_esa_units.pro)
PROCEDURE: convert_esa_units2 PURPOSE: To convert FAST ESA data units to counts,eflux,flux,df,rate, or crate 'COUNTS' : # 'RATE' : #/sec 'CRATE' : #/sec (dead time corrected) 'EFLUX' : eV/(cm^2-s-sr-eV) (dead time corrected) 'FLUX' : #/(cm^2-s-sr-eV) (dead time corrected) 'DF' : #/(km^3-(cm/s)^3) (dead time corrected) INPUT: data: A 3d structure such as those generated by get_el,get_pl,etc. units: A string telling the procedure which units to convert to, such as ncounts,rate,nrate,eflux,flux,df KEYWORDS: scale: A named variable that will return the scale used to convert CREATED BY: J. McFadden (modified from convert_esa_units - D.Larson) LAST MODIFICATION: 97/03/03 MOD HISTORY: 97/03/03 Changed to accept 1-D or 2-D GEOM structure element
(See idlUtil/science/convert_esa_units2.pro)
PROCEDURE: convert_tms_units PURPOSE: to convert units of data from the teams instruments. INPUT: data: A 3d structure such as those generated by get_fa_th,etc. units: A string telling the procedure which units to convert to, such as ncounts,rate,nrate,eflux,flux KEYWORDS: scale: A named variable that will return the scale used to convert REVISION HISTORY: Made from convert_esa_units.pro Last modification: Li Tang Univ. of New Hampshire. 8/22/96 3D data(himass) added.
(See idlUtil/fast/convert_tms_units.pro)
PROCEDURE: convert_tms_units2 PURPOSE: to convert units of data from the teams instruments. INPUT: data: A 3d structure such as those generated by get_el,get_pl,etc. units: A string telling the procedure which units to convert to, such as ncounts,rate,nrate,eflux,flux,df KEYWORDS: scale: A named variable that will return the scale used to convert REVISION HISTORY: Made from convert_esa_units.pro Last modification: Li Tang Univ. of New Hampshire. 8/22/96 3D data(himass) added.
(See idlUtil/fast/convert_tms_units2.pro)
NAME:
convert_vframe
FUNCTION: convert_vframe , dat, velocity
PURPOSE: Change velocity frames
INPUT:
dat: 3d data structure
velocity: SW velocity vector [VX,VY,VZ]
OUTPUT: 3d data structure. Data will be in a different coordinate frame.
(data will also be in units of distrubution function.)
KEYWORDS:
ETHRESH: Threshold energy for interpolation.
BINS: Angle bins to be used
EVALUES:
INTERPOLATE: set to non-zero value to have the data evaluated
(interpolated) at the original energy steps.
CREATED BY: Davin Larson
LAST MODIFICATION: @(#)convert_vframe.pro 1.12 97/01/16
(See idlUtil/windGeneral/science/convert_vframe.pro)
FUNCTION: conv_units PURPOSE: To convert from counts to any other unit which is supported. This procedure is just a shell that calls whatever conversion procedure is specified in data.units_procedure. right now the only conversion procedures are "convert_esa_units" and "convert_sst_units" INPUT: data: A 3d data structure such as those generated by get_el, get_eh, get_pl,get_ph,etc. e.g. "get_el" units: The units you wish to convert to, such as eflux,flux,df,ncounts, rate,nrate. KEYWORDS: scale: a dummy keyword, returns the scale used to convert. CREATED BY: Davin Larson LAST MODIFICATION: @(#)conv_units.pro 1.8 95/11/07
(See idlUtil/windGeneral/science/conv_units.pro)
PROCEDURE: copy_data, oldname, newname
PURPOSE: to copy a data structure
INPUT:
oldname: name associated with old data structure
newname: name associated with new data structure
KEYWORDS:
LINK: if set, then the data is not copied but is linked to the old
name.
SEE ALSO: "get_data",
"store_data"
CREATED BY: Davin Larson
LAST MODIFICATION: copy_data.pro 1.9 95/11/22
(See idlUtil/windGeneral/tplot/copy_data.pro)
FUNCTION: countcdfrvarrecs
PURPOSE: count the number of records written to rvariables in one or more CDF files
INPUTS:
filespec:
file specification of the files to be counted, in the form
used by findfile.pro.
KEYWORDS:
count:
receives the number of CDFs that result from expanding the filespec.
OUTPUTS:
return value:
returns an array of structures containing the names and number of elements
of each of the specified files. The number of elements in the array of
structures is equal to 'count' described above. Each structure has two
fields, 'name', which contains the filename of the CDF, and 'size', which
contains the number of rvariable records contained in the file.
EXAMPLE:
To generate a list of the names and sizes of all the EES orbit CDF files:
stats = countcdfrvarrecs('/disks/juneau/cdf1/ees/fa_k0_ees*.cdf', count=count)
for i = 0, count - 1 do begin
print, stats(i).name, stats(i).size
endfor
CREATED BY: Vince Saba, July, 1997.
VERSION: @(#)countcdfrvarrecs.pro 1.2 07/18/97
(See idlUtil/misc/countcdfrvarrecs.pro)
Routine adapted from IDL's box_cursor.pro
(See idlUtil/windGeneral/tplot/crosshairs.pro)
NAME: CROSSN3
PURPOSE: Takes cross product of two time series vectors, both of
which must be N x 3 matrices.
CALLING SEQUENCE:
INPUTS: A, B - two N x 3 vectors
OUTPUTS: C - an N x 3 vector, the cross product of A and B.
EXAMPLE: compute V cross B (motional electric field)
help,b, v
B FLOAT = Array[1000, 3]
V FLOAT = Array[1000, 3]
e_motional = crossn3(v, b)
MODIFICATION HISTORY: ???
(See idlUtil/misc/crossn3.pro)
NAME: CROSS_SPEC
PURPOSE: Routine to calculate the cross-spectra of two input time
series sig1 and sig2. Program returns coherence and phase
delay vs. frequency for the two input signals.
CALLING SEQUENCE: cross_spec, sig1, sig2, n_ave, npts, sample, coh,
frequency, overlap=overlap
INPUTS:
sig1 - A one dimensional array containing time series
waveform amplitudes.
sig2 - A second time series signal similar to sig1.
N_AVE - The number of segments to divide up the time series
data in sig1 and sig2 for averaging.
SAMPLE -The sample time for each point in the time
series data in sig1 and sig2.
OUTPUTS -
COH - The resulting coherence data for sig1 and sig2. This
represents gamma^2 in the popular literature.
PHASE - The resulting phase delay between the two input
signals sig1 and sig2.
FREQ - The frequency axis for the coherence and phase data.
KEYWORDS:
OVERLAP - Set this keyword to slide the cross-spectral
interval by one-half of an interval instead of
averaging together each separate interval. For
most data types this will yield a higher number of
averages and less error per data point than straight
sequential averaging. Note that N_AVE
specifies how many sequential averages are taken
without overlap. Thus N_AVE=4 with /OVERLAP yields
a total of 7 averages, etc.
EXAMPLE: You have two time series signals sig1 and sig2 that you
want to derive a cross-spectra from. Each of these time
series data must be of the same length and should be a
multiple of 2^n, say 8192 points. To get decent
statistics at least 4-8 sequential or sliding averages
should be used -- so pick n_ave = 8, npts=1024, and
sample = the sample time (in seconds) for the time series
data. Alternatively, to get a higher frequency resolution
set n_ave=4, npts=2048, and set /overlap. This yields 4+3
= 7 sliding averages for the data.
A note about errors:
For n sequential (non-sliding) averages FFT's have a
statistical error of 1/n^0.5. For the same time interval,
if a sliding average is used of 1/2 a window overlap, n
goes up by a factor of 2 but the errors are no longer
completely independent -- so the new error per point is
1/(0.81*N)^0.5 -- but N=2n so there is less error per point
than in the non-sliding average case. For more
information about errors and correlation analyses in
general, consult Bendat & Piersol, "Engineering
Applications of Correlation and Spectral Analysis", 1993.
A note about the data:
Results may not be valid if the number of points per FFT
(npts) is not 2^j where j = any integer.
This routine assumes that the input data is continuous and
that there are no data gaps or bad time points.
REVISION HISTORY
ver 1.0 04/03/97 G.T.Delory
ver 1.1 04/11/97 G.T.Delory
(See idlUtil/science/cross_spec.pro)
PROCEDURE: ctime,time,y
INPUT:
time: Named variable in which to return the selected time (seconds
since 1970)
y: Named variable in which to return the y value
KEYWORDS:
PROMPT: Optional prompt string
NPOINTS: Max number of points to return
PSYM: If set to a psym number, the cooresponding psym is plotted at
selected points
SILENT: Do not print data point information
PANEL: Set to a named variable to return an array of tplot panel numbers
coresponding to the variables points were chosen from.
APPEND: If set, points are appended to the input arrays,
instead of overwriting the old values.
VNAME: Set to a named variable to return an array of tplot variable names,
cooresponding to the variables points were chosen from.
COLOR: An alternative color for the crosshairs. 0<=color<=!d.n_colors-1
SLEEP: Sleep time (seconds) between polling the cursor for events.
Defaults to 0.1 seconds. Increasing SLEEP will slow ctime down,
but will prevent ctime from monopolizing cpu time.
INDS: Return the indices into the data arrays for the points nearest the
recorded times to this named variable.
EXACT: Get the time and y from the data arrays. If on a multi-line plot,
get the value from the line closest to the cursor along y.
In addition, exact returns dimen2(data.y)
This means TIME(i) equals data.x(INDS(i)) and
Y(i) equals data.y(INDS(i),EXACT(i))
for get_data,VNAME(i),data=data
PURPOSE: Interactively uses the cursor to select a time (or times)
NOTES: If you use the keyword EXACT, ctime may run noticeablly slower.
Reduce the number of time you cross panels, especially with
tplots of large data sets.
SEE ALSO: "crosshairs"
CREATED BY: Davin Larson & Frank Marcoline
LAST MODIFICATION: @(#)ctime.pro 1.24 97/01/09
WARNING!
If ctime crashes, you may need to call:
IDL> device,set_graph=3,/cursor_crosshair
(See idlUtil/windGeneral/tplot/ctime.pro)
plots a cumulative distribution of DATA. Many keywords in common with other HISTOGRAM functions.
(See idlUtil/misc/cumdist.pro)
compare cumulative distributions of X1 and X2.
(See idlUtil/misc/cumdist_compare.pro)
NAME: CURVOUT
PURPOSE:
Calls IDL's CURVEFIT iteratively, rejecting outliers at each
iteration, until the fit converges or too many points are thrown
away.
INPUTS: X - the independent variable
Y - the dependent variable
WEIGHTS - the relative importance of each point in
determining goodness of fit
APAR - a vector of parameters for evaluating the model
function. This should be a good guess on input.
KEYWORD PARAMETERS:
FUNCTION_NAME - a string naming a user supplied procedure which
will be called by CURVEFIT.
ITMAX: maximum number of CURVEFIT iterations. CURVOUT will
iterate until it's done.
ITER: the number of iterations actually performed. This will
apply only to the last cycle of CURVOUT.
TOL: convergence tolerance. The routine returns when the relative
decrease in chi-squared is less than TOL in an
interation. Default = 1.e-3.
CHI2: The value of chi-squared on exit (obsolete)
CHISQ: The value of reduced chi-squared on exit
NODERIVATIVE: If this keyword is set then the user procedure will
not be requested to provide partial
derivatives. The partial derivatives will be
estimated in CURVEFIT using forward differences. If
analytical derivatives are available they should
always be used.
USED - a named variable in which the indices of the data
used for the final fit are returned.
TOSSED - a named variable in which the indices of the data
removed from the final fit are returned.
MAX_TOSS - the maximum allowable fraction of the data represented
by outliers. Up to MAX_TOSS*(number of points) may be
thrown away to acheive a good fit. Default is 0.5.
SHOW - if set, causes successive fits to be plotted
interactively.
OUTPUTS: A - the vector of parameters at which the model function
most closely matches the data Y.
SIGMA - standard deviations of APAR
EXAMPLE: phase_diff = curveout(tdiff,pdiff,weights,ang,sigma,
funct='sun_mag_diff',/noderiv)
MODIFICATION HISTORY:
(See idlUtil/misc/curvout.pro)
PROCEDURE: cuts PURPOSE: to show x cuts or y cuts of a "tplot" spectrogram using the profiles routine INPUT: none KEYWORDS: name: name of the variable you want cuts for CREATED BY: Jasper Halekas LAST MODIFICATION: @(#)cuts.pro 1.3 95/10/06
(See idlUtil/windGeneral/tplot/cuts.pro)
FUNCTION: c_2d(dat,ENERGY=en,ERANGE=er,EBINS=ebins,ANGLE=an,ARANGE=ar,BINS=bins) INPUT: dat: structure, 2d data structure filled by get_fa_ees, get_fa_eeb, etc. KEYWORDS ENERGY: fltarr(2), optional, min,max energy range for integration ERANGE: fltarr(2), optional, min,max energy bin numbers for integration EBINS: bytarr(na), optional, energy bins array for integration 0,1=exclude,include, na = dat.nenergy ANGLE: fltarr(2), optional, min,max pitch angle range for integration ARANGE: fltarr(2), optional, min,max angle bin numbers for integration BINS: bytarr(nb), optional, angle bins array for integration 0,1=exclude,include, nb = dat.ntheta BINS: bytarr(na,nb), optional, energy/angle bins array for integration 0,1=exclude,include PURPOSE: Returns the sum of the counts in dat.data NOTES: Function normally called by "get_2dt" to generate time series data for "tplot". CREATED BY: J.McFadden 96-12-13 LAST MODIFICATION:
(See idlUtil/science/c_2d.pro)
FUNCTION: c_3d(dat,ENERGY=en,ERANGE=er,EBINS=ebins,ANGLE=an,ARANGE=ar,BINS=bins) INPUT: dat: structure, 2d data structure filled by get_eesa_surv, get_eesa_burst, etc. KEYWORDS ENERGY: fltarr(2), optional, min,max energy range for integration ERANGE: fltarr(2), optional, min,max energy bin numbers for integration EBINS: bytarr(na), optional, energy bins array for integration 0,1=exclude,include, na = dat.nenergy ANGLE: fltarr(2,2), optional, angle range for integration theta min,max (0,0),(1,0) -90<theta<90 phi min,max (0,1),(1,1) 0<phi<360 ARANGE: fltarr(2), optional, min,max angle bin numbers for integration BINS: bytarr(nb), optional, angle bins array for integration 0,1=exclude,include, nb = dat.ntheta BINS: bytarr(na,nb), optional, energy/angle bins array for integration 0,1=exclude,include PURPOSE: Returns the sum of the counts in temp.data NOTES: Function normally called by "get_3dt" to generate time series data for "tplot". CREATED BY: J.McFadden 95-7-27 LAST MODIFICATION: 96-7-6 J.McFadden
(See idlUtil/windGeneral/science/c_3d.pro)
FUNCTION: A = data_cut(name, t)
PURPOSE: Interpolates data from a data structure.
INPUT:
name: Either a data structure or a string that can be associated with
a data structure. (see "get_data" routine)
the data structure must contain the element tags: "x" and "y"
the y array may be multi dimensional.
t: (scalar or array) x-values for interpolated quantities.
RETURN VALUE:
a data array: the first dimention is the first dimention of t
the second dimention is the second dimention of name
NOTE!! keyword options have been temporarily removed!!!!
KEYWORDS:
EXTRAPOLATE: Controls interpolation of the ends of the data. Effects:
0: Default action. Set new y data to NAN or to MISSING.
1: Extend the endpoints horizontally.
2: Extrapolate the ends. If the range of 't' is
significantly larger than the old time range, the ends
are likely to blow up.
INTERP_GAP: Determines if points should be interpolated between data gaps,
together with the GAP_DIST. IF the data gap GAP_DIST,
follow the action of INTERP_GAP
0: Default action. Set y data to MISSING.
1: Interpolate gaps
GAP_DIST: Determines the size of a data gap above which interpolation
is regulated by INTER_GAP.
Default value is 5, in units of the average time interval:
delta_t = (t(end)-t(start)/N)
MISSING: Value to set the new y data to for data gaps. Default is NAN.
CREATED BY: Davin Larson
LAST MODIFICATION: @(#)data_cut.pro 1.12 96/05/28
Added the four keywords. (fvm 9/27/95)
(See idlUtil/windGeneral/tplot/data_cut.pro)
FUNCTION:
data_only
PURPOSE:
To find non-empty invervals in data. Good for selecting the
N. hem. and S. hem. passes out of an orbit's worth of data. Given
the string name of a preloaded tplot structure, will return an array
containing pairs of times designating data intervals.
array(0,0) contains the start time of the first data interval and
array(1,0) contains the end time of the first data interval.
Returns either one or two pairs of times. Only works with 2-D data.
ARGUMENTS:
qty Name of tplot data structure: 'Je', 'Ji', etc.
KEYWORDS:
thresh minimum number of seconds between data intervals. By
default this is set to 900 which should be enough to
discern the northern and southern passes.
(See idlUtil/fast/data_only.pro)
FUNCTION: data_to_normal PURPOSE: convert data coordinates to normal coordinates INPUT: datav: data coordinates s: !AXIS structure KEYWORDS: none CREATED BY: Frank Marcoline. Hiested from Davin's normal_to_data. LAST MODIFICATION: @(#)data_to_normal.pro 1.2 97/01/09 NOTE: I think this procedure is superceded by convert_coord.
(See idlUtil/windGeneral/tplot/data_to_normal.pro)
FUNCTION: data_type(x)
PURPOSE:
Returns the variable type (ignores dimension).
INPUTS: x: Any idl variable.
OUTPUT: integer variable type:
0 = undefined
1 = byte
2 = integer
3 = long
4 = float
5 = double
6 = complex
7 = string
8 = structure
9 = double precision complex
KEYWORDS:
STRUCTURE: When set and if input is a structure, then an array
of data types are returned.
SEE ALSO: "dimen", "ndimen"
CREATED BY: Davin Larson
LAST MODIFICATION: @(#)data_type.pro 1.5 96/12/16
(See idlUtil/windGeneral/misc/data_type.pro)
FUNCTION:
DATESEC
DESCRIPTION:
function to parse out a date string of either the form [YY]YY-MM-DD
(e.g. '1989-10-1' or '89-10-1), DD/MM/YY (e.g. '1/10/89'), DD MMM YY
(e.g. '1 Oct 89' or '1 OCT 89', case ingnored) or YYYY/MM/DD
(e.g. 1989/10/01, where the first field is greater than 31). The
RETURN value is double float in seconds since 1 Jan 1970, 00:00 UT.
USAGE (SAMPLE CODE FRAGMENT):
; seconds since 1970
string_date = '21 Mar 91'
; convert to string
seconds_date = datesec(string_date)
; print it out
PRINT, seconds_date
--- Sample output would be
6.6951720e+08
NOTES:
If conversion fails, this function returns -1.
For the forth input format to work (YYYY/MM/DD), the year
specified must be greater than 31, otherwise the DD/MM/YY
format assumed.
Note that NO combination of of input formats will work. Also, all
three fields must be present.
If any of the fields is to large then a carry operation will occur.
i.e. 34/13/89 would come out to year 90, month 2, day 3.
If input seconds is an array, then an array of
N_ELEMENTS(inputs vals) of date strings and remainders will be returned.
REVISION HISTORY:
@(#)datesec.pro 1.6 08/17/95
Originally written by Jonathan M. Loran, University of
California at Berkeley, Space Sciences Lab. Sep. '91
Revised to handle arrays of input values, JML, Jan. '92
(See idlUtil/datetime/datesec.pro)
FUNCTION:
DATESEC_DOY
DESCRIPTION:
take args for year and day of year and return
(double float) seconds since 1 Jan 1970, 00:00 UT.
USAGE:
print, datesec_doy(75, 134)
gives result:
1.6925760e+08
NOTES:
does not handle years past 1999; year must be two digit.
REVISION HISTORY:
@(#)datesec_doy.pro 1.3 01/26/99
written by Ken Bromund, Space Sciences Lab, Berkeley. May, 1991
(See idlUtil/datetime/datesec_doy.pro)
FUNCTION:
DATESEC_VAR
DESCRIPTION:
function to return seconds since 1 Jan 1970, 00:00 UT corresponding
to beginning of given day.
USAGE (SAMPLE CODE FRAGMENT):
; seconds since 1970
day = 21
month = 3
year = 91
; convert to string
seconds_date = datesec_var(day, month, year)
; print it out
PRINT, seconds_date
--- Sample output would be
6.6951360e+08
NOTES:
If conversion fails, this function returns -1.
If any of the fields is to large then a carry operation will occur.
i.e. 34/13/89 would come out to year 90, month 2, day 3.
If inputs are arrays, then an array of
N_ELEMENTS(inputs vals) of times will be returned
REVISION HISTORY:
@(#)datesec_var.pro 1.2 06/07/95
Originally written by Ken Bromund, University of
California at Berkeley, Space Sciences Lab. May, '92
made to give results equivalent to datesec by Jon Loran
(See idlUtil/datetime/datesec_var.pro)
FUNCTION:
DATESTRUCT
DESCRIPTION:
function to parse out a date string of either the form DD-MM-YY
(e.g. '1-10-89'), DD/MM/YY (e.g. '1/10/89'), DD MMM YY (e.g.
'1 Oct 89' or '1 OCT 89', case ingnored) or YYYY/MM/DD (e.g.
1989/10/01, where the year is greater than 31).
The return value is a structure of the format:
{date_str $
,year: 1970 $ ; year component of the date
,month: 01 $ ; month component of the date
,monthday: 01 $ ; day of month component of the date
,secs: 0.D $ ; seconds since 1 Jan 1970 00:00:00
,valid: 1 $ ; contents are valid
}
USAGE (SAMPLE CODE FRAGMENT):
; seconds since 1970
string_date = '21 Mar 91'
; convert to string
date_struct = datestruct(string_date)
; print it out
PRINT, date_struct
--- Sample output would be
{1991, 03, 21, 6.6951720e+08, 1}
NOTES:
If conversion fails, this function returns a date_str with the valid
tag set to 0.
For the forth input format to work (YYYY/MM/DD), the year
specified must be greater than 31, otherwise the DD/MM/YY
format assumed.
Note that NO combination of of input formats will work. Also, all
three fields must be present.
If any of the fields is to large then a carry operation will occur.
i.e. 34/13/89 would come out to year 90, month 2, day 3.
If input seconds is an array, then an array of
N_ELEMENTS(inputs vals) of dat estrings and remainders will be
returned.
REVISION HISTORY:
@(#)datesec.pro 1.2 04 Jun 1995
Originally written by Jonathan M. Loran, University of
California at Berkeley, Space Sciences Lab. June. '95
(See idlUtil/datetime/datestruct.pro)
FUNCTION:
DATETIMESEC
DESCRIPTION:
function to parse out a date/time string with date format of
either the form DD-MM-YY (e.g. '1-10-89'), DD/MM/YY (e.g. '1/10/89'),
DD MMM YY (e.g. '1 Oct 89' or '1 OCT 89', case ingnored) or YYYY/MM/DD
OR YYYY-MM-DD (e.g. 1989/10/01, where the first field is greater than
31), and time format of with format HH:MM:SS.MSC where the least
significant entries may be omitted (e.g. HH:MM is legal), but at least
one colon must remain. There must be some delimiter between the date
and the time, which must be different than the delimiter between the
fields within the date string portion. The RETURN value is double
float in seconds since 1 Jan 1970, 00:00 UT.
USAGE (SAMPLE CODE FRAGMENT):
; seconds since 1970
string_date_time = '1991-03-21/04:04:04'
; convert to string
seconds_date = datetimesec(string_date_time)
; print it out
PRINT, seconds_date
--- Sample output would be
6.6952824e+08
NOTES:
If conversion fails, this function returns -1.
For the forth date input format to work (YYYY/MM/DD), the year
specified must be greater than 31, otherwise the DD/MM/YY
format assumed.
Note that NO combination of date input formats will work. Also, all
three date fields must be present.
If any of the fields is to large then a carry operation will
occur. i.e. 34/13/89 would come out to year 90, month 2, day 3.
The same is true of the time portion.
If the date or time portion of the input string are omitted, then
this function will behave like the datesec() or timesec() respectively.
If input seconds is an array, then an array of
N_ELEMENTS(inputs vals) of date strings and remainders will be
returned.
REVISION HISTORY:
@(#)datetimesec.pro 1.2 07/20/95
Originally written by Jonathan M. Loran, University of
California at Berkeley, Space Sciences Lab. Sep. '91
Revised to handle arrays of input values, JML, Jan. '92
(See idlUtil/datetime/datetimesec.pro)
FUNCTION:
DATETIMESEC_DOY
DESCRIPTION:
function to return seconds since 1/1/1970 00:00 UT, from date and
time given as day, month, year, hour, minute, second, millisecond.
USAGE (SAMPLE CODE FRAGMENT):
; set up a date and time (21 Mar '91, 00:01:01.000)
doy = 80
year = 91
hour = 0
min = 1
sec = 1
msc = 0
; convert to seconds
sec_date_time = datetimesec_doy(year, doy, hour, min, sec, msc)
; print it out
PRINT, sec_date_time
--- Sample output would be
669517261
NOTES:
If any of the fields are are out of range, the value will be carried.
e.g. given date and time of 31/12/90, 25:01:00.1001, this will be
converted to 1/1/91, 01:01:01: 001
If any of the input values are negitive, this is an error and -1 will
This function can return seconds of days, or seconds since 1970 only
by calling it with dates or times set to zero.
If input values are arrays, then an array of N_ELEMENTS(inputs vals)
of date strings and remainders will be returned. The number of
array elements for all input parameters must be the same
REVISION HISTORY:
@(#)datetimesec_doy.pro 1.2 01/26/99
Originally written by Jonathan M. Loran, University of
California at Berkeley, Space Sciences Lab. Sep. '91
Revised to handle arrays of input values, JML, Mar. '92
(See idlUtil/datetime/datetimesec_doy.pro)
FUNCTION:
DATETIMESEC_VAR
DESCRIPTION:
function to return seconds since 1/1/1970 00:00 UT, from date and
time given as day, month, year, hour, minute, second, millisecond.
USAGE (SAMPLE CODE FRAGMENT):
; set up a date and time (21 Mar '91, 00:01:01.000)
day = 21
month = 3
year = 91
hour = 0
min = 1
sec = 1
msc = 0
; convert to seconds
sec_date_time = datetimesec_var(day, month, year, hour, min, sec, msc)
; print it out
PRINT, sec_date_time
--- Sample output would be
669517261
NOTES:
If any of the fields are are out of range, the value will be carried.
e.g. given date and time of 31/12/90, 25:01:00.1001, this will be
converted to 1/1/91, 01:01:01: 001
If any of the input values are negitive, this is an error and -1 will
This function can return seconds of days, or seconds since 1970 only
by calling it with dates or times set to zero.
If input values are arrays, then an array of N_ELEMENTS(inputs vals)
of date strings and remainders will be returned. The number of
array elements for all input parameters must be the same
REVISION HISTORY:
@(#)datetimesec_var.pro 1.2 07/20/95
Originally written by Jonathan M. Loran, University of
California at Berkeley, Space Sciences Lab. Sep. '91
Revised to handle arrays of input values, JML, Mar. '92
(See idlUtil/datetime/datetimesec_var.pro)
NAME: day_to_year_doy PURPOSE: determines year and day of year given day since 0000 AD USAGE: day_to_year_doy,daynum,year,doy INPUT: daynum: (long int) day since 0 AD OUTPUT: year: year (0 <= year <= 14699 AD) doy: day of year (1 <= doy <= 366) NOTES: This procedure is reasonably fast, it works on arrays and works from 0 AD to 14699 AD CREATED BY: Davin Larson Oct 1996 FILE: day_to_year_doy.pro VERSION: 1.2 LAST MODIFICATION: 97/01/27
(See idlUtil/windGeneral/misc/day_to_year_doy.pro)
brief way to check if a variable has been defined yet.
returns 1 for defined variables, 0 for undefined.
example:
if defined(x) then begin
do_stuff_to(x)
endif
Originally written 9-July-1996 by Bill Peria
(See idlUtil/misc/defined.pro)
returns 3-point derivative of a 1-d array.
(See idlUtil/misc/deltas.pro)
Procedure: diag_p, p, n, t=t, s=s INPUT: p: pressure array of n by 6 or a string (e.g., 'p_3d_el') n: density array of n or a string (e.g., 'n_3d_el') PURPOSE: Returns the temperature: [Tpara,Tperp,Tperp], and the unit symmetry axis s. Also returns 'T_diag' and 'S.axis' for plotting purposes. CREATED BY: Tai Phan 95-09-28 LAST MODIFICATION: 95-9-29 Tai Phan
(See idlUtil/windGeneral/science/diag_p.pro)
FUNCTION: dimen(x) PURPOSE: Returns the dimensions of an array as an array of integers. INPUT: matrix RETURNS: vector of dimensions of matrix. If the input is undefined then 0 is returned. if the input is a scaler then 1 is returned. SEE ALSO: "dimen", "data_type", "dimen1", "dimen2" CREATED BY: Davin Larson LAST MODIFICATION: @(#)dimen.pro 1.6 96/12/16
(See idlUtil/windGeneral/misc/dimen.pro)
FUNCTION: dimen1 INPUT: matrix RETURNS: scaler int: size of first dimension (1 if dimension doesn't exist) CREATED BY: Davin Larson LAST MODIFICATION; @(#)dimen1.pro 1.3 95/08/24
(See idlUtil/windGeneral/misc/dimen1.pro)
FUNCTION: dimen2 INPUT: matrix RETURNS: scaler int: size of second dimension (1 if dimension doesn't exist) CREATED BY: Davin Larson LAST MODIFICATION; @(#)dimen2.pro 1.3 95/08/24
(See idlUtil/windGeneral/misc/dimen2.pro)
FUNCTION: dimen_shift(x,shift) NAME: dimen_shift PURPOSE: Rotate dimensions of a multidimensional array. This function is very similar to transpose but works on multi-dimensional arrays to shift the dimensions around. It has no effect on scalars and one dimensional arrays. INPUT: x multi-dimensional array of any type shift: 1 or -1 direction of shift. CREATED BY: Davin Larson LAST MODIFICATION: @(#)dimen_shift.pro 1.3 96/10/10