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
(See idlUtil/windGeneral/misc/dimen_shift.pro)
PROCEDURE: doy_to_month_date, year, doy, month, date NAME: doy_to_month_date PURPOSE: Determines month and date given the year and day of year. fast, vector oriented routine that returns the month and date given year and day of year (1<=doy<=366) CREATED BY: Davin Larson Oct 1996 FILE: doy_to_month_date.pro VERSION: 1.2 LAST MODIFICATION: 97/01/27
(See idlUtil/windGeneral/misc/doy_to_month_date.pro)
PROCEDURE: draw_color_scale NAME: draw_color_scale Purpose: Procedure to draw a color scale. Documentation not finished!
(See idlUtil/windGeneral/tplot/draw_color_scale.pro)
FUNCTION: ec_2d((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), 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 characteristic energy, Ec, eV NOTES: Function calls j_2d.pro and je_2d.pro Function normally called by "get_2dt.pro" to generate time series data for "tplot.pro". CREATED BY: J.McFadden LAST MODIFICATION: 96-7-5 J.McFadden
(See idlUtil/science/ec_2d.pro)
PROCEDURE: edit3dbins,dat,bins
PURPOSE: Interactive procedure to produce a bin array for selectively
turning angle bins on and off. Works on a 3d structure (see
"3D_STRUCTURE" for more info)
INPUT:
dat: 3d data structure. (will not be altered)
bins: a named variable in which to return the results.
KEYWORDS:
EBINS: Specifies energy bins to plot.
SUM_EBINS: Specifies how many bins to sum, starting with EBINS. If
SUM_EBINS is a scaler, that number of bins is summed for
each bin in EBINS. If SUM_EBINS is an array, then each
array element will hold the number of bins to sum starting
at each bin in EBINS. In the array case, EBINS and SUM_EBINS
must have the same number of elements.
SEE ALSO: "PLOT3D" and "PLOT3D_OPTIONS"
CREATED BY: Davin Larson
FILE: edit3dbins.pro
VERSION: 1.11
LAST MODIFICATION: 96/02/16
(See idlUtil/windGeneral/science/edit3dbins.pro)
FUNCTION: energy_to_ebin(dat,en) INPUT: dat: structure, 2d data structure filled by get_eesa_surv, get_eesa_burst, etc. en: real,fltarr, real or float array of energy values KEYWORD: BIN int,intarr optional, angle bins corresponding to "en" used when energies depend upon angle bin PURPOSE: Returns the energy bin numbers in "dat.energy" nearest to "en" CREATED BY: J.McFadden LAST MODIFICATION: 96-4-22 J.McFadden
(See idlUtil/science/energy_to_ebin.pro)
NAME: enlarge_periodic FUNCTION: enlarge_periodic INPUT: image (On the surface of a sphere) PURPOSE: enlarges a 2 dimensional matrix by n elements on each side It assumes the array has spherical boundary conditions. OUTPUT: enlarged image array NOTES: Called from function: 'SMOOTH_PERIODIC' CREATED BY: Davin Larson LAST MODIFICATION: @(#)smooth_periodic.pro 1.5 95/10/04
(See idlUtil/windGeneral/science/smooth_periodic.pro)
PROCEDURE: extract_tags, newstruct, oldstruct
PURPOSE: takes the named tag elements from oldstruct and puts them into
newstruct. This procedure is very useful for creating a structure that
can be passed onto the PLOT or OPLOT subroutines using the _EXTRA keyword.
If no tag keywords are included then all tag elements of oldstruct are
added to newstruct. The mode keyword PRESERVE is used to prevent the
overwritting of an existing keyword.
INPUTS:
newstruct: new structure to be created or added to.
oldstruct: old structure from which elements are extracted.
KEYWORDS: Only one of the following should be given:;
(TAG KEYWORDS)
TAGS: array of strings. (tag names) to be taken from oldstruct and put in
newstruct
EXCEPT: array of strings. Tag names not to be copied from old to new.
OPLOT: (flag) If set, then TAGS is set to an array of valid keywords
for the OPLOT subroutine.
PLOT: (flag) If set, then TAGS is set to an array of valid keywords
for the PLOT subroutine.
CONTOUR: (flag) If set, then TAGS is set to an array of valid keywords
for the CONTOUR procedure. (might not be complete)
If no KEYWORDS are set then all elements of oldstruct are put into newstruct
(MODE KEYWORDS)
PRESERVE: (flag) Prevents the overwritting of an existing, non-null keyword.
Adds tags to newstruct that were not already there, or if they were there
and their values were either "" or 0.
CREATED BY: Davin Larson
FILE: extract_tags.pro
VERSION 1.15
LAST MODIFICATION: 96/02/07
(See idlUtil/windGeneral/misc/extract_tags.pro)
see HELPFAST
(See idlUtil/fast/fasthelp.pro)
FUNCTION: FA_ALMANAC_DIR DESCRIPTION: Function to read fast_archive.conf a parse out the almanac directory RETURN VALUE: If successful, The almanac directory, else the string: '-error-' REVISION HISTORY: @(#)fa_almanac_dir.pro 1.1 03/04/97 Originally written by Jonathan M. Loran, University of California at Berkeley, Space Sciences Lab. Mar. '97
(See idlUtil/fast/fa_almanac_dir.pro)
PROCEEDURE: FA_FIELDS_BUFS, dat, n, delta_t=delta_t,
buf_starts=buf_starts, buf_ends=buf_ends
PURPOSE: Shows stretches of data with n or more points in a
row with no change in dt.
INPUT:
dat - Fast fields data structure or data.
- Or the time array
n - OPTIONAL: Minimum number of points to make a buffer.
- Default = 1024.
KEYWORDS:
delta_t - Allowable error in time steps. Default = 1.0e-6 s.
buf_starts - OUTPUT. A list of starting indecies of good streaks.
buf_ends - OUTPUT. A list of ending indecies of good streaks.
CALLING: fa_fields_bufs,dat ; Survey data.
OUTPUT:
buf_starts - A list of starting indecies of good streaks.
buf_ends - A list of ending indecies of good streaks.
SEE: fa_fields_filter, etc.
INITIAL VERSION: REE 97-03-17
MODIFICATION HISTORY:
Space Scienes Lab, UCBerkeley
(See idlUtil/fast/fa_fields_bufs.pro)
PROCEDURE: FA_FIELDS_COMBINE, dat1, dat2, result=result, add=add, $
delt_t=delt_t, interp=interp, spline=spline,
tag_2=tag_2, talk=talk
tag_1=tag_1, time_offset=time_offset, svy=svy
PURPOSE: Combines two time series data structures into one for dcE
analysis or cross-spectral analysis, etc.
INPUT:
dat1 - MASTER data. dat1.time is used if /interp or dt options
are used
dat2 - .comp1 is put into result or are added to dat1 as
comp(n+1) if /add. For now, no
multi-component data.
KEYWORDS:
result - dat2.comp1 time aligned with dat1.time.
add - Will cause result to be added to dat1 structure.
Using /add is very slow!
delt_t - Allowable delta t to determine a time match.
This is interpreted as allowable gap in interpolate
and spline modes.
interp - Interpolate dat2 values to dat1 times.
spline - Spline dat2 values to dat1 times. will not extrapolate.
tag_1 - The new component label in dat1 such as 'phase'.
If blank 'comp(n+1)' is used.
tag_2 - The tag name in dat2 to be added (e.g. 'comp3') to
dat1 structure. If not given, 'comp1' is assumed.
time_offset - Subtract time_offset from dat2.time to help match time.
svy - Survey data. delt_t set to 0.9 of time step in dat1.
talk - Prints out diagnostic messages.
CALLING: fa_fields_combine,V58,V12,/svy,/add ; Survey data.
Add phase to V58.
fa_fields_combine,V58,PHI,tag1='PHASE',/interp,delt_t=100., /add
OUTPUT: Result or comp(n+1) in dat1: IDL fields time series data
structure with multiple components.
SIDE EFFECTS: Need lots of memory.
INITIAL VERSION: REE 97-03-03
MODIFICATION HISTORY:
Space Scienes Lab, UCBerkeley
(See idlUtil/fast/fa_fields_combine.pro)
FUNCTION: FA_FIELDS_CROSS
PURPOSE: A high level routine which produces FFT spectrum of
time series data. Result is a spectrogram as a function of
time.
INPUT:
dat1 : A time series data structure.
dat2 : A second time series data structure.
KEYWORDS:
store : Store data as a tplot file. DEFAULT = 0
npts : OPTIONAL. The number of points in each FFT.
DEFAULT = 1024
nave : OPTIONAL. The number FFTs to average.
DEFAULT = 4
dt : OPTIONAL. For time series data with different
time axes, this is the maximum time difference
allowable between two points before they are
time aligned. See FA_FIELDS_COMBINE for more
info. Ignored when CHAN2 is not used.
slide : OPTIONAL. Overlap between FFTs. DEFAULT = 0.5
svy : OPTIONAL. Ignores changes in the time axis due
to varying sample rates. (Not working yet.)
structure : OPTIONAL. When using /STORE, the output to the
user is a string (no actual data) in order to
save memory. If both stored tplot data and
explicit user-level data are desired, set the
structure keyword to a data name when using
/STORE.
tags : OPTIONAL. An array of strings designating the
two tag names in DAT1 that should be used in the
cross-spectra. If CHAN2 is specified, the first
tag name corresponds to the DAT1 tag to be used,
and the second tag name corresponds to the tag
within CHAN2 to be used.
talk : OPTIONAL. Tells user some useful info during
processing.
CALLING: result = fa_fields_cross(dat)
EXAMPLE: You have COMP1, COMP2 in a structure DAT:
result = FA_FIELDS_CROSS(DAT)
Two structures DAT1 and DAT2:
result = FA_FIELDS_CROSS(DAT1,chan2=DAT2)
Tag names other than 'COMP1': Takes elements of TAGS -
result = FA_FIELDS_CROSS(DAT1, chan2=DAT2, tags=['data1','data2']
OUTPUT: RESULT is a data structure simlar to SFA or DSP. Function
returns -1 on some errors.
SIDE EFFECTS: May need lots of memory.
INITIAL VERSION: ver 1.0 GTD 04-16-97
MODIFICATION HISTORY: v1.1 GTD 07-21-97
Space Sciences Lab, UC Berkeley
(See idlUtil/fast/fa_fields_cross.pro)
PROCEDURE: FA_FIELDS_DESPIN, V58, V12, T1 = t1, T2 = t2,
PHASE = phase, USE_V158 = Use_V158,
SHADOW_NOTCH = shadow_notch,
MAG_NOTCH = mag_notch, STORE=store, SLOW=slow
PURPOSE: A high-level routine which produces despun DC electric field
data for FAST.
INPUT:
V58 - If blank, program will get V5-V8_S. If you want
to run this program on burst data, use
V58=get_fa_fields('V5-V8_4k',/all), for example.
V12 - If blank, program will get V1-V2_S
to run this program on burst data, use
V12=get_fa_fields('V1-V2_4k',/all), for example.
KEYWORDS:
USE_V158 If set, use V158, otherwise V1-V2. DEFAULT = 0
Note: be sure to set this if you supply V1-58!
SHADOW_NOTCH - Notch out shadow spikes (also known as "sun
spikes"). These are set to NaN's, unless the
Sinterp keyword is set. The default is
SHADOW_NOTCH = 0, in which case the sun spikes are
left alone.
MAG_NOTCH - Notch out mag pulses. These will be interpolated
across, unless the Bnan keyword is set.The default is
MAG_NOTCH = 1, so you must say ...,mag_notch=0,... if
you want to see the mag spikes.
STORE - Store data for tplot. DEFAULT = 1
SLOW - Uses FA_FIELDS_SPINFIT instead
of FF_QUICKFIT. DEFAULT = 0
T1, T2 - Start and stop time, if other than that
contained in V58 and V12, (or if those
quantities are not defined).
CALLING: fa_fields_despin,t1='1997-09-27/01:32',t2='1997-09-27/01:34'
That's easy! Now you can plot E_near_B and E_equatorward.
IMPORTANT! SDT SETUP: Need to have: V5-V8_S, V1-V2_S (or V1-V4_S, V4_S
and V8_S), 1032_spinPhase
OUTPUT: Dat is IDL fields time series data structure with multiple
components. This
SIDE EFFECTS: Need lots of memory.
INITIAL VERSION: REE 97-03-25
MODIFICATION HISTORY:
Space Scienes Lab, UCBerkeley
(See idlUtil/fast/fa_fields_despin.pro)
PROCEEDURE: FA_FIELDS_FILTER, dat, freq, mag=mag, db=db, recursive=recursive,
poles=poles, tags=tags, buf_len=buf_len, min_dt=min_dt,
nan=nan, buf_dt=buf_dt
PURPOSE: Filters the data COMP*.
INPUT:
dat - NEEDED. Fields data of any type.
freq - NEEDED. Pole of filter. If band_pass: [f1,f2] f1<f2
- If low-pass: [0,f]. If high-pass [f,0]
KEYWORDS:
mag - OPTIONAL. IF set, freq is % of Nyquist.
Note: /MAG IGNORED in recursive filter.
db - OPTIONAL. If convol option is taken, default = 120.
recursive - OPTIONAL. Use of recursive filter:
- advantages: Faster and Mimics SDT.
- disadvantages: Causes phase shift.
poles - OPTIONAL. If recursive option is taken, 1-8 default = 8.
tag - OPTIONAL. The tag name(s) of the data to be filtered.
buf_len - OPTIONAL. The min stretch of continous data (DFLT = 10).
min_dt - OPTIONAL. Allowable error in timeing. Default=1.e-6, may
want to set to 1.e-7 for HSBM.
nan - OPTIONAL. If set, will NAN data near edges.
buf_dt - OPTIONAL. Allowable error in fa_fields_bufs call.
USE: fa_fields_filter,dat,[0,1.0] ; Filter data to 1 Hz.
RETURN: Filters the data in place.
CREATED BY: REE, 97-03-17 - modified 97-10-03 REE added buf_dt
FILE: fa_fields_filter.pro
VERSION: 0.0
LAST MODIFICATION:
REE 97-04-08, Added NAN option.
(See idlUtil/fast/fa_fields_filter.pro)
FUNCTION: FA_FIELDS_MAGDC, t1=t1, t2=t2, fit=fit, twd=twd, tws=tws,
fit2=fit2, twd2=twd2, tws2=tws2,
iterate=iterate
PURPOSE: Gets mag data and calibrates accurately.
INPUT:
mag - OPTIONAL. 'MagDC' data structure.
KEYWORDS:
t1 - Optional start time.
t2 - Optional end time.
iterate - OPTIONAL. Will iterate fits twice.
talk - OPTIONAL. Give informational message.
plot - OPTIONAL. Plot results.
USED IN FF_MAG_SPEED:
min_streak - OPTIONAL. DEFAULT=40. Miniumun stretch of good data.
USED IN FF_MAG_TORQUE:
max_sig - OPTIONAL. Max error in fit. DFLT=10 nT
max_x0 - OPTIONAL. Maximum allowed x0. DFLT=40 nT.
Used to determine where torquers are on.
USED IN FF_MAG_REJECT:
max_err - OPTIONAL. Maximun allowable error. DFLT = 100 nT
ave_per - OPTIONAL. S/C period. DFLT = 5.0 s
nper_trq - OPTIONAL. Throw out points within nper_trq
spin periods of a torque boundary. DFLT = 1.5
npts_speed_af OPTIONAL. Throw out npts_speed_after
a speed change boundary. DFLT = 40
npts_speed_be OPTIONAL. Throw out npts_speed_before
a speed change boundary. DFLT = 5
npts_per_spin-OPTIONAL. Too tricky to describe. DFLT = 16
max_sig2 - OPTIONAL. Max error in fit. DFLT = 10 nT
n_sm - OPTIONAL. N_points to smooth fits. DFLT = 21
USED IN FF_MAG_TWD:
max_sig3 - OPTIONAL. Max error in tweak dynamic. DFLT = 10 nT
n_sm_twd - OPTIONAL. N_points to smooth fits. DFLT = 41
CALLING:
mag=fa_fields_magdc()
OUTPUT:
mag - A pointer struc containing results.
fit - Fits of raw data.
twd - Dynamic tweak matrix.
tws - Static tweak matrix.
fit2 - Fits of raw data, 2nd iteration.
twd2 - Dynamic tweak matrix, 2nd iteration.
tws2 - Static tweak matrix, 2nd iteration.
INITIAL VERSION: REE/RJS/KRB 97-10-02 - see UCLA_MAG_DESPIN, FF_XYMAGFIX
MODIFICATION HISTORY:
Space Scienes Lab, UCBerkeley
(See idlUtil/fast/fa_fields_magdc.pro)
FUNCTION: FA_FIELDS_SPEC
PURPOSE: A high level routine which produces FFT spectrum of
time series data.
INPUT:
dat - A time series data structure.
KEYWORDS:
store : Store data as a tplot file. DEFAULT = 0
npts : OPTIONAL. The number of points in FFT.
DEFAULT = 1024
nave : OPTIONAL. The number FFTs to average.
DEFAULT = 4
slide : OPTIONAL. Overlap between FFTs. DEFAULT = 0.5
svy : OPTIONAL. Ignores changes in the time axis due
to varying sample rates.
db : OPTIONAL. Specifies output to be in decibels
(10*log10(units^2/Hz))
t_name : OPTIONAL. A string array that sets the name of
the data in TPLOT.
structure : OPTIONAL. When the /STORE keyword is used, data
is not returned by the function (saves
memory). If both data and tplot variables are
desired, use STRUCTURE = <data name> to extract
the data explicitly.
tags : OPTIONAL. Specifies what tag names in the FFT to
be used for the spectra. Othwerwise routine will
grab all components.
CALLING: result = fa_fields_spec(dat)
OUTPUT: RESULT is a data structure simlar to SFA or DSP.
SIDE EFFECTS: Need lots of memory.
LIMITATIONS: Does NOT account for changing data rates. Be careful.
INITIAL VERSION: REE 97-04-10
MODIFICATION HISTORY: GTD 97-04-16
Space Sciences Lab, UCBerkeley
(See idlUtil/fast/fa_fields_spec.pro)
NAME: FA_FIELDS_SPINFIT
PURPOSE: To perform fits to the data from FAST spin plane sensors.
CALLING SEQUENCE: status = fa_fields_spinfit(data,TIMES=ts,X=x,$
Y=y,MAG=mag, SUN = sun, STORE = store)
INPUTS: DATA - a structure of the type returned by GET_FA_FIELDS.
KEYWORD PARAMETERS: TIMES - a named variable containing the center
times of the spinfit intervals.
SLIDE - the time between fits, in fractions of a
spin. The default is 1.0.
INTERVAL - the length of time used for each fit,
in units of the spin period. The default is 1.0.
X - a named variable in which the component of
the spinfit field along the sensor axis, for a
phase of zero, is returned.
Y - a named variable in which the component of
the spinfit field perpendicular the sensor axis,
for a phase of zero, is returned. The spin axis
is equal to the cross product of the X and Y
directions.
MAG - set this to do the spinfit with respect to
the background magnetic field. This is the default.
SUN - set this to spinfit with respect to the
Earth-Sun line.
STORE - set this to store the resulting spinfit
fields for TPLOT. By default, this is set.
OUTPUTS: STATUS - If all goes well, 1 is returned, otherwise 0.
SIDE EFFECTS: If /STORE is set, or if neither X, Y or STORE is set,
a TPLOT store of the spinfit components is performed.
RESTRICTIONS: If your data are poorly modeled by a sinusoid,
FA_FIELDS_SPINFIT will happily return nonsense. Severe
sun spiking in electric field data is one known
example of this. An algorithm to remove such spikes
(through the NOTCH tag in fields structures) is in the
works.
EXAMPLE: if fa_fields_spinfit(v58data,/store,/mag) then begin
tplot,['V5-V8_S_mag',''V5-V8_S_mag_perp']
endif
MODIFICATION HISTORY: Gathered together from summary plot routines,
in celebration of the vernal equinox, 1997, by
Bill Peria, UCB/SSL.
(See idlUtil/fast/fa_fields_spinfit.pro)
NAME: FA_FIELDS_SPIN_AVE
PURPOSE: Performs spin averages on FAST fields structures
CALLING SEQUENCE: fa_fields_spin_ave, data, BOX = box, SVD = svd,
NOTCH = notch, CENTER = center,phase = phase,
Sphase = sphase, MAG = mag, SUN = sun, SLIDE =
slide, INTERVAL = interval, NAME = name
INPUTS: DATA - a FAST fields data structure, or an array (which must
then be sent along with a DQD, and a time or phase array.
KEYWORD PARAMETERS: BOX - DEFAULT. If non-zero, a boxcar average
over BOX number of spins is performed.
SVD - OPTIONAL. if set, a spin-by-spin linear fit is
performed and the spin-centered offsets are
returned.
NOTCH - OPTIONAL. if set, ff_notch is called and
the "bad" phases of the data are weighted zero.
CENTER - OPTIONAL. the phase (mag or sun) in
degrees at which the values in DATA are located
after averaging. Has no effect if TIME is
defined. Default is zero.
PHASE - an array of phases, defined any way the
user wishes, except that they *must* be
monotonically increasing, i.e. atan(by,bx) is no
good for more than one spin. Also, the PHASE
array must be of the same size as the data
with which it will be paired.
FUNCT - if SVD is set, a string name of a model
function for use by SVDFIT.
MAG - DEFAULT if set, do average with respect to mag
phase.
SUN - if set, do fit average with respect to sun
phase.
STORE - if set, cause a TPLOT store of the
spin-averaged data, and does not overwrite the
input structure.
INTERVAL - the period over which to perform each
average, in units of one spin period. Default is
1.0.
SLIDE - the time between succesive averages, in
units of a spin period. Default is 1.0.
NAME - a string to use for the DATA_NAME in the
returned structure or the TPLOT name of the
stored quantity.
OUTPUTS: DATA - the input structure is spin-averaged in place,
unless STORE is set.
SIDE EFFECTS: the original data are averaged, and destroyed, unless
STORE is set.
EXAMPLE: pot = get_fa_potential()
fa_fields_spin_ave,potential
MODIFICATION HISTORY: written 2-April-1997 by Bill Peria UCB/SSL
(See idlUtil/fast/fa_fields_spin_ave.pro)
NAME: FA_FIELDS_STORE
PURPOSE: To perform a tplot store of FAST fields structures, like
those returned by GET_FA_FIELDS.
CALLING SEQUENCE: data = get_fa_fields('V5-V8_S')
fa_fields_store,data
INPUTS: A fields structure (up to six of them, actually.) The tags
DATA_NAME, VALID, and COMP* TIME are required.
KEYWORDS: NAME - a string for an alternate name to use for TPLOT
storage, otherwise, DATA.DATA_NAME is used.
SIDE EFFECTS: The data are TPLOT stored. The data are assumed to be
in the COMP* tags, and the TIME tag is used for time.
MODIFICATION HISTORY: written 29-April-1997 by Bill Peria UCB/SSL
(See idlUtil/fast/fa_fields_store.pro)
FUNCTION: FA_OUTPUT_PATH DESCRIPTION: Function to generate a pathname for output files for the FAST project. USAGE (SAMPLE CODE FRAGMENT): base_path = '/disks/juneau/scratch' data_level = k0 type = 'ees' orbit = 100 further_desc = 'is' ext = 'gif' path = fa_output_path( base_path, data_level, type, orbit, $ further_desc, ext) print, path --- output would be: /disks/juneau/scratch/fa_k0_ees_00100_is.gif ARGUMENTS: base_path: STRING, base path component of the output filename data_level: STRING, the data level. For example: k0, ql. type: STRING, usually one of 'ees', 'ies', 'dcf', 'acf', 'tms' orbit: The orbit of the data. further_desc: STRING, this will be inserted in the filename after the orbit. ext: STRING: The filename extension. If it is the empty string it means ther is no extension. RETURN VALUE: The path for the output file as given above will be returned, unless an error occurs, in which case the string: "INVALID" is returned. REVISION HISTORY: @(#)fa_output_path.pro 1.1 10/08/96 Originally written by Jonathan M. Loran, University of California at Berkeley, Space Sciences Lab. Oct. '96
(See idlUtil/fast/fa_output_path.pro)
NAME: FA_SHADOW
PURPOSE: To compute when FAST is in shadow or sunlight.
CALLING SEQUENCE: fa_shadow,t1,t2,USE=use NO_STORE=no_store,
DELTA_T = delta_t, STRUC = struc
OPTIONAL INPUTS: T1: start time in seconds since 1970, or as a
string. If T1 is an array, then those times are
used and T2 is ignored.
T2: end time
DELTA_T: time between points, ignored if T1 is an
array, default is 20 seconds.
KEYWORD PARAMETERS: USE: a TPLOT string handle pointing to a quantity
from which to grab the timespan.
NO_STORE: inhibits tplot storing
STRUC: a named variable in which the shadow info
is returned.
NO_CALL: inhibits the call to GET_FA_ORBIT. The
quantity 'fa_pos' must already have
been stored by a previous *appropriate*
call to GET_FA_ORBIT.
If none of these are defined, FA_SHADOW will use the currently
occurring orbit, and will do a tplot store.
OUTPUTS: A TPLOT quantity called 'sunlit?' is stored, which has
values of 0 or 1, labeled 'yes' and 'no' when plotted, and
the STRUC keyword contains the same information.
SIDE EFFECTS: If T1 or T2 is defined, then GET_FA_ORBIT is called
and previously stored orbit data will be over-written.
EXAMPLE: fa_shadow,use='ORBIT'
This will compute sun/shadow at those times when ORBIT is
currently stored.
MODIFICATION HISTORY: 23-April-1997 Bill Peria UCB/SSL
(See idlUtil/fast/fa_shadow.pro)
FUNCTION:
FA_TS_EFF
DESCRIPTION:
function to calculate teams survey efficiency.
INPUT:
en: Arrary (nnrgs, nbins) of energy
pac: A number for the calculation of post acceleration voltage
spec: Species for which the effciency is calculated. (0--3)
mode: Teams instrument mode. (0--9)
spin_section: The spin section of data readout (0--2)
0: don't care section.1: first half spin, 2: 2nd half spin
RETURN:
eff(nnrgs, nbins): Efficiency
eff_version: The version number of calibration data
CREADED BY:
Li Tang, University of New Hampshire
LAST MODIFICATION: 10/22/96. L.Tang
(See idlUtil/fast/fa_ts_eff.pro)
FUNCTION:
FA_TS_EFF_EQ
DESCRIPTION:
function to calculate teams survey efficiency on equator angle bins
INPUT:
en: Arrary (nnrgs, nbins) of energy
pac: A number for the calculation of post acceleration voltage
spec: Species for which the effciency is calculated. (0--3)
mode: Teams instrument mode. (0--9)
spin_section: The spin section of data readout (0--2)
0: don't care section.1: first half spin, 2: 2nd half spin
RETURN:
eff(nnrgs, nbins): Efficiency
eff_version: The version of calibration data
CREADED BY:
Li Tang, University of New Hampshire
LAST MODIFICATION: 8/14/96. LT
(See idlUtil/fast/fa_ts_eff_eq.pro)
FUNCTION:
FA_TTOF_CALIBRATION
DESCRIPTION:
to calculate the teams Time Of Flight(TOF)
INPUT:
energy: Array (nnrgs, nbins) of energy
pac: pac: A number for the calculation of post acceleration voltage
RETURN:
TOF_EFF(nenergy, pixels, species)
version: version of calibration data.
CREADED BY:
Li Tang, University of New Hampshire, Space Physics Lab
LAST MODIFICATION: 8/14/96. LT
(See idlUtil/fast/fa_ttof_calibration.pro)
FUNCTION:
FA_WEB_PATH
DESCRIPTION:
Function to generate a pathname where one would write world wide
web files for the FAST project.
USAGE (SAMPLE CODE FRAGMENT):
base_path = '/disks/cdstudio/WWWSUM'
time = str_to_time ('1997-1-1/00:00:00')
data_level = 'k0'
type = 'ees'
orbit = 100
auroral_cross = 'is'
ext = 'gif'
path = fa_web_path( base_path, time, data_level, type, orbit, $
auroral_cross, ext)
print, path
--- output would be:
/disks/cdstudio/WWWSUM/1997_01_01_00100/fa_k0_ees_00100_is.gif
ARGUMENTS:
base_path: STRING, this is the to level directory where
the www files reside.
time: Any standard time type: the start time of the
data.
data_level: STRING, the data level. For example: k0, ql.
type: STRING, one of 'ees', 'ies', 'dcf', 'acf', 'tms'
orbit: The orbit of the data.
auroral_cross: STRING, this is one of 'in', 'on', 'is', 'os'
ext: STRING: The file type, must be one of 'gif',
'ps', ''. (The empty string means no extension.)
RETURN VALUE:
The path for the web file as given above will be
returned, unless an error occurs, in which case the
string: "INVALID" is returned.
REVISION HISTORY:
@(#)fa_web_path.pro 1.4 10/08/96
Originally written by Jonathan M. Loran, University of
California at Berkeley, Space Sciences Lab. Oct. '96
(See idlUtil/fast/fa_web_path.pro)
FUNCTION: FDF_ORB_WRITE
PURPOSE: Writes an orbit file in the style of the FDF for use
as an input file to orbgen. The file will contain
only an epoch, position vector, and velocity vector.
Orbgen does not need the other orbit parameters
(ecc., manomaly, etc.) to propagate an orbit when
given this form of input.
KEYWORDS:
EPOCH The time for which the position and velocity vectors
are given. (String or double float.)
POSITION Three-element position vector in GEI.
VELOCITY Three-element velocity vector in GEI.
FILE The name of the file to be created.
CREATED: 97-8-21
By J.Rauchleiba
(See idlUtil/fast/fdf_orb_write.pro)
PRO: FF_DAT_TO_PTR, dat, tags=tags, streak=streak, double=double
PURPOSE: Converts all 'tags' to pointers. These include all arrays which
are length npts if npts > 100. Will convert streaks if asked.
CALLING: fu_dat_to_ptr,dat, /streak, /double
Pretty simple!
INPUTS: A valid data structure.
KEYWORD PARAMETERS:
tags - OPTIONAL. If given, only tags are converted.
streak - OPTIONAL. IF set, 'STREAK*' will be converted to ptr.
double - OPTIONAL. IF set, 'COMP*' will be converted to double.
OUTPUTS: Alters dat.
INITIAL VERSION: REE 97_10_20
MODIFICATION HISTORY:
Space Scienes Lab, UCBerkeley
(See idlUtil/fast/ff_dat_to_ptr.pro)
PROCEEDURE: FF_DCE_FIX, dat, time, zero, zt, ratio, rt
PURPOSE: Routine called by fa_fields despin to fix zero level and
relative gain of dcE signals. Not for general use.
INPUT:
dat - REQUIRED. A DATA ARRAY - NOT A STRUCTURE!
time - REQUIRED. A DATA ARRAY - NOT A STRUCTURE!
zero - REQUIRED. The zero level is subtracted.
zt - REQUIRED. Time array of zero.
ratio- Optional. The ratio is multiplied.
rt - Time array of ratio.
KEYWORDS:
CALLING: ff_dce_fix,dat,time,zero,zt,ratio,rt
OUTPUT: Fixes zero level and gain of data.
INITIAL VERSION: REE 97-03-29
MODIFICATION HISTORY:
Space Scienes Lab, UCBerkeley
(See idlUtil/fast/ff_dce_fix.pro)
PROCEEDURE: FF_FIXTIME, time, kept=kept, fix=fix
PURPOSE: Identifies stretches of data that are time reversed. Throws
away the fewest number of points. Used a C-call.
INPUT:
time - Time array.
KEYWORDS:
kept - Where the good points are.
fix - Fixes the time array for you. DEFAULT = 1
CALLING: fix_time, time
OUTPUT: None.
INITIAL VERSION: REE 97-03-25
MODIFICATION HISTORY:
Space Scienes Lab, UCBerkeley
(See idlUtil/misc/ff_fixtime.pro)
FUNCTION: FF_INFO, dqd, talk=talk, pot=pot, notch=notch
PURPOSE: A utility routine which gives default values for FAST FIELDS.
Examples: potential, notching. USER HOSTILE.
INPUT:
dqd - USUALLY REQUIRED. A string that starts with:
'V5-V8', 'V1-V2', 'V1-V4', 'V5-V6','V7-V8', or 'V1-V58'
KEYWORDS:
talk - Messages and descriptions appear on the screen.
pot - Returns information for forming potentials from
fields data.
CALLING: ff_notch(/pot)
OUTPUT: A structure that depends on the specific information requested.
INITIAL VERSION: REE 97-04-01
MODIFICATION HISTORY:
Space Scienes Lab, UCBerkeley
(See idlUtil/fast/ff_info.pro)
FUNCTION: FF_INTERP, time1, time2, data2, delt_t=delt_t, spline=spline,
nearest=nearest, ptr=ptr
PURPOSE: A utility routine which that interpolates through notched
dc fields data. Called by ff_notch. User hostile.
INPUT:
time1 - REQUIRED. Double array of time to interpolate to.
time2 - REQUIRED. Double array of time must match data2.
data2 - REQUIRED. Data will be expanded or reduced to meet time1
may be double, float, long, int, or byte array
any of inputs time1, time2 or data2 may be pointers.
NOTE: the values of TIME2 must all be finite, i.e. no NaN's!!!
KEYWORDS:
delt_t - Largest delta t interpret across. DEFAULT = 1.0d
spline - Use cubic spline interpolation instead of linear.
nearest - Choose nearest point in time2 for each point in time1.
ptr - Return a pointer to an array of same type as data2.
DEFAULT = ptr is time1 is ptr, otherwise not prt.
CALLING: data1 = ff_interp(time1, time2, data2)
OUTPUT: data1 is superset of data2, interpolated from time2 to time1.
If data2 is a pointer, then data1 will be a pointer.
INITIAL VERSION: REE 97-03-25
MODIFICATION HISTORY: KRB 97-06-17. add cubic spline interpolation.
REE 97-11-17. Change ptr call.
Space Scienes Lab, UCBerkeley
(See idlUtil/fast/ff_interp.pro)
FUNCTION: FF_MAGFIT, mag, out=out, talk=talk, max_err=max_err, plot=plot
PURPOSE: Wrapper between ff_magdc to ff_qfit.
NOT FOR GENERAL USE!
IDL 5 OR HIGHER - USES POINTERS!
INPUT:
mag - REQUIRED. 'MagDC' data structure. MAY HAVE POINTERS!
KEYWORDS:
out - OPTIONAL. Will locate bad points in mag.notch.
talk - OPTIONAL. Give informational message.
plot - OPTIONAL. Plots results.
max_err - OPTIONAL. Maximun allowable error. DFLT = 25 nT
CALLING:
fit = ff_magfit(mag)
OUTPUT: fit.
INITIAL VERSION: REE/RJS/KRB 97-10-20 - see UCLA_MAG_DESPIN, FF_XYMAGFIX
MODIFICATION HISTORY:
Space Scienes Lab, UCBerkeley
(See idlUtil/fast/ff_magfit.pro)
FUNCTION: FF_MAGFIT_SM, mag, fit, n_sm=n_sm, max_sig=max_sig, talk=talk
PURPOSE: Routine calculates a dynamic tweak matrix
IDL VER 5 AND GREATER!
NOT FOR GENERAL USE!
INPUT:
mag - REQUIRED. 'MagDC' data structure.
fit - REQUIRED. Fits from ff_magfit.
KEYWORDS:
max_sig - OPTIONAL. Maximum allowed sigma in fit. DFLT=10 nT.
n_sm - OPTIONAL. Smooting cof.
talk - OPTIONAL. Give informational message.
CALLING:
fit_sm = ff_magfit_sm(mag, fit)
OUTPUT: sm_fit.
INITIAL VERSION: REE/RJS/KRB 97-10-20 - see UCLA_MAG_DESPIN, FF_XYMAGFIX
MODIFICATION HISTORY:
Space Scienes Lab, UCBerkeley
(See idlUtil/fast/ff_magfit_sm.pro)
PROCEEDURE: FF_MAGFIX, mag, Bphase, filt=filt, freq=freq, max_chi = max_chi
PURPOSE: Performs a crude fix to the mag data. Essentially filters
spiky noise and trows away spin tone on Z component.
Before calling this routine:
(1) Get 'MagDC'.
INPUT:
mag - REQUIRED. 'MagDC' data structure.
phs - OPTIONAL. Bphase interpolated to MagDC.
KEYWORDS:
filt - Filter cof for tweak values. DEFAULT = 0.1
freq - Percent Nyquist to filter data.
max_chi - Maximum reduced chi-square of fit yielding usable tweak
values. DEFAULT = 1.0
CALLING:
ff_magfix,mag
OUTPUT: mag.comp3 altered.
INITIAL VERSION: REE 97-04-10
MODIFICATION HISTORY:
Space Scienes Lab, UCBerkeley
(See idlUtil/fast/ff_magfix.pro)
PROCEEDURE: FF_MAG_BUFS, mag, n, delta_t=delta_t, fit=fit,
buf_starts=buf_starts, buf_ends=buf_ends
PURPOSE: Shows stretches of data with n or more points in a
row with no change in dt.
ALSO LOCATES TORQUE AND /SUN SHADOW BOUNDARIES
MAG MUST HAVE 'SUN' AND 'TORQUE' ELEMENTS!
NOT FOR GENERAL USE.
INPUT:
mag - Fast fields data structure or data.
- Or the time array
n - OPTIONAL: Minimum number of points to make a buffer.
- Default = 1024.
KEYWORDS:
delta_t - Allowable error in time steps. Default = 1.0e-6 s.
buf_starts - OUTPUT. A list of starting indecies of good streaks.
buf_ends - OUTPUT. A list of ending indecies of good streaks.
fit - OPTIONAL. IF included, fit.buf will be updated.
CALLING: fa_fields_bufs,dat ; Survey data.
OUTPUT:
buf_starts - A list of starting indecies of good streaks.
buf_ends - A list of ending indecies of good streaks.
SEE: fa_fields_filter, etc.
INITIAL VERSION: REE 97-03-17
MODIFICATION HISTORY:
Space Scienes Lab, UCBerkeley
(See idlUtil/fast/ff_mag_bufs.pro)
PROCEEDURE: FF_MAG_EXTEND, data, time, n_fit, t_strt=t_strt, t_stop=t_stop
PURPOSE: Extends data to t_strt and t_stop with ladfit.
NOT GENERAL PURPOSE.
INPUT:
data - REQUIRED. Data to be extended.
time - REQUIRED. Time corrsonding to data.
n_fit - OPTIONAL. Number of points to fit. DEFAULT = 9.
KEYWORDS:
t_strt - OPTIONAL. Early time to extend to.
t_stop - OPTIONAL. Late time to extend to.
CALLING:
ff_mag_extend, data, time, n_fit, t_strt=t_strt, t_stop=t_stop
OUTPUT: Adds points to data.
INITIAL VERSION: REE 97-10-20
MODIFICATION HISTORY:
Space Scienes Lab, UCBerkeley
(See idlUtil/fast/ff_mag_extend.pro)
PROCEEDURE: FF_MAG_REJECT, mag, fit
PURPOSE: REJECTS BAD MAG DATA.
IDL 5 OR HIGHER - USES POINTERS!
INPUT:
mag - REQUIRED. 'MagDC' data structure. MAY HAVE POINTERS!
fit - REQUIRED. Fit to mag data. See ff_magfit.
KEYWORDS:
max_err - OPTIONAL. Maximun allowable error. DFLT = 100 nT
ave_per - OPTIONAL. S/C period. DFLT = 5.0 s
nper_trq - OPTIONAL. Throw out points within nper_trq
spin periods of a torque boundary. DFLT = 1.5
npts_speed_af OPTIONAL. Throw out npts_speed_after
a speed change boundary. DFLT = 40
npts_speed_be OPTIONAL. Throw out npts_speed_before
a speed change boundary. DFLT = 5
npts_per_spin-OPTIONAL. Too tricky to describe. DFLT = 16
n_sm - OPTIONAL. N_points to smooth fits. DFLT = 21
max_sig - OPTIONAL. Max error in fit. DFLT = 10 nT
talk - OPTIONAL. Give informational message.
plot - OPTIONAL. Plot results.
CALLING:
ff_mag_reject, mag, fit
OUTPUT: Adds notch, notch3, and bphase to mag.
INITIAL VERSION: REE/RJS/KRB 97-10-20 - see UCLA_MAG_DESPIN, FF_XYMAGFIX
MODIFICATION HISTORY:
Space Scienes Lab, UCBerkeley
(See idlUtil/fast/ff_mag_reject.pro)
PROCEEDURE: FF_MAG_SPEED, mag, fit=fit, ptr=ptr, min_streak=min_streak,
plot=plot
PURPOSE: Routine determines sample speed in log2(smaples/s).
NOT FOR GENERAL USE! ACCEPTS PTR STRUCTURE.
INPUT:
mag - REQUIRED. 'MagDC' data structure. MAY HAVE POINTERS!
KEYWORDS:
fit - OPTIONAL. Fits from ff_magfit.
ptr - OPTIONAL. DEFAULT = SAME. Adds a pointer to mag.
min_streak - OPTIONAL. DEFAULT = 40. Miniumun stretch of good
data points in a valid buffer.
plot - OPTIONAL. Plots the results.
CALLING:
ff_mag_speed, mag, fit=fit.
OUTPUT: Adds structure elememt 'speed' to mag and fit.
INITIAL VERSION: REE 97-10-20 - see UCLA_MAG_DESPIN, FF_XYMAGFIX
MODIFICATION HISTORY:
Space Scienes Lab, UCBerkeley
(See idlUtil/fast/ff_mag_speed.pro)
PROCEEDURE: FF_MAG_SUN, mag, fit=fit, talk=talk, plot=plot
PURPOSE: Routine determines where torque on/off is.
NOT FOR GENERAL USE! ACCEPTS PTR STRUCTURE.
INPUT:
mag - REQUIRED. DC mag data.
KEYWORDS:
fit - OPTIONAL. Fits from ff_magfit.
talk - OPTIONAL. Give informational message.
CALLING:
ff_mag_sun, mag, fit=fit.
OUTPUT: Adds structure elememt 'sun' to mag and fit.
INITIAL VERSION: REE 97-10-20 - see ff_magdc
MODIFICATION HISTORY:
Space Scienes Lab, UCBerkeley
(See idlUtil/fast/ff_mag_sun.pro)
PROCEEDURE: FF_MAG_TORQUE, mag, fit, max_sig=max_sig, max_x0=max_x0,
add_sig=add_sig, talk=talk, plot=plot
PURPOSE: Routine determines where torque on/off is.
NOT FOR GENERAL USE!
IDL 5 OR HIGHER - USES POINTERS!
INPUT:
fit - REQUIRED. Fits from ff_magfit.
mag - OPTIONAL. ENTER 0 IF YOU NOT WANT MAG ALTERED!
KEYWORDS:
max_sig - OPTIONAL. Maximum allowed sigma in fit. DFLT=10 nT.
max_x0 - OPTIONAL. Maximum allowed x0. DFLT=40 nT.
Used to determine where torquers are on.
add_sig - OPTIONAL. Add where 'good' to fit.
talk - OPTIONAL. Give informational message.
plot - OPTIONAL. Plot the torquer results.
CALLING:
ff_mag_torque, 0, fit, /add_sig - Adds torque and sigma to fit.
OUTPUT: Adds structure elememt 'torque' and 'good'.
INITIAL VERSION: REE/RJS/KRB 97-10-20 - see ff_magdc
MODIFICATION HISTORY:
Space Scienes Lab, UCBerkeley
(See idlUtil/fast/ff_mag_torque.pro)
FUNCTION: FF_MAG_TWC, fit, talk=talk
PURPOSE: Routine calculates a static tweak matrix.
IDL VER 5 AND GREATER!
NOT FOR GENERAL USE!
INPUT:
fit - REQUIRED. Fits from ff_magfit.
KEYWORDS:
talk - OPTIONAL. Give informational message.
CALLING:
twc = ff_mag_twc(fit)
OUTPUT: twc.
INITIAL VERSION: REE/RJS/KRB 97-10-20 - see ff_magdc
MODIFICATION HISTORY:
Space Scienes Lab, UCBerkeley
(See idlUtil/fast/ff_mag_twc.pro)
FUNCTION: FF_MAG_TWD, mag, fit, n_sm=n_sm,max_sig=max_sig,talk=talk,plot=plot
PURPOSE: Routine calculates a dynamic tweak matrix
IDL VER 5 AND GREATER!
NOT FOR GENERAL USE!
INPUT:
mag - REQUIRED. 'MagDC' data structure.
fit - REQUIRED. Fits from ff_magfit.
KEYWORDS:
max_sig - OPTIONAL. Maximum allowed sigma in fit. DFLT=10 nT.
n_sm - OPTIONAL. Smooting cof.
talk - OPTIONAL. Give informational message.
plot - OPTIONAL. Plots Results.
CALLING:
twd = ff_mag_twd(mag, fit)
OUTPUT: pfit.
INITIAL VERSION: REE/RJS/KRB 97-10-20 - see UCLA_MAG_DESPIN, FF_XYMAGFIX
MODIFICATION HISTORY:
Space Scienes Lab, UCBerkeley
(See idlUtil/fast/ff_mag_twd.pro)
PROCEEDURE: FF_MAG_TWKDAT, mag, tw, talk=talk, plot=plot
PURPOSE: Applies the tweak matrix to the magnetic field data.
NOT FOR GENERAL USE! IDL >=5.0 COMPATABLE. ALLOWS POINTERS.
INPUT:
mag - REQUIRED. Data structure.
tw - REQUIRED. Static or dynamic tweak matrix.
KEYWORDS:
talk - OPTIONAL. Give informational message.
plot - OPTIONAL. Plots results.
CALLING:
ff_mag_twkdat,mag,twc
OUTPUT: fit.
INITIAL VERSION: REE/RJS/KRB 97-10-20 - see ff_magdc
MODIFICATION HISTORY:
Space Scienes Lab, UCBerkeley
(See idlUtil/fast/ff_mag_twkdat.pro)
FUNCTION: FF_MAG_TWKFIT, fit, twc
PURPOSE: Routine calculates a constant tweak matrix for the orbit.
NOT FOR GENERAL USE!
INPUT:
fit - REQUIRED. Fits from ff_magfit.
twc - REQUIRED. Static tweak matrix.
KEYWORDS:
CALLING:
fit = ff_mag_twkfit(fit,twc)
OUTPUT: fit.
INITIAL VERSION: REE/RJS/KRB 97-10-20 - see ff_magdc
MODIFICATION HISTORY:
Space Scienes Lab, UCBerkeley
(See idlUtil/fast/ff_mag_twkfit.pro)
FUNCTION: FF_NOTCH, dqd, data, Bphase=Bphase, Binterp=Binterp, Bnan=Bnan,
Sphase=Sphase, Sinterp=Sinterp, Snan=Snan
PURPOSE: A utility routine which that notches dc fields data on
magphase or sunphase.
INPUT:
dqd - REQUIRED. A string that starts with:
'V5-V8', 'V1-V2', 'V1-V4', 'V5-V6','V7-V8', or 'V1-V58'
data - OPTIONAL. An byte, int, long, float, or double arrray.
KEYWORDS:
Bphase Magnetic field phase. One of Bphase or Sphase
is REQUIRED. This array
must have the same number of points as data.
See fa_fields_combine to form data.
Binterp - If set, interpolates mag notched data. DEFAULT = 0
Bnan - If set, mag notched data is set to fnan. DEFAULT = 0
Sphase Sun spin phase. One of Bphase or Sphase
is REQUIRED. This array
must have the same number of points as data.
See fa_fields_combine to form data.
Sinterp - If set, interpolates sun notched data. DEFAULT = 0
Bnan - If set, sun notched data is set to fnan. DEFAULT = 0
CALLING: ff_notch(comp1, 'V5-V8', Bphase=Bphase, /Bint)
OUTPUT: A byte array of the notched data. If Data is changed in place.
INITIAL VERSION: REE 97-03-25
MODIFICATION HISTORY: 97-04-03. Ne added by REE.
Space Scienes Lab, UCBerkeley
(See idlUtil/fast/ff_notch.pro)
PROCEDURE: FF_PDQFIT, dat, phs, coeff, phsf, m=m, funct=funct
period=period, slide=slide,
n_fitpts=n_fitpts, out=out
PURPOSE: Performs a crude, but very fast spin fit to the data.
Before calling this routine:
(1) Notch the data with Bphase and/or Sphase.
(2) Recommend filtering the data to 5 Hz at 2-poles.
INPUT:
dat - REQUIRED. A DATA ARRAY - NOT A STRUCTURE!
RECOMMEND: dat_in does not have NANS. One nan
may destroy entire period.
phs - REQUIRED. A DATA ARRAY - NOT A STRUCTURE!
IMPORTANT! PHS CANNOT HAVE NAN'S!
OUTPUT:
coeff - fltarr(N, M) for the N spin fits.
phsf - fltarr(N) Phase of fit.
See Also: KEYWORDS.
KEYWORDS:
M - INPUT. number of basis functions. DEFAULT = 4
Funct - INPUT. Function which given array of phase returns vectors
corresponding to the basis functions evaluated at each
input phase. Must accept input values of X (an array
of phases) and M (the number of basis functions)
and output an (nelements(X), M) element
matrix containing the basis functions.
for M = 4, DEFAULT = ONE_PHI_COS_SIN
for M = 6, DEFAULT = ONE_PHI_COS_SIN_PHICOS_PHISIN
period - INPUT. Fit period. DEFAULT = 2pi
slide - INPUT. Number of periods to slide. DEFAULT = 0.5.
NOTE: Slide will be forced to be interger # of fit pnts.
n_fitpts - INPUT. Number of points per fit. DEFAULT = 64.
out - INPUT. outlier rejection mode. reject points with
deviation greater than 1.2 + i*0.4 and iterate.
NOT IMPLEMENTED YET
sigma - OUTPUT. the sigma for each fit.
CALLING:
index = where(finite(your_data) AND finite(your_phase), n_finite)
IF (nfinite GT 0) then BEGIN
dat = your_data(index)
phs = your_phase(index)
ff_pdqfit,dat,phs,es=es, ec=ec, phsf=phsf, zero=zero
ENDIF
ALTERNATIVE CALL: ff_pdqfit, dat, time, period = 5.0d, $
es=es, ec=ec, phsf=phsf, zero=zero
INITIAL VERSION: KRB 07-01-97
MODIFICATION HISTORY:
Space Sciences Lab, UCBerkeley
(See idlUtil/fast/ff_pdqfit.pro)
FUNCTION: FF_PHASE_ZC, time_, data_, smooth=smooth, period=period,
tzero=tzero
PURPOSE: Calculates the phase from zero crossings. IMPUT ARRAY MUST HAVE
CONSTANT DT! SEE FA_FIELDS_BUFS.
INPUT:
time_ - REQIRED. Double array. NOTE: subtract time(0)
to avoid large errors!
data_ - REQIRED. Must be nearly sinusoidal at spin_per.
KEYWORDS:
freq - Smoothing frequency in Hertz. DEFAULT = 0.8 Slow Survey
and 10.0 in Fast Survey. Optimized by REE.
period - Seed value. Precise value output. Default = 5.0 seconds.
CALLING:
phase = ff_phase_zc(time,data)
OUTPUT: Array of times. Period will be updated.
tzero - Array of times.
INITIAL VERSION: REE/RJS 97-10-02 - see FF_MAGDC.PRO
MODIFICATION HISTORY:
Space Scienes Lab, UCBerkeley
(See idlUtil/fast/ff_phase_zc.pro)
FUNCTION: FF_POTENTIAL, V58, V8, V14, V4, save_mem=save_mem
PURPOSE: Calculate the potential from the above quantities.
INPUT:
V58 - If blank, program will get V5-V8_S /all,/rep.
To run this program on burst data, use
V58=get_fa_fields('V5-V8_4k',/all).
V8 - If blank, program will get V8_S /all,/rep. User can
supply structure if wanted.
V14 - If blank, program will get V1-V4_S, /all,/rep.
To run this program on burst data, use
V58=get_fa_fields('V1-V4_4k',/all).
V4 - If blank, program will get V4_S /all, /rep. User can
supply structure if wanted.
KEYWORDS:
save_mem CAREFUL! If set, this will blow away V58, V14, V8,
and V4 after they are no longer needed.
CALLING: pot = fa_potential()
That's easy! Now you the S/C potential.
IMPORTANT! SDT SETUP: Need to have: V5-V8_S, V1-V4_S, V4_S, and V8_S.
OUTPUT: pot is IDL fields time series data structure with one
component.
SIDE EFFECTS: As with all fields pro's this pro need lots of memory.
INITIAL VERSION: REE 97-03-25
MODIFICATION HISTORY:
Space Scienes Lab, UCBerkeley
(See idlUtil/fast/ff_potential.pro)
PRO: FF_PTR_TO_DAT, dat, tags=tags
PURPOSE: Converts all pointer 'tags' to data arrays.
CALLING: ff_ptr_to_dat,dat
Pretty simple!
INPUTS: A valid data structure.
KEYWORD PARAMETERS:
tags - OPTIONAL. If given, only tags are converted.
OUTPUTS: Alters dat.
INITIAL VERSION: REE 97_10_20
MODIFICATION HISTORY:
Space Scienes Lab, UCBerkeley
(See idlUtil/fast/ff_ptr_to_dat.pro)
FUNCTION: FF_QFIT, data, phs, phsf=phsf, es=es, ec=ec, zero=zero,
do_sigma=do_sigma, sigma=sigma,
period=period, slide=slide, n_fitpts=n_fitpts,
out=out, max_err=max_err, bad_pts=bad_pts
PURPOSE: User unfriendly fit routine. Called by ff_magdc.
NOTE: REQUIRES CONTINUOUS BUFFERS!
NOT FOR GENERAL USE.
INPUT:
data - REQUIRED. A DATA ARRAY - NOT A STRUCTURE!
RECOMMEND: dat_in does not have NANS. One nan
may destroy entire period.
phs - REQUIRED. An array of phases.
IMPORTANT! All phases must be valid! No NANs!
KEYWORDS:
period - INPUT. Fit period. DEFAULT = 2pi
slide - NO LONGER AN OPTION!
NOTE: Slide will be forced to be pi/2.
n_fitpts - INPUT. Number of points per fit. DEFAULT = 64.
do_sigma - OPTION. /do_sigma fills sigma.
out - OPTION. /out fills bad_pts.
NOTE: FOR OUTLYER REJECTION, SEE BELOW!
max_err - INPUT. Maximum allowable error of bad_pts. DEFAULT=25 nT
OUTPUT:
phsf - OUTPUT. Phase of fit -> Time of fit.
es - OUTPUT. Sin phase of fit.
es - OUTPUT. Cos phase of fit.
zero - OUTPUT. Zero level of fit.
sigma - OUTPUT. Deviation in nT. Only filled if /do_sigma
bad_pts - OUTPUT. Deviation in nT. Only filled if /out
CALLING:
SEE ff_magdc for an example. MUST USE fa_fields_bufs, and
ff_zero_crossing first.
OUT-LYING POINTS REJECTION:
The program must be iterated. For example, below shows one interation:
ff_qfit,data,phs,phsf=phsf,es=es,ec=ec,zero=zero,/out, bad_pts=bad_pts
data(bad_pts) = !values.f_nan
index = where(finite(data), n_index)
IF n_index GT 0 then BEGIN
data = data(index)
phs = phs(index)
ff_qfit,data,phs,phsf=phsf,es=es,ec=ec,zero=zero
ENDIF ELSE print, "Big trouble! No valid points."
INITIAL VERSION: REE 97-10-05
MODIFICATION HISTORY:
Space Sciences Lab, UCBerkeley
(See idlUtil/fast/ff_qfit.pro)
PROCEDURE: FF_QUICKFIT, dat, phs, es=es, ec=ec, phsf=phsf, zero=zero,
period=period, n_fitpts=n_fitpts
PURPOSE: Performs a crude, but very fast spin fit to the data.
Before calling this routine:
(1) Notch the data with Bphase and/or Sphase.
(2) Recommend filtering the data to 5 Hz at 2-poles.
INPUT:
dat - REQUIRED. A DATA ARRAY - NOT A STRUCTURE!
RECOMMEND: dat_in does not have NANS. One nan
may destroy entire period.
phs - REQUIRED. A DATA ARRAY - NOT A STRUCTURE!
IMPORTANT! PHS CANNOT HAVE NAN'S!
KEYWORDS:
es - OUTPUT. Sin phase of fit.
es - OUTPUT. Cos phase of fit.
tf - OUTPUT. Time of fit.
zero - OUTPUT. Zero level of fit.
period - INPUT. Fit period. DEFAULT = 2pi
slide - INPUT. Number of periods to slide. DEFAULT = 0.5.
NOTE: Slide will be forced to be interger # of fit pnts.
n_fitpts - INPUT. Number of points per fit. DEFAULT = 64.
CALLING:
index = where(finite(your_data) AND finite(your_phase), n_finite)
IF (nfinite GT 0) then BEGIN
dat = your_data(index)
phs = your_phase(index)
ff_quickfit,dat,phs,es=es, ec=ec, phsf=phsf, zero=zero
ENDIF
ALTERNATIVE CALL: ff_quickfit, dat, time, period = 5.0d, $
es=es, ec=ec, phsf=phsf, zero=zero
OUTPUT: See KEYWORDS.
INITIAL VERSION: REE 97-03-29
MODIFICATION HISTORY:
Space Sciences Lab, UCBerkeley
(See idlUtil/fast/ff_quickfit.pro)
FUNCTION: FF_SMOOTH, data, n_sm, w=w, detrend=detrend, sm_funct=sm_funct
PURPOSE: Smoothing routine which treats edges and has weight!
INPUT:
data - REQUIRED. Data to be smoothed. Must be evenly spaced.
n_sm - REQUIRED. Number of pts in Gauss 3 sigma width.
MUST BE ODD!
KEYWORDS:
w - OPTIONAL. Weighting function.
detrend - OPTIONAL. Detrends data before smoothing.
sm_funct - OPTIONAL. A smoothing function of n_sm length.
CALLING:
result = ff_smooth, data, n_sm, w=w
OUTPUT: pfit.
INITIAL VERSION: REE 97-10-20
MODIFICATION HISTORY:
Space Scienes Lab, UCBerkeley
(See idlUtil/fast/ff_smooth.pro)
FUNCTION: files_exist, file_spec_list
PURPOSE:
returns array of strings corresponding to input array of file specs
INPUTS:
file_spec_list:
either a single file spec, or an array of file specs, where by file spec
is meant the file specification required by the findfile program.
OUTPUTS:
return value:
empty string if there are no files, else an array of strings naming
the files that exist.
CREATED BY: Vince Saba
VERSION: @(#)files_exist.pro 1.2 10/23/98
(See idlUtil/misc/files_exist.pro)
NAME: FIND_GAPS
NOTE: This routine is essentially made obsolete by FA_FIELDS_BUFS,
or by the /REPAIR option in GET_FA_FIELDS.
PURPOSE: to find times in tplot-like structures where there is a gap
in time. The usual reason for this is to know where to insert
!values.f_nan into some data, so that IDL won't draw a line across
the gap.
CALLING SEQUENCE: gaps = find_gaps(my_data, ngaps)
INPUTS: the structure MY_DATA, which must have a tag TIME
OUTPUTS: GAPS is an array of indices into MY_DATA.TIME. These
indices mark the *beginnings* of unusually large gaps in
MY_DATA.TIME. NGAPS is set to the number of gaps found. If
there are no gaps, GAPS will be -1, and NGAPS will be
zero.
SLOP: If not zero, SLOP is added to 1.0 and used as a tolerance for
determining whether or not two time increments are equal. For
example, the HSBM on FAST works best if slop is 0.13.
SPIKE: If set, causes a 3 point median filter to be applied to the
input time increments. This also helps handle the FAST HSBM data.
MODIFICATION HISTORY: Written 18-July-1996 by Bill Peria
(See idlUtil/datetime/find_gaps.pro)
FUNCTION: find_handle(name,tagname)
PURPOSE:
Returns the index associated with a string name.
This function is used by the "TPLOT" routines.
INPUT: name (scalar string)
name can also be the corresponding integer index to a TPLOT quantity,
in which case name will be converted to the string handle.
RETURN VALUE: tplot index. (0 if not found)
CREATED BY: Davin Larson
LAST MODIFICATION: @(#)find_handle.pro 1.10 96/08/19
(See idlUtil/windGeneral/tplot/find_handle.pro)
FUNCTION: find_last_epoch
PURPOSE: Gets the last orbit element epoch time entry of an orbit
file. Returns time in double float. (All arguments
and keywords are optional.)
ARGUMENTS: FILE The orbit file to look in. Defaults to:
fa_almanac_dir()/orbit/predicted
unless DEFINITIVE keyword set.
ORBIT Named variable to return last orbit in file.
YEAR Named variable to return year.
DOY Named variable to return day of year.
TIME Named variable to return time of day.
KEYWORDS: DEFINITIVE If no FILE argument supplied, use the
definitive orbit file:
fa_almanac_dir()/orbit/definitive
(See idlUtil/fast/find_last_epoch.pro)
**** OBSOLETE!!! Please use "str_element"instead! *** FUNCTION: find_str_element PURPOSE: find an element within a structure Input: struct, generic structure name, string (tag name) Purpose: Returns index of structure tag. Returns -1 if not found Returns -2 if struct is not a structure KEYWORDS: If VALUE is set to a named variable then the value of that element is returned in it. CREATED BY: Davin Larson LAST MODIFICATION: @(#)find_str_element.pro 1.6 95/10/06
(See idlUtil/windGeneral/misc/find_str_element.pro)
NAME: FRAC_INDICES
PURPOSE: to obtain the fractional indices of one array relative to
another. This function would usually precede a call to
IDL's INTERPOLATE.
CALLING SEQUENCE: new_indices = frac_indices(my_times, data_times)
INPUTS: MY_TIMES: an array of values for which the fractional
indices, with respect to DATA_TIMES, will be returned.
OUTPUTS: The fractional indices! For example, note that
print,frac_indices([5,15],[0,10,30]), produces the output
0.50000000 1.2500000, and that in general the
function call:
interpolate(x,frac_indices(y,x)) reproduces y.
RESTRICTIONS: Inputs must be one-dimensional arrays of a type that
can be sorted monotonically, i.e. no complex.
MODIFICATION HISTORY: Written 1 August 1996 by Bill Peria UCBerkeley
Space Sciences Laboratory.
(See idlUtil/arrayUtil/frac_indices.pro)
PROCEDURE: funct_fit2d,dat
Select energy/angle range and perform functional fit to data
(default Maxwellian)
INPUTS:
dat - data structure containing 2d data
- e.g. "get_fa_ees, get_fa_ies, etc."
KEYWORDS:
NFITF integer optional number of functions for the
fit, default = 1
FITF string optional function for the fit, default
= maxwellian
AUTO 0/1 if set, defaults are used and peak
energy determined from the data
ENERGY: fltarr(2), optional, min,max energy range for fit
ERANGE: fltarr(2), optional, min,max energy bin numbers
for fit
EBINS: bytarr(na), optional, energy bins array for fit
0,1=exclude,include,
na = dat.nenergy
ANGLE: fltarr(2), optional, min,max pitch angle range
for fit
ARANGE: fltarr(2), optional, min,max angle bin numbers
for fit
BINS: bytarr(nb), optional, angle bins array for fit
0,1=exclude,include,
nb = dat.ntheta
BINS: bytarr(na,nb), optional, energy/angle bins array for
fit 0,1=exclude,include
LIMITS - A structure containing limits and display options.
see: "options", "xlim" and "ylim", to change limits
UNITS - convert to given data units before plotting
F_UNITS - convert dat.data to given data units before
passing to function "FITF"
COLOR - array of colors to be used for each bin
LABEL - Puts bin labels on the plot if set.
SUMPLT - redraws the summed data and the fit after
completion.
MSEC - Subtitle will include milliseconds
NOTES:
This program still has bugs and may not weight the points
properly !!!!!
See "spec2d" for another means of plotting data.
See "conv_units" to change units.
See "time_stamp" to turn time stamping on and off.
Future changes: fitfunct.pro, tempfit.pro, tempfit2.pro
CREATED BY: J. McFadden 96-11-14
FILE: funct_fit3d.pro
VERSION 1.
LAST MODIFICATION: Ver 1.1 GTDelory 97-07-30
(See idlUtil/science/funct_fit2d.pro)
PROGRAM: fu_spec2d(funct,dat) INPUT: funct: string, function that operates on structures generated by get_eesa_surv, get_eesa_burst, etc. funct = 'n_2d','j_2d','v_2d','p_2d','t_2d', 'vth_2d','ec_2d', or 'je_2d' dat: structure, 2d data structures example: dat = get_fa_ees(t) KEYWORDS LIMITS - structure, A structure containing limits and display options. see: "options", "xlim" and "ylim", to change limits 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 INTEG_F: 0,1 if set, plot forward integral INTEG_R: 0,1 if set, plot reverse integral PURPOSE: Plots the differential funct(dat) versus energy, funct(dat) is integrated over angle only CREATED BY: J.McFadden 97/03/13 LAST MODIFICATION: 97/03/13 MOD HISTORY: NOTES: Current version only works for FAST
(See idlUtil/science/fu_spec2d.pro)
PROCEDURE: gclose INPUT: none PURPOSE: Write GIF file named with gopen, and change device back to default. If common block string 'printer_name' is set, then file is sent to that printer. SEE ALSO: "print_options" "gopen" CREATED BY: Davin Larson LAST MODIFICATION: @(#)gclose.pro 1.5 95/10/06
(See idlUtil/tplot/gclose.pro)
PROCEDURE: gen_fa_k0_ees_gifps.pro INPUT: none PURPOSE: Generates gif and ps FAST electron key parameter data. Plot 1: Electron Differential Energy Flux vs Energy, 0-30 deg pitch angle Plot 2: Electron Differential Energy Flux vs Energy, 60-120 deg pitch angle Plot 3: Electron Differential Energy Flux vs Energy, 150-180 deg pitch angle Plot 4: Electron Differential Energy Flux vs Pitch Angle, .1-1 keV Plot 5: Electron Differential Energy Flux vs Pitch Angle, 1-30 keV Plot 6: Electron Energy Flux - mapped to 100 km, positive earthward Plot 7: Electron Flux - mapped to 100 km, positive earthward KEYWORDS bw If set, grayscale postscript plots generated k0 If set, output files names are 'fa_k0_ees_XXXXX.ext' where ext = ps,gif and XXXXX = padded orbit files sent to /disks/juneau/www/WWWSUM/yyyy_mm_dd_tttttt/ If not set, output files names are 'fa_ees_XXXXX.ext' files sent to local directory NOTES: Run load_fa_k0_ees.pro first to get the k0 data CREATED BY: J.McFadden 96-9-24 VERSION: 1 LAST MODIFICATION: 97/03/04 MOD HISTORY: 96/10/08 k0 keyword added 97/03/04 color=4 used for positive (earthward) Je,JEe; color=6 used for negative Je,JEe upgrade for Je,JEe definition changes - mapped to 100 km now
(See idlUtil/fast/gen_fa_k0_ees_gifps.pro)
PROCEDURE: gen_fa_k0_ies_gifps.pro INPUT: none PURPOSE: Generates gif and ps FAST ion key parameter data. Plot 1: Ion Differential Energy Flux vs Energy, 0-30 deg pitch angle Plot 2: Ion Differential Energy Flux vs Energy, 40-140 deg pitch angle Plot 3: Ion Differential Energy Flux vs Energy, 150-180 deg pitch angle Plot 4: Ion Differential Energy Flux vs Pitch Angle, .05-1. keV Plot 5: Ion Differential Energy Flux vs Pitch Angle, 1.-25. keV Plot 6: Ion Energy Flux - mapped to 100 km, positive earthward Plot 7: Ion Flux - mapped to 100 km, positive earthward KEYWORDS bw If set, grayscale postscript plots generated k0 If set, output files names are 'fa_k0_ies_XXXXX.ext' where ext = ps,gif and XXXXX = padded orbit files sent to /disks/juneau/www/WWWSUM/yyyy_mm_dd_tttttt/ If not set, output files names are 'fa_ies_XXXXX.ext' files sent to local directory NOTES: Run load_fa_k0_ies.pro first to get the k0 data CREATED BY: J.McFadden 96-9-24 VERSION: 1 LAST MODIFICATION: 97/03/04 MOD HISTORY: 96/10/08 k0 keyword added 97/03/04 color=4 used for positive (earthward) Ji,JEi; color=6 used for negative Ji,JEi upgrade for Ji,JEi definition changes - mapped to 100 km now
(See idlUtil/fast/gen_fa_k0_ies_gifps.pro)
PROCEDURE: gen_fa_k0_tms_gifps.pro INPUT: none PURPOSE: Generates gif and ps FAST TEAMS key parameter data. Plot 1: Hydrogen Differential Energy Flux vs Energy, 0-360 deg pitch angle Plot 2: Helium Differential Energy Flux vs Energy, 0-360 deg pitch angle Plot 3: Oxygen Differential Energy Flux vs Energy, 0-360 deg pitch angle Plot 4: Hydrogen Differential Energy Flux vs Pitch Angle, < 1 keV Plot 5: Hydrogen Differential Energy Flux vs Pitch Angle, > 1 keV Plot 6: Oxygen Differential Energy Flux vs Pitch Angle, < 1 keV Plot 7: Oxygen Differential Energy Flux vs Pitch Angle, > 1 keV Plot 8: MassSpectrum Counts Rate vs Mass, 1eV - 12keV, 4*Pi angles KEYWORDS bw If set, grayscale postscript plots generated k0 If set, output files names are 'fa_k0_tms_XXXXX.ext' where ext = ps,gif and XXXXX = padded orbit files sent to /disks/juneau/www/WWWSUM/yyyy_mm_dd_tttttt/ If not set, output files names are 'fa_tms_XXXXX.ext' files sent to local directory NOTES: Run load_fa_k0_tms.pro first to get the k0 data CREATED BY: J.McFadden 96-10-6 VERSION: 1.02 LAST MODIFICATION: 97/06/09 MOD HISTORY: 97/06/09 added He+ panel 96/10/08 k0 keyword added
(See idlUtil/fast/gen_fa_k0_tms_gifps.pro)
pro geoc2geod, lat_in, alt_in, lat_out, alt_out, INVERSE = inverse converts geocentric latitude and altitude and to geodetic. Latitude must be in degrees, altitude in kilometers. The INVERSE keyword goes from geodetic to geocentric. With double precision, roundoff error is less than 1.d-06 km, which is more than adequate. Uses geodetic parameters from WGS '84, semi-major axis and inverse of flattening : 6378.137 km and 298.257223563, unless one of the other ellipsoids is specified through a keyword.
(See idlUtil/misc/geoc2geod.pro)
NAME: GETSPEC
PURPOSE: To compute some sort of frequency spectrum from a
uniformly sampled time series, after removing the mean
value and any linear trend.
CALLING SEQUENCE: getspec,t,x,f,s
INPUTS: T is an array of time tags for X. F is an array which, on
return, contains the frequencies corresponding to the
spectral estimates S. S has the same units as X by default,
this can be changed with keywords.
KEYWORD PARAMETERS:
NOCONDITION: If set, prevents the removal of the mean and best
line from the time series data.
COMPLEX: If set, causes GETSPEC to return an S of type
complex, for use in cross-spectral analysis.
PSD: If set, causes PWRSPC to return power spectral
density, i.e., the units of S will be [X]/sqrt(Hz).
NOHANNING: If set, prevents PWRSPC from applying a zero-tapering
window to the time series data.
BINSIZE: If non-zero, causes PWRSPC to sum BINSIZE
near-neighbors of a preliminary spectrum into the
final spectrum S. This reduces the number of elements
of F and S, by a factor of approximately BINSIZE, and
also reduces the variance in the spectral estimates.
SIDE EFFECTS: PWRSPC is called, unless COMPLEX is set.
RESTRICTIONS: ??? don't know of any ???
MODIFICATION HISTORY: slowly developed by Bill Peria, UCBerkeley
Space Sciences Lab. This version
released on 25-July-1996.
(See idlUtil/science/getspec.pro)
FUNCTION: gettime(x)
INPUTS: x: Null or double or string or integer
OUTPUT: double, seconds since Jan 1, 1970
Examples:
t = gettime('95-7-4/12:34')
t = gettime('12:34:56') (get time on reference date)
t = gettime(t+300.) (assumes t is a double)
t = gettime(10) (t = 10 am on reference date)
t = gettime(/key) (prompts user for time on reference date)
t = gettime(key='Enter time: ')
t = gettime(/curs) (select time using cursor in tplot routine)
KEYWORDS:
KEYBOARD: If non-zero then user is prompted to enter a time. If KEYBOARD
is a string then that string is used as a prompt.
CURSOR: if non-zero then user can select a time with the cursor.
REFDATE: Sets the reference date if REFDATE is a string with
format: "yyyy-mm-dd".
CREATED BY: Davin Larson
LAST MODIFICATION: @(#)gettime.pro 1.14 96/08/09
(See idlUtil/windGeneral/tplot/gettime.pro)
PROGRAM: get_2dt,funct,get_dat INPUT: funct: function, function that operates on structures generated by get_eesa_surv, get_eesa_burst, etc. funct = 'n_2d','j_2d','v_2d','p_2d','t_2d', 'vth_2d','ec_2d', or 'je_2d' get_dat:function, function that returns 2d data structures function name must be "get_"+"get_dat" get_dat = 'eesa_surv' for get_eesa_surv, get_dat = 'eesa_burst' for get_eesa_burst, etc. KEYWORDS T1: real or dbl start time, seconds since 1970 T2: real or dbl end time, seconds since 1970 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 GAP_TIME: time gap big enough to signify a data gap (def 200 sec, 8 sec for FAST) NO_DATA: returns 1 if no_data else returns 0 NAME: New name of the Data Quantity Default: funct+'_'+get_dat BKG: A 3d data structure containing the background counts. FLOOR: Sets the minimum value of any data point to sqrt(bkg). MISSING: value for bad data. 0,1=exclude,include CALIB: Calib keyword passed on to get_dat PURPOSE: To generate time series data for "tplot.pro" NOTES: Program names time series data to funct+"_"+get_dat if NAME keyword not set See 'tplot_names.pro'. CREATED BY: J.McFadden LAST MODIFICATION: 97/03/04 MOD HISTORY: 97/03/04 T1,T2 keywords added NOTES: Current version only works for FAST
(See idlUtil/science/get_2dt.pro)
PROGRAM: get_2dt_ts,funct,get_dat INPUT: funct: function, function that operates on structures generated by get_eesa_surv, get_eesa_burst, etc. funct = 'n_2d','j_2d','v_2d','p_2d','t_2d', 'vth_2d','ec_2d', or 'je_2d' get_dat:function, function that returns 2d data structures function name must be "get_"+"get_dat"+"_ts" get_dat = 'fa_ees' for get_fa_ees_ts, get_dat = 'fa_eeb' for get_fa_eeb_ts, etc. KEYWORDS T1: real or dbl start time, seconds since 1970 T2: real or dbl end time, seconds since 1970 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 GAP_TIME: time gap big enough to signify a data gap (def 200 sec, 8 sec for FAST) NO_DATA: returns 1 if no_data else returns 0 NAME: New name of the Data Quantity Default: funct+'_'+get_dat BKG: A 3d data structure containing the background counts. FLOOR: Sets the minimum value of any data point to sqrt(bkg). MISSING: value for bad data. 0,1=exclude,include CALIB: Calib keyword passed on to get_dat n_get_pts: Number of points in the array of structures formed by get_"data_str"_ts, default=200. PURPOSE: To generate time series data for "tplot.pro" NOTES: Program names time series data to funct+"_"+get_dat if NAME keyword not set See 'tplot_names.pro'. CREATED BY: J.McFadden LAST MODIFICATION: 97/05/16 MOD HISTORY: 97/05/16 Variation on get_2dt.pro that uses get_*_ts.pro routines NOTES: Current version only works for FAST
(See idlUtil/science/get_2dt_ts.pro)
PROGRAM: get_3dt(funct,get_dat,ERANGE=erange,BINS=bins,NAME=name) INPUT: funct: function, function that operates on structures generated by get_pl, get_el, etc. e.g. "get_el" funct = 'n_3d','j_3d','v_3d','p_3d','t_3d', 'vth_3d', or 'c_3d' "n_3d" "j_3d" "v_3d" "p_3d" "t_3d" "vth_3d" "c_3d" get_dat:function, function that returns 3d data structures function name must be "get_"+"get_dat" get_dat = 'pl' for get_pl, get_dat = 'el' for get_el, etc. KEYWORDS: erange: fltarr(2), optional, min,max energy bin numbers for integration bins: bytarr(nbins), optional, angle bins for integration, see edit3dbins.pro 0,1=exclude,include, nbins = temp.nbins name: string New name of the Data Quantity Default: funct+'_'+get_dat PURPOSE: To generate time series data for "tplot" NOTES: Program names time series data to funct+"_"+get_dat. See "tplot_names". CREATED BY: J.McFadden LAST MODIFICATION: 96/02/06 FILE: @(#)get_3dt.pro 1.9
(See idlUtil/windGeneral/science/get_3dt.pro)
FUNCTION: get_colors PURPOSE: returns a structure containing color pixel values INPUT: none KEYWORDS: NOCOLOR: forces all colors to !d.table_size-1. Written by: Davin Larson 96-01-31 FILE: get_colors.pro VERSION: 1.1 LAST MODIFICATION: 96/08/09
(See idlUtil/windGeneral/misc/get_colors.pro)
PROCEDURE: get_data , name, time, data, values
PURPOSE:
Retrieves the data and or limit structure associated with a name handle.
This procedure is used by the "TPLOT" routines.
INPUT: name (scaler string)
KEYWORDS:
DATA: named variable to hold the data structure.
LIMITS: named variable to hold the limits structure.
INDEX: named variable to hold the name index. This value will be 0
if the request was unsuccesful.
SEE ALSO: "STORE_DATA", "TPLOT_NAMES", "TPLOT"
CREATED BY: Davin Larson
LAST MODIFICATION: @(#)get_data.pro 1.13 97/02/05
(See idlUtil/windGeneral/tplot/get_data.pro)
NAME: GET_DQDS
PURPOSE: returns the list of DQD strings currently loaded in SDT
CALLING SEQUENCE: list = get_dqds()
INPUTS: none
KEYWORDS: START_TIMES and END_TIMES. These can be used to return an
array of start and end times to the caller, in double
precision seconds since 1970.
OUTPUTS: a strarr of DQD names, or the null string if SDT is not running.
SIDE EFFECTS: calls SHOW_DQIS, which has a call_external in it.
MODIFICATION HISTORY: wriiten 22-Aug-97 by Bill Peria UCB/SSL
(See idlUtil/misc/get_dqds.pro)
PROCEDURE: get_en_spec PURPOSE: Generates energy-time spectrogram data structures for tplot INPUT: data_str, a string (either 'eh','pl','eesa_surv','ess', ...) where get_'string' returns a 2D or 3D data structure KEYWORDS: T1: start time, seconds since 1970 T2: end time, seconds since 1970 ANGLE: fltarr(2),fltarr(4) angle range to sum over ARANGE: intarr(2) bin range to sum over BINS: bytarr(dat.nbins) bins to sum over gap_time: time gap big enough to signify a data gap (default 200 sec, 8 sec for FAST) NO_DATA: returns 1 if no_data else returns 0 UNITS: convert to these units if included NAME: New name of the Data Quantity BKG: A 3d data structure containing the background counts. FLOOR: Sets the minimum value of any data point to sqrt(bkg). MISSING: value for bad data. RETRACE: Set to number of retrace energy steps to be eliminated starting at energy step 0 CALIB: Calib keyword passed on to get_"get_dat"_ts CREATED BY: J.McFadden VERSION: 1 LAST MODIFICATION: 97/03/04 MOD HISTORY: 97/03/04 T1,T2 keywords added 97/05/22 CALIB keyword added NOTES: Current version only works for FAST
(See idlUtil/science/get_en_spec.pro)
PROCEDURE: get_en_spec_ts PURPOSE: Generates energy-time spectrogram data structures for tplot INPUT: get_dat, a string (either 'fa_ees','fa_eeb', ...) where get_'string'_ts returns a 2D or 3D array of data structures KEYWORDS: T1: start time, seconds since 1970 T2: end time, seconds since 1970 ANGLE: fltarr(2),fltarr(4) angle range to sum over ARANGE: intarr(2) bin range to sum over BINS: bytarr(dat.nbins) bins to sum over gap_time: time gap big enough to signify a data gap (default 200 sec, 8 sec for FAST) NO_DATA: returns 1 if no_data else returns 0 UNITS: convert to these units if included NAME: New name of the Data Quantity BKG: A 3d data structure containing the background counts. FLOOR: Sets the minimum value of any data point to sqrt(bkg). MISSING: value for bad data. RETRACE: Set to number of retrace energy steps to be eliminated starting at energy step 0 CALIB: Calib keyword passed on to get_"get_dat"_ts n_get_pts: Number of points in the array of structures formed by get_"get_dat"_ts, default=200. CREATED BY: J.McFadden VERSION: 1 LAST MODIFICATION: 97/05/15 MOD HISTORY: 97/05/15 Variation on get_en_spec.pro with help from J.Loran NOTES: Current version only works for FAST
(See idlUtil/science/get_en_spec_ts.pro)
FUNCTION: get_ess(time,START=start,EN=en,ADVANCE=advance,RETREAT=retreat) INPUT: time: real This argument gives a time handle from which to take data from. It may be either a string with the following possible formats: 'MM-DD-YY/HH:MM:SS.MSC' or 'HH:MM:SS' (use reference date) or a number, which will represent seconds since 1970 (must be a double > 94608000.D), or a hours from a reference time, if set. Time will always be returned as a double representing the actual data time found in seconds since 1970. ;KEYWORDS: START: If non-zero, get data from the start time of the data instance in the SDT buffers EN: If non-zero, get data at the end time of the data instance in the SDT buffers ADVANCE: If non-zero, advance to the next data point following the time input RETREAT: If non-zero, retreat (reverse) to the previous data point before the time input VARARR If non-zero, program will not convert to 48 Energy by 32 angle arrays. PURPOSE: To generate fast eesa survey data structures averaged over one spin. ;NOTES: Program calls get_eesa_surv.pro multiple times to generate spin averaged data. Data is averaged starting at the first "spin phase"=0 after "time". Program checks for header changes, returns dat.valid=2 if less than 1 spin averaged. Program only return 48 Energies x 32 Angles, will average if in 96 E or 64 A mode. See get_eesa_surv.pro CREATED BY: J.McFadden LAST MODIFICATION: 96-7-2 J.McFadden
(See idlUtil/fast/get_ess.pro)
PROCEDURE: get_fa_att_diag.pro PURPOSE: Calculates attitude quantites and loads them into tplot structures. INPUTS: T1 Start time of the interval. T2 End time of the interval. KEYWORDS: NOTES: Time resolution is 20 seconds. Created: Creator: J.Rauchleiba
(See idlUtil/fast/get_fa_att_diag.pro)
FUNCTION: get_fa_ees_sp(time,START=start,EN=en,ADVANCE=advance,RETREAT=retreat,CALIB=calib) INPUT: time: real This argument gives a time handle from which to take data from. It may be either a string with the following possible formats: 'MM-DD-YY/HH:MM:SS.MSC' or 'HH:MM:SS' (use reference date) or a number, which will represent seconds since 1970 (must be a double > 94608000.D), or a hours from a reference time, if set. Time will always be returned as a double representing the actual data time found in seconds since 1970. ;KEYWORDS: START: If non-zero, get data from the start time of the data instance in the SDT buffers EN: If non-zero, get data at the end time of the data instance in the SDT buffers ADVANCE: If non-zero, advance to the next data point following the time input RETREAT: If non-zero, retreat (reverse) to the previous data point before the time input CALIB: If non-zero, use the esa calibration array VARARR If non-zero, program will not convert to 48 Energy by 32 angle arrays. PURPOSE: To generate fast eesa survey data structures averaged over one spin. ;NOTES: Program calls get_fa_ees_c.pro multiple times to generate spin averaged data. Data is averaged starting at the first "spin phase"=0 after "time". Program checks for header changes, returns dat.valid=2 if less than 1 spin averaged. Program only return 48 Energies x 32 Angles, will average if in 96 E or 64 A mode. See get_fa_ees_c.pro CREATED BY: J.McFadden 96-7-2 LAST MODIFICATION: 97/03/04 MOD HISTORY: 97/03/04 CALIB keyword added 97/07/23 uses get_fa_ees_c.pro now
(See idlUtil/fast/get_fa_ees_sp.pro)
FUNCTION: get_fa_fdf_att(time)
NAME:
get_fa_fdf_att
PURPOSE:
Get the spin attidude vector for the given time from
the FDF attitude files.
INPUT: time input must be of a type which is valid as
an input to time_double, array's exceptable.
OUTPUT: att_struc structure:
elements: x, y, z, zsun, lambda, phi
all elements are double.
KEYWORDS:
FILE: if set, use given FDF attitude file name.
FDF_DIR: if set, use given string as directory in which to find
FDF files.
ENVIRONMENT VARIABLES:
FAST_FDFATT_DIR if set, provides the default directory to
consult when looking for FDF attitude files. Is overridden by
the keyword FDF_DIR.
SEE ALSO: "time_double"
CREATED BY: KRB 1997-09-11
FILE: %M%
VERSION: %I%
LAST MODIFICATION: %E%
added FDF_DIR keyword for use outside of the ``Ivory Tower''.
also changed SPAWN calls to allow for noisy shell startup scripts.
JWB, LANL, 04-29-98
added examination of environment variable FAST_FDFATT_DIR to
allow for more transparent changing of default directory for
FDF attitude files. JWB, LANL, 05-08-98.
(See idlUtil/fast/get_fa_fdf_att.pro)
FUNCTION: get_fa_ies_sp(time,START=start,EN=en,ADVANCE=advance,RETREAT=retreat,CALIB=calib) INPUT: time: real This argument gives a time handle from which to take data from. It may be either a string with the following possible formats: 'MM-DD-YY/HH:MM:SS.MSC' or 'HH:MM:SS' (use reference date) or a number, which will represent seconds since 1970 (must be a double > 94608000.D), or a hours from a reference time, if set. Time will always be returned as a double representing the actual data time found in seconds since 1970. ;KEYWORDS: START: If non-zero, get data from the start time of the data instance in the SDT buffers EN: If non-zero, get data at the end time of the data instance in the SDT buffers ADVANCE: If non-zero, advance to the next data point following the time input RETREAT: If non-zero, retreat (reverse) to the previous data point before the time input CALIB: If non-zero, use the esa calibration array VARARR If non-zero, program will not convert to 48 Energy by 32 angle arrays. PURPOSE: To generate fast iesa survey data structures averaged over one spin. ;NOTES: Program calls get_fa_ies_c.pro multiple times to generate spin averaged data. Data is averaged starting at the first "spin phase"=0 after "time". Program checks for header changes, returns dat.valid=2 if less than 1 spin averaged. Program only return 48 Energies x 32 Angles, will average if in 96 E or 64 A mode. See get_fa_ies_c.pro CREATED BY: J.McFadden 96-7-2 LAST MODIFICATION: 97/03/04 MOD HISTORY: 97/03/04 CALIB keyword added 97/07/23 uses get_fa_ies_c.pro now
(See idlUtil/fast/get_fa_ies_sp.pro)
NAME: GET_FA_ORBIT_TIMES
PURPOSE: To obtain the orbit start and stop times, in double
precision seconds since 1970, given an orbit number.
CALLING SEQUENCE: if get_fa_orbit_times(1701,t0,t1) then ...
INPUTS: the orbit number.
OUTPUTS: The return value is 1 for success, 0 for failure. The times
are returned in T0 and T1.
SIDE EFFECTS: A process is spawned, and the orbit almanac file is
awked. The orbit number and times are stored, unless
NO_STORE is set, or unless the desired times are
already stored.
MODIFICATION HISTORY: Originally written by J.Rauchleiba, for
PLOT_FA_CROSSING, although he'll deny it.
Stolen and modularized by Bill Peria,
27-Jan-97.
Hard-coded path removed 11-March-97 BP
TPLOT storage added 15-April-97 BP
Use ORBITTIME spawn 22-July-97 BP
(See idlUtil/fast/get_fa_orbit_times.pro)
FUNCTION:
GET_FA_TBALL_TS
DESCRIPTION:
Function to load a time sequence of FAST Teams burst data for all species from the
SDT program shared memory buffers.
The philosophy for the number of array dimensions is to keep them to a minimum,
except that duplication of measurement parameters over npts (the number of 2-d distributions)
takes place in as far as required for consistency with get_md_ts_from_sdt, which
has min1,max1 etc duplicated npts times.
This is not necessarily consistent with Loran/McFadden, where duplication seems a bit out of
control and without simple rules.
A structure of the following format is returned:
(Note: 1. nnrgs=nenergy; nnrgs is retained because of frequent use in other software.
2. "2-d distribution" refers to a single data sample taken from 16 sectors in a plane
and at 48 energies.)
3. The "look" or "boresight" direction can be computed from quantities below,
but remember that ion direction vector is opposite to look direction.)
DATA_NAME STRING 'Tms Burst All' ; Data Quantity name
VALID INT 1 ; Data valid flag
PROJECT_NAME STRING 'FAST' ; project name
UNITS_NAME STRING 'Counts' ; Units of this data
UNITS_PROCEDURE STRING 'proc' ; Units conversion proc
TIMES DOUBLE Array(npts) ; Start Time of sample (should be true time of
; start of data, not original packet time tag
END_TIMES DOUBLE Array(npts) ; End time of sample
INTEG_T DOUBLE Array(npts) ; Integration time for each individual energy step
; (dat.endTimes-dat.times)/dat.dimsizes(0)
NBINS INT nbins ; Number of angle bins (16)
NENERGY INT nnrgs ; Number of energy bins (48)
NPTS INT npts ; number of data 'points' = # of 2d distributions
CALIBRATED INT calibrated ; flags calibrated data mb
CALIBRATED_UNITS STRING units ; calibrated units string mb
DATA FLOAT Array(nnrgs, nbins, nspec,npts)
; Data quantities; nspec=4, may require wrk to change
ENERGY FLOAT Array(nnrgs,npts) ; Ion energy, duplicated npts times (ev)
THETA FLOAT Array(nbins,npts) ; Angle of sector, duplicated npts times (deg)
THETA_FOV FLOAT Array(nbins,npts) ; Angle of sector, duplicated npts times (deg),
; Measured ccw from between bins 3 and 4 (0-15 range) in detector plane
; For a diagram see FAST/TEAMS Fields-of-View, D.M. Klumpar, May, 1995
GEOM FLOAT Array(nbins) ; Geometry factor
DENERGY FLOAT Array(nnrgs, npts) ; Width of energy bins (ev)
DTHETA FLOAT Array(nbins,npts) ; Delta Theta acceptance width, roughly
; actually separation between sectors
EFF FLOAT Array(nnrgs,nbins=16,nspec=4) ; Efficiency (GF)
SPIN_FRACT FLOAT Array(nbins) ; fraction of dat.time-dat.end_time
; over which the measurement was active
MODE BYTE Array(npts) ; teams mode for each time
SPHASE INT Array(npts) ; spin phase wrt sun, corrected to dat.times
; (start-of-acquisition) within this program (as of July 30 1997 mb)
; (the original sphase in header_bytes is from the data read time, not the actual data acquisition time)
SNUMBER BYTE Array(npts) ; spin number
MAGDIR FLOAT Array(npts) ; phase of sun wrt magfld 0 crossing, 0-4095 range,
; S/C Y component of field, -/+ crossing
MASS FLOAT 0.0104389 *[16.,1.,4.,2.] ; Mass eV/(km/sec)^2 (actually mass/(charge/e))
GEOMFACTOR FLOAT .0015 ; Bin GF
HEADER_BYTES BYTE Array(44,npts) ; Header bytes; 44 was 25. don't know why, changed, mb
; 3 sets of 14 with 2 additional bytes (L. Kistler)
HDR_TIME FLOAT Array(npts) ; added to allow timing cross-checks at higher level
; these are explicitly the times attached to sphase in the header (which are still wrong, being the
; times corrected for the data, not the original times correct for sphase) mb july 29 1997
EFF_VERSION ; version number returned by FA_TTOF_CALIBRATION
CALLING SEQUENCE:
data = get_fa_tball_ts (inputTime,endtime, [START=start | EN=en | NPTS=npts | /PANF | /PANB
| /ALL | IDXST=idxst)
ARGUMENTS:
inputTime This argument gives a time handle from which
to start to take data. It may be either a string
with the following possible formats:
'YY-MM-DD/HH:MM:SS.MSC' or
'HH:MM:SS' (use reference date)
or a number, which will represent seconds
since 1970 (must be a double > 94608000.D), or
a hours from a reference time, if set.
time will always be returned as a double
representing the actual data time found in
seconds since 1970.
endtime similar, ending time of data interval
KEYWORDS:
START If non-zero, get data from the start time
of the data instance in the SDT buffers
NPTS If given will determine the number of 2-D distributions to get,
overriding the endTime specification
EN If non-zero, get data at the end time
of the data instance in the SDT buffers
PANF, PANB Untested. Meant to override other timing specifications, pan forward or backward
ALL Untested. get all data, meant to override other time specs.
IDXST Untested. get data at a certain index relative to start of TIMESPAN.
RETURN VALUE:
Upon success, the above structure is returned, with the valid tag
set to 1. Upon failure, the valid tag will be 0.
REVISION HISTORY:
@(#)get_fa_tba.pro 1.8 09/04/96
Originally written by Jonathan M. Loran, University of
California at Berkeley, Space Sciences Lab. June '95
Modified to get_fa_tball by M Boehm may 14 1997. Untested.
LAST MODIFICATION: Modified to get_fa_tball_ts by M Boehm may 28 1997. Tested with a few orbits
only. HDR_TIME returned separately largely for error checking purposes july 11. Note
that most other error checking from get_fa_tb* has been removed, due to the fact
that I couldn't figure out when most of it would apply.
Last minor (hopefully not functional) mods July 15, 1997 mb
Added theta_fov and documentation, July 17, 1997, ESC.
Comment-olny changes July 24 mb.
tempw added (line ~162) to avoid where()=-1 problem ~nov 24 1997 mb
(See idlUtil/fast/get_fa_tball_ts.pro)
FUNCTION: GET_FA_TBH_3D DESCRIPTION: function to load FAST Teams burst He++ species data from the call of routine get_fa_tba_eq to generate a 3D data. A structure of the following format is returned: DATA_NAME STRING 'Tms Burst Alpha' ; Data Quantity name VALID INT 1 ; Data valid flag PROJECT_NAME STRING 'FAST' ; project name UNITS_NAME STRING 'Counts' ; Units of this data UNITS_PROCEDURE STRING 'proc' ; Units conversion proc TIME DOUBLE 8.0118726e+08 ; Start Time of sample END_TIME DOUBLE 7.9850884e+08 ; End time of sample INTEG_T DOUBLE 3.0000000 ; Integration time NBINS INT nbins ; Number of angle bins NENERGY INT nnrgs ; Number of energy bins DATA FLOAT Array(nnrgs, nbins) ; Data qauantities ENERGY FLOAT Array(nnrgs, nbins) ; Energy steps THETA FLOAT Array(nnrgs, nbins) ; Angle for bins GEOM FLOAT Array(nbins) ; Geometry factor DENERGY FLOAT Array(nnrgs, nbins) ; Energies for bins DTHETA FLOAT Array(nbins) ; Delta Theta DOMEGA FLOAT ARRAY(nbins) SPIN_FRACT FLOAT ARRAY(nnrgs, nbins) ; Spin fraction of angles EFF FLOAT Array(nnrgs,nbins) ; Efficiency (GF) MASS DOUBLE 0.0104389 ; Mass eV/(km/sec)^2 GEOMFACTOR DOUBLE 0.0015 ; Bin GF HEADER_BYTES BYTE Array(25) ; Header bytes EFF_VERSION FLOAT 1.0 ; Eff. calibration vers. CALLING SEQUENCE: data = get_fa_tba_3d (time, [START=start | EN=en | ADVANCE=advance | RETREAT=retreat]) ARGUMENTS: time This argument gives a time handle from which to take data from. It may be either a string with the following possible formats: 'YY-MM-DD/HH:MM:SS.MSC' or 'HH:MM:SS' (use reference date) or a number, which will represent seconds since 1970 (must be a double > 94608000.D), or a hours from a reference time, if set. time will always be returned as a double representing the actual data time found in seconds since 1970. KEYWORDS: START If non-zero, get data from the start time of the data instance in the SDT buffers EN If non-zero, get data at the end time of the data instance in the SDT buffers ADVANCE If non-zero, advance to the next data point following the time input RETREAT If non-zero, retreat (reverse) to the previous data point before the time input RETURN VALUE: Upon success, the above structure is returned, with the valid tag set to 1. Upon failure, the valid tag will be 0. CREATED BY: Li Tang 1/1/97 University of New Hampshire Space Physics Lab tang@teams.sr.unh.edu MODIFICATION HISTORY: 7/15/97 Keyword CALIB added L.Tang
(See idlUtil/fast/get_fa_tba_3d.pro)
FUNCTION:
GET_FA_TBA_EQ
DESCRIPTION:
function to load FAST Teams burst alpha species equator data
from the SDT program shared memory buffers.
A structure of the following format is returned:
DATA_NAME STRING 'Tms Burst Alpha' ; Data Quantity name
VALID INT 1 ; Data valid flag
PROJECT_NAME STRING 'FAST' ; project name
UNITS_NAME STRING 'Counts' ; Units of this data
UNITS_PROCEDURE STRING 'proc' ; Units conversion proc
TIME DOUBLE 8.0118726e+08 ; Start Time of sample
END_TIME DOUBLE 7.9850884e+08 ; End time of sample
INTEG_T DOUBLE 3.0000000 ; Integration time
NBINS INT nbins ; Number of angle bins
NENERGY INT nnrgs ; Number of energy bins
DATA FLOAT Array(nnrgs, nbins) ; Data qauantities
ENERGY FLOAT Array(nnrgs, nbins) ; Energy steps
THETA FLOAT Array(nnrgs, nbins) ; Angle for bins
GEOM FLOAT Array(nnrgs, nbins) ; Geometry factor
DENERGY FLOAT Array(nnrgs, nbins) ; Energies for bins
DTHETA FLOAT Array(nbins) ; Delta Theta
SPIN_FRACT FLOAT ARRAY(nnrgs, nbins) ; Spin fraction of angles
SPBIN INT ; Spin phase bin
MODE INT ; TEAMS Instrument mode
MAGDIR FLOAT ; Mag direction
EFF FLOAT Array(nnrgs) ; Efficiency (GF)
EFF_VERSION FLOAT 1.0 ; Eff. calibration vers.
MASS DOUBLE 0.0208778 ; Mass eV/(km/sec)^2
GEOMFACTOR DOUBLE 0.0015 ; Bin GF
HEADER_BYTES BYTE Array(25) ; Header bytes
CALLING SEQUENCE:
data = get_fa_tba_eq (time, [START=start | EN=en | ADVANCE=advance |
RETREAT=retreat])
ARGUMENTS:
time This argument gives a time handle from which
to take data from. It may be either a string
with the following possible formats:
'YY-MM-DD/HH:MM:SS.MSC' or
'HH:MM:SS' (use reference date)
or a number, which will represent seconds
since 1970 (must be a double > 94608000.D), or
a hours from a reference time, if set.
time will always be returned as a double
representing the actual data time found in
seconds since 1970.
KEYWORDS:
START If non-zero, get data from the start time
of the data instance in the SDT buffers
EN If non-zero, get data at the end time
of the data instance in the SDT buffers
ADVANCE If non-zero, advance to the next data point
following the time input
RETREAT If non-zero, retreat (reverse) to the previous
data point before the time input
RETURN VALUE:
Upon success, the above structure is returned, with the valid tag
set to 1. Upon failure, the valid tag will be 0.
CREATED BY:
Li Tang 11/2/96 University of New Hampshire
Space Physics Lab
MODIFICATION HISTORY:
7/15/97 Keyword CALIB added L.Tang
7/15/97 domega removed L.Tang
7/18/97 updated spin phase correction L.Tang
(See idlUtil/fast/get_fa_tba_eq.pro)
FUNCTION: GET_FA_TBH_3D DESCRIPTION: function to load FAST Teams burst He+ species data from the call of routine get_fa_tbh_eq to generate a 3D data. A structure of the following format is returned: DATA_NAME STRING 'Tms Burst Helium' ; Data Quantity name VALID INT 1 ; Data valid flag PROJECT_NAME STRING 'FAST' ; project name UNITS_NAME STRING 'Counts' ; Units of this data UNITS_PROCEDURE STRING 'proc' ; Units conversion proc TIME DOUBLE 8.0118726e+08 ; Start Time of sample END_TIME DOUBLE 7.9850884e+08 ; End time of sample INTEG_T DOUBLE 3.0000000 ; Integration time NBINS INT nbins ; Number of angle bins NENERGY INT nnrgs ; Number of energy bins DATA FLOAT Array(nnrgs, nbins) ; Data qauantities ENERGY FLOAT Array(nnrgs, nbins) ; Energy steps THETA FLOAT Array(nnrgs, nbins) ; Angle for bins GEOM FLOAT Array(nbins) ; Geometry factor DENERGY FLOAT Array(nnrgs, nbins) ; Energies for bins DTHETA FLOAT Array(nbins) ; Delta Theta DOMEGA FLOAT ARRAY(nbins) SPIN_FRACT FLOAT ARRAY(nnrgs, nbins) ; Spin fraction of angles EFF FLOAT Array(nnrgs,nbins) ; Efficiency (GF) MASS DOUBLE 0.0417556 ; Mass eV/(km/sec)^2 GEOMFACTOR DOUBLE 0.0015 ; Bin GF HEADER_BYTES BYTE Array(25) ; Header bytes EFF_VERSION FLOAT 1.0 ; Eff. calibration vers. CALLING SEQUENCE: data = get_fa_tbh_3d (time, [START=start | EN=en | ADVANCE=advance | RETREAT=retreat]) ARGUMENTS: time This argument gives a time handle from which to take data from. It may be either a string with the following possible formats: 'YY-MM-DD/HH:MM:SS.MSC' or 'HH:MM:SS' (use reference date) or a number, which will represent seconds since 1970 (must be a double > 94608000.D), or a hours from a reference time, if set. time will always be returned as a double representing the actual data time found in seconds since 1970. KEYWORDS: START If non-zero, get data from the start time of the data instance in the SDT buffers EN If non-zero, get data at the end time of the data instance in the SDT buffers ADVANCE If non-zero, advance to the next data point following the time input RETREAT If non-zero, retreat (reverse) to the previous data point before the time input RETURN VALUE: Upon success, the above structure is returned, with the valid tag set to 1. Upon failure, the valid tag will be 0. CREATED BY: Li Tang 1/1/97 University of New Hampshire Space Physics Lab tang@teams.sr.unh.edu MODIFICATION HISTORY: 7/15/97 Keyword CALIB added L.Tang
(See idlUtil/fast/get_fa_tbh_3d.pro)
FUNCTION:
GET_FA_TBH_EQ
DESCRIPTION:
function to load FAST Teams burst helium species equator data
from the SDT program shared memory buffers.
A structure of the following format is returned:
DATA_NAME STRING 'Tms Burst Helium' ; Data Quantity name
VALID INT 1 ; Data valid flag
PROJECT_NAME STRING 'FAST' ; project name
UNITS_NAME STRING 'Counts' ; Units of this data
UNITS_PROCEDURE STRING 'proc' ; Units conversion proc
TIME DOUBLE 8.0118726e+08 ; Start Time of sample
END_TIME DOUBLE 7.9850884e+08 ; End time of sample
INTEG_T DOUBLE 3.0000000 ; Integration time
NBINS INT nbins ; Number of angle bins
NENERGY INT nnrgs ; Number of energy bins
DATA FLOAT Array(nnrgs, nbins) ; Data qauantities
ENERGY FLOAT Array(nnrgs, nbins) ; Energy steps
THETA FLOAT Array(nnrgs, nbins) ; Angle for bins
GEOM FLOAT Array(nnrgs, nbins) ; Geometry factor
DENERGY FLOAT Array(nnrgs, nbins) ; Energies for bins
DTHETA FLOAT Array(nbins) ; Delta Theta
SPIN_FRACT FLOAT ARRAY(nnrgs, nbins) ; Spin fraction of angles
SPBIN INT ; Spin phase bin
MODE INT ; TEAMS Instrument mode
MAGDIR FLOAT ; Mag direction
EFF FLOAT Array(nnrgs) ; Efficiency (GF)
EFF_VERSION FLOAT 1.0 ; Eff. calibration vers.
MASS DOUBLE 0.0417556 ; Mass eV/(km/sec)^2
GEOMFACTOR DOUBLE 0.0015 ; Bin GF
HEADER_BYTES BYTE Array(25) ; Header bytes
CALLING SEQUENCE:
data = get_fa_tbh_eq (time, [START=start | EN=en | ADVANCE=advance |
RETREAT=retreat])
ARGUMENTS:
time This argument gives a time handle from which
to take data from. It may be either a string
with the following possible formats:
'YY-MM-DD/HH:MM:SS.MSC' or
'HH:MM:SS' (use reference date)
or a number, which will represent seconds
since 1970 (must be a double > 94608000.D), or
a hours from a reference time, if set.
time will always be returned as a double
representing the actual data time found in
seconds since 1970.
KEYWORDS:
START If non-zero, get data from the start time
of the data instance in the SDT buffers
EN If non-zero, get data at the end time
of the data instance in the SDT buffers
ADVANCE If non-zero, advance to the next data point
following the time input
RETREAT If non-zero, retreat (reverse) to the previous
data point before the time input
RETURN VALUE:
Upon success, the above structure is returned, with the valid tag
set to 1. Upon failure, the valid tag will be 0.
CREATED BY:
Li Tang 11/2/96 University of New Hampshire
Space Physics Lab
MODIFICATION HISTORY:
7/15/97 Keyword CALIB added L.Tang
7/15/97 domega removed L.Tang
7/18/97 updated spin phase correction L.Tang
(See idlUtil/fast/get_fa_tbh_eq.pro)
FUNCTION: GET_FA_TBO_3D DESCRIPTION: function to load FAST Teams burst O+ species data from the call of routine get_fa_tbo_eq to generate a 3D data. A structure of the following format is returned: DATA_NAME STRING 'Tms Burst Oxygen' ; Data Quantity name VALID INT 1 ; Data valid flag PROJECT_NAME STRING 'FAST' ; project name UNITS_NAME STRING 'Counts' ; Units of this data UNITS_PROCEDURE STRING 'proc' ; Units conversion proc TIME DOUBLE 8.0118726e+08 ; Start Time of sample END_TIME DOUBLE 7.9850884e+08 ; End time of sample INTEG_T DOUBLE 3.0000000 ; Integration time NBINS INT nbins ; Number of angle bins NENERGY INT nnrgs ; Number of energy bins DATA FLOAT Array(nnrgs, nbins) ; Data qauantities ENERGY FLOAT Array(nnrgs, nbins) ; Energy steps THETA FLOAT Array(nnrgs, nbins) ; Angle for bins GEOM FLOAT Array(nbins) ; Geometry factor DENERGY FLOAT Array(nnrgs, nbins) ; Energies for bins DTHETA FLOAT Array(nbins) ; Delta Theta DOMEGA FLOAT ARRAY(nbins) SPIN_FRACT FLOAT ARRAY(nnrgs, nbins) ; Spin fraction of angles EFF FLOAT Array(nnrgs,nbins) ; Efficiency (GF) MASS DOUBLE 0.1670224 ; Mass eV/(km/sec)^2 GEOMFACTOR DOUBLE 0.0015 ; Bin GF HEADER_BYTES BYTE Array(25) ; Header bytes EFF_VERSION FLOAT 1.0 ; Eff. calibration vers. CALLING SEQUENCE: data = get_fa_tbo_3d (time, [START=start | EN=en | ADVANCE=advance | RETREAT=retreat]) ARGUMENTS: time This argument gives a time handle from which to take data from. It may be either a string with the following possible formats: 'YY-MM-DD/HH:MM:SS.MSC' or 'HH:MM:SS' (use reference date) or a number, which will represent seconds since 1970 (must be a double > 94608000.D), or a hours from a reference time, if set. time will always be returned as a double representing the actual data time found in seconds since 1970. KEYWORDS: START If non-zero, get data from the start time of the data instance in the SDT buffers EN If non-zero, get data at the end time of the data instance in the SDT buffers ADVANCE If non-zero, advance to the next data point following the time input RETREAT If non-zero, retreat (reverse) to the previous data point before the time input RETURN VALUE: Upon success, the above structure is returned, with the valid tag set to 1. Upon failure, the valid tag will be 0. CREATED BY: Li Tang 1/1/97 University of New Hampshire Space Physics Lab tang@teams.sr.unh.edu MODIFICATION HISTORY: 7/15/97 Keyword CALIB added L.Tang
(See idlUtil/fast/get_fa_tbo_3d.pro)
FUNCTION:
GET_FA_TBO_EQ
DESCRIPTION:
function to load FAST Teams burst oxygen species equator data
from the SDT program shared memory buffers.
A structure of the following format is returned:
DATA_NAME STRING 'Tms Burst Oxygen' ; Data Quantity name
VALID INT 1 ; Data valid flag
PROJECT_NAME STRING 'FAST' ; project name
UNITS_NAME STRING 'Counts' ; Units of this data
UNITS_PROCEDURE STRING 'proc' ; Units conversion proc
TIME DOUBLE 8.0118726e+08 ; Start Time of sample
END_TIME DOUBLE 7.9850884e+08 ; End time of sample
INTEG_T DOUBLE 3.0000000 ; Integration time
NBINS INT nbins ; Number of angle bins
NENERGY INT nnrgs ; Number of energy bins
DATA FLOAT Array(nnrgs, nbins) ; Data qauantities
ENERGY FLOAT Array(nnrgs, nbins) ; Energy steps
THETA FLOAT Array(nnrgs, nbins) ; Angle for bins
GEOM FLOAT Array(nnrgs, nbins) ; Geometry factor
DENERGY FLOAT Array(nnrgs, nbins) ; Energies for bins
DTHETA FLOAT Array(nbins) ; Delta Theta
SPIN_FRACT FLOAT ARRAY(nnrgs, nbins) ; Spin fraction of angles
SPBIN INT ; Spin phase bin
MODE INT ; TEAMS Instrument mode
MAGDIR FLOAT ; Mag direction
EFF FLOAT Array(nnrgs) ; Efficiency (GF)
EFF_VERSION FLOAT 1.0 ; Eff. calibration vers.
MASS DOUBLE 0.1670224 ; Mass eV/(km/sec)^2
GEOMFACTOR DOUBLE 0.0015 ; Bin GF
HEADER_BYTES BYTE Array(25) ; Header bytes
CALLING SEQUENCE:
data = get_fa_tbo_eq (time, [START=start | EN=en | ADVANCE=advance |
RETREAT=retreat])
ARGUMENTS:
time This argument gives a time handle from which
to take data from. It may be either a string
with the following possible formats:
'YY-MM-DD/HH:MM:SS.MSC' or
'HH:MM:SS' (use reference date)
or a number, which will represent seconds
since 1970 (must be a double > 94608000.D), or
a hours from a reference time, if set.
time will always be returned as a double
representing the actual data time found in
seconds since 1970.
KEYWORDS:
START If non-zero, get data from the start time
of the data instance in the SDT buffers
EN If non-zero, get data at the end time
of the data instance in the SDT buffers
ADVANCE If non-zero, advance to the next data point
following the time input
RETREAT If non-zero, retreat (reverse) to the previous
data point before the time input
RETURN VALUE:
Upon success, the above structure is returned, with the valid tag
set to 1. Upon failure, the valid tag will be 0.
CREATED BY:
Li Tang 11/2/96 University of New Hampshire
Space Physics Lab
MODIFICATION HISTORY:
7/15/97 Keyword CALIB added L.Tang
7/15/97 domega removed L.Tang
7/18/97 updated spin phase correction L.Tang
(See idlUtil/fast/get_fa_tbo_eq.pro)
FUNCTION: GET_FA_TBP_3D DESCRIPTION: function to load FAST Teams burst H+ species data from the call of routine get_fa_tbp_eq to generate a 3D data. A structure of the following format is returned: DATA_NAME STRING 'Tms Burst Proton' ; Data Quantity name VALID INT 1 ; Data valid flag PROJECT_NAME STRING 'FAST' ; project name UNITS_NAME STRING 'Counts' ; Units of this data UNITS_PROCEDURE STRING 'proc' ; Units conversion proc TIME DOUBLE 8.0118726e+08 ; Start Time of sample END_TIME DOUBLE 7.9850884e+08 ; End time of sample INTEG_T DOUBLE 3.0000000 ; Integration time NBINS INT nbins ; Number of angle bins NENERGY INT nnrgs ; Number of energy bins DATA FLOAT Array(nnrgs, nbins) ; Data qauantities ENERGY FLOAT Array(nnrgs, nbins) ; Energy steps THETA FLOAT Array(nnrgs, nbins) ; Angle for bins GEOM FLOAT Array(nbins) ; Geometry factor DENERGY FLOAT Array(nnrgs, nbins) ; Energies for bins DTHETA FLOAT Array(nbins) ; Delta Theta DOMEGA FLOAT ARRAY(nbins) SPIN_FRACT FLOAT ARRAY(nnrgs, nbins) ; Spin fraction of angles EFF FLOAT Array(nnrgs,nbins) ; Efficiency (GF) MASS DOUBLE 0.0104389 ; Mass eV/(km/sec)^2 GEOMFACTOR DOUBLE 0.0015 ; Bin GF HEADER_BYTES BYTE Array(25) ; Header bytes EFF_VERSION FLOAT 1.0 ; Eff. calibration vers. CALLING SEQUENCE: data = get_fa_tbp_3d (time, [START=start | EN=en | ADVANCE=advance | RETREAT=retreat]) ARGUMENTS: time This argument gives a time handle from which to take data from. It may be either a string with the following possible formats: 'YY-MM-DD/HH:MM:SS.MSC' or 'HH:MM:SS' (use reference date) or a number, which will represent seconds since 1970 (must be a double > 94608000.D), or a hours from a reference time, if set. time will always be returned as a double representing the actual data time found in seconds since 1970. KEYWORDS: START If non-zero, get data from the start time of the data instance in the SDT buffers EN If non-zero, get data at the end time of the data instance in the SDT buffers ADVANCE If non-zero, advance to the next data point following the time input RETREAT If non-zero, retreat (reverse) to the previous data point before the time input RETURN VALUE: Upon success, the above structure is returned, with the valid tag set to 1. Upon failure, the valid tag will be 0. CREATED BY: Li Tang 1/1/97 University of New Hampshire Space Physics Lab tang@teams.sr.unh.edu MODIFICATION HISTORY: 7/15/97 Keyword CALIB added L.Tang
(See idlUtil/fast/get_fa_tbp_3d.pro)
FUNCTION:
GET_FA_TBP_EQ
DESCRIPTION:
function to load FAST Teams burst proton species equator data
from the SDT program shared memory buffers.
A structure of the following format is returned:
DATA_NAME STRING 'Tms Burst Proton' ; Data Quantity name
VALID INT 1 ; Data valid flag
PROJECT_NAME STRING 'FAST' ; project name
UNITS_NAME STRING 'Counts' ; Units of this data
UNITS_PROCEDURE STRING 'proc' ; Units conversion proc
TIME DOUBLE 8.0118726e+08 ; Start Time of sample
END_TIME DOUBLE 7.9850884e+08 ; End time of sample
INTEG_T DOUBLE 3.0000000 ; Integration time
NBINS INT nbins ; Number of angle bins
NENERGY INT nnrgs ; Number of energy bins
DATA FLOAT Array(nnrgs, nbins) ; Data qauantities
ENERGY FLOAT Array(nnrgs, nbins) ; Energy steps
THETA FLOAT Array(nnrgs, nbins) ; Angle for bins
GEOM FLOAT Array(nnrgs, nbins) ; Geometry factor
DENERGY FLOAT Array(nnrgs, nbins) ; Energies for bins
DTHETA FLOAT Array(nbins) ; Delta Theta
SPIN_FRACT FLOAT ARRAY(nnrgs, nbins) ; Spin fraction of angles
SPBIN INT ; Spin phase bin
MODE INT ; TEAMS Instrument mode
MAGDIR FLOAT ; Mag direction
EFF FLOAT Array(nnrgs) ; Efficiency (GF)
EFF_VERSION FLOAT 1.0 ; Eff. calibration vers.
MASS DOUBLE 0.0104389 ; Mass eV/(km/sec)^2
GEOMFACTOR DOUBLE 0.0015 ; Bin GF
HEADER_BYTES BYTE Array(25) ; Header bytes
CALLING SEQUENCE:
data = get_fa_tbp_eq (time, [START=start | EN=en | ADVANCE=advance |
RETREAT=retreat])
ARGUMENTS:
time This argument gives a time handle from which
to take data from. It may be either a string
with the following possible formats:
'YY-MM-DD/HH:MM:SS.MSC' or
'HH:MM:SS' (use reference date)
or a number, which will represent seconds
since 1970 (must be a double > 94608000.D), or
a hours from a reference time, if set.
time will always be returned as a double
representing the actual data time found in
seconds since 1970.
KEYWORDS:
START If non-zero, get data from the start time
of the data instance in the SDT buffers
EN If non-zero, get data at the end time
of the data instance in the SDT buffers
ADVANCE If non-zero, advance to the next data point
following the time input
RETREAT If non-zero, retreat (reverse) to the previous
data point before the time input
RETURN VALUE:
Upon success, the above structure is returned, with the valid tag
set to 1. Upon failure, the valid tag will be 0.
CREATED BY:
Li Tang 11/2/96 University of New Hampshire
Space Physics Lab
MODIFICATION HISTORY:
7/15/97 Keyword CALIB added L.Tang
7/15/97 domega removed L.Tang
7/18/97 updated spin phase correction L.Tang
(See idlUtil/fast/get_fa_tbp_eq.pro)
FUNCTION: GET_FA_TB_3D_EQ DESCRIPTION: function to load FAST Teams burst H+, O+, He++, He+ species data from the call of routine get_fa_tb_eq to generate a 3D data in instrument equatorial plane. A structure of the following format is returned: DATA_NAME STRING 'Tms Burst Data' ; Data Quantity name VALID INT 1 ; Data valid flag PROJECT_NAME STRING 'FAST' ; project name UNITS_NAME STRING 'Counts' ; Units of this data UNITS_PROCEDURE STRING 'proc' ; Units conversion proc TIME DOUBLE 8.0118726e+08 ; Start Time of sample END_TIME DOUBLE 7.9850884e+08 ; End time of sample INTEG_T DOUBLE 3.0000000 ; Integration time NBINS INT nbins ; Number of angle bins NENERGY INT nnrgs ; Number of energy bins DATA FLOAT Array(nnrgs, nbins,mbins) ; Data qauantities ENERGY FLOAT Array(nnrgs, nbins) ; Energy steps THETA FLOAT Array(nnrgs, nbins) ; Angle for bins GEOM FLOAT Array(nbins) ; Geometry factor DENERGY FLOAT Array(nnrgs, nbins) ; Energies for bins DTHETA FLOAT Array(nbins) ; Delta Theta SPIN_FRACT FLOAT ARRAY(nnrgs, nbins) ; Spin fraction of angles EFF FLOAT Array(nnrgs,nbins,mbins) ; Efficiency (GF) MASS DOUBLE ARRAY(4) ; Mass eV/(km/sec)^2 GEOMFACTOR DOUBLE 0.0015 ; Bin GF HEADER_BYTES BYTE Array(25) ; Header bytes EFF_VERSION FLOAT 1.0 ; Eff. calibration vers. CALLING SEQUENCE: data = get_fa_tb_3d_eq (time, [START=start | EN=en | ADVANCE=advance | RETREAT=retreat]) ARGUMENTS: time This argument gives a time handle from which to take data from. It may be either a string with the following possible formats: 'YY-MM-DD/HH:MM:SS.MSC' or 'HH:MM:SS' (use reference date) or a number, which will represent seconds since 1970 (must be a double > 94608000.D), or a hours from a reference time, if set. time will always be returned as a double representing the actual data time found in seconds since 1970. KEYWORDS: START If non-zero, get data from the start time of the data instance in the SDT buffers EN If non-zero, get data at the end time of the data instance in the SDT buffers ADVANCE If non-zero, advance to the next data point following the time input RETREAT If non-zero, retreat (reverse) to the previous data point before the time input RETURN VALUE: Upon success, the above structure is returned, with the valid tag set to 1. Upon failure, the valid tag will be 0. CREATED BY: Li Tang 11/2/96 University of New Hampshire Space Physics Lab MOD. HISTORY: 7/25/97 recalculated pitch angle LT
(See idlUtil/fast/get_fa_tb_3d_eq.pro)
FUNCTION:
GET_FA_TB_EQ
DESCRIPTION:
function to load FAST Teams burst 4 species equator data
from the SDT program shared memory buffers.
A structure of the following format is returned:
DATA_NAME STRING 'Tms Burst PAHO' ; Data Quantity name
VALID INT 1 ; Data valid flag
PROJECT_NAME STRING 'FAST' ; project name
UNITS_NAME STRING 'Counts' ; Units of this data
UNITS_PROCEDURE STRING 'proc' ; Units conversion proc
TIME DOUBLE 8.0118726e+08 ; Start Time of sample
END_TIME DOUBLE 7.9850884e+08 ; End time of sample
INTEG_T DOUBLE 3.0000000 ; Integration time
NBINS INT nbins ; Number of angle bins
NENERGY INT nnrgs ; Number of energy bins
DATA FLOAT Array(nnrgs, nbins,4) ; Data qauantities
ENERGY FLOAT Array(nnrgs, nbins) ; Energy steps
THETA FLOAT Array(nnrgs, nbins) ; Angle for bins
GEOM FLOAT Array(nbins) ; Geometry factor
DENERGY FLOAT Array(nnrgs, nbins) ; Energies for bins
DTHETA FLOAT Array(nbins) ; Delta Theta
SPIN_FRACT FLOAT ARRAY(nnrgs, nbins) ; Spin fraction of angles
SPBIN INT ; Spin phase bin
MODE INT ; TEAMS Instrument mode
MAGDIR FLOAT ; Mag direction
EFF FLOAT Array(nnrgs) ; Efficiency (GF)
EFF_VERSION FLOAT 1.0 ; Eff. calibration vers.
MASS DOUBLE 0.0104389 ; Mass eV/(km/sec)^2
GEOMFACTOR DOUBLE 1. ; Bin GF
HEADER_BYTES BYTE Array(25) ; Header bytes
CALLING SEQUENCE:
data = get_fa_tba_eq (time, [START=start | EN=en | ADVANCE=advance |
RETREAT=retreat])
ARGUMENTS:
time This argument gives a time handle from which
to take data from. It may be either a string
with the following possible formats:
'YY-MM-DD/HH:MM:SS.MSC' or
'HH:MM:SS' (use reference date)
or a number, which will represent seconds
since 1970 (must be a double > 94608000.D), or
a hours from a reference time, if set.
time will always be returned as a double
representing the actual data time found in
seconds since 1970.
KEYWORDS:
START If non-zero, get data from the start time
of the data instance in the SDT buffers
EN If non-zero, get data at the end time
of the data instance in the SDT buffers
ADVANCE If non-zero, advance to the next data point
following the time input
RETREAT If non-zero, retreat (reverse) to the previous
data point before the time input
RETURN VALUE:
Upon success, the above structure is returned, with the valid tag
set to 1. Upon failure, the valid tag will be 0.
CREATED BY:
Li Tang 11/2/96 University of New Hampshire
Space Physics Lab
MODIFICATION HISTORY:
7/15/97 Keyword CALIB added L.Tang
7/15/97 domega removed L.Tang
7/18/97 debubbed spin phase correction L.Tang
(See idlUtil/fast/get_fa_tb_eq.pro)
FUNCTION:
GET_FA_TH_3D
DESCRIPTION:
function to load FAST Teams HiMass data from the SDT
program shared memory buffers.
A structure of the following format is returned:
DATA_NAME STRING 'Tms HiMass Bin:N'; Data Quantity name
VALID INT 1 ; Data valid flag
PROJECT_NAME STRING 'FAST' ; project name
UNITS_NAME STRING 'Counts' ; Units of this data
UNITS_PROCEDURE STRING 'proc' ; Units conversion proc
TIME DOUBLE 8.0118726e+08 ; Start Time of sample
END_TIME DOUBLE 7.9850884e+08 ; End time of sample
INTEG_T DOUBLE 3.0000000 ; Integration time
NBINS INT nbins ; Number of angle bins
NENERGY INT nnrgs ; Number of energy bins
NBINS INT mbins ; Number of mass bins
DATA FLOAT Array(nnrgs, nbins,mbins) ; Data qauantities
ENERGY FLOAT Array(nnrgs, nbins) ; Energy steps
THETA FLOAT Array(nnrgs, nbins) ; Theta angle for bins
PHI FLOAT Array(nnrgs, nbins) ; Phi angle for bins
GEOM FLOAT Array(nnrgs, nbins) ; Geometry factor
DENERGY FLOAT Array(nnrgs, nbins) ; Energies for bins
DTHETA FLOAT Array(nbins) ; Delta Theta
DPHI FLOAT Array(nbins) ; Delta Phi
DOMEGA FLOAT Array(nbins, nbins) ;Solid angle for bins
PT_LIMITS FLOAT Array(2) ;Mass min/max limits
EFF FLOAT Array(nnrgs, nbins) ; Efficiency (GF)
MASS FLOAT Array(nnrgs, mbins) ; mean bin Mass in
; mass unit
DMASS FLOAT Array(mbins) ; mass bin width in
; mass unit
GEOMFACTOR DOUBLE 0.0015 ; Bin GF
SPIN_FRACT FLOAT ARRAY(nnrgs, nbins) ; Spin fraction of
; angles
HEADER_BYTES BYTE Array(226) ; Header bytes
The bin number selected will be returned as part of the DATA_NAME
string.
CALLING SEQUENCE:
data = get_fa_th_3d (time, [START=start | EN=en |
ADVANCE = advance | RETREAT=retreat])
ARGUMENTS:
time This argument gives a time handle from which
to take data from. It may be either a string
with the following possible formats:
'YY-MM-DD/HH:MM:SS.MSC' or
'HH:MM:SS' (use reference date)
or a number, which will represent seconds
since 1970 (must be a double > 94608000.D), or
a hours from a reference time, if set.
time will always be returned as a double
representing the actual data time found in
seconds since 1970.
KEYWORDS:
START If non-zero, get data from the start time
of the data instance in the SDT buffers
EN If non-zero, get data at the end time
of the data instance in the SDT buffers
ADVANCE If non-zero, advance to the next data point
following the time input
RETREAT If non-zero, retreat (reverse) to the previous
data point before the time input
RETURN VALUE:
Upon success, the above structure is returned, with the valid tag
set to 1. Upon failure, the valid tag will be 0.
REVISION HISTORY:
Made from get_fa_th.pro 1.13 12 Jul 1996
Last modification: 8/20/96 Li Tang Univ. of New Hampshire
Space Physcis Lab
MODIFICATION HISTORY:
7/15/97 Keyword CALIB added L.Tang
(See idlUtil/fast/get_fa_th_3d.pro)
FUNCTION: GET_FA_TH_3D_EQ DESCRIPTION: function to get FAST Teams survey He++ species eqtuator data from get_fa_tsp.pro routine, calculate pitch angles and add efficiency to the returned data A structure of the following format is returned: DATA_NAME STRING 'Tms Survey Alpha' ; Data Quantity name VALID INT 1 ; Data valid flag PROJECT_NAME STRING 'FAST' ; project name UNITS_NAME STRING 'Counts' ; Units of this data UNITS_PROCEDURE STRING 'proc' ; Units conversion proc TIME DOUBLE 8.0118726e+08 ; Start Time of sample END_TIME DOUBLE 7.9850884e+08 ; End time of sample INTEG_T DOUBLE 3.0000000 ; Integration time NBINS INT nbins ; Number of angle bins NENERGY INT nnrgs ; Number of energy bins DATA FLOAT Array(nnrgs, nbins) ; Data qauantities ENERGY FLOAT Array(nnrgs, nbins) ; Energy steps THETA FLOAT Array(nnrgs, nbins) ; Pitch angle for bins GEOM FLOAT Array(nnrgs, nbins) ; Geometry factor DENERGY FLOAT Array(nnrgs, nbins) ; Energies for bins DTHETA FLOAT Array(nbins) ; Delta Theta DOMEGA FLOAT Array(nbins) ; Solid angle for bins PT_LIMITS FLOAT Array(2) ; Angle min/max limits EFF FLOAT Array(nnrgs, nbins) ; Efficiency (GF) MASS DOUBLE 0.165695 ; Mass eV/(km/sec)^2 GEOMFACTOR DOUBLE 0.0015 ; Bin GF HEADER_BYTES BYTE Array(86) ; Header bytes SPIN_FRACT FLOAT Array(nnrgs, nbins) ; Spin fraction of angles EFF_VERSION FLOAT 1.00 ; Calibration version CALLING SEQUENCE: data = get_fa_th_3d_eq (time, [START=start | EN=en | ADVANCE=advance | RETREAT=retreat]) ARGUMENTS: time This argument gives a time handle from which to take data from. It may be either a string with the following possible formats: 'YY-MM-DD/HH:MM:SS.MSC' or 'HH:MM:SS' (use reference date) or a number, which will represent seconds since 1970 (must be a double > 94608000.D), or a hours from a reference time, if set. time will always be returned as a double representing the actual data time found in seconds since 1970. KEYWORDS: START If non-zero, get data from the start time of the data instance in the SDT buffers EN If non-zero, get data at the end time of the data instance in the SDT buffers ADVANCE If non-zero, advance to the next data point following the time input RETREAT If non-zero, retreat (reverse) to the previous data point before the time input RETURN VALUE: Upon success, the above structure is returned, with the valid tag set to 1. Upon failure, the valid tag will be 0. REVISION HISTORY: Created By: 8/21/96 Li Tang University of New Hampshire, Space Physics Lab MODIFICATION HISTORY: 7/15/97 Keyword CALIB added L.Tang 7/15/97 domega removed L.Tang
(See idlUtil/fast/get_fa_th_3d_eq.pro)
FUNCTION:
GET_FA_TSA_EQ
DESCRIPTION:
function to get FAST Teams survey He++ species eqtuator data from
get_fa_tsp.pro routine, calculate pitch angles and add efficiency
to the returned data
A structure of the following format is returned:
DATA_NAME STRING 'Tms Survey Alpha' ; Data Quantity name
VALID INT 1 ; Data valid flag
PROJECT_NAME STRING 'FAST' ; project name
UNITS_NAME STRING 'Counts' ; Units of this data
UNITS_PROCEDURE STRING 'proc' ; Units conversion proc
TIME DOUBLE 8.0118726e+08 ; Start Time of sample
END_TIME DOUBLE 7.9850884e+08 ; End time of sample
INTEG_T DOUBLE 3.0000000 ; Integration time
NBINS INT nbins ; Number of angle bins
NENERGY INT nnrgs ; Number of energy bins
DATA FLOAT Array(nnrgs, nbins) ; Data qauantities
ENERGY FLOAT Array(nnrgs, nbins) ; Energy steps
THETA FLOAT Array(nnrgs, nbins) ; Pitch angle for bins
GEOM FLOAT Array(nnrgs, nbins) ; Geometry factor
DENERGY FLOAT Array(nnrgs, nbins) ; Energies for bins
DTHETA FLOAT Array(nbins) ; Delta Theta
DOMEGA FLOAT Array(nbins) ; Solid angle for bins
PT_LIMITS FLOAT Array(2) ; Angle min/max limits
EFF FLOAT Array(nnrgs, nbins) ; Efficiency (GF)
MASS DOUBLE 0.165695 ; Mass eV/(km/sec)^2
GEOMFACTOR DOUBLE 0.0015 ; Bin GF
HEADER_BYTES BYTE Array(86) ; Header bytes
SPIN_FRACT FLOAT Array(nnrgs, nbins) ; Spin fraction of angles
EFF_VERSION FLOAT 1.00 ; Calibration version
CALLING SEQUENCE:
data = get_fa_tsa_eq (time, [START=start | EN=en | ADVANCE=advance |
RETREAT=retreat])
ARGUMENTS:
time This argument gives a time handle from which
to take data from. It may be either a string
with the following possible formats:
'YY-MM-DD/HH:MM:SS.MSC' or
'HH:MM:SS' (use reference date)
or a number, which will represent seconds
since 1970 (must be a double > 94608000.D), or
a hours from a reference time, if set.
time will always be returned as a double
representing the actual data time found in
seconds since 1970.
KEYWORDS:
START If non-zero, get data from the start time
of the data instance in the SDT buffers
EN If non-zero, get data at the end time
of the data instance in the SDT buffers
ADVANCE If non-zero, advance to the next data point
following the time input
RETREAT If non-zero, retreat (reverse) to the previous
data point before the time input
RETURN VALUE:
Upon success, the above structure is returned, with the valid tag
set to 1. Upon failure, the valid tag will be 0.
REVISION HISTORY:
Created By: Li Tang University of New Hampshire,
Space Physics Lab
Last modification: 8/21/96.
7/15/97 keyword CALIB added L.Tang
domega removed L.Tang
(See idlUtil/fast/get_fa_tsa_eq.pro)
FUNCTION:
GET_FA_TSH_EQ
DESCRIPTION:
function to get FAST Teams survey He+ species eqtuator data from
get_fa_tsp.pro routine, calculate pitch angles and add efficiency
to the returned data
A structure of the following format is returned:
DATA_NAME STRING 'Tms Survey Helium' ; Data Quantity name
VALID INT 1 ; Data valid flag
PROJECT_NAME STRING 'FAST' ; project name
UNITS_NAME STRING 'Counts' ; Units of this data
UNITS_PROCEDURE STRING 'proc' ; Units conversion proc
TIME DOUBLE 8.0118726e+08 ; Start Time of sample
END_TIME DOUBLE 7.9850884e+08 ; End time of sample
INTEG_T DOUBLE 3.0000000 ; Integration time
NBINS INT nbins ; Number of angle bins
NENERGY INT nnrgs ; Number of energy bins
DATA FLOAT Array(nnrgs, nbins) ; Data qauantities
ENERGY FLOAT Array(nnrgs, nbins) ; Energy steps
THETA FLOAT Array(nnrgs, nbins) ; Pitch angle for bins
GEOM FLOAT Array(nnrgs, nbins) ; Geometry factor
DENERGY FLOAT Array(nnrgs, nbins) ; Energies for bins
DTHETA FLOAT Array(nbins) ; Delta Theta
DOMEGA FLOAT Array(nbins) ; Solid angle for bins
PT_LIMITS FLOAT Array(2) ; Angle min/max limits
EFF FLOAT Array(nnrgs, nbins) ; Efficiency (GF)
MASS DOUBLE 0.165695 ; Mass eV/(km/sec)^2
GEOMFACTOR DOUBLE 0.0015 ; Bin GF
HEADER_BYTES BYTE Array(86) ; Header bytes
SPIN_FRACT FLOAT Array(nnrgs, nbins) ; Spin fraction of angles
EFF_VERSION FLOAT 1.00 ; Calibration version
CALLING SEQUENCE:
data = get_fa_tsh_eq (time, [START=start | EN=en | ADVANCE=advance |
RETREAT=retreat])
ARGUMENTS:
time This argument gives a time handle from which
to take data from. It may be either a string
with the following possible formats:
'YY-MM-DD/HH:MM:SS.MSC' or
'HH:MM:SS' (use reference date)
or a number, which will represent seconds
since 1970 (must be a double > 94608000.D), or
a hours from a reference time, if set.
time will always be returned as a double
representing the actual data time found in
seconds since 1970.
KEYWORDS:
START If non-zero, get data from the start time
of the data instance in the SDT buffers
EN If non-zero, get data at the end time
of the data instance in the SDT buffers
ADVANCE If non-zero, advance to the next data point
following the time input
RETREAT If non-zero, retreat (reverse) to the previous
data point before the time input
RETURN VALUE:
Upon success, the above structure is returned, with the valid tag
set to 1. Upon failure, the valid tag will be 0.
REVISION HISTORY:
Created By: Li Tang University of New Hampshire,
Space Physics Lab
Last modification: 8/21/96.
7/15/97 keyword CALIB added L.Tang
domega removed L.Tang
(See idlUtil/fast/get_fa_tsh_eq.pro)
FUNCTION:
GET_FA_TSO_EQ
DESCRIPTION:
function to get FAST Teams survey O+ species eqtuator data from
get_fa_tsp.pro routine, calculate pitch angles and add efficiency
to the returned data
A structure of the following format is returned:
DATA_NAME STRING 'Tms Survey Oxygen' ; Data Quantity name
VALID INT 1 ; Data valid flag
PROJECT_NAME STRING 'FAST' ; project name
UNITS_NAME STRING 'Counts' ; Units of this data
UNITS_PROCEDURE STRING 'proc' ; Units conversion proc
TIME DOUBLE 8.0118726e+08 ; Start Time of sample
END_TIME DOUBLE 7.9850884e+08 ; End time of sample
INTEG_T DOUBLE 3.0000000 ; Integration time
NBINS INT nbins ; Number of angle bins
NENERGY INT nnrgs ; Number of energy bins
DATA FLOAT Array(nnrgs, nbins) ; Data qauantities
ENERGY FLOAT Array(nnrgs, nbins) ; Energy steps
THETA FLOAT Array(nnrgs, nbins) ; Pitch angle for bins
GEOM FLOAT Array(nnrgs, nbins) ; Geometry factor
DENERGY FLOAT Array(nnrgs, nbins) ; Energies for bins
DTHETA FLOAT Array(nbins) ; Delta Theta
DOMEGA FLOAT Array(nbins) ; Solid angle for bins
PT_LIMITS FLOAT Array(2) ; Angle min/max limits
EFF FLOAT Array(nnrgs, nbins) ; Efficiency (GF)
MASS DOUBLE 0.165695 ; Mass eV/(km/sec)^2
GEOMFACTOR DOUBLE 0.0015 ; Bin GF
HEADER_BYTES BYTE Array(86) ; Header bytes
SPIN_FRACT FLOAT Array(nnrgs, nbins) ; Spin fraction of angles
EFF_VERSION FLOAT 1.00 ; Calibration version
CALLING SEQUENCE:
data = get_fa_tso_eq (time, [START=start | EN=en | ADVANCE=advance |
RETREAT=retreat])
ARGUMENTS:
time This argument gives a time handle from which
to take data from. It may be either a string
with the following possible formats:
'YY-MM-DD/HH:MM:SS.MSC' or
'HH:MM:SS' (use reference date)
or a number, which will represent seconds
since 1970 (must be a double > 94608000.D), or
a hours from a reference time, if set.
time will always be returned as a double
representing the actual data time found in
seconds since 1970.
KEYWORDS:
START If non-zero, get data from the start time
of the data instance in the SDT buffers
EN If non-zero, get data at the end time
of the data instance in the SDT buffers
ADVANCE If non-zero, advance to the next data point
following the time input
RETREAT If non-zero, retreat (reverse) to the previous
data point before the time input
RETURN VALUE:
Upon success, the above structure is returned, with the valid tag
set to 1. Upon failure, the valid tag will be 0.
REVISION HISTORY:
Created By: Li Tang University of New Hampshire,
Space Physics Lab
Last modification: 8/21/96.
7/15/97 keyword CALIB added L.Tang
domega removed L.Tang
(See idlUtil/fast/get_fa_tso_eq.pro)
FUNCTION:
GET_FA_TSO_EQ_SP
DESCRIPTION:
function to get FAST Teams survey O+ species eqtuator data from
get_fa_tsp.pro routine, calculate pitch angles and add efficiency
to the returned data. The difference of this routine from
GET_FA_TSO_EQ.PRO is that this routine generates one spin
resolution data when in TEAMS mode 6 and 7.
A structure of the following format is returned:
DATA_NAME STRING 'Tms Survey Oxygen' ; Data Quantity name
VALID INT 1 ; Data valid flag
PROJECT_NAME STRING 'FAST' ; project name
UNITS_NAME STRING 'Counts' ; Units of this data
UNITS_PROCEDURE STRING 'proc' ; Units conversion proc
TIME DOUBLE 8.0118726e+08 ; Start Time of sample
END_TIME DOUBLE 7.9850884e+08 ; End time of sample
INTEG_T DOUBLE 3.0000000 ; Integration time
NBINS INT nbins ; Number of angle bins
NENERGY INT nnrgs ; Number of energy bins
DATA FLOAT Array(nnrgs, nbins) ; Data qauantities
ENERGY FLOAT Array(nnrgs, nbins) ; Energy steps
THETA FLOAT Array(nnrgs, nbins) ; Pitch angle for bins
GEOM FLOAT Array(nnrgs, nbins) ; Geometry factor
DENERGY FLOAT Array(nnrgs, nbins) ; Energies for bins
DTHETA FLOAT Array(nbins) ; Delta Theta
DOMEGA FLOAT Array(nbins) ; Solid angle for bins
PT_LIMITS FLOAT Array(2) ; Angle min/max limits
EFF FLOAT Array(nnrgs, nbins) ; Efficiency (GF)
MASS DOUBLE 0.165695 ; Mass eV/(km/sec)^2
GEOMFACTOR DOUBLE 0.0015 ; Bin GF
HEADER_BYTES BYTE Array(86) ; Header bytes
SPIN_FRACT FLOAT Array(nnrgs, nbins) ; Spin fraction of angles
EFF_VERSION FLOAT 1.00 ; Calibration version
CALLING SEQUENCE:
data = get_fa_tso_eq_sp (time, [START=start | EN=en | ADVANCE=advance |
RETREAT=retreat])
ARGUMENTS:
time This argument gives a time handle from which
to take data from. It may be either a string
with the following possible formats:
'YY-MM-DD/HH:MM:SS.MSC' or
'HH:MM:SS' (use reference date)
or a number, which will represent seconds
since 1970 (must be a double > 94608000.D), or
a hours from a reference time, if set.
time will always be returned as a double
representing the actual data time found in
seconds since 1970.
KEYWORDS:
START If non-zero, get data from the start time
of the data instance in the SDT buffers
EN If non-zero, get data at the end time
of the data instance in the SDT buffers
ADVANCE If non-zero, advance to the next data point
following the time input
RETREAT If non-zero, retreat (reverse) to the previous
data point before the time input
RETURN VALUE:
Upon success, the above structure is returned, with the valid tag
set to 1. Upon failure, the valid tag will be 0.
REVISION HISTORY:
Created By: Li Tang 9/17/96 University of New Hampshire,
Space Physics Lab
Last modification:
7/15/97 keyword CALIB added L.Tang
domega removed L.Tang
(See idlUtil/fast/get_fa_tso_eq_sp.pro)
FUNCTION:
GET_FA_TSP_EQ
DESCRIPTION:
function to get FAST Teams survey H+ species eqtuator data from
get_fa_tsp.pro routine, calculate pitch angles and add efficiency
to the returned data
A structure of the following format is returned:
DATA_NAME STRING 'Tms Survey Proton' ; Data Quantity name
VALID INT 1 ; Data valid flag
PROJECT_NAME STRING 'FAST' ; project name
UNITS_NAME STRING 'Counts' ; Units of this data
UNITS_PROCEDURE STRING 'proc' ; Units conversion proc
TIME DOUBLE 8.0118726e+08 ; Start Time of sample
END_TIME DOUBLE 7.9850884e+08 ; End time of sample
INTEG_T DOUBLE 3.0000000 ; Integration time
NBINS INT nbins ; Number of angle bins
NENERGY INT nnrgs ; Number of energy bins
DATA FLOAT Array(nnrgs, nbins) ; Data qauantities
ENERGY FLOAT Array(nnrgs, nbins) ; Energy steps
THETA FLOAT Array(nnrgs, nbins) ; Pitch angle for bins
GEOM FLOAT Array(nnrgs, nbins) ; Geometry factor
DENERGY FLOAT Array(nnrgs, nbins) ; Energies for bins
DTHETA FLOAT Array(nbins) ; Delta Theta
DOMEGA FLOAT Array(nbins) ; Solid angle for bins
PT_LIMITS FLOAT Array(2) ; Angle min/max limits
EFF FLOAT Array(nnrgs, nbins) ; Efficiency (GF)
MASS DOUBLE 0.0104389 ; Mass eV/(km/sec)^2
GEOMFACTOR DOUBLE 0.0015 ; Bin GF
HEADER_BYTES BYTE Array(86) ; Header bytes
SPIN_FRACT FLOAT Array(nnrgs, nbins) ; Spin fraction of angles
EFF_VERSION FLOAT 1.00 ; Calibration version
CALLING SEQUENCE:
data = get_fa_tsp_eq (time, [START=start | EN=en | ADVANCE=advance |
RETREAT=retreat])
ARGUMENTS:
time This argument gives a time handle from which
to take data from. It may be either a string
with the following possible formats:
'YY-MM-DD/HH:MM:SS.MSC' or
'HH:MM:SS' (use reference date)
or a number, which will represent seconds
since 1970 (must be a double > 94608000.D), or
a hours from a reference time, if set.
time will always be returned as a double
representing the actual data time found in
seconds since 1970.
KEYWORDS:
START If non-zero, get data from the start time
of the data instance in the SDT buffers
EN If non-zero, get data at the end time
of the data instance in the SDT buffers
ADVANCE If non-zero, advance to the next data point
following the time input
RETREAT If non-zero, retreat (reverse) to the previous
data point before the time input
RETURN VALUE:
Upon success, the above structure is returned, with the valid tag
set to 1. Upon failure, the valid tag will be 0.
REVISION HISTORY:
Created By: Li Tang University of New Hampshire,
Space Physics Lab
Last modification: 8/21/96.
7/15/97 keyword CALIB added L.Tang
domega removed L.Tang
(See idlUtil/fast/get_fa_tsp_eq.pro)
FUNCTION:
GET_FA_TSP_EQ_SP
DESCRIPTION:
function to get FAST Teams survey H+ species eqtuator data from
get_fa_tsp.pro routine, calculate pitch angles and add efficiency
to the returned data. The difference of this routine from
GET_FA_TSP_EQ.PRO is that this routine generates one spin
resolution data when in TEAMS mode 6 and 7.
A structure of the following format is returned:
DATA_NAME STRING 'Tms Survey Proton' ; Data Quantity name
VALID INT 1 ; Data valid flag
PROJECT_NAME STRING 'FAST' ; project name
UNITS_NAME STRING 'Counts' ; Units of this data
UNITS_PROCEDURE STRING 'proc' ; Units conversion proc
TIME DOUBLE 8.0118726e+08 ; Start Time of sample
END_TIME DOUBLE 7.9850884e+08 ; End time of sample
INTEG_T DOUBLE 3.0000000 ; Integration time
NBINS INT nbins ; Number of angle bins
NENERGY INT nnrgs ; Number of energy bins
DATA FLOAT Array(nnrgs, nbins) ; Data qauantities
ENERGY FLOAT Array(nnrgs, nbins) ; Energy steps
THETA FLOAT Array(nnrgs, nbins) ; Pitch angle for bins
GEOM FLOAT Array(nnrgs, nbins) ; Geometry factor
DENERGY FLOAT Array(nnrgs, nbins) ; Energies for bins
DTHETA FLOAT Array(nbins) ; Delta Theta
DOMEGA FLOAT Array(nbins) ; Solid angle for bins
PT_LIMITS FLOAT Array(2) ; Angle min/max limits
EFF FLOAT Array(nnrgs, nbins) ; Efficiency (GF)
MASS DOUBLE 0.0104389 ; Mass eV/(km/sec)^2
GEOMFACTOR DOUBLE 0.0015 ; Bin GF
HEADER_BYTES BYTE Array(86) ; Header bytes
SPIN_FRACT FLOAT Array(nnrgs, nbins) ; Spin fraction of angles
EFF_VERSION FLOAT 1.00 ; Calibration version
CALLING SEQUENCE:
data = get_fa_tsp_eq_sp (time, [START=start | EN=en | ADVANCE=advance |
RETREAT=retreat])
ARGUMENTS:
time This argument gives a time handle from which
to take data from. It may be either a string
with the following possible formats:
'YY-MM-DD/HH:MM:SS.MSC' or
'HH:MM:SS' (use reference date)
or a number, which will represent seconds
since 1970 (must be a double > 94608000.D), or
a hours from a reference time, if set.
time will always be returned as a double
representing the actual data time found in
seconds since 1970.
KEYWORDS:
START If non-zero, get data from the start time
of the data instance in the SDT buffers
EN If non-zero, get data at the end time
of the data instance in the SDT buffers
ADVANCE If non-zero, advance to the next data point
following the time input
RETREAT If non-zero, retreat (reverse) to the previous
data point before the time input
RETURN VALUE:
Upon success, the above structure is returned, with the valid tag
set to 1. Upon failure, the valid tag will be 0.
REVISION HISTORY:
Created By: Li Tang 9/17/96 University of New Hampshire,
Space Physics Lab
Last modification:
7/15/97 keyword CALIB added L.Tang
domega removed L.Tang
(See idlUtil/fast/get_fa_tsp_eq_sp.pro)
PROCEDURE: get_file_names, fnames
PURPOSE:
Gets an array of filenames within a masterfile within a time range
INPUT:
fnames: named variable in which the output array of filenames is placed.
KEYWORDS:
TIME_RANGE: Two element vector (double or string) specifying the time range.
If time range is not set, then "GET_TIMESPAN" will be called
to get a time range.
MASTERFILE: Name of a masterfile that contains times and associated
filenames. The file should have the format:
yyyy-mm-dd/hh:mm:ss yyyy-mm-dd/hh:mm:ss fullpathfilename
with one line for each file.
(Hint: for CDF files, the masterfile can be created using the
UNIX program 'kpdfile' or the IDL procedure "MAKE_CDF_INDEX".)
ROOT_DIR: Optional root_directory of the masterfile. This will properly
manage operating system dependancies.
NO_DUPLICATES: (N; integer)
when set the first N characters of file names are compared and only
the highest version is returned.
CREATED BY: Davin Larson
VERSION: 1.17 97/02/05 get_file_names.pro
(See idlUtil/windGeneral/misc/get_file_names.pro)
FUNCTION: get_iss(time,START=start,EN=en,ADVANCE=advance,RETREAT=retreat) INPUT: time: real This argument gives a time handle from which to take data from. It may be either a string with the following possible formats: 'MM-DD-YY/HH:MM:SS.MSC' or 'HH:MM:SS' (use reference date) or a number, which will represent seconds since 1970 (must be a double > 94608000.D), or a hours from a reference time, if set. Time will always be returned as a double representing the actual data time found in seconds since 1970. ;KEYWORDS: START: If non-zero, get data from the start time of the data instance in the SDT buffers EN: If non-zero, get data at the end time of the data instance in the SDT buffers ADVANCE: If non-zero, advance to the next data point following the time input RETREAT: If non-zero, retreat (reverse) to the previous data point before the time input VARARR If non-zero, program will not convert to 48 Energy by 32 angle arrays. PURPOSE: To generate fast iesa survey data structures averaged over one spin. ;NOTES: Program calls get_iesa_surv.pro multiple times to generate spin averaged data. Data is averaged starting at the first "spin phase"=0 after "time". Program checks for header changes, returns dat.valid=2 if less than 1 spin averaged. Program only return 48 Energies x 32 Angles, will average if in 96 E or 64 A mode. See get_iesa_surv.pro CREATED BY: J.McFadden LAST MODIFICATION: 96-7-2 J.McFadden
(See idlUtil/fast/get_iss.pro)
FUNCTION: get_orbfile_epoch
PURPOSE: Searches an orbit file for the epoch time of an orbit.
Uses a relatively fast algorithm.
ARGUMENTS: ORBIT The orbit to search for in the orbit file.
KEYWORDS: ORBIT_FILE The orbit file to search in. This defaults to
the definitive orbit file in
fa_almanac_dir()/orbit/. If the requested
orbit is beyond this file, it will try the
predicted file. A -1 will be returned if the
orbit is not found in either file.
CREATED: 1998/01/30 By J. Rauchleiba
(See idlUtil/fast/get_orbfile_epoch.pro)
PROCEDURE: get_pa_spec PURPOSE: Generates pitch angle vs. time spectrogram data structures for tplot INPUT: data_str, a string (either 'eesa_surv','ess', ...) where get_'string' returns a 2D pitch angle data structure KEYWORDS: T1: start time, seconds since 1970 T2: end time, seconds since 1970 ENERGY: fltarr(2) energy range to sum over ERANGE: intarr(2) energy bin range to sum over EBINS: bytarr(dat.nenergy) energy bins to sum over gap_time: time gap big enough to signify a data gap (default 200 sec, 8 sec for FAST) NO_DATA: returns 1 if no_data else returns 0 UNITS: convert to these units if included NAME: New name of the Data Quantity BKG: A 3d data structure containing the background counts. FLOOR: Sets the minimum value of any data point to sqrt(bkg). MISSING: Value for bad data. RETRACE: Set to number of retrace energy steps to be eliminated starting at energy step 0 CALIB: Calib keyword passed on to get_"get_dat"_ts EWEIGHT Weights the energy bin average by bin energy width. SHIFT90 If set true, pitch angle range is -90 to 270 CREATED BY: J.McFadden VERSION: 1 LAST MODIFICATION: 97/07/11 MOD HISTORY: 96/08/14 Added EWEIGHT keyword - mcfadden 97/03/04 T1,T2 keywords added 97/07/11 CALIB keyword added 97/07/23 fixed bug - ind1=fix((max(ind)+min(ind))/2) NOTES: Current version only works for FAST
(See idlUtil/science/get_pa_spec.pro)
PROCEDURE: get_pa_spec_ts PURPOSE: Generates pitch angle vs. time spectrogram data structures for tplot INPUT: get_dat, a string (either 'fa_ees','fa_eeb', ...) where get_'string'_ts returns a 2D or 3D array of data structures KEYWORDS: T1: start time, seconds since 1970 T2: end time, seconds since 1970 ENERGY: fltarr(2) energy range to sum over ERANGE: intarr(2) energy bin range to sum over EBINS: bytarr(dat.nenergy) energy bins to sum over gap_time: time gap big enough to signify a data gap (default 200 sec, 8 sec for FAST) NO_DATA: returns 1 if no_data else returns 0 UNITS: convert to these units if included NAME: New name of the Data Quantity BKG: A 3d data structure containing the background counts. FLOOR: Sets the minimum value of any data point to sqrt(bkg). MISSING: Value for bad data. RETRACE: Set to number of retrace energy steps to be eliminated starting at energy step 0 EWEIGHT Weights the energy bin average by bin energy width. SHIFT90 If set true, pitch angle range is -90 to 270 CALIB: Calib keyword passed on to get_"get_dat"_ts n_get_pts: Number of points in the array of structures formed by get_"get_dat"_ts, default=200. CREATED BY: J.McFadden VERSION: 1 LAST MODIFICATION: 97/05/21 MOD HISTORY: 97/05/15 Variation on get_pa_spec.pro 97/07/23 fixed bug - ind1=fix((max(ind)+min(ind))/2) NOTES: Current version only works for FAST
(See idlUtil/science/get_pa_spec_ts.pro)
PROCEDURE: get_po_orbit
PURPOSE: Gets orbit data for the POLAR spacecraft and loads it
into tplot structures. Does not consider thrusters.
METHOD: 1) Extracts position and veloctity vectors from a POLAR
CDF file. The POLAR "master index file" must
be in place for this step to work.
2) Writes a temporary orbit file to be used as
input to the orbit propagator.
3) Calls the FAST orbit propagator, with the orbit
file as input, to load POLAR orbit data into
tplot structures (or save as a single structure).
NOTE: This procedure needs permission to create files in
the current working directory. The filenames will
begin with "polar_" and should be deleted
automatically.
WARNING: The POLAR spacecraft is equipped with thrusters.
Calculated orbit parameters will be in error if
the thrusters were fired between the initial
reference time used by this procedure and the
end of the requested propagation period.
PARAMETERS:
arg1 If keyword parameter 'time_array' is not set, then this
parameter is the start time of the timespan over which
orbit vectors are to be computed else it is the array
of times for which orbit vectors are to be computed.
arg2 if keyword parameter 'time_array' is not set, then this
parameter is the end time of the timespan over which
orbit vectors are to be computed, else it is not used.
KEYWORDS:
time_array If not set, then interpret the two positional
parameters as the start time and end time of the
timespan over which orbit vectors are to computed.
If set, interpret the first positional parameter
as an array.
ALL If not set, will get the following data:
{x:time, y:orbit, ytitle:'ORBIT'}
{x:time, y:pos, ytitle:'po_pos'}
{x:time, y:alt, ytitle:'ALT'}
{x:time, y:ilat, ytitle:'ILAT'}
{x:time, y:ilng, ytitle:'ILNG'}
{x:time, y:mlt, ytitle:'MLT'}
{x:time, y:vel, ytitle:'po_vel'}
If set, will get the quantities above, and also:
{x:time, y:lat, ytitle:'LAT'}
{x:time, y:lng, ytitle:'LNG'}
{x:time, y:flat, ytitle:'FLAT'}
{x:time, y:flng, ytitle:'FLNG'}
{x:time, y:b, ytitle:'B_model'}
{x:time, y:bfootprint, ytitle:'BFOOT'}
STATUS The long integer return value of the
OrbGetVectors() call in the orbitio library.
There are about a dozen different status codes
indicating the various possible error conditions.
These status codes are shown in the include file
$(workspace)/include/orbitlib.h (ORB_OK, ORB_EOF,
etc). The user should explicitly test that status
equals 0 (ORB_OK = 0 signifies success) before
using the returned data. Other miscellaneous errors
may result in nonzero status also.
NO_STORE If set, inhibits storage of orbit quantities in
tplot structures. This is useful to avoid the
overwriting of previously stored data.
STRUCTURE A named variable into which a structure containing
the requested orbit quantities will be returned.
NOTE: As a side effect of using the FAST orbit
propagator, the position and velocity tags in this
structure will be FA_POS and FA_VEL, not PO_POS
and PO_VEL as they should be.
DELTA_T Spacing in seconds of the computed orbit vectors
(default = 20 sec). This keyword is ignored if
time_array is set.
CREATED: 97-8-20
By J. Rauchleiba
(See idlUtil/fast/get_po_orbit.pro)
NAME: GET_SDT_TIMESPAN
PURPOSE: To return the start and stop times for data currently
stored in SDT.
KEYWORD PARAMETERS: DQD - a string naming a specific quantity for
which the timespan is desired. If not set, then
the first and last times (among any currently
stored quantity) are returned.
OUTPUTS: T1 and T2 : scalar, double precision seconds since 1970,
ready to be passed to GET_FA_FIELDS, GET_EN_SPEC,
whatever.
EXAMPLE: if get_sdt_timespan(t1,t2,dqd='Eesa Burst') then begin
print,'timespan is from ',t1,' to ',t2
endif else begin
print,' could not get timespan...'
endelse
MODIFICATION HISTORY: written 22-Aug_97 by Bill Peria UCB/SSL
(See idlUtil/datetime/get_sdt_timespan.pro)
PROCEDURE: get_symm PURPOSE: Gets symmetry direction of magnetic field INPUT: none KEYWORDS: use_mag: use_q: use_dir: time: stheta: sphi: CREATED BY: Davin Larson LAST MODIFICATION: @(#)get_symm.pro 1.5 95/08/24
(See idlUtil/windGeneral/science/get_symm.pro)
PROCEDURE: get_timespan PURPOSE: To get timespan from tplot_com or by using timespan, if tplot time range not set. INPUT: t, actually returned to you KEYWORDS: none SEE ALSO: "timespan" CREATED BY: Davin Larson LAST MODIFICATION: @(#)get_timespan.pro 1.7 96/08/21
(See idlUtil/windGeneral/tplot/get_timespan.pro)
FUNCTION: get_tms_ang INPUT: NONE PURPOSE: Select teams survey or himass angle bins. KEYWORDS: None CALLING SEQUENCE: bins = fast_tms_ang() CREATED BY: Li Tang 11/5/96 Univ. of New Hampshire Space Physics Lab tang@teams.sr.unh.edu
(See idlUtil/fast/get_tms_ang.pro)
PROCEDURE: get_tms_hm_spec PURPOSE: Generates energy-time spectrogram data structures for tplot INPUT: data_str, a string (either 'th_3d','ess', ...) where get_'string' returns a 2D(if input is 3D) or 1D(input is 2D) mass data structure KEYWORDS: STIME: '1996-10-09/12:23:34' time to start TSPAN: seconds time span ENERGY: fltarr(2) energy range to sum over ERANGE: intarr(2) energy bin range to sum over EBINS: bytarr(dat.nenergy) energy bins to sum over ANGLE: fltarr(2),fltarr(4) angle range to sum over ARANGE: intarr(2) bin range to sum over BINS: bytarr(dat.nbins) bins to sum over gap_time: time gap big enough to signIFy a data gap (default 200 sec, 9 sec for FAST) NO_DATA: returns 1 IF no_data ELSE returns 0 UNITS: convert to these units IF included NAME: New name of the Data Quantity BKG: A 3d data structure containing the background counts. FLOOR: Sets the minimum value of any data point to sqrt(bkg). MISSING: Value for bad data. CREATED BY: Li Tang Univ. of New Hampshire Space Physics Lab tang@teams.sr.unh.edu VERSION: 3.0 LAST MODIFICATION: 96-10-17 MOD HISTORY: 96-8-20 Added ASUM and ESUM keywords - LT 96-9-27 removed asum, esum, aweight, eweight, and etc LT 96-11-4 Able to deal with 2D data type LT 97-3-21 Change pitch angle calculation. LT 97-3-30 changed the aweight for 2D structure LT NOTES: Current version only works for FAST
(See idlUtil/fast/get_tms_hm_spec.pro)
PROCEDURE: gopen, filename PURPOSE: Prepare to put out a GIF file. INPUT: optional; if: string : string used as filename, '.gif' extension is added automatically integer X: filename set to 'plotX.gif'. value of x is incremented by 1. none: filename set to 'plot.gif' KEYWORDS: See print_options for info. COPY: pass COPY keyword to set_plot INTERP: pass INTERP keyword to set_plot (default is to have interp on) SEE ALSO: "gclose", "print_options", "gopen_com" CREATED BY: Davin Larson (as popen.pro) SWIPED BY: Bill Peria
(See idlUtil/tplot/gopen.pro)
COMMON BLOCK: gopen_com PURPOSE: Common block for print routines SEE ALSO: "gopen","gclose", "print_options" CREATED BY: Davin Larson STOLEN BY: Bill Peria
(See idlUtil/tplot/gopen_com.pro)
PROCEDURE: gts.pro (Generic Trending System)
PURPOSE: Extracts DQIs from SDT SMBs.
Saves variables to a file.
Called by gts_batch.pro from sdt_batch, from gts.ksh.
ARGUMENTS: None
ENV. VARS: output_datafile File in which to save the data.
DQIlist List of SDT Data Quantity Instances
BY: J. Rauchleiba 1998/8/20
(See idlUtil/fast/gts.pro)
gts_batch.pro Used by GTS (Generic Trending System) Called by sdt_batch Calls IDL procedure gts.pro, which gets all input from env vars. By J.Rauchleiba 1998/8/18
(See idlUtil/fast/gts_batch.pro)
PROCEDURE: gts_concatenate.pro
PURPOSE: Restores IDL "save" files containing FAST trending data
and concatenates the contents.
ARGUMENTS: (None)
KEYWORDS: DATA_DIRECTORY The directory containing the save
files.
QUANTITIES String array of variable names
contained in the save files.
PREFIX Initial string in filenames. (default=`*')
YEAR_RE Regular expression for year field
in filename.
DOY1_RE RE for start DOY in file name.
DOY2_RE RE for ending DOY in filename.
BY: J.Rauchleiba 1998/8/21
(See idlUtil/fast/gts_concatenate.pro)
PROCEDURE:
HEAD.PRO
DESCRIPTION:
Procedure to print out the head (first few elements) of an array.
USAGE:
HEAD, input_array, [NUMBER=number-of-initial-elements]
ARGUMENTS:
input_array The array to print.
KEYWORDS:
NUMBER The number if array elements to print.
REVISION HISTORY:
@(#)head.pro 1.1 06/04/95
Originally written by Terry Slocum, University of
California at Berkeley, Space Sciences Lab. Sep. '91
(See idlUtil/arrayUtil/head.pro)
FUNCTION: heatflux PURPOSE: Calulates heatlux from a 3dimensional data structure such as those generated by get_el,get_pl,etc. e.g. "get_el" INPUT: dat: A 3d data structure. KEYWORDS: esteprange: the energy step range to use, default is full range CREATED BY: Davin Larson LAST MODIFICATION: @(#)heatflux.pro 1.5 95/10/06
(See idlUtil/windGeneral/science/heatflux.pro)
PROCEDURE: helpfast
PURPOSE: Calls netscape and brings up our on_line help. One of the pages
accessed by this on_line help provides documentation on all of
our procedures and is updated daily. The other is a
list of Data Quantity Descriptor (DQD) strings
recognized by SDT, for use in the SDT/IDL
interface. At the present time, HELPFAST works
only on the UCB FAST machines. From all other sites,
access the help pages directly at:
http://sprg.ssl.berkeley.edu/~peria/fastidl.html
The links to view the source code will not work when
the pages are accessed in this way, unfortunately.
INPUT: none
KEYWORDS:
MOSAIC: if set uses mosaic instead of netscape
CREATED BY: Jasper Halekas (Wind)
STOLEN BY: Bill Peria (FAST)
FILE: helpfast.pro
VERSION: 1.0
LAST MODIFICATION: 96/10/18
(See idlUtil/fast/helpfast.pro)
NAME: HIST
PURPOSE: To actually produce a histogram plot. This is a radical
departure from the IDL HISTOGRAM function, which is for
something else, as far as anyone can tell. The default
binsize is set such that the middle two quartiles of the
data land in five bins.
CALLING SEQUENCE: hist, my_data
INPUTS: MY_DATA - an array of numerical values. Can be multi-D, but
can't be complex.
KEYWORD PARAMETERS: Everything you can pass to IDL's HISTOGRAM
function can be passed to HIST. Also, any
keyword accepted by the PLOT procedure will be
passed thru as well. In addition to that, HIST
has these keywords:
XBINS - a named variable in which the centers of
the histogram bins can be returned to
the caller.
HIST - a named variable in which the histogram
itself can be returned.
SIGMA - Error bar for the bins...sqrt(hist)
NO_PLOT - if set, the histogram is not
plotted. By default, a plot is made.
NO_ERROR - if set, prevents error bars from
being drawn on the plot.
SIDE EFFECTS: The amount of redundant coding when looking at
histograms is drastically reduced.
EXAMPLE: To see how SOME_DATA are distributed, using a text-only
terminal at 300 Baud, do this:
hist, some_data, /no_plot, xbins = bins, hist = hist
for i=0,n_elements(bins)-1 do print,bins[i],hist[i]
MODIFICATION HISTORY: written about 10 years late, by Bill Peria.
(See idlUtil/misc/hist.pro)
NAME: HIST_NORM
PURPOSE: To compute and plot a normalized histogram. By default, a
plot with error bars is made.
INPUTS: DATA - the stuff you want to histogram
KEYWORD PARAMETERS: HIST_NORM takes all the keywords of IDL
HISTOGRAM. Keywords accepted by PLOT, such as
titles and the like, may also be
passed. HIST_NORM also has these keywords:
CONDITION - A byte array, of the same size as DATA, which is
either 1 (true) or 0 (false). The histogram of
those elements of DATA where CONDITION is 1 is
divided by the histogram of all elements of
DATA, to form a normalized histogram. CONDITION
must be defined, otherwise calling HIST_NORM
makes no sense.
COMPLEMENT - if set, causes the histogram where CONDITION is
true to be normalized by the histogtram where
CONDITION is false.
XBINS - named variable in which the bin centers can be
returned.
NO_PLOT - if set, inhibits display of the normalized
histogram
NPOINTS - The minimum number of points per bin for which the
normalized histogram is considered computed. The
default is 0.
SHOW_NUMBERS - if set, causes the number of points per bin
to be displayed on the histogram plot.
NO_ERROR - if set, inhibits the display of error bars.
SIGMA - a named variable in which the bin standard
deviations can be returned.
EXAMPLE: hist_norm, density, condition = (wavepower gt .001), $
title='Density dependence of wave power'
This will show the likelihood of wave power greater than .001, as
a function of density.
MODIFICATION HISTORY: Written in early 1999, by Bill Peria
(See idlUtil/misc/hist_norm.pro)
NAME: INREAL
PURPOSE: To obtain a floating point number from the keyboard.
CALLING SEQUENCE: x = inreal(prompt,default)
INPUTS: PROMPT - a string that tells the user what to type. You must
provide this string, sorry, there's no default.
OPTIONAL INPUTS: DEFAULT - a value to be used if the user just hits
return in response to PROMPT. The default for
DEFAULT is zero.
OUTPUTS: X - if the user manages to type something that can be
parsed as a real number, then that number gets returned in
X.
EXAMPLE: gain = inreal('What is the gain?',1.0)
MODIFICATION HISTORY: Written before the dawn of time by Bill Peria,
documented 14-May-1997.
(See idlUtil/misc/inreal.pro)
FUNCTION: interp(y,x,u)
PURPOSE:
Linearly Interpolates vectors with an irregular grid.
INTERP is functionally the same as INTERPOL, however it is typically
much faster for most applications.
USAGE:
result = interp(y,x,u)
INPUTS:
Y: The input vector can be any type except string.
X: The absicissae values for Y. This vector must have same # of
elements as Y. The values MUST be monotonically ascending
or descending.
U: The absicissae values for the result. The result will have
the same number of elements as U. U does not need to be
monotonic.
CREATED BY: Davin Larson 4-30-96
FILE: interp.pro
VERSION: 1.8
LAST MODIFICATION: 96/12/02
(See idlUtil/windGeneral/misc/interp.pro)
NAME: INT_UP_TO
PURPOSE: Computes the succesive definite integrals of an array
CALLING SEQUENCE: int = int_up_to(time,data)
INPUTS: TIME - the independent variable
DATA - dependent variable
KEYWORDS: ADAMS - if set, uses the somewhat more accurate
Adams-Bashforth two-step method.
/time
OUTPUTS: INT = | data*d(time)
/time(0)
RESTRICTIONS: You must make sure about things like sufficient
resolution, etc., because no error estimate or sorting
or anything of the kind is done, and the area under
the curve between adjacent points is approximated by a
trapezoid.
MODIFICATION HISTORY: written long, long ago by Bill Peria. Finally
documented 16-March-1997.
(See idlUtil/misc/int_up_to.pro)
FUNCTION:
ISIN.PRO
DESCRIPTION:
Function to return an array of values in array "a" that are inclusive
of array "b". We assume that array's "a" and "b" are of the same type.
If no matchs are found, -1 is returned
USAGE:
result = ISIN (a, b)
ARGUMENTS:
a First array to search
b Second array to search
REVISION HISTORY:
@(#)isin.pro 1.1 06/04/95
Originally written by Jonathan M Loran, University of
California at Berkeley, Space Sciences Lab. Oct. '91
(See idlUtil/arrayUtil/isin.pro)
PROCEDURE: is_leap_year
PURPOSE: determine if a given year (or array of years) is leap
INPUTS:
year:
year is an int or long or an array of ints or longs
OUTPUTS:
return value is a byte (or byte array of same size as year if year is array)
value is 1 for each year that is a leap year
CREATED BY: Vince Saba, 9/96
VERSION: @(#)is_leap_year.pro 1.1 10/02/96
(See idlUtil/datetime/is_leap_year.pro)
NAME: iton
PURPOSE:
Convert an index or array of indicies to data names.
This exits because it is not always reasonable to make
a program tell the difference between a data array
and an index array, and because not all programs
accept indicies as inputs instead of data names.
CALLING SEQUENCE: names=iton(ind)
INPUTS: ind: an index or array of indicies
OPTIONAL INPUTS: none
KEYWORD PARAMETERS: none
OUTPUTS: a data name or array of data names
OPTIONAL OUTPUTS: none
COMMON BLOCKS: tplot_com
SIDE EFFECTS: none
EXAMPLE: for i=6,13 do store_data,iton(6),/delete
LAST MODIFICATION: @(#)iton.pro 1.3 96/12/02
CREATED BY: Frank Marcoline
(See idlUtil/windGeneral/misc/iton.pro)
FUNCTION: je_2d(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), 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 field aligned energy flux, JEz, ergs/cm^2-sec NOTES: Function normally called by "get_2dt.pro" to generate time series data for "tplot.pro". CREATED BY: J.McFadden LAST MODIFICATION: 96-4-22 J.McFadden
(See idlUtil/science/je_2d.pro)
FUNCTION: je_2d_b(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), 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 field aligned energy flux, JEz, ergs/cm^2-sec, assumes a narrow (< 5 deg) field aligned beam NOTES: Similar to je_2d.pro, treats the anodes within 5 deg of the magnetic field differently. Function normally called by "get_2dt.pro" to generate time series data for "tplot.pro". CREATED BY: J.McFadden 97-5-14 Created from je_2d.pro Treats narrow beams correctly, no do loops LAST MODIFICATION: 97-5-14 J.McFadden
(See idlUtil/science/je_2d_b.pro)
FUNCTION: je_2d_fs(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_ies, 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 field aligned energy flux, JEz, ergs/cm^2-sec, assumes a narrow (< 5 deg) field aligned beam NOTES: Same as je_2d_b.pro, accept separates 64 angle fast survey data for FAST to do a more accurated calculation. Function normally called by "get_2dt.pro" to generate time series data for "tplot.pro". Note that the EBINS, ARANGE, and BINS keywords below may not work properly since their meaning changes with 32 or 64 angle bins. CREATED BY: J.McFadden 97-8-13 Treats FAST fast survey narrow beams correctly, calls je_2d_b.pro LAST MODIFICATION: 97-8-13 J.McFadden
(See idlUtil/science/je_2d_fs.pro)
FUNCTION: je_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 energy flux, [Je_x,Je_y,Je_z], ergs/(cm^2-s) NOTES: Function normally called by "get_3dt" or "get_2dt" to generate time series data for "tplot.pro". CREATED BY: J.McFadden 97-12-4 LAST MODIFICATION: 97-12-4 J.McFadden
(See idlUtil/windGeneral/science/je_3d.pro)
FUNCTION: j_2d(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), 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 field aligned flux, Jz, #/cm^2-sec NOTES: Function normally called by "get_2dt.pro" to generate time series data for "tplot.pro". CREATED BY: J.McFadden LAST MODIFICATION: 96-4-22 J.McFadden
(See idlUtil/science/j_2d.pro)
FUNCTION: j_2d_b(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), 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 field aligned flux, Jz, #/cm^2-sec, assumes a narrow (< 5 deg) field aligned beam NOTES: Similar to j_2d.pro, treats the anodes within 5 deg of the magnetic field differently. Function normally called by "get_2dt.pro" to generate time series data for "tplot.pro". CREATED BY: J.McFadden 97-5-14 Created from j_2d.pro Treats narrow beams correctly, no do loops LAST MODIFICATION: 97-5-14 J.McFadden
(See idlUtil/science/j_2d_b.pro)
FUNCTION: j_2d_fs(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_ies, 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 field aligned flux, Jz, #/cm^2-sec, assumes a narrow (< 5 deg) field aligned beam. NOTES: Same as j_2d_b.pro, accept separates 64 angle fast survey data for FAST to do a more accurated calculation. Function normally called by "get_2dt.pro" to generate time series data for "tplot.pro". Note that the EBINS, ARANGE, and BINS keywords below may not work properly since their meaning changes with 32 or 64 angle bins. CREATED BY: J.McFadden 97-8-2 Treats FAST fast survey narrow beams correctly, calls j_2d_b.pro LAST MODIFICATION: 97-8-2 J.McFadden
(See idlUtil/science/j_2d_fs.pro)
FUNCTION: j_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 flux, [Jx,Jy,Jz], 1/(cm^2-s) NOTES: Function normally called by "get_3dt" or "get_2dt" to generate time series data for "tplot.pro". CREATED BY: J.McFadden 95-7-27 LAST MODIFICATION: 96-7-6 J.McFadden
(See idlUtil/windGeneral/science/j_3d.pro)
returns the Legendre polynomials in SVDFIT ready form.
(See idlUtil/misc/legendre.pro)
PROCEDURE: loadallcdf
PURPOSE:
Loads selected CDF file variables into tplot variables.
KEYWORDS: (all keywords are optional)
FILENAMES: string (array); full pathname of file(s) to be loaded.
(INDEXFILE, ENVIRONVAR, MASTERFILE and TIME_RANGE are ignored
if this is set.)
MASTERFILE: Full Pathname of indexfile. (INDEXFILE and ENVIRONVAR are
ignored if this is set)
INDEXFILE: File name (without path) of indexfile. This file should be
located in the directory given by ENVIRONVAR. If not given then
"PICKFILE" is used to select an index file. see "make_cdf_index" for
information on producing this file.
ENVIRONVAR: Name of environment variable containing directory of indexfiles
(default is 'CDF_INDEX_DIR')
TIME_RANGE: Two element vector specifying time range (default is to use
trange_full; see "TIMESPAN" or "GET_TIMESPAN" for more info)
CDFNAMES Names of CDF variables to be loaded. (string array)
DATA: Named variable that data is returned in.
NOVARNAMES: Names of 'novary' variables to be loaded
NOVARDATA: Named variable that 'novary' data is returned in.
TPLOT: If set then data is also put in "TPLOT" format.
SEE ALSO:
"loadcdf","loadcdfstr","makecdf","make_cdf_index","get_file_names"
VERSION: 97/02/05 loadallcdf.pro 1.12
Created by Davin Larson, August 1996
Documentation still incomplete.
(See idlUtil/windGeneral/key_param/loadallcdf.pro)
PROCEDURE: loadcdf
PURPOSE:
Loads one type of data from specified cdf file.
INPUT:
CDF_file: the file to load data from (or the id of an open file)
CDF_var: the variable to load
x: the variable to load data into
KEYWORDS:
zvar: must be set if variable to be loaded is a zvariable
append: appends data to the end of x instead of overwriting it.
nrecs: number of records to be read.
CREATED BY: Jim Byrnes, heavily modified by Davin Larson
MODIFICATIONS:
96-6-26 added APPEND keyword
LAST MODIFICATION: @(#)loadcdf.pro 1.10 96/12/02
(See idlUtil/windGeneral/key_param/loadcdf.pro)
PROCEDURE: loadcdfstr
PURPOSE:
loads data from specified cdf file into a structure.
INPUT:
x: A named variable to return the structure in
KEYWORDS:
FILENAMES: [array of] CDF filename[s]. (or file id's)
VARNAMES: [array of] CDF variable name[s] to be loaded.
TAGNAMES: optional array of structure tag names.
TIME: If set, will create tag TIME using the Epoch variable.
SEE ALSO:
"loadcdf", "loadallcdf", "print_cdf_info","make_cdf_index"
CREATED BY: Davin Larson
MODIFICATIONS:
LAST MODIFICATION: @(#)loadcdfstr.pro 1.8 97/02/05
(See idlUtil/windGeneral/key_param/loadcdfstr.pro)
PROCEDURE loadct2, colortable
KEYWORDS:
FILE: Color table file
Uses the environment variable IDL_CT_FILE to determine
the color table file if FILE is not set.
common blocks:
colors_com
See also:
"get_colors","colors_com","bytescale"
Created by Davin Larson; August 1996
Version: 1.2
File: 96/08/30
Last Modification: loadct2.pro
(See idlUtil/windGeneral/misc/loadct2.pro)
PROCEDURE: load_fa_k0_acf
PURPOSE:
Load summary data from the FAST AC fields instrument into TPLOT
structures. Up to eight TPLOT quantities are stored, namely VLF
E, VLF E POWER, VLF B POWER, VLF B, HF E, HF B, HF E POWER, HF
B POWER.
INPUT:
none
KEYWORDS:
filenames strarr(m), string array of filenames of cdf files to be entered
Files are obtained from "dir" if dir is set,
otherwise files obtained from local dir.
If filenames not set, then orbit or trange keyword must
be set.
dir string, directory where filenames can be found
If dir not set, default is "environvar" or local directory
environvar string, name of environment variable to set "dir"
Used if filenames not set
Default environvar = '$FAST_CDF_HOME'
trange trange[2], time range used to get files from index list
indexfile string, complete path name for indexfile of times and filenames
Used if trange is set.
Default = indexfiledir+'/fa_k0_acf_file'
indexfiledir = '$FAST_CDF_MAST_DIR'
orbit int, orbit for file load
var strarr(n) of cdf variable names
default=['VLF_E_SPEC','VLF_PWR','VLF_B_SPEC','HF_E_SPEC','HF_PWR', $
'HF_B_SPEC','ELF_E_SPEC','ELF_B_SPEC','ELF_PWR','MODEBAR']
dvar strarr(n) of cdf dependent variable names
set dvar(n)='' if no dependent variable for variable
dvar must be same dimension as var
default = ['VLF_E_FREQ','','VLF_B_FREQ','HF_E_FREQ','','HF_B_FREQ',
'ELF_E_FREQ','ELF_B_FREQ','','VMBAR']
CREATED BY: J. McFadden 96-9-8
modified for fields B. Peria 96-10-7
(See idlUtil/fast/load_fa_k0_acf.pro)
PROCEDURE: load_fa_k0_dcf
PURPOSE:
Load summary data from the FAST DC fields instrument into TPLOT
structures. Up to eight TPLOT quantities are stored, namely
EX, EZ, DENSITY, BX, BY, BZ, S/C POTENTIAL, SPIN ANGLE, and MODEBAR.
INPUT:
none
KEYWORDS:
filenames strarr(m), string array of filenames of cdf files to be entered
Files are obtained from "dir" if dir is set,
otherwise files obtained from local dir.
If filenames not set, then orbit or trange keyword must
be set.
dir string, directory where filenames can be found
If dir not set, default is "environvar" or local directory
environvar string, name of environment variable to set "dir"
Used if filenames not set
Default environvar = '$FAST_CDF_HOME'
trange trange[2], time range used to get files from index list
indexfile string, complete path name for indexfile of times and filenames
Used if trange is set.
Default = indexfiledir+'/fa_k0_dcf_file'
indexfiledir = '$FAST_CDF_MAST_DIR'
orbit int, orbit for file load
var strarr(n) of cdf variable names
default is ['EX','EZ','DENSITY','BX','BY','BZ','S/C POTENTIAL','SPIN ANGLE']
dvar strarr(n) of cdf dependent variable names
set dvar(n)='' if no dependent variable for variable
dvar must be same dimension as var
default=['','','','','','']
CREATED BY: J. McFadden 96-9-8
modified for fields B. Peria 96-10-7
(See idlUtil/fast/load_fa_k0_dcf.pro)
PROCEDURE: load_fa_k0_ees PURPOSE: Load summary data from the FAST electron experiment into tplot structure. Loads el_0 electon energy spectrogram, 0-30 pitch angle Loads el_90 electon energy spectrogram, 60-120 pitch angle Loads el_180 electon energy spectrogram, 150-180 pitch angle Loads el_low electon pitch angle spectrogram, .1-1 keV energy Loads el_high electon pitch angle spectrogram, > 1 keV energy Loads JEe electon energy flux - mapped to 100 km, positive earthward Loads Je electon particle flux - mapped to 100 km, positive earthward INPUT: none KEYWORDS: filenames strarr(m), string array of filenames of cdf files to be entered Files are obtained from "dir" if dir is set, otherwise files obtained from local dir. If filenames not set, then orbit or trange keyword must be set. dir string, directory where filenames can be found If dir not set, default is "environvar" or local directory environvar string, name of environment variable to set "dir" Used if filenames not set Default environvar = '$FAST_CDF_HOME' trange trange[2], time range used to get files from index list indexfile string, complete path name for indexfile of times and filenames Used if trange is set. Default = indexfiledir+'/fa_k0_ees_files' indexfiledir = '$CDF_INDEX_DIR' orbit int, intarr, orbit(s) for file load var strarr(n) of cdf variable names default=['el_0','el_90','el_180','el_low','el_high','JEe','Je'] dvar strarr(n) of cdf dependent variable names set dvar(n)='' if no dependent variable for variable dvar must be same dimension as var default=['el_en','el_en','el_en','el_low_pa','el_high_pa','',''] nodata returns 1 if no data is found CREATED BY: J. McFadden 96-9-8 LAST MODIFICATION: 97-04-03 MOD HISTORY: 96-09-24 corrections 97-03-04 get_fa_orbit call changed 97-03-13 orbit keyword can be an array, version number check 97-03-25 added label to Je,JEe 97-04-03 can load daily cdf files with "unix_time" rather than "TIME" 97-04-15 added no_orbit, nodata keywords; loads "MODEBAR"
(See idlUtil/fast/load_fa_k0_ees.pro)
PROCEDURE: load_fa_k0_ees_day PURPOSE: Load daily summary data from the FAST electron experiment into tplot structure. Loads el_0 electon energy spectrogram, 0-30 pitch angle Loads el_90 electon energy spectrogram, 60-120 pitch angle Loads el_180 electon energy spectrogram, 150-180 pitch angle Loads el_low electon pitch angle spectrogram, .1-1 keV energy Loads el_high electon pitch angle spectrogram, > 1 keV energy Loads JEe electon energy flux - mapped to 100 km, positive earthward Loads Je electon particle flux - mapped to 100 km, positive earthward Loads Attitude and Orbit data from the cdf file INPUT: filename string, filename of daily cdf file to be loaded File is obtained from "dir" if dir is set, otherwise file obtained from local dir. KEYWORDS: dir string, directory where filename can be found var strarr(n) of cdf variable names default=['el_0','el_90','el_180','el_low','el_high','JEe','Je'] dvar strarr(n) of cdf dependent variable names set dvar(n)='' if no dependent variable for variable dvar must be same dimension as var default=['el_en','el_en','el_en','el_low_pa','el_high_pa','',''] CREATED BY: J. McFadden 97-04-18 LAST MODIFICATION: 97-04-18 MOD HISTORY:
(See idlUtil/fast/load_fa_k0_ees_day.pro)
PROCEDURE: load_fa_k0_ies PURPOSE: Load summary data from the FAST ion experiment into tplot structure. Loads ion_0 ion energy spectrogram, 0-30 pitch angle Loads ion_90 ion energy spectrogram, 40-140 pitch angle Loads ion_180 ion energy spectrogram, 150-180 pitch angle Loads ion_low ion pitch angle spectrogram, .05-1 keV energy Loads ion_high ion pitch angle spectrogram, > 1 keV energy Loads JEi ion energy flux - mapped to 100 km, positive earthward Loads Ji ion particle flux - mapped to 100 km, positive earthward INPUT: none KEYWORDS: filenames strarr(m), string array of filenames of cdf files to be entered Files are obtained from "dir" if dir is set, otherwise files obtained from local dir. If filenames not set, then orbit or trange keyword must be set. dir string, directory where filenames can be found If dir not set, default is "environvar" or local directory environvar string, name of environment variable to set "dir" Used if filenames not set Default environvar = '$FAST_CDF_HOME' trange trange[2], time range used to get files from index list indexfile string, complete path name for indexfile of times and filenames Used if trange is set. Default = indexfiledir+'/fa_k0_ies_files' indexfiledir = '$CDF_INDEX_DIR' orbit int, intarr, orbit(s) for file load var strarr(n) of cdf variable names default=['ion_0','ion_90','ion_180','ion_low','ion_high','JEi','Ji'] dvar strarr(n) of cdf dependent variable names set dvar(n)='' if no dependent variable for variable dvar must be same dimension as var default=['ion_en','ion_en','ion_en','ion_low_pa','ion_high_pa','',''] CREATED BY: J. McFadden 96-9-8 LAST MODIFICATION: 97-04-03 MOD HISTORY: 96-09-24 corrections 97-03-04 get_fa_orbit call changed 97-03-13 orbit keyword can be an array, version number check 97-03-25 added label to Ji,JEi 97-04-03 can load daily cdf files with "unix_time" rather than "TIME"
(See idlUtil/fast/load_fa_k0_ies.pro)
PROCEDURE: load_fa_k0_ies_day PURPOSE: Load daily summary data from the FAST ion experiment into tplot structure. Loads ion_0 ion energy spectrogram, 0-30 pitch angle Loads ion_90 ion energy spectrogram, 40-140 pitch angle Loads ion_180 ion energy spectrogram, 150-180 pitch angle Loads ion_low ion pitch angle spectrogram, .05-1 keV energy Loads ion_high ion pitch angle spectrogram, > 1 keV energy Loads JEi ion energy flux - mapped to 100 km, positive earthward Loads Ji ion particle flux - mapped to 100 km, positive earthward Loads Attitude and Orbit data from the cdf file INPUT: none KEYWORDS: filenames strarr(m), string array of filenames of cdf files to be entered Files are obtained from "dir" if dir is set, otherwise files obtained from local dir. If filenames not set, then orbit or trange keyword must be set. dir string, directory where filenames can be found If dir not set, default is "environvar" or local directory environvar string, name of environment variable to set "dir" Used if filenames not set Default environvar = '$FAST_CDF_HOME' CREATED BY: J. McFadden 97-04-03 LAST MODIFICATION: 97-04-03 MOD HISTORY:
(See idlUtil/fast/load_fa_k0_ies_day.pro)
PROCEDURE: load_fa_k0_tms PURPOSE: Load summary data from the FAST TEAMS experiment into tplot structure. Loads H+ Hydrogen Differential Energy Flux vs Energy, 0-360 deg pitch angle Loads He+ Helium Differential Energy Flux vs Energy, 0-360 deg pitch angle Loads O+ Oxygen Differential Energy Flux vs Energy, 0-360 deg pitch angle Loads H+_low Hydrogen Differential Energy Flux vs Pitch Angle, .01-1 keV Loads H+_high Hydrogen Differential Energy Flux vs Pitch Angle, > 1 keV Loads He+_low Helium Differential Energy Flux vs Pitch Angle, .01-1 keV Loads He+_high Helium Differential Energy Flux vs Pitch Angle, > 1 keV Loads O+_low Oxygen Differential Energy Flux vs Pitch Angle, .01-1 keV Loads O+_high Oxygen Differential Energy Flux vs Pitch Angle, > 1 keV Loads hm MassSpectrum Counts Rate vs Mass, 1eV - 12keV, 4*Pi angles INPUT: none KEYWORDS: filenames strarr(m), string array of filenames of cdf files to be entered Files are obtained from "dir" if dir is set, otherwise files obtained from local dir. If filenames not set, then orbit or trange keyword must be set. dir string, directory where filenames can be found If dir not set, default is "environvar" or local directory environvar string, name of environment variable to set "dir" Used if filenames not set Default environvar = '$FAST_CDF_HOME' trange trange[2], time range used to get files from index list indexfile string, complete path name for indexfile of times and filenames Used if trange is set. Default = indexfiledir+'/fa_k0_tms_files' indexfiledir = '$CDF_INDEX_DIR' orbit int, orbit for file load var strarr(n) of cdf variable names default=['H+','He+','O+','H+_low','H+_high','He+_low',$ 'He+_high','O+_low','O+_high'] dvar strarr(n) of cdf dependent variable names set dvar(n)='' if no dependent variable for variable dvar must be same dimension as var default=['H+_en','He+_en','O+_en','H+_low_pa',$ 'H+_high_pa','He+_low_pa','He+_high_pa',$ 'O+_low_pa','O+_high_pa'] tplot if set, loads hm data from "filenames".tplot *.tplot files are assumed to be in the cdf dir CREATED BY: J. McFadden 96-10-6 VERSION: 1.03 LAST MODIFICATION: 97-06-04 MODIFICATION HISTORY: 97-06-04 added He+ to cdf's 97-03-25 get_fa_orbit call changed 97-03-25 orbit keyword can be an array, version number check
(See idlUtil/fast/load_fa_k0_tms.pro)
PROCEDURE: load_ge_mgf PURPOSE: loads GEOTAIL MAGNETOMETER Experiment key parameter data for "tplot". INPUTS: none, but will call "timespan" if time range is not already set. KEYWORDS: POLAR: Also computes the B field in polar coordinates. TIME_RANGE: 2 element vector specifying the time range DATA: Data returned in this named variable RESTRICTIONS: This routine expects to find the master file: 'ge_k0_mgf_files' in the directory specified by the environment variable: 'CDF_DATA_DIR' See "make_cdf_index" for more info. SEE ALSO: "make_cdf_index","loadcdf","loadcdfstr","loadallcdf" CREATED BY: Davin Larson FILE: load_ge_mgf.pro LAST MODIFICATION: 96/08/23
(See idlUtil/windGeneral/key_param/load_ge_mgf.pro)
PROCEDURE: load_i8_mag PURPOSE: loads IMP-8 magnetometer key parameter data for "tplot". INPUTS: none, but will call "timespan" if time range is not already set. KEYWORDS: TIME_RANGE: 2 element vector specifying the time range RESTRICTIONS: This routine expects to find the master file: 'i8_k0_mag_files' In the directory specified by the environment variable: 'CDF_DATA_DIR' See "make_cdf_index" for more info. SEE ALSO: "make_cdf_index","loadcdf","loadcdfstr","loadallcdf" CREATED BY: Davin Larson FILE: load_i8_mag.pro LAST MODIFICATION: 96/08/23
(See idlUtil/windGeneral/key_param/load_i8_mag.pro)
PROCEDURE: load_i8_pla PURPOSE: loads IMP-8 Plasma Experiment key parameter data for "tplot". INPUTS: none, but will call "timespan" if time range is not already set. KEYWORDS: TIME_RANGE: 2 element vector specifying the time range RESTRICTIONS: This routine expects to find the master file: 'i8_k0_pla_files' In the directory specified by the environment variable: 'CDF_DATA_DIR' See "make_cdf_index" for more info. SEE ALSO: "make_cdf_index","loadcdf","loadcdfstr","loadallcdf" CREATED BY: Davin Larson FILE: load_i8_pla.pro LAST MODIFICATION: 96/08/23
(See idlUtil/windGeneral/key_param/load_i8_pla.pro)
PROCEDURE: load_po_pwi PURPOSE: Loads Polar Plasma Wave Instrument key parameter data into "tplot" variables. INPUTS: none, but will call "timespan" if time range is not already set. KEYWORDS: DATA: Raw data can be returned through this named variable. TIME_RANGE: 2 element vector specifying the time range RESTRICTIONS: This routine expects to find the master file: 'po_k0_pwi_files' In the directory specified by the environment variable: 'CDF_DATA_DIR' See "make_cdf_index" for more info. SEE ALSO: "make_cdf_index","loadcdf","loadcdfstr","loadallcdf" CREATED BY: Davin Larson FILE: load_po_pwi.pro LAST MODIFICATION: 96/08/30
(See idlUtil/windGeneral/key_param/load_po_pwi.pro)
PROCEDURE: load_so_cel PURPOSE: loads SOHO CEL key parameter data for "tplot". INPUTS: none, but will call "timespan" if time range is not already set. KEYWORDS: TIME_RANGE: 2 element vector specifying the time range CREATED BY: Davin Larson FILE: load_so_cel.pro LAST MODIFICATION: 96/09/27
(See idlUtil/windGeneral/key_param/load_so_cel.pro)
PROCEDURE: load_so_cst PURPOSE: loads SOHO CST key parameter data for "tplot". INPUTS: none, but will call "timespan" if time range is not already set. KEYWORDS: TIME_RANGE: 2 element vector specifying the time range CREATED BY: Davin Larson FILE: load_so_cst.pro LAST MODIFICATION: 96/10/15
(See idlUtil/windGeneral/key_param/load_so_cst.pro)
PROCEDURE: load_so_ern PURPOSE: loads SOHO ERN key parameter data for "tplot". INPUTS: none, but will call "timespan" if time_range is not already set. KEYWORDS: TIME_RANGE: 2 element vector specifying the time range SEE ALSO: "make_cdf_index","loadcdf","loadcdfstr","loadallcdf" CREATED BY: Davin Larson FILE: load_so_ern.pro LAST MODIFICATION: 96/09/27
(See idlUtil/windGeneral/key_param/load_so_ern.pro)
PROCEDURE: load_wi_3dp PURPOSE: loads WIND 3D Plasma Experiment key parameter data for "tplot". INPUTS: none, but will call "timespan" if time_range is not already set. KEYWORDS: DATA: Raw data can be returned through this named variable. POLAR: Computes polar coordinates if set. TIME_RANGE: 2 element vector specifying the time range RESTRICTIONS: This routine expects to find the master file: 'wi_k0_3dp_files' In the directory specified by the environment variable: 'CDF_DATA_DIR' See "make_cdf_index" for more info. SEE ALSO: "make_cdf_index","loadcdf","loadcdfstr","loadallcdf" CREATED BY: Davin Larson FILE: load_wi_3dp.pro LAST MODIFICATION: 96/10/20
(See idlUtil/windGeneral/key_param/load_wi_3dp.pro)
PROCEDURE: load_wi_ehsp_3dp PURPOSE: loads WIND 3D Plasma Experiment key parameter data for "tplot". INPUTS: none, but will call "timespan" if time_range is not already set. KEYWORDS: DATA: Raw data can be returned through this named variable. TIME_RANGE: 2 element vector specifying the time range RESTRICTIONS: This routine expects to find the master file: 'wi_ehsp_3dp_files' In the directory specified by the environment variable: 'CDF_INDEX_DIR' See "make_cdf_index" for more info. SEE ALSO: "make_cdf_index","loadcdf","loadcdfstr","loadallcdf" CREATED BY: Davin Larson FILE: load_wi_ehsp_3dp.pro LAST MODIFICATION: 97/02/05
(See idlUtil/windGeneral/key_param/load_wi_ehsp_3dp.pro)
PROCEDURE: load_wi_elpd_3dp PURPOSE: loads WIND 3D Plasma Experiment key parameter data for "tplot". INPUTS: none, but will call "timespan" if time_range is not already set. KEYWORDS: DATA: Raw data can be returned through this named variable. TIME_RANGE: 2 element vector specifying the time range NO_PLOT: Suppresses the display of the summary plot RESTRICTIONS: This routine expects to find the master file: 'wi_elsp_3dp_files' In the directory specified by the environment variable: 'CDF_INDEX_DIR' See "make_cdf_index" for more info. SEE ALSO: "make_cdf_index","loadcdf","loadcdfstr","loadallcdf" CREATED BY: Davin Larson FILE: load_wi_elpd_3dp.pro LAST MODIFICATION: 97/01/29
(See idlUtil/windGeneral/key_param/load_wi_elpd_3dp.pro)
PROCEDURE: load_wi_elsp_3dp PURPOSE: loads WIND 3D Plasma Experiment key parameter data for "tplot". INPUTS: none, but will call "timespan" if time_range is not already set. KEYWORDS: DATA: Raw data can be returned through this named variable. TIME_RANGE: 2 element vector specifying the time range RESTRICTIONS: This routine expects to find the master file: 'wi_elsp_3dp_files' In the directory specified by the environment variable: 'CDF_INDEX_DIR' See "make_cdf_index" for more info. SEE ALSO: "make_cdf_index","loadcdf","loadcdfstr","loadallcdf" CREATED BY: Davin Larson FILE: load_wi_elsp_3dp.pro LAST MODIFICATION: 97/01/20
(See idlUtil/windGeneral/key_param/load_wi_elsp_3dp.pro)
PROCEDURE: load_wi_em_3dp PURPOSE: loads WIND 3D Plasma Experiment key parameter data for "tplot". INPUTS: none, but will call "timespan" if time_range is not already set. KEYWORDS: DATA: Raw data can be returned through this named variable. POLAR: Computes polar coordinates if set. TIME_RANGE: 2 element vector specifying the time range RESTRICTIONS: This routine expects to find the master file: 'wi_em_3dp_files' In the directory specified by the environment variable: 'CDF_INDEX_DIR' See "make_cdf_index" for more info. SEE ALSO: "make_cdf_index","loadcdf","loadcdfstr","loadallcdf" CREATED BY: Davin Larson FILE: load_wi_em_3dp.pro LAST MODIFICATION: 97/02/05
(See idlUtil/windGeneral/key_param/load_wi_em_3dp.pro)
PROCEDURE: load_wi_epa PURPOSE: loads WIND Energetic Particle Analyser key parameter data for "tplot". INPUTS: none, but will call "timespan" if time range is not already set. KEYWORDS: TIME_RANGE: 2 element vector specifying the time range SEE ALSO: "make_cdf_index" CREATED BY: Davin Larson FILE: load_wi_epa.pro LAST MODIFICATION: 96/08/23
(See idlUtil/windGeneral/key_param/load_wi_epa.pro)
PROCEDURE: load_wi_mfi PURPOSE: loads WIND MAGNETOMETER Experiment key parameter data for "tplot". INPUTS: none, but will call "timespan" if time range is not already set. KEYWORDS: POLAR: Also computes the B field in polar coordinates. TIME_RANGE: 2 element vector specifying the time range DATA: Data returned in this named variable RESTRICTIONS: This routine expects to find the master file: 'wi_k0_mfi_files' In the directory specified by the environment variable: 'CDF_DATA_DIR' See "make_cdf_index" for more info. SEE ALSO: "make_cdf_index","loadcdf","loadcdfstr","loadallcdf" CREATED BY: Davin Larson FILE: load_wi_mfi.pro LAST MODIFICATION: 97/02/05
(See idlUtil/windGeneral/key_param/load_wi_mfi.pro)
PROCEDURE: load_wi_or PURPOSE: loads WIND 3D Plasma Experiment orbit data for "tplot". INPUTS: none, but will call "timespan" if time_range is not already set. KEYWORDS: POLAR: Computes polar coordinates if set. TIME_RANGE: 2 element vector specifying the time range RESTRICTIONS: This routine expects to find the master file: 'wi_or_def_files' In the directory specified by the environment variable: 'CDF_DATA_DIR' See "make_cdf_index" for more info. SEE ALSO: "make_cdf_index","loadcdf","loadcdfstr","loadallcdf" CREATED BY: Davin Larson FILE: load_wi_or.pro LAST MODIFICATION: 97/02/05
(See idlUtil/windGeneral/key_param/load_wi_or.pro)
PROCEDURE: load_wi_pm_3dp PURPOSE: loads WIND 3D Plasma Experiment key parameter data for "tplot". INPUTS: none, but will call "timespan" if time_range is not already set. KEYWORDS: DATA: Raw data can be returned through this named variable. POLAR: Computes polar coordinates if set. TIME_RANGE: 2 element vector specifying the time range RESTRICTIONS: This routine expects to find the master file: 'wi_em_3dp_files' In the directory specified by the environment variable: 'CDF_INDEX_DIR' See "make_cdf_index" for more info. SEE ALSO: "make_cdf_index","loadcdf","loadcdfstr","loadallcdf" CREATED BY: Davin Larson FILE: load_wi_pm_3dp.pro LAST MODIFICATION: 97/02/05
(See idlUtil/windGeneral/key_param/load_wi_pm_3dp.pro)
PROCEDURE: load_wi_sp_mfi PURPOSE: loads WIND MAGNETOMETER 3 second data for "tplot". INPUTS: none, but will call "timespan" if time range is not already set. KEYWORDS: TIME_RANGE: 2 element vector specifying the time range POLAR: Also computes the B field in polar coordinates. DATA: Data returned in this named variable RESTRICTIONS: This routine expects to find the master file: 'wi_sp_mfi_files' In the directory specified by the environment variable: 'CDF_DATA_DIR' See "make_cdf_index" for more info. SEE ALSO: "make_cdf_index","loadcdf","loadcdfstr","loadallcdf" CREATED BY: Davin Larson FILE: load_wi_sp_mfi.pro VERSION: 1.10 LAST MODIFICATION: 97/02/05
(See idlUtil/windGeneral/key_param/load_wi_sp_mfi.pro)
PROCEDURE: load_wi_swe PURPOSE: loads WIND Solar Wind Experiment key parameter data for "tplot". INPUTS: none, but will call "timespan" if time range is not already set. KEYWORDS: TIME_RANGE: 2 element vector specifying the time range RESTRICTIONS: This routine expects to find the master file: 'wi_k0_swe_files' In the directory specified by the environment variable: 'CDF_DATA_DIR' See "make_cdf_index" for more info. SEE ALSO: "make_cdf_index","loadcdf","loadcdfstr","loadallcdf" CREATED BY: Davin Larson FILE: load_wi_swe.pro LAST MODIFICATION: 97/01/26
(See idlUtil/windGeneral/key_param/load_wi_swe.pro)
PROCEDURE: load_wi_wav PURPOSE: loads WIND WAVES Experiment key parameter data for "tplot". INPUTS: none, but will call "timespan" if time range is not already set. KEYWORDS: TIME_RANGE: 2 element vector specifying the time range RESTRICTIONS: This routine expects to find the master file: 'wi_k0_wav_files' In the directory specified by the environment variable: 'CDF_DATA_DIR' See "make_cdf_index" for more info. SEE ALSO: "make_cdf_index","loadcdf","loadcdfstr","loadallcdf" CREATED BY: Davin Larson FILE: load_wi_wav.pro LAST MODIFICATION: 97/02/05
(See idlUtil/windGeneral/key_param/load_wi_wav.pro)
NAME: MAKE5SEC
PURPOSE: To obtain data with 5 second time resolution from
tplot-like structures. 2-nearest-neighbor linear interpolation is
performed to obtain the data.
CALLING SEQUENCE: make5sec,data
INPUTS: DATA: a tplot-like structure, which must contain a TIME tag
and one or more COMP* tags.
KEYWORD PARAMETERS: DATA_TAGS: used to pass in an array of tag names
containing data for conversion to 5 second
resolution. If not set, then COMP* tags will be
used.
OVERWRITE: if set, causes in-place conversion
of the original data. This is
probably much faster for large
structures.
TAG_TYPE: used to pass in an alternate tag type,
for example DATA instead of COMP.
TIME_BIN: used to pass in an alternate time
resolution, instead of the default 5.0
seconds.
TZERO: if non-zero, then the first time in the
reduced resolution timetags will be
DATA.START_TIME + TZERO, instead of just
DATA.START_TIME.
GAPS: used to pass in an array of indices which
refer to the beginning of time gaps in the
original data. If set and of the correct
type, 5-second times which fall in the
gaps will be set to NAN.
IGNORE_GAPS: if set, causes find_gaps to be
called, and 5 second times in the
gaps will be set to NAN.
TIMES_ONLY: if set, prevents interpolation of
the data, and merely returns a
reduced resolution time
column. Believe it or not, this can
be useful.
SPIN_PHASE: if defined, then this value is used
to generate the time column, rather
than TZERO or TIME_BIN. The times
where phase is equal to SPIN_PHASE
(in degrees) will be selected.
RAW_PHASE: if set, and SPIN_PHASE is defined,
causes SPIN_PHASE to be interpreted
in units of (degrees * 360/1024).
GIVEN_TIMES: an array of times to use, probably
generated from a spin phase quantity.
OUTPUTS: The DATA structure is returned, with the 5 second data in
either the COMP* tags, the DATA_TAGS tags, or some new
*_5 tags.
SIDE EFFECTS: Addition of *_5 tags, *OR* overwriting of COMP*
tags. Also a tag (FIVE_SEC) indicating success of the
conversion is added.
MODIFICATION HISTORY: Written 26-July-1996 by Bill Peria
(See idlUtil/arrayUtil/make5sec.pro)
PROCEDURE:
makecdf, datavary, datanovary=datanovary, filename=filename, status=status, $
gattributes=gattr, vattributes=vattr
PURPOSE:
Creates a CDF file given an array of structures
KEYWORDS:
filename:
Name of file to be created.
datanovary:
a structure containing the time invariant data to be written to CDF (like
array descriptors).
tagsvary:
array of strings that will be used as the CDF variable names for the values
stored in the datavary structure. Default CDF variable names are the names
of the tags of the datavary structure.
Note that, since IDL internally capitalizes all variable and tag names,
the CDF variable names will be all caps in the default, so the tagsvary
keyword should generally be used to control capitalization of the CDF variable
names.
tagsnovary:
array of strings that will be used as the CDF variable names for the values
stored in the datanovary structure. Default CDF variable names are the names
of the tags of the datanovary structure.
Note that, since IDL internally capitalizes all variable and tag names,
the CDF variable names will be all caps in the default, so the tagsnovary
keyword should generally be used to control capitalization of the CDF variable
names.
gattributes:
a structure specifying the names, entry numbers, and values of the global
CDF attributes that will be written to the CDF file.
The tagnames of the gattributes structure are actually dummy placeholders
which are not used (but must all be unique, or course).
The value of each field is a struture containing three fields, 'name',
which contains the name of the attribute, 'entry', which contains the entry
number (many attributes contain just a single entry, generally just entry 0,
and some contain several entries, generally entries 0,1,2,3, etc), and
'value' which contains the value of the attribute for the specified entry.
(see the example below)
vattributes:
a structure specifying, for each CDF variable that has variable attributes,
the names and values of the variable CDF attributes that will be written to
the CDF file. The tagnames of the vattributes structure are actually dummy
placeholders and are not used. The values of the fields of the vattributes
structure should each be a structure, with a 'varname' field containing the
name of a CDF variable, and an 'attrlist' field which contains a structure
containing the set of attribute names and values for the specified variable.
(see the example below)
overwrite:
if set, overwrite any existing CDF file with the specified name (default
is to not overwrite any such existing file).
status:
status is 0 on successful return, nonzero on unsuccessful return.
A routine that calls makecdf should in general use the status keyword parameter
and verify that the CDF write has completed successfully.
INPUT:
datavary:
an array of structures containing the time variant data to be written to CDF.
Each element of the array is a structure containing the values for one time.
Datavary must have a tag named 'time' that contains the time in seconds since
01-01-1970/00:00:00 UT. An additional CDF variable named 'Epoch', of type
CDF_EPOCH, will be written to the CDF, and will be computed from 'time'.
EXAMPLE:
To make a CDF file named 'foo.cdf' containing tplot variables 'el_0' and 'el_high',
and with two global attributes, named 'foo' (with one entry with value 'bar') and
'goo' (with two entries, one with value 1.0, and one with value 2.0),
and with two variable attributes, 'VALIDMIN' and 'VALIDMAX', with VALIDMIN for el_0
to be set to 1.0, and VALIDMAX of el_0 to be set to 2.0, and VALIDMIN of el_high to
be set to 1.0 and VALIDMAX of el_high to be set to 2.0,
give the following IDL commands:
> make_cdf_structs, ['el_0', 'el_high'], datavary, datanovary
> gattr = {foo0: {name:'foo', entry:0, value:'bar'}, $
goo0: {name:'goo', entry:0, value:1.0 }, $
goo1: {name:'goo', entry:1, value:2.0 }}
> vattr_el_0 = {VALIDMIN:1.0, VALIDMAX:2.0}
> vattr_el_high = {VALIDMIN:1.0, VALIDMAX:2.0}
> vattr = {el_0: {varname:'el_0', attrlist:vattr_el_0}, $
el_high: {varname:'el_high', attrlist:vattr_el_high}}
> makecdf, file='foo', datavary, datanovary=datanovary, $
tagsvary=['time', 'el_0', 'el_high'], tagsnovary=['el_0_en', 'el_high_pa'], $
gattr=gattr, vattr=vattr
Note that, in the above specification of vattr, the names of the CDF variables (el_0
and el_high in this example), appear to be repeated in two places each. The first
occurrence of each, in the tagname, is actually just an unused dummy, and the second
occurrence of each, in the string value of varname, is the CDF variable name. This
is because IDL variable names and tag names can't be used to specify the more general
strings that CDF variable names can have. Similarly with gattr.
The resulting CDF file will contain an Epoch variable (computed from the time),
a time variable (taken by default from the 'x' component of the first named tplot
variable, but specifiable otherwise by the 'times' keyword to 'make_cdf_structs'),
and, for each tplot variable named in the argument list to 'make_cdf_structs', the
'y' component, with a name taken from 'tagsvary', and the 'v' component, with a
name taken from 'tagsnovary'.
Thus the CDF file from the above commands will contain the CDF variables
Epoch:
This is of type CDF_EPOCH, and is calculated from the time variable below
time:
by default, the 'x' tag from the tplot variable 'el_0'
el_0:
the 'y' tag from the tplot variable 'el_0'
el_high:
the 'y' tag from the tplot variable 'el_high'
el_0_en:
the 'v' tag from the tplot variable 'el_0'
el_high_pa:
the 'v' tag from the tplot variable 'el_high'
SEE ALSO:
"make_cdf_structs.pro", "strarr_to_arrstr.pro"
VERSION: @(#)makecdf.pro 1.4 10/01/96
(See idlUtil/windGeneral/key_param/makecdf.pro)
PROCEDURE:
makecdf2, data, sktfile=sktfile, cdffile=cdffile, $
gattributes=gattr, vattributes=vattr, overwrite=overwrite, status=status
PURPOSE:
Creates a CDF file from a structure of arrays
INPUT:
data:
(this sounds complicated to describe, but see the EXAMPLE below)
The structure containing the data to write out to CDF.
The 'data' structure will contain exactly one field for each variable that
is to be written to the output CDF (with the exception that additional
variables 'Epoch' and 'Time_PB5' will be written to the CDF file, if they
have been specified in the skeleton file input via the 'sktfile' keyword
parameter).
Each field of the 'data' structure is itself a structure containing exactly
4 fields, named 'name', 'value', 'recvary', and 'fill'.
The 'name' field of the n-th field of 'data' should be the name of the n-th
CDF variable in the output CDF file. The 'value' field of the n-th field of
'data' should be an array containing the values of the n-th variable (the
i-th element of the array is the value at the i-th time). The 'recvary'
field of the n-th field of 'data' should be 1 if the n-th variable is time
varying and 'recvary' should be 0 if the n-th variable is time invariant.
Time invariant variables are generally things like various kinds of array
descriptors that don't depend on the time. The 'fill' field of the n-th field
of 'data' should be 1 if the variable should have its values overwritten with
ISTP standard FILLVAL's for all times for which data are missing or invalid,
as specified by the values of the 'quality_flag' variable, otherwise, 'fill'
should be zero.
NOTE: the first field of the 'data' structure must contain the time values
in seconds since 01-01-1970/00:00:00 UT.
NOTE: all of the time variant variable arrays in the 'data' structure must
be based on the exact same time array (that set of times given in the first
field of the 'data' structure). If you have a set of arrays to write out
to CDF which are not all based on the same time array, you must first do
the appropriate interpolations to generate a set of arrays that are all
based on the same time array. See the routine 'time_align.pro' for one
simple way to do this with tplot variables.
KEYWORDS:
sktfile:
name of the skeleton file that is to be used to specify the global attributes
and their values, variable attributes and their values, and variable types and
sizes. The value used for this parameter should not include any '.skt' suffix.
cdffile:
Name of CDF file to be created. Do not include any '.cdf' suffix.
gattributes:
FIX
vattributes:
FIX
overwrite:
if set, overwrite any existing CDF file with the specified name (default
is to not overwrite any such existing file).
status:
status is 0 on successful return, nonzero on unsuccessful return.
A routine that calls makecdf2 should in general use the status keyword parameter
and verify that the CDF write has completed successfully.
EXAMPLE:
Consider making a CDF file of the FAST EESA summary data, as is done by the IDL
routine 'fast_e_summary.pro'. Assume that an appropriate skeleton file named
'fa_k0_ees_template.skt' has been created, containing the appropriate variable
definitions and the appropriate global and variable scope attributes and their
values. Assume that all the standard data necessary has been stored with
'store_data' in IDL.
Then to make the CDF file named 'fa_k0_ees.cdf'containing the variables 'unix_time',
'el_0', 'el_90', 'el_180', 'el_en', 'el_low', 'el_low_pa', 'el_high',
'el_high_pa', 'JEe', and 'Je', you could give the following IDL commands:
> get_data, 'el_0', data=el_0
> get_data, 'el_90', data=el_90
> get_data, 'el_180', data=el_180
> get_data, 'el_low', data=el_low
> get_data, 'el_high', data=el_high
> get_data, 'JEe', data=JEe
> get_data, 'Je', data=Je
>
> data = {unix_time: {name:'unix_time', value:el_0.x, recvary:1, fill:0}, $
> el_0: {name:'el_0', value:el_0.y, recvary:1, fill:1}, $
> el_90: {name:'el_90', value:el_90.y, recvary:1, fill:1}, $
> el_180: {name:'el_180', value:el_180.y, recvary:1, fill:1}, $
> el_en: {name:'el_en', value:el_0.v, recvary:1, fill:1}, $
> el_low: {name:'el_low', value:el_low.y, recvary:1, fill:1}, $
> el_low_pa: {name:'el_low_pa', value:el_low.v, recvary:1, fill:1}, $
> el_high: {name:'el_high', value:el_high.y, recvary:1, fill:1}, $
> el_high_pa: {name:'el_high_pa', value:el_high.v, recvary:1, fill:1}, $
> JEe: {name:'JEe', value:JEe.y, recvary:1, fill:1}, $
> Je: {name:'Je', value:Je.y, recvary:1, fill:1}}
>
> makecdf2, data, sktfile='fa_k0_ees_template', $
cdffile='fa_k0_ees', status=status, /overwrite
> if status ne 0 then begin
> message, /info, 'makecdf2 failed.'
> return
> endif
Note that in the above, the name of the field containing time was named 'unix_time',
and not 'time'. In general, CDF variables can be named anything you want, but there
are a few special exceptions.
IF A CDF CONTAINS AN 'EPOCH' VARIABLE, THE FOLLOWING VARIABLE NAMES SHOULD NOT BE
USED: TIME, YEAR, MONTH, DAY, HOUR, MINUTE, SECOND, MSEC, IYEAR, IMONTH, IDAY,
IHOUR, IMINUTE, ISECOND, IMSEC. THIS IS BECAUSE MANY STANDARD CDF ANALYSIS TOOLS
USE THESE NAMES FOR SPECIFIC PURPOSES. This is because of certain assumptions
made by various software tools developed by CDHF.
SEE ALSO:
"time_align"
VERSION: @(#)makecdf2.pro 1.11 02/04/98
(See idlUtil/science/makecdf2.pro)
PROCEDURE: makegif, filename NAME: makegif PURPOSE: Creates a GIF file from the currently displayed image. NOTES: extension '.gif' is added automatically Restrictions: Current device should have readable pixels (ie. 'x' or 'z') Created by: Davin Larson FILE: makegif.pro VERSION: 1.2 LAST MODIFICATION: 96/10/15
(See idlUtil/windGeneral/misc/makegif.pro)
FUNCTION make_3dmap, dat,nx,ny
PURPOSE:
Returns a 3d map using the theta's and phi's of a 3d structure.
This routine is primarily used by "PLOT3D".
INPUT: dat: a 3d structure (see "3D_STRUCTURE" for more info).
nx: x dimension of output array.
ny: y dimension of output array.
OUTPUT: A 2 dimensional array of bin values that reflect the mapping.
KEYWORDS:
HIGHEST: force the highest bin number to prevail for overlapping bins.
BINS: bins selection. Same keyword as in "PLOT3D"
ASSUMPTIONS: theta +/- dtheta should be in the range: -90 to +90.
NOTES: if there are any overlapping bins, then the lowest bin number
will win, unless the HIGHEST keyword is set.
WRITTEN BY: Davin Larson, 96-2-8
LAST MODIFICATION: @(#)make_3dmap.pro 1.1 96/02/13
(See idlUtil/windGeneral/science/make_3dmap.pro)
NAME: make_cdf_index PROCEDURE: make_cdf_index, [pattern] PURPOSE: Creates an index file for CDF files. The index file will have one line for each CDF file found. Each line contains the start time, end time and filename with the following format: YYYY-MM-DD/hh:mm:ss YYYY-MM-DD/hh:mm:ss fullpathname.cdf CDF files may be distributed over many directories or disks. INPUT: pattern: (string) file pattern, default is: '*.cdf' KEYWORDS: DATA_DIREC (string) data directory(s) INDEX_FILENAME: (string) Name of index file to be created. NO_DUPLICATES: Set to 1 if duplicate days are to be ignored. SEE ALSO: "makecdf","loadcdf","loadcdfstr","loadallcdf", CREATED BY: Davin Larson, August 1996 VERSION: 96/10/15 make_cdf_index.pro 1.2
(See idlUtil/windGeneral/key_param/make_cdf_index.pro)
PROCEDURE: make_cdf_structs.pro
USAGE: make_cdf_structs, namelist, datavary, datanovary, times=times
PURPOSE:
from stored data, creates the structures that are needed to write to CDF.
INPUTS:
namelist: array of tplot names or tplot numbers of the quantities desired
OUTPUTS:
datavary:
an array of structures. Each element of the array is a structure corresponding
to one value of time, containing time and a value for each of several quantities.
All elements of datavary will be written to the CDF as record-variant data.
datanovary:
a structure, each tag of which is a time-invariant quantity that came from
either the data structure or the limit structure of the stored data.
All elements of datanovary will be written to the CDF as non-record-variant data.
KEYWORDS:
times:
when stored data quantities have different time arrays, they must all be
interpolated to the same time array in order to write to CDF. The default
action is to interpolate all time based quantities to the time array of the
first data quantity listed. If it is desired to interpolate to a different
time array than this, set the keyword times to the array of desired times.
DETAILS:
for each tplot variable named, this routine expects to find a tag 'x' containing
time, which will be named 'time' in the created structures, a tag 'y', which will
be given the name of the tplot variable in the created structures, and a tag 'v',
which will be named 'name_v', where name is the name of the tplot variable.
This routine is meant to be used prior to using 'makecdf' to write a CDF.
When using 'makecdf', the above names will be the default names of the CDF
variables that are written to CDF, and one one can use keyword parameters to
change the names of the variables from the above to anything else. (see EXAMPLE).
EXAMPLE:
To make a CDF file named 'foo.cdf' containing tplot variables 'el_0' and 'el_high',
give the following IDL commands:
> make_cdf_structs, ['el_0', 'el_high'], datavary, datanovary
> makecdf, file='foo', datavary, datanovary=datanovary, $
tagsvary=['time', 'el_0', 'el_high'], tagsnovary=['el_0_en', 'el_high_pa']
The resulting CDF file will contain an Epoch variable (computed from the time),
a time variable (taken by default from the 'x' component of the first named tplot
variable, but specifiable otherwise by the 'times' keyword to 'make_cdf_structs'),
and, for each tplot variable named in the argument list to 'make_cdf_structs', the
'y' component, with its name taken, in order, from 'tagsvary', and the 'v' component,
with its name taken, in order, from 'tagsnovary'.
Thus the CDF file from the above commands will contain the CDF variables
Epoch:
This is of type CDF_EPOCH, and is calculated from the time variable below
time:
by default, the 'x' tag from the tplot variable 'el_0'
el_0:
the 'y' tag from the tplot variable 'el_0'
el_high:
the 'y' tag from the tplot variable 'el_high'
el_0_en:
the 'v' tag from the tplot variable 'el_0'
el_high_pa:
the 'v' tag from the tplot variable 'el_high'
SEE ALSO:
"strarr_to_arrstr.pro", "makecdf.pro"
CREATED BY: Vince Saba
LAST MODIFICATION: @(#)make_cdf_structs.pro 1.2 09/05/96
(See idlUtil/misc/make_cdf_structs.pro)
PRO: MAKE_DATA_DOUBLE, dat
PURPOSE: Converts data.comp* to double. Written for MagAC data. Can be used
by any standard dqd.
CALLING: make_data_double(dat)
Pretty simple!
INPUTS: A valid data structure.
KEYWORD PARAMETERS: NONE!
OUTPUTS: Makes data.comp* into double.
;
INITIAL VERSION: REE 96_11_06
MODIFICATION HISTORY:
Space Scienes Lab, UCBerkeley
(See idlUtil/misc/make_data_double.pro)
PROCEDURE: make_day_cdf.pro
PURPOSE: generate FAST summary data file for a given day from the per orbit summary files
INPUTS:
dataset:
char string with value = 'ees', 'ies', 'dcf', 'acf', or 'tms'. Case is ignored.
specifies whether EES, IES, DCF, ACF, or TMS data is created.
year:
month:
day:
the year, month (Jan = 1), and day (first day of month = 1) of the day, UT, for
which the file is to be generated.
KEYWORDS:
versionnumber:
The ISTP version number to be written to the CDF file. Although this version
number appears in the filename of the daily file in exactly the same way that
our local version number appears in the filename of our orbit CDF files, this
version number is NOT the same as our local version number--it is the ISTP
standard version number. The first daily file sent to ISTP for each date must
have version number 1, regardless of how many versions have previously been
created for other dates. Any daily file sent to ISTP, which is not the first
daily file sent to ISTP for that particular date, must have a version number
which is 1 greater than the last daily file sent to ISTP for that particular date.
This keyword parameter must be set--there is no default.
indexfile:
Pathname of the index file to be used to find the per orbit summary files.
Default indexfile is
index = getenv('CDF_INDEX_DIR') + '/fa_k0_' + dataset + '_files'.
(ie, for dataset='ees', index = getenv('CDF_INDEX_DIR') + /fa_k0_ees_files)
sktfile:
Pathname of the skt file to be used to initialize the output CDF.
Defaults sktfile is
skt = getenv('FASTLIB') + '/cdf_templates/fa_k0_' + dataset + '_day_template'.
(ie, for dataset='ees', index = getenv('FASTLIB') + /fa_k0_ees_day_template)
length:
Length in seconds of the file to be built, defaults to 86400.0 seconds, 1 day
status:
set to zero on return for success, nonzero otherwise
verbose:
Not for use by users. For debugging/programming use only. Functionality
changes unexpectedly.
VERSION: @(#)make_day_cdf.pro 1.7 04/30/99
(See idlUtil/fast/make_day_cdf.pro)
PROCEDURE: make_fa_cdf_mastfiles
PURPOSE:
Update cdf master files in the fast cdf area. Note that the
following environment variables must be set for this procedure to
work properly: FAST_CDF_HOME and CDF_INDEX_DIR. Any zero
length files are removed from the hierarchy (they're an error anyway).
The directories given in the dirnames parameter are searched for
cdf files in the FAST_CDF_HOME directory.
INPUT:
dirnames: An array of directories under FAST_CDF_HOME that will
searched for cdf's. Note that the mastfiles will be
named:
${CDF_INDEX_DIR}/fa_k0_<dirname>_files
for each <dirname> given.
KEYWORDS:
CREATED BY: J. Loran Feb '97
LAST MODIFICATION: @(#)make_fa_cdf_mastfiles.pro 1.4 03/31/97
(See idlUtil/fast/make_fa_cdf_mastfiles.pro)
PROCEDURE: make_po_cdf_mastfiles PURPOSE: Update cdf master files in the polar cdf area. Note that the following environment variables must be set for this procedure to work properly: POLAR_CDF_HOME and POLAR_CDF_MAST_DIR. Any zero length files are removed from the hierarchy (they're an error anyway). Every month the directories need to be updated. INPUT: dirnames: A string array containing the directories to look in for the cdf files. KEYWORDS: CREATED BY: J. Loran Feb '97 LAST MODIFICATION: @(#)make_fa_cdf_mastfiles.pro 1.1 02/08/97 Revised for Polar data by S. Wittenbrock 02/10/97 Revised to include directory names by S. Wittenbrock 06/03/97
(See idlUtil/polar/make_po_cdf_mastfiles.pro)
PROCEDURE: make_quality
PURPOSE: create a quality flag for use in a CDF from a
representation of a set of variables
DETAILS:
When dealing with a set of variables that are all time-based
arrays, based on the same time array, one simple notion of data
quality is that quality = 0 for those times for which all data
variables have defined values, and quality = 255 for any time
for which one or more variables have a value for which 1 or more
components are missing or invalid. This routine is used to
generate such a simple form of quality flag.
INPUTS:
data:
a structure of the following form:
data = {dummy1: {name:'time', value:time}, $
dummy2: {name:'var1', value:var1}, $
dummy3: {name:'var2', value:var2}, $
dummy4: {name:'var3', value:var3}}
that is used to represent the data to be written to a CDF file.
The values of the 'name' fields are the names of the
variables, and the values of the 'value' fields are the
values of the variables. The first field of 'data' is an
array of times, and the other variables are all arrays based
on this time array. See makecdf2.pro for more details.
Some of the values may contain missing or invalid values.
Missing or invalid values are signified either by NaN, or by
the following special values that are used by CHDF CDF files
as FILLVAL's.
type FILLVAL
---- -------
BYTE -128
INT2 -32768
INT4 -2147483648
REAL4 -1.0e31
REAL8 -1.0d31
Any value containing either NaN or the appropriate above
FILLVAL for the type is considered either missing or otherwise
invalid.
OUTPUT:
return value: the return value (which we will call 'quality'
here), is an byte array of the same size as the time array from
'data'. That is, n_elements(quality) =
n_elements(data.(0).value). Also, quality(i) = 0 if all the
variables are defined and present for the ith time value, and
quality(i) = 255 if any of the variables contain a NaN or
FILLVAL for the ith time value.
VERSION: @(#)make_quality.pro 1.3 05/03/99
(See idlUtil/science/make_quality.pro)
Form the matrix for transforming components expressed in OLD system to NEW system...all six basis vectors must be expressed in the same system, although it doesn't matter what that system is.
(See idlUtil/misc/matfrombas.pro)
Program: mat_diag, p, EIG_VAL= eig_val, EIG_VEC= eig_vec INPUT: p 6-element vector [Pxx, Pyy, Pzz, Pxy, Pxz, Pyz] of a symmetric matrix OUTPUT: eig_val, eig_vec PURPOSE: Diagonalize a 3x3 symmetric matrix Returns the eigenvalues and eigenvectors. The eigenvalues are the diagnonal elements of the matrix The eigenvectors are the associated principle axis. NOTES: The first eigenvalue (eig_val(0)) and eigenvector (eig_vec(*,0)) are the distinguisheable eigenvalue and the major (symmetry) axis, respectively. The "degenerate" eigenvalues are sorted such that the 2nd eigenvalue is smaller than the third one. CREATED BY: Tai Phan (95-9-15) LAST MODIFICATION: 95-9-29 Tai Phan
(See idlUtil/windGeneral/science/mat_diag.pro)
PROCEDURE: maxwellian_1,x,a,f,pder,units=units,mass=mass,index=ind PURPOSE: Procedure returns maxwellian function f(x,a) and df/da, where f=a0*exp(a1*x), x-vector of energies. INPUTS: x fltarr(n) array of energy values a dblarr(2) array of function parameters f dblarr(n) array of function values to be returned pder dblarr(n,2) array of partial derivative, df/da returned KEYWORDS: UNITS string units for function (df,eflux,flux), def='df' INDEX intarr(2) indexes used for estimate of "a" if set, returns initial estimate of "a." call before calling curvefit.pro NOTES: see funct_fit2d.pro see curvefit.pro see maxwellian_2.pro, maxwellian_3.pro CREATED BY: J. McFadden 96-11-14 FILE: maxwellian_1.pro VERSION 1. LAST MODIFICATION: mcfadden 97-10-16 MOD HISTORY: 97-5 delory 97-10-16 mcfadden mass in common
(See idlUtil/science/maxwellian_1.pro)
FUNCTION: minmax_range,array PURPOSE: returns a two element array of min, max values INPUT: array KEYWORDS: MAX_VALUE: ignore all numbers greater than this value MIN_VALUE: ignore all numbers less than this value POSITIVE: forces MINVALUE to 0 CREATED BY: Davin Larson LAST MODIFICATION: @(#)minmax_range.pro 1.4 95/11/07
(See idlUtil/windGeneral/misc/minmax_range.pro)
NAME: missing_dqds
PURPOSE: to check a SDT session for a set of required dqds
CALLING SEQUENCE: missing = missing_dqds(required_dqds)
INPUTS: REQ_DQDS_CALL: a string or string array of dqds to look for in the
SDT session.
KEYWORDS: The keyword ABSENT can be used to return the mising tag
names. If no dqds are missing, ABSENT contains the null
string on return.
QUIET can be used to get MISSING_DQDS to not report
missing dqds to the user.
OUTPUTS: The number of missing dqds is returned. A -1 is returned if
MISSING_DQDS was called incorrectly.
MODIFICATION HISTORY: Written 19-August-1997 by Bill Peria, UCBerkeley
Space Sciences Lab
(See idlUtil/misc/missing_dqds.pro)
NAME: missing_tags
PURPOSE: to check a structure for a set of required tags
CALLING SEQUENCE: missing = missing_tags(my_structure,required_tags)
INPUTS: REQ_TAGS_CALL: a string or string array of tags to look for in the
structure STRUCT.
KEYWORDS: The keyword ABSENT can be used to return the mising tag
names. If no tags are missing, ABSENT contains the null
string on return.
QUIET can be used to get MISSING_TAGS to not report
missing tags to the user.
OUTPUTS: The number of missing tags is returned. A -1 is returned if
MISSING_TAGS was called incorrectly.
MODIFICATION HISTORY: Written 23-July-1996 by Bill Peria, UCBerkeley
Space Sciences Lab
(See idlUtil/misc/missing_tags.pro)
NAME:
MK_HTML_HELP2
PURPOSE:
Creates a html document from a list of IDL procedures.
Given a list of IDL procedure files (.PRO), VMS text library
files (.TLB), or directories that contain such files, this procedure
generates a file in the HTML format that contains the documentation
for those routines that contain a DOC_LIBRARY style documentation
template. The output file is compatible with World Wide Web browsers.
This version is enhanced over the routine supplied by IDL, It will
also cross reference, print the purpose, and add links to the source
code.
CATEGORY:
Help, documentation.
CALLING SEQUENCE:
MK_HTML_HELP, Sources, Outfile
INPUTS:
Sources: A string or string array containing the name(s) of the
.pro or .tlb files (or the names of directories containing
such files) for which help is desired. If a source file is
a VMS text library, it must include the .TLB file extension.
If a source file is an IDL procedure, it must include the .PRO
file extension. All other source files are assumed to be
directories.
Outfile: The name of the output file which will be generated.
If no inputs are given: All directories in the current IDL path
are used with the exception of: directories named: 'obsolete'
or 'SCCS' or directories in the IDL library. (UNIX only)
KEYWORDS:
TITLE: If present, a string which supplies the name that
should appear as the Document Title for the help.
FILENAME: Alternative method of specifying Outfile (see above)
VERBOSE: Normally, MK_HTML_HELP does its work silently.
Setting this keyword to a non-zero value causes the procedure
to issue informational messages that indicate what it
is currently doing. !QUIET must be 0 for these messages
to appear.
STRICT: If this keyword is set to a non-zero value, MK_HTML_HELP will
adhere strictly to the HTML format by scanning the
the document headers for characters that are reserved in
HTML (",&,"). These are then converted to the appropriate
HTML syntax in the output file. By default, this keyword
is set to zero (to allow for faster processing).
CROSSLINK:If this keyword is set MK_HTML_HELP will create a cross
reference between library files.
CLTURBO: If this keyword is set to a single character string, then the
cross reference procedure will only cross reference lines that
contain the character given in CLTURBO. This greatly increases
the speed of the routine. By default the double quote (") is
used
PRINT_PURPOSE: If this keyword is set then the first line after PURPOSE:
is printed in the output file.
COMMON BLOCKS:
None.
SIDE EFFECTS:
A help file with the name given by the Outfile argument is
created.
RESTRICTIONS:
The following rules must be followed in formatting the .pro
files that are to be searched.
(a) The first line of the documentation block contains
only the characters ";+", starting in column 1.
(b) There must be a line which contains the string "NAME:",
which is immediately followed by a line containing the
name of the procedure or function being described in
that documentation block. If this NAME field is not
present, the name of the source file will be used.
(c) The last line of the documentation block contains
only the characters ";-", starting in column 1.
(d) Every other line in the documentation block contains
a ";" in column 1.
Note that a single .pro file can contain multiple procedures and/or
functions, each with their own documentation blocks. If it is desired
to have "invisible" routines in a file, i.e. routines which are only
for internal use and should not appear in the help file, simply leave
out the ";+" and ";-" lines in the documentation block for those
routines.
No reformatting of the documentation is done.
MODIFICATION HISTORY:
July 5, 1995, DD, RSI. Original version.
July 13, 1995, Mark Rivers, University of Chicago. Added support for
multiple source directories and multiple documentation
headers per .pro file.
July 17, 1995, DD, RSI. Added code to alphabetize the subjects;
At the end of each description block in the HTML file,
added a reference to the source .pro file.
July 18, 1995, DD, RSI. Added STRICT keyword to handle angle brackets.
July 19, 1995, DD, RSI. Updated STRICT to handle & and ".
Changed calling sequence to accept .pro filenames, .tlb
text librarie names, and/or directory names.
Added code to set default subject to name of file if NAME
field is not present in the doc header.
September, 1995, D. Larson. SSL Berkeley. Added crosslink, print_purpose
clturbo.
October 4, 1995, D. Larson. SSL Berkeley. Added link to source file.
October 3, 1996, F. Marcoline. SSL Berkeley. Added Alphabet Jumpline.
October 10, 1996, D. Larson. Added Listing by Directory.
FILE: mk_html_help2.pro
VERSION 1.14
LAST MODIFICATION: 97/01/02
(See idlUtil/windGeneral/misc/mk_html_help2.pro)
FUNCTION:
MONTHYRFROM
DESCRIPTION:
Function to build an array of strings of the format:
'YR-MN-1'
given a start time in seconds since 1970.
The date in each string increases monotonically, in the specified
number of months increments for the number of strings requested,
from the start time given.
Input parameters are the time to start the strings in seconds
since 1970, Jan 1, 00:00, the number of strings to output, and
the number of months to increment by.
USAGE (SAMPLE CODE FRAGMENT):
; set an array of strings to month and year date representions
date_strings = monthyrfrom(16156800.0,8,2) ; 8 dates, in 2 month
; increments, starting at
; 7 Jul 1970 0:0:0.00
; output result
PRINT, date_strings
--- Sample output would be
70-7-1 70-9-1 70-11-1 70-1-1 70-3-1 70-5-1 70-7-1 70-9-1
NOTES:
The start time in seconds is normally a float type, though
this isn't necessary.
If the input start time is negitive, this is an error, and the string
'ERROR' is returned.
If an array of start times is given, then a two dimensional array
of dimensions (n_dates,N_ELEMENTS(inputs vals)) of stings will
be returned.
the increment can have any sign.
This routine calls the function "secdate".
REVISION HISTORY:
@(#)monthyrfrom.pro 1.3 08/18/95
Originally written by Jonathan M. Loran, University of
California at Berkeley, Space Sciences Lab. Feb. '92
(See idlUtil/datetime/monthyrfrom.pro)
PROCEDURE: mplot, x, y, [,dy]
INPUT:
x: 1 or 2 dimensional array of x values.
y: 1 or 2 dimensional array of y values.
dy; error bars for y; same dimensions as y. (optional)
PURPOSE:
General purpose procedure used to make multi-line plots.
KEYWORDS:
DATA: A structure that contains the elements 'x', 'y' ['dy']. This
is an alternative way of inputing the data (used by TPLOT).
LIMITS: Structure containing any combination of the following elements:
ALL PLOT/OPLOT keywords (ie. PSYM,SYMSIZE,LINESTYLE,COLOR,etc.)
COLORS: array of colors to be used for each line.
NSUMS: array of NSUM keywords.
LINESTYLES: array of linestyles.
LABELS: array of text labels.
LABPOS: array of positions for LABELS
LABFLAG: integer, flag that controls label positioning.
-1: labels placed in reverse order.
0: No labels.
1: labels spaced equally.
2: labels placed according to data.
3: labels placed according to LABPOS.
BINS: flag array specifying which channels to plot.
OVERPLOT: If non-zero then data is plotted over last plot.
NOXLAB: if non-zero then xlabel tick marks are supressed.
LABELS: array of strings used to identify the curve(s)
COLORS: array of colors used for each curve.
BINS: array of 0's or 1's that specify if a trace should be plotted
NOTES:
The values of all the keywords can also be put in the limits structure or
in the data structure using the full keyword as the tag name.
The structure value will overide the keyword value.
CREATED BY: Davin Larson
FILE: mplot.pro
VERSION 1.27
LAST MODIFICATION: 97/01/26
(See idlUtil/windGeneral/tplot/mplot.pro)
A program to insert NaN's into an X array whenever there is a gap larger then GAP_SIZE in the T array. The X point beginning and ending each gap is lost. This compensates for a feature of TPLOT, where spectrograms are interpolated 1/2 way back to the previous NaN. Bill Peria 29-April-1999
(See idlUtil/misc/nan_gap.pro)
FUNCTION: ndimen PURPOSE: Returns the number of dimensions in an array. INPUT: array RETURNS number of dimensions (0 for scalers,-1 for undefined) SEE ALSO: "dimen", "data_type" CREATED BY: Davin Larson LAST MODIFICATION: @(#)ndimen.pro 1.5 96/12/16
(See idlUtil/windGeneral/misc/ndimen.pro)
NAME: nn
PURPOSE: Find the index of the data point(s) nearest to the specified time(s)
CALLING SEQUENCE: ind=nn(data,time)
INPUTS: data: a data structure, a tplot variable name/index,
or a time array
time: (double) seconds from 1970-01-01, scalar or array
if not present, "ctime" is called to get time(s)
OPTIONAL INPUTS: none
KEYWORD PARAMETERS: silent: passed to ctime if input time not specified
OUTPUTS: a long scalar index or long array of indicies
on failure, returns: -2 if bad inputs,
-1 if nearest neighbor not found
EXAMPLE: ctime,times,npoints=2
inds=nn('Np',times)
get_data,'Np',data=dens & get_data,'Tp',data=temp
plot,dens.y(inds(0):inds(1)),temp(inds(0):inds(1))
LAST MODIFICATION: @(#)nn.pro 1.4 96/12/06
CREATED BY: Frank Marcoline
(See idlUtil/windGeneral/misc/nn.pro)
FUNCTION: NOISE, dqd_name
PURPOSE: Produces the DSP noise level for a dqd. This is the noise
limit due to the ADC and DSP/ or SFA - NOT the sensor!
CALLING: dat = NOISE(dqd_name)
Pretty simple!
INPUTS: A valid SDT dqd name such as 'Dsp_V5-V8HG'
KEYWORD PARAMETERS: BASE: The minimum value.
OUTPUTS: A IDL data structure.
SIDE EFFECTS: Does not include sensor noise.
INITIAL VERSION: REE 96_11_01
MODIFICATION HISTORY:
Space Scienes Lab, UCBerkeley
(See idlUtil/fast/noise.pro)
FUNCTION: normal_to_data PURPOSE: convert normal coordinates to data coordinates INPUT: normv: normal coordinates s: array of ? KEYWORDS: none CREATED BY: Davin Larson LAST MODIFICATION: @(#)normal_to_data.pro 1.4 95/08/24 NOTE: I think this procedure is superceded by convert_coord.
(See idlUtil/windGeneral/tplot/normal_to_data.pro)
Normalizes vectors, must be n by 3.
(See idlUtil/misc/normn3.pro)
NAME: notin PURPOSE: Function to return an array of values in array "a" that are exclusive of array "b". We assume that array's "a" and "b" are of the same type. CALLING SEQUENCE: c = notin (a, b) ARGUMENTS: a First array to search b Second array to search SIDE EFFECTS: none INPUTS: two arrays: a and b both of the same type. MODIFICATION HISTORY: @(#)notin.pro 1.1 06/04/95 Written By Jonathan Loran, UCB Feb. 25 '92
(See idlUtil/arrayUtil/notin.pro)
FUNCTION: n_2d(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), 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 density, n, 1/cm^3 NOTES: Function normally called by "get_2dt.pro" to generate time series data for "tplot.pro". CREATED BY: J.McFadden LAST MODIFICATION: 96-4-22 J.McFadden
(See idlUtil/science/n_2d.pro)
FUNCTION: n_2d_b(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), 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 density, n, 1/cm^3, assumes a narrow (< 5 deg) field aligned beam NOTES: Similar to n_2d.pro, treats the anodes within 5 deg of the magnetic field differently. Function normally called by "get_2dt.pro" to generate time series data for "tplot.pro". CREATED BY: J.McFadden 97-7-11 Created from j_2d_b.pro Treats narrow beams correctly, no do loops LAST MODIFICATION: 97-7-11 J.McFadden
(See idlUtil/science/n_2d_b.pro)
FUNCTION: n_2d_fs(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_ies, 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 density, n, 1/cm^3, assumes a narrow (< 5 deg) field aligned beam NOTES: Same as n_2d_b.pro, accept separates 64 angle fast survey data for FAST to do a more accurated calculation. Function normally called by "get_2dt.pro" to generate time series data for "tplot.pro". Note that the EBINS, ARANGE, and BINS keywords below may not work properly since their meaning changes with 32 or 64 angle bins. CREATED BY: J.McFadden 97-8-13 Treats FAST fast survey narrow beams correctly, calls n_2d_b.pro LAST MODIFICATION: 97-8-13 J.McFadden
(See idlUtil/science/n_2d_fs.pro)
FUNCTION: n_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 density, n, 1/cm^3 NOTES: Function normally called by "get_3dt" or "get_2dt" to generate time series data for "tplot.pro". CREATED BY: J.McFadden 95-7-27 LAST MODIFICATION: 96-7-6 J.McFadden added more keywords
(See idlUtil/windGeneral/science/n_3d.pro)
FUNCTION: omni2d PURPOSE: Produces an energy or angle averaged data structure Summing is over pitch angle or energy, default is pitch angle summing. This structure can be plotted with spec2d or pitch2d. KEYWORDS: ANGLE: intarr(n) n=1 nearest angle to be summed n=2 angle range to be summed n>2 angle list to be summed ARANGE: intarr(2) angle bin range to be summed BINS - bytarr(dat.nbins) angle bins to be summed ENERGY: fltarr(2) energy range to be summed ERANGE: intarr(2) energy bin range to be summed EBINS: bytarr(dat.nenergy) energy bins to be summed NOTE: If no keyword is set, then sum over all angle to form energy spectrum CREATED BY: J.McFadden LAST MODIFICATION: 97-3-3 MOD HISTORY 97/03/03 ANGLE,ARANGE,ENERGY,ERANGE,EBINS keywords added
(See idlUtil/science/omni2d.pro)
FUNCTION: omni3d PURPOSE: produces an omnidirectional spectrum structure by summing over the non-zero bins in the keyword bins. this structure can be plotted with "spec3d" CREATED BY: Davin Larson LAST MODIFICATION: @(#)omni3d.pro 1.9 96/04/17 WARNING: This is a very crude structure; use at your own risk.
(See idlUtil/windGeneral/science/omni3d.pro)
PROCEDURE: options, str, tag_name, value
PURPOSE:
Add (or change) an element of a structure.
This routine is useful for changing plotting options for tplot, but can also
be used for creating limit structures for other routines such as "SPEC3D"
or "CONT2D"
INPUT:
str:
Case 1: String (or array of strings)
The limit structure associated with the "TPLOT" handle name is altered.
Case 2: Number (or array of numbers)
The limit structure for the given "TPLOT" quantity is altered. The
number/name association is given by "TPLOT_NAMES"
Case 3: Structure or not set (undefined or zero)
Structure to be created, added to, or changed.
tag_name: string, tag name for value.
value: (any type or dimension) value of new element.
NOTES:
if VALUE is undefined then it will be DELETED from the structure.
if TAG_NAME is undefined, then the entire limit structure is deleted.
KEYWORDS:
DELETE: If set, then the corresponding tag_name is removed.
SEE ALSO:
"GET_DATA","STORE_DATA", "TPLOT", "XLIM", "YLIM", "ZLIM", "ADD_STR_ELEMENT"
CREATED BY: Jasper Halekas
Modified by: Davin Larson
LAST MODIFICATION: @(#)options.pro 1.15 97/02/05
(See idlUtil/windGeneral/tplot/options.pro)
FUNCTION: pad PURPOSE: makes a data pad from a 3d structure INPUT: dat: A 3d data structure such as those gotten from get_el,get_pl,etc. e.g. "get_el" KEYWORDS: bdir: Add B direction esteps: Energy steps to use bins: bins to sum over num_pa: number of the pad CREATED BY: Davin Larson LAST MODIFICATION: @(#)pad.pro 1.15 97/01/16
(See idlUtil/windGeneral/science/pad.pro)
PROCEDURE: padplot,pad
Plots pad data vs pitch angle.
INPUTS:
pad - structure containing pitch angle distribution (PAD) data.
(Obtained from "pad()" routine)
KEYWORDS:
LIMITS - limit structure. (see "xlim" , "YLIM" or "OPTIONS")
The limit structure can have the following elements:
UNITS: units to be plotted in.
ALL PLOT and OPLOT keywords.
UNITS - convert to given data units before plotting
MULTI - Set to the number of plots desired across the page.
OPLOT - Overplots last plot if set.
LABEL - set to print labels for each energy step.
SEE ALSO: "spec3d"
CREATED BY: Davin Larson
LAST MODIFICATION: @(#)padplot.pro 1.13 96/09/24
(See idlUtil/windGeneral/science/padplot.pro)
FUNCTION: pangle,theta,phi,b_theta,b_phi PURPOSE: Computes pitch angle given two sets of theta and phi INPUT: theta,phi: double (array or scaler) first directions b_theta,b_phi : double (array or scaler) second directions RETURNS: pitch angle (array or scaler) same dimensions as theta and phi CREATED BY: Davin Larson LAST MODIFICATION: @(#)pangle.pro 1.4 95/11/28
(See idlUtil/windGeneral/science/pangle.pro)
WARNING!!! This Function is OBSOLETE try not to use it... FUNCTION: pb5_to_time INPUT: pb5 array from cdf files (especially kpd files) OUTPUT: double array, seconds since 1970 SEE ALSO: "print_cdf_info", "loadcdf" CREATED BY: Davin Larson LAST MODIFICATION: @(#)pb5_to_time.pro 1.5 95/10/18
(See idlUtil/windGeneral/key_param/pb5_to_time.pro)
PROCEDURE: pclose INPUT: none PURPOSE: Close postscript file opened with popen, and change device back to default. If common block string 'printer_name' is set, then file is sent to that printer. SEE ALSO: "print_options" "popen" CREATED BY: Davin Larson LAST MODIFICATION: @(#)pclose.pro 1.7 97/02/05
(See idlUtil/windGeneral/misc/pclose.pro)
NAME: PDQPLOT
PURPOSE: to make quick line plots of quantities in FA_FIELDS
structures, mostly for debugging purposes.
CALLING SEQUENCE: pdqplot,DATA
INPUTS: DATA is a structure which has a TIME tag and some COMP*
tags. The data in the COMP tags will be plotted vs. the TIME tags.
SIDE EFFECTS: plot(s) appear in the default window. The plot(s) will
begin from time = 0, defined as the earliest time in DATA.
EXAMPLE: v14 = get_fa_fields('V1-V4_S',/all)
pdqplot,v14
MODIFICATION HISTORY: written pdq, 16-July-1996 by Bill Peria
(See idlUtil/misc/pdqplot.pro)
PROCEDURE: pitch2d,data
PURPOSE:
Plots 2d data as pitch angle distributions.
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
COLOR - array of colors to be used for each bin
ENERGY: fltarr(2) energy range to be plotted
ERANGE: intarr(2) energy bin range to be plotted
EBINS: bytarr(dat.nenergy) energy bins to be plotted
OVERPLOT - Overplots last plot if set.
LABEL - Puts bin labels on the plot if set.
ERROR_BARS - set to plot error bars
See "spec2d", "contour2d" for another means of plotting data.
See "conv_units" to change units.
CREATED BY: J. McFadden 96-8-26
FILE: pitch2d.pro
VERSION 1.
LAST MODIFICATION: 97/02/24
MOD HISTORY:
97/02/24 MSEC keyword added,
(See idlUtil/science/pitch2d.pro)
NAME:
PLOT3D
PROCEDURE: plot3d, dat , latitude, longitude
PURPOSE:
Draws a series of 3d color plots, one plot per energy step.
INPUT:
dat: 3d data structure.
latitude: latitude of center of plot
longitude: longitude of center of plot
KEYWORDS:
EBINS: Specifies energy bins to plot.
SUM_EBINS: Specifies how many bins to sum, starting with EBINS. If
SUM_EBINS is a scaler, that number of bins is summed for
each bin in EBINS. If SUM_EBINS is an array, then each
array element will hold the number of bins to sum starting
at each bin in EBINS. In the array case, EBINS and SUM_EBINS
must have the same number of elements.
BNCENTER: if > 0 then lat,lon set so that B direction is in center
if < 0 then lat,lon set so that -B direction is in center
('magf' element must exist in dat structure. See "ADD_MAGF")
BINS: bins to use for autoscaling.
SMOOTH: smoothing parameter. 0=none, 2 is typical
SEE ALSO: "PLOT3D_OPTIONS" to see how to set other options.
CREATED BY: Davin Larson
LAST MODIFICATION: @(#)plot3d.pro 1.28 97/01/02
(See idlUtil/windGeneral/science/plot3d.pro)
COMMON BLOCK: plot3d_com PURPOSE: Common block for "PLOT#D" routines CREATED BY: Davin Larson LAST MODIFICATION: @(#)plot3d_com.pro 1.8 95/11/07 SEE ALSO: "PLOT3D" and "PLOT3D_OPTIONS"
(See idlUtil/windGeneral/science/plot3d_com.pro)
PROCEDURE: plot3d_options
PURPOSE: Sets default options for the "plot3d" routine
The only inputs are through keywords:
KEYWORDS:
MAP: one of the following strings:
'cylindrical', 'molleweide', 'ait' ,'lambert' ....
(See manual for other maps, only the first 3 characters are req'd)
COMPRESS: integer defining map resolution (see manual) 1 si default
SMOOTH: 0 gives no smoothing.
LOG: 0: linear color scale; 1: log color scale
TRIANGULATE: Uses spherical triangulation if set
LATITUDE: Center Latitude.
LONGITUDE: Center Longitude.
CREATED BY: Davin Larson
LAST MODIFICATION: @(#)plot3d_options.pro 1.10 96/09/24
(See idlUtil/windGeneral/science/plot3d_options.pro)
PROCEDURE: plot_fa_k0_ees.pro INPUT: none PURPOSE: Plots FAST electron key parameter data. Plot 1: Electron Differential Energy Flux vs Energy, 0-45 deg pitch angle Plot 2: Electron Differential Energy Flux vs Energy, 45-135 deg pitch angle Plot 3: Electron Differential Energy Flux vs Energy, 135-180 deg pitch angle Plot 4: Electron Differential Energy Flux vs Pitch Angle, < 1 keV Plot 5: Electron Differential Energy Flux vs Pitch Angle, > 1 keV Plot 6: Electron Energy Flux - mapped to 100 km, positive earthward Plot 7: Electron Flux - mapped to 100 km, positive earthward KEYWORDS NOTES: Run load_fa_k0_ees.pro first to get the k0 data CREATED BY: J.McFadden 96-9-24 VERSION: 1 LAST MODIFICATION: 97-03-25 MOD HISTORY: 97-03-04 color=4 used for positive (earthward) Ji,JEi; color=6 used for negative Ji,JEi upgrade for Ji,JEi definition changes - mapped to 100 km now 97-3-25 Lists multiple orbit numbers in title
(See idlUtil/fast/plot_fa_k0_ees.pro)
PROCEDURE: plot_fa_k0_ies.pro INPUT: none PURPOSE: Plots FAST ion key parameter data. Plot 1: Ion Differential Energy Flux vs Energy, 0-45 deg pitch angle Plot 2: Ion Differential Energy Flux vs Energy, 45-135 deg pitch angle Plot 3: Ion Differential Energy Flux vs Energy, 135-180 deg pitch angle Plot 4: Ion Differential Energy Flux vs Pitch Angle, < 1 keV Plot 5: Ion Differential Energy Flux vs Pitch Angle, > 1 keV Plot 6: Ion Energy Flux - mapped to 100 km, positive earthward Plot 7: Ion Flux - mapped to 100 km, positive earthward KEYWORDS NOTES: Run load_fa_k0_ies.pro first to get the k0 data CREATED BY: J.McFadden 96-9-24 VERSION: 1 LAST MODIFICATION: 97-03-25 MOD HISTORY: 97-03-04 color=4 used for positive (earthward) Ji,JEi; color=6 used for negative Ji,JEi upgrade for Ji,JEi definition changes - mapped to 100 km now 97-3-25 Lists multiple orbit numbers in title
(See idlUtil/fast/plot_fa_k0_ies.pro)
PROCEDURE: plot_fa_k0_tms.pro INPUT: none PURPOSE: Plots FAST TEAMS key parameter data. Plot 1: Hydrogen Differential Energy Flux vs Energy, 0-360 deg pitch angle Plot 2: Oxygen Differential Energy Flux vs Energy, 0-360 deg pitch angle Plot 3: Hydrogen Differential Energy Flux vs Pitch Angle, < 1 keV Plot 4: Hydrogen Differential Energy Flux vs Pitch Angle, > 1 keV Plot 5: Oxygen Differential Energy Flux vs Pitch Angle, < 1 keV Plot 6: Oxygen Differential Energy Flux vs Pitch Angle, > 1 keV Plot 7: MassSpectrum Counts Rate vs Mass, 1eV - 12keV, 4*Pi angles KEYWORDS NOTES: Run load_fa_k0_tms.pro first to get the k0 data CREATED BY: J.McFadden 96-10-7 VERSION: 1 LAST MODIFICATION: 97-3-25 MOD HISTORY: 97-3-25 Checks for "hm" data and includes it in plot if it exists 97-3-25 Lists multiple orbit numbers in title
(See idlUtil/fast/plot_fa_k0_tms.pro)
PROCEDURE: PLOT_MAP DESCRIPTION: Plot the map from the standard 3-D data structure that is returned from the IDL from SDT interface. The THETA, PHI, DTHETA, DPHI, DATA_NAME and PROJECT_NAME tags must exist for this routine to work. (The standard 3-D data structure should contain these.) CALLING SEQUENCE: plot_map, data_structure ARGUMENTS: data_structure The standard 3-D data structure to plot the map from. REVISION HISTORY: @(#)plot_map.pro 1.1 22 Aug 1995 Originally written by Jonathan M. Loran, University of California at Berkeley, Space Sciences Lab. Aug. '95
(See idlUtil/windGeneral/science/plot_map.pro)
PROCEDURE: plot_orbit2, data_name
PURPOSE: To do an xyplot of orbital or other data
INPUT: String associated with spacecraft position data quantity.
Default is 'GSE_pos_def'. (see "get_orbit")
KEYWORDS:
ZPLOT: will produce an x-z plot, rather than x-y
BOW: structure that determines bow shock parameters.
FREQ: if set will draw a star every freq days
INIT_FREQ: first date to label. (date string: yy-mm-dd)
DATE_LAB: if set will label a date every date_lab days
INIT_DATE_LAB: first date to start labeling. (date string: yy-mm-dd)
LIMITS: A limit structure that defines plot limits.
(see "OPTIONS", "XLIM" or "YLIM")
TRANGE: Two element vector of time values giving the time range.
(see "GETTIME")
DAT3D: A data structure that contains some of the following:
magf: 3 components of magnetic field.
sc_pos: 3 components of spacecraft position.
vsw: 3 components of solar wind velocity.
NOCOLOR: Plot everything in black and white.
Written by: Davin Larson 95-9-12
Modified from xyplot.pro by Jasper Halekas.
Modified by J. McFadden to work better with FAST
FILE: plot_orbit2.pro
VERSION: 1.13
LAST MODIFICATION: 96/04/17
(See idlUtil/misc/plot_orbit2.pro)
FUNCTION: plot_positions PURPOSE: Procedure that will compute plot positions for multiple plots per page. Created by Davin Larson
(See idlUtil/windGeneral/misc/plot_positions.pro)
PROGRAM (main program, a few functions down....)
plot_tms_counts
DESCRIPTION
function to calculate velocity of ions in a 2-D mag-field referenced system
and to plot each count as an individual symbol in polar angle-energy plot.
(The program also contains a presently non-functional option to do v_x-v_y plots.)
In order not to have a number of symbols covering each other, each count is plotted
at a random position within the (energy,angle) acceptance range of a pixel.
There are various options to be entered intereactively by typing, all with defaults.
These include norm=1 to correct for the projection effect when the acceptance
range of teams covers
A structure of the following format is used:
DATA_NAME STRING 'Tms Burst All'
TIMES DOUBLE Array(76)
END_TIMES DOUBLE Array(76)
DATA FLOAT Array(48, 16, 4, 76)
ENERGY DOUBLE Array(48, 76)
THETA FLOAT Array(16, 76)
THETA_FOV FLOAT Array(16, 76)
SPHASE INT Array(76)
SNUMBER BYTE Array(76)
MAGDIR INT Array(76)
MASS FLOAT Array(4)
GEOMFACTOR FLOAT 0.00150000
HEADER_BYTES BYTE Array(44, 76)
HDR_TIME DOUBLE Array(76)
EFF_VERSION FLOAT 1.00000
CALLING SEQUENCE
plot__tms_counts, dat
ARGUMENTS
dat data structure in plot_dists.sav
KEYWORDS
RETURN VALUE
REVISION HISTORY
Written by Jennifer Law, Cheryl Kang, and Tim Lee
July 18, 1997
Repeatedly modified by m. boehm, last aug 25, 1997
LAST MODIFICATION
(See idlUtil/fast/plot_tms_counts.pro)
FUNCTION
logtick
DESCRITPION
very specific routine for formatting labels on a logarithmic
polar dist fn plot. The values are expected to run -5 to 5.
Absolute valeus of these values are taken, and they are then
regarded as log base 10 of the energy, with an offset such that
0 represents 0.0001 keV. The actual labeling in keV is to start at
.01 keV (input value 2) and run upwards to what ever values are presented.
This is a separate routine only because the [xyz]tickformat graphics
keyword requires it.
unction logtick,axis,index,value ; axis and index exist here because [xyz]tickformat
; passes them; not used.
ommon pllims,plotlim,plotlim0
ruevalue=exp((abs(value)-4.)*alog(10.))*plotlim0(0) ; plotting is done explcitly
; in log-10 coordinates, with 0 radius corresponding to plotlim0(0)/10. (in eV)
; (alog is natural log, not anti-log; -4 rather than -1 because labeling is in keV, not eV)
print,truevalue
f abs(value) ge .1 then retstring=string(truevalue,format="(f6.2)")
f abs(value) lt .1 then retstring=' '
eturn,retstring
nd
(See idlUtil/fast/plot_tms_counts.pro)
PROCECURE: pmplot
PURPOSE: Used for making log y-axis plots. Preformats data for
use with mplot. Plots negative data in red and positive
data in green.
KEYWORDS:
DATA: The data structure.
LIMITS: The limit structure.
(See idlUtil/fast/pmplot.pro)
NAME: POLY_OUT
PURPOSE: Polynomial fit with 3-sigma throw-away. Essentially the
same as POLY_FIT, which is supplied with IDL.
CALLING SEQUENCE: c = poly_out(x,y,ndegree)
INPUTS: X - array of independent variables corresponding to Y
Y - dependent variables
NDEGREE - order of desired polynomial fit
OPTIONAL INPUTS: see documentation for IDL routine POLY_FIT.
OUTPUTS: an array of coefficients for polynomial fit. If NDEGREE is
2, then Y is approximated best by:
y ~ c(0) + c(1)*x + c(2)*x^2
OPTIONAL OUTPUTS: see documentation for IDL routine POLY_FIT.
MODIFICATION HISTORY: written October 1996 by Bill Peria, UCB/SSL
(See idlUtil/misc/poly_out.pro)
PROCEDURE: popen, filename PURPOSE: Change plot device to postscript. INPUT: optional; if: string : string used as filename, '.ps' extension is added automatically integer X: filename set to 'plotX.ps'. value of x is incremented by 1. none: filename set to 'plot.ps' KEYWORDS: See print_options for info. COPY: pass COPY keyword to set_plot INTERP: pass INTERP keyword to set_plot (default is to have interp on) SEE ALSO: "pclose", "print_options", "popen_com" CREATED BY: Davin Larson LAST MODIFICATION: @(#)popen.pro 1.18 97/02/05
(See idlUtil/windGeneral/misc/popen.pro)
COMMON BLOCK: popen_com PURPOSE: Common block for print routines SEE ALSO: "popen","pclose", "print_options" CREATED BY: Davin Larson LAST MODIFICATION: @(#)popen_com.pro 1.8 96/10/04
(See idlUtil/windGeneral/misc/popen_com.pro)
NAME: POWER_SPEC
PURPOSE: Transform time series data into averaged frequency power
spectra using FFT's. Result is the two-sided Power Spectral
Density (PSD) given in (input units)^2/Hz.
CALLING SEQUENCE: power_spec, data, n_ave=n_ave, npnts=npts,
sample=sample, freq, ave_spec, overlap=overlap
INPUTS:
DATA - A one-dimensional array containing the values of
the time series data for which an average power
spectra is desired.
OUTPUTS:
FREQ - An array returned by the routine containing the
frequency axis of the power spectra.
AVE_SPEC -An array returned by the routine containing the
amplitudes of the power spectra. The units
returned are (input units)^2/Hz. Thus EACH
AMPLITUDE in the FFT is divided by the bandwidth
in Hz of each frequency interval.
KEYWORDS:
OVERLAP - Set this keyword to slide the FFT 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 (see below!). 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.
N_AVE - The number of FFT's to average together within
the data series provided. This specifies how many
sequential segments in which to divide the
data. Setting the /OVERLAP keyword increases the
number of segments by 2*N_AVE-1.
NPNTS - The number of time series points that each
interval will be for the discrete FFT's.
SAMPLE - The sample time (in secs) of each time series
point. If unspecified, an arbitrary sample time
of 1 is assigned to the data.
EXAMPLE: You have 8192 continuous time series points. You want to
average together 8 FFT's to obtain a single average spectra
for this data. Set n_ave = 8, npnts=1024. Result is
a power_spectra obtained by taking a single FFT of each
1024 pt sequential interval in the data and averaging them
together. For the same parameters, if you set /overlap,
then the interval slides 1/2 and then averages, i.e. an FFT
is taken of the first 1024 points, then moves forward 512
points, another FFT, then slide again by 512 points. Thus
for num_ave = 8 and /overlap, you average together 8+7 = 15
FFT's for the interval of 8192 points.
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. See any of the
numerical recipes books by Press et al for a complete
description of this and other aspects of computational FFT's.
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 11/15/96 G.T.Delory
ver 1.1 03/26/97 G.T.Delory
ver 1.2 04/10/97 G.T.Delory
(See idlUtil/science/power_spec.pro)
PROCEDURE: prestens PURPOSE: This function computes the relative components of the pressure tensor INPUT: dat: A 3d structure such as those gotten by using get_el,get_pl,etc. e.g. "get_el" KEYWORDS: esteprange: energy range to use CREATED BY: Davin Larson LAST MODIFICATION: @(#)prestens.pro 1.5 95/10/06 NOTE: It is NOT yet corrected to give physical results
(See idlUtil/windGeneral/science/prestens.pro)
PROCEDURE: print_cdf_info PURPOSE: prints information about a specified cdf file INPUT: filename: The name of the file for which info is desired. KEYWORDS: none CREATED BY: unknown LAST MODIFICATION: @(#)print_cdf_info.pro 1.10 96/12/02
(See idlUtil/windGeneral/key_param/print_cdf_info.pro)
PROCEDURE: print_options PURPOSE: controls postscript printing options KEYWORDS: PORT: print pages in portrait format (default) LAND: print pages in landscape format BW: Use black and white mode (untested) COLOR: Use Color postscript (default) FUTURE OPTIONS: Ecapsulated postscript format changing plotting area SEE ALSO: "popen","pclose" CREATED BY: Davin Larson LAST MODIFICATION: @(#)print_options.pro 1.14 96/02/16
(See idlUtil/windGeneral/misc/print_options.pro)
FUNCTION: p_2d(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), 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 pressure tensor, [Pxx,Pyy,Pzz,Pxy,Pxz,Pyz], eV/cm^3 NOTES: Function calls j_2d.pro and n_2d.pro Function normally called by "get_2dt.pro" to generate time series data for "tplot.pro". CREATED BY: J.McFadden LAST MODIFICATION: 96-7-5 J.McFadden
(See idlUtil/science/p_2d.pro)
FUNCTION: p_2d_b(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), 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 pressure tensor, [Pxx,Pyy,Pzz,Pxy,Pxz,Pyz], eV/cm^3, z along B, off diagonal terms are zero assumes a narrow (< 5 deg) field aligned beam NOTES: Similar to p_2d.pro, treats the anodes within 5 deg of the magnetic field differently. Function calls j_2d_b.pro and n_2d_b.pro Function normally called by "get_2dt.pro" to generate time series data for "tplot.pro". CREATED BY: J.McFadden 97-8-19 Created from n_2d_b.pro and p_2d.pro Treats narrow beams correctly, no do loops LAST MODIFICATION: 97-8-19 J.McFadden
(See idlUtil/science/p_2d_b.pro)
FUNCTION: p_2d_fs(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_ies, 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 pressure tensor, [Pxx,Pyy,Pzz,Pxy,Pxz,Pyz], eV/cm^3, z along B, off diagonal terms are zero NOTES: Same as p_2d_b.pro, accept separates 64 angle fast survey data for FAST to do a more accurated calculation. Function normally called by "get_2dt.pro" to generate time series data for "tplot.pro". Note that the EBINS, ARANGE, and BINS keywords below may not work properly since their meaning changes with 32 or 64 angle bins. CREATED BY: J.McFadden 97-8-20 Treats FAST fast survey narrow beams correctly, calls p_2d_b.pro LAST MODIFICATION: 97-8-20 J.McFadden
(See idlUtil/science/p_2d_fs.pro)
FUNCTION: p_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 pressure tensor, [Pxx,Pyy,Pzz,Pxy,Pxz,Pyz], eV/cm^3 NOTES: Function normally called by "get_3dt" or "get_2dt" to generate time series data for "tplot.pro". CREATED BY: J.McFadden 95-7-27 LAST MODIFICATION: 96-7-6 J.McFadden
(See idlUtil/windGeneral/science/p_3d.pro)
NAME:
READ_ASCII_NONX
PURPOSE:
Read data from an ASCII file into IDL. (Identical to
READ_ASCII.PRO except for the absence of one line, which
allows it to run not connected to an X terminal.)
CATEGORY:
Input/Output.
CALLING SEQUENCE:
data = READ_ASCII_NONX(file)
INPUTS:
file - Name of file to read.
INPUT KEYWORD PARAMETERS:
record_start - 1st sequential "record" (see DESCRIPTION) to read.
Default = 0 (the first record of the file).
num_records - Number of records to read.
Default = Read up to and including the last record.
template - ASCII file template (e.g., generated by function
ASCII_TEMPLATE) describing attributes of the file
to read. Specific attributes contained in the
template may be overridden by keywords below.
Default = (see the keywords below).
data_start - Number of lines of header to skip.
Default (if no template) = 0L.
delimiter - Character that delimits fields.
Default (if no template) = '' = use fields(*).loc.
missing_value - Value to replace any missing/invalid data.
Default (if no template) = !VALUES.F_NAN.
comment_symbol - String identifying comments
(from comment_symbol to the next end-of-line).
Default (if no template) = '' = no comments.
[Note: The 'fields' keyword has not been implemented yet.]
fields - Descriptions of the data fields, formatted as
an array of structures containing the tags:
name = name of the field (string)
type = type of field as returned by SIZE (long)
loc = offset from the beginning of line to
the start of the field (long)
group = sequential group the field is in (int)
Default (if no template) =
{name:'field', type:4L, loc:0L, group:0}.
verbose - If set, print runtime messages.
Default = Do not print them.
OUTPUT KEYWORD PARAMETERS:
header - The header read (string array of length
data_start). If no header, empty string returned.
count - The number of records read.
OUTPUTS:
The function returns an anonymous structure, where each field in
the structure is a "field" of the data read (see DESCRIPTION).
If no records are read, 0 is returned.
COMMON BLOCKS:
None.
SIDE EFFECTS:
None.
RESTRICTIONS:
See DESCRIPTION.
DESCRIPTION:
ASCII files handled by this routine consist of an optional header
of a fixed number of lines, followed by columnar data. Files may
also contain comments, which exist between a user-specified comment
string and the corresponding end-of-line.
One or more rows of data constitute a "record." Each data element
within a record is considered to be in a different column, or "field."
Adjacent fields may be "grouped" into multi-column fields.
The data in one field must be of, or promotable to, a single
type (e.g., FLOAT).
EXAMPLES:
; Using default file attributes.
data = READ_ASCII_NONX(file)
; Setting specific file attributes.
data = READ_ASCII_NONX(file, DATA_START=10)
; Using a template to define file attributes.
data = READ_ASCII_NONX(file, TEMPLATE=template)
; Using a template to define file attributes,
; and overriding some of those attributes.
data = READ_ASCII_NONX(file, TEMPLATE=template, DATA_START=10)
; Using the ASCII_TEMPLATE GUI to generate a template in place.
data = READ_ASCII_NONX(file, TEMPLATE=ASCII_TEMPLATE(file))
[Note: The 'fields' keyword has not been implemented yet.]
; An example defining fields by hand.
fields = REPLICATE({name:'', type:0L, loc:0L, group:0}, 2, 3)
num = N_ELEMENTS(fields)
fields(*).name = 'field' + STRTRIM(STRING(INDGEN(num) + 1), 2)
fields(*).type = REPLICATE(4L, num)
fields(*).loc = [0L,10L, 0L,15L, 0L,12L]
fields(*).group = INDGEN(num)
data = READ_ASCII_NONX(file, FIELDS=fields)
[Note: The 'fields' keyword has not been implemented yet.]
; Another example defining fields by hand.
void = {sMyStructName, name:'', type:0L, loc:0L, group:0}
fields = [ [ {sMyStructName, 'frog', (SIZE(''))(1), 0L, 0}, $
{sMyStructName, 'bird', (SIZE(0 ))(1), 15L, 1} ], $
[ {sMyStructName, 'fish', (SIZE(0.))(1), 0L, 2}, $
{sMyStructName, 'bear', (SIZE(0D))(1), 15L, 3} ], $
[ {sMyStructName, 'boar', (SIZE(0B))(1), 0L, 4}, $
{sMyStructName, 'nerd', (SIZE(OL))(1), 15L, 5} ] ]
data = READ_ASCII_NONX(file, FIELDS=fields)
DEVELOPMENT NOTES:
- See ???,xxx in the code.
- Error check input 'delimiter' to be a string (not a byte).
- Implement the 'fields' keyword.
MODIFICATION HISTORY:
AL & RPM, 8/96 - Written.
(See idlUtil/fast/read_ascii_nonx.pro)
PROCEDURE:
read_au_ulaw
PURPOSE:
Extracts specifications and sound data from a Sun audio ".au"
file.
ARGUMENTS:
FILE The file to open.
DATA Variable in which to return the sound data. This will be
a byte array containing value from 0 to 255.
KEYWORDS:
PLAY Play the sound data on the local audio device once it is
read. Sample will loop PLAY times.
The following keywords are optional. They return various file
specs.
OFFSET The offset in bytes of the data from the beginning of
the file.
SIZE The size in bytes of the sound data array
RATE The sampling rate.
CHANNELS Number of interleaved channels. (1=mono, 2=stereo)
TEXT Arbitrary textual description embedded in the file.
CREATED:
By Joseph Rauchleiba
1998/4/22
(See idlUtil/fast/read_au_ulaw.pro)
NAME: REDUCE_RESOLUTION
PURPOSE: To reduce obnoxiously large numbers of data points to more
manageable ones, for applications which don't need such high
time resolution, like summary plots.
INPUTS: T is an array of times, X is an array of time-ordered
data. T_RES is the requested time resolution.
KEYWORDS: KEPT is a named array in which the indices of the
surviving elements are returned. These indices are with
respect to the original T and X, not the reduced
ones. This is useful for reducing, say all three
components of a magnetometer...call REDUCE_RESOLUTION with
the first component, and reduce the other two with the
KEPT indices.
OUTPUTS: Again, T and X. On output, the time between adjacent points
will be between T_RES/2 and T_RES, *except*, of course, in
gaps, which may already have been considerably larger than
T_RES.
SIDE EFFECTS: T and X will be decimated.
RESTRICTIONS: None. No input checking is performed either, however.
MODIFICATION HISTORY: written 13-Jan-97 by Bill Peria UCB/SSL
(See idlUtil/misc/reduce_resolution.pro)
PROCEDURE:
ROTMAT,time,geogei,geigse,geigsm,geism,geigsq,geigsr,dgei,rgei,s
PURPOSE:
generates rotation matrices for coordinate transformations for a given time
------------------------------------------------------------------
ROTMAT generates various rotation matrices for coordinate trans-
formations for a given instant of time
INPUT: TIME: in seconds since 1970
OUTPUT (cf. Russell, Cosm. Electrodyn. 2, 184,
1971 for names and definitions)
matrices: GEOGEI ... GEIGSR = rotation matrices transforming from
GEO to GEI system etc.; transposed matrix transforms
from GEI to GEO etc.
GEO = geographic GEI = geoc. equat. inertial
GSE = geoc. solar ecliptic GSM = geoc. solar magnetospheric
SM = geoc. solar magnetic GSQ = geoc. solar equatorial
GSR = y axis as in gsq, z axis = sun's rot. axis,
earth-sun line in x-z plane
vectors: dgei = earth's dipole axis in gei
rgei = sun's rotation axis in gei
s = position of sun (earth-sun line) in gei
(See idlUtil/misc/rotmat.pro)
PROCEDURE: scat_plot, xname, yname
PURPOSE:
Produces a scatter plot of selected tplot variables.
Colors are scaled according to zname, if present
INPUTS:
xname: xvariable name
yname: yvariable name
zname: if present, color variable name
KEYWORDS:
TRANGE: two element vector giving start and end time.
limits: a structure with plotting keywords
CREATED BY: Davin Larson
LAST MODIFICATION: @(#)scat_plot.pro 1.10 96/10/14
(See idlUtil/windGeneral/tplot/scat_plot.pro)
FUNCTION: SEARCH_FA_INDEX.PRO
PURPOSE: Finds FAST summary plot files associated with a
given timespan. Timespan may be specified by
orbit or a pair of dates. This function searches
the FAST index file using a quick algorithm.
Returns an array of filenames. If timespan is
specified by orbit, array will contain one
filename. If specified by dates, array will
contain all files with timespans that overlap the
given timespan.
Only the latest version of a file will be
returned. There should be no duplication.
NOTES: Assumes index file is well organized. Columns
are of constant width. Entries are sorted first
by orbit number, then version number.
Returns [''] if no associated files found.
Function will need editing if filename field
changes length.
Uses environment variable CDF_INDEX_DIR.
ARGUMENTS:
T1 Double float or string, scalar or 2-element
array. If scalar, this is the start time. If
this is a 2-element array, start time is T1[0],
and end time is T1[1]. Ignored if ORBIT set.
T2 If T1 is scalar, this is the end time. Ignored
if ORBIT set.
KEYWORDS:
ORBIT The orbit requested. If unset, must supply
timespan arguments.
MASTERFILE Name of a masterfile that contains times and associated
filenames. Overrides EES,IES,TMS,ACF,DCF keywords.
EES,IES,TMS, Set one of these keywords to identify the data
ACF,DCF quantity, and thus the index file. Must set one
of these or MASTERFILE.
EXISTS Only files that actually exist will be returned.
EXAMPLES: files = search_fa_index(orbit=5000, /ies, /exists)
files = search_fa_index(t1, t2, master='/path/index_file')
CREATED: 98/7/31 By J. Rauchleiba
(See idlUtil/fast/search_fa_index.pro)
FUNCTION:
SECDATE
DESCRIPTION:
function to return a date string from the number of seconds since
1970, Jan. 1 00:00. Output format is controled by the keyword
FMT. This function will return a string in the format:
FMT=0 YYYY-MM-DD (e.g. "1991-03-21");
FMT NE 0 DD MMM YY (e.g. " 3 Mar 91");
In addition, the remander in seconds of the day are returned through
the remainder formal, which can be used in a subsiquent call to the
function sectime if the full representation of time in date/time is
desired.
USAGE (SAMPLE CODE FRAGMENT):
; seconds since 1970
seconds_date = 6.6951720e+08 ; 21 Mar 91, 01:00:00.000
; convert to string
date_string = secdate(seconds_date,remainder, FMT=0)
; print it out
PRINT, date_string, remainder
--- Sample output would be
1991-03-21, 3600.
KEYWORDS:
FMT Controls the output string format. See description above.
NOTES:
The seconds and remainder parameters should be double precision.
If seconds is given negitive, this is an error and the string 'ERROR' is
returned.
If seconds is greater than 5e9, this is past the year 2100,
and this is considered an error, and 'ERROR' is returned.
(I hope this code doesn't last past the year 2100!)
If input seconds is an array, then an array of
N_ELEMENTS(inputs vals) of date strings and remainders will be returned.
Credits: adapted from The C Programming Lanuage, by Kernighan and
Ritchie, 2nd Ed. page 111
REVISION HISTORY:
@(#)secdate.pro 1.6 02/10/97
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. '91
Revised to check for time too large. Before it would
go into a rediculously long loop finding the year.
(See idlUtil/datetime/secdate.pro)
FUNCTION:
SECDATETIME
DESCRIPTION:
function to return a date-time string from the number of seconds since
1970, Jan. 1 00:00. Output format is controled by the keyword
FMT. This function will return a string in the format:
FMT=0 YYYY-MM-DD/HH:MM:SS.MSC (e.g. "1991-03-21/10:35:22.156");
FMT NE 0 DD MMM YY HH:MM:SS.MSC (e.g. " 3 Mar 91 10:35:22.156");
USAGE (SAMPLE CODE FRAGMENT):
; seconds since 1970
seconds_date_time = 6.6951720e+08 ; 21 Mar 91, 01:00:00.000
; convert to string
date_time_string = secdatetime(seconds_date_time FMT=0)
; print it out
PRINT, date_time_string
--- Sample output would be
1991-03-21/10:35:22.156
KEYWORDS:
FMT Controls the output string format. See description above.
NOTES:
The seconds parameter should be double precision.
If seconds is given negitive, this is an error and the string 'ERROR'
is returned.
If input seconds is an array, then an array of
N_ELEMENTS(inputs vals) of date strings will be returned.
This function relies upon the secdate and sectime functions
Credits: adapted from The C Programming Lanuage, by Kernighan and
Ritchie, 2nd Ed. page 111
REVISION HISTORY:
@(#)secdatetime.pro 1.1 07/26/95
Originally written by Jonathan M. Loran, University of
California at Berkeley, Space Sciences Lab. Jul. '95
(See idlUtil/datetime/secdatetime.pro)
FUNCTION:
SECOFDAY
DESCRIPTION:
Function to return seconds of a day, given the time in hours, minutes,
seconds and milliseconds.
USAGE (SAMPLE CODE FRAGMENT):
; set up a time (00:01:01.001)
hour = 0.
min = 1.
sec = 1.
msc = 1.
; convert to seconds
seconds = secofday(hour, min, sec, msc)
; print it out
PRINT, seconds
--- Sample output would be
61.001
NOTES:
If input seconds is an array, 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:
@(#)secofday.pro 1.2 06/04/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/secofday.pro)
FUNCTION:
SECTIME
DESCRIPTION:
function to return a time string from time of day given in seconds---
Given an input time in the seconds of the day, this function will
return a string in the format:
HH:MM:SS.MSC
USAGE (SAMPLE CODE FRAGMENT):
; seconds of the day
seconds_day = 43200.00 ; 12 noon
; convert to string
time_string = sectime(seconds_day)
; print it out
PRINT, time_string
--- Sample output would be
12:00:00.000
NOTES:
The seconds parameter should be of a floating point type (i.e float
or double)
If the input is greater than 86400. (24 hours), time will be subtracted
in 24 hour chunks, until the time is less than 24 hours.
If seconds is given negative, this is an error and the string 'ERROR' is
returned.
If input seconds is an array, then an array of
N_ELEMENTS(inputs vals) of time strings will be returned.
REVISION HISTORY:
@(#)sectime.pro 1.2 06/30/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, Dec. '91
Added "carry" to seconds, S. Claflin, June, 97.
(See idlUtil/datetime/sectime.pro)
NAME: SELECT_RANGE
PURPOSE: to obtain the indices where an array's values lie in a
specified range.
CALLING SEQUENCE: indices = select_range(array, range_min,
range_max, n_in_range)
INPUTS: ARRAY - any type but structure, string, or complex.
RANGE_MIN - the minimum value of the desired range.
RANGE_MAX - the maximum value of the desired range.
OUTPUTS: INDICES - a longword array of the indices, if any are in
range, or -1L if not.
OPTIONAL OUTPUTS: N_IN_RANGE - the number of points found in the
range.
EXAMPLE: comfortable = select_range(temperatures,60,70,ncomf)
MODIFICATION HISTORY: written summer 1996 by Bill Peria UCB/SSL
(See idlUtil/arrayUtil/select_range.pro)
FUNCTION:
SERIES_COMPRESS.PRO
DESCRIPTION:
Routine to return a series of numbers as a string in a compressed
(abreviated) format. Contiguous series of numbers (n and m, in a
subarray) are displayed as:
n<delimiter>..m
If the series is not contiguous, they are displayed as:
n<delimiter>m
The string delimiter is specified by the user with the delimit
parameter. The series must be a numeric type.
USAGE:
SERIES_COMPRESS, input_array, delimit
ARGUMENTS:
input_array The input series, as an array to compress.
delimit The delimiter to use between values
REVISION HISTORY:
@(#)series_compress.pro 1.1 06/04/95
Originally written by Jonathan M. Loran, University of
California at Berkeley, Space Sciences Lab. Sep. '91
(See idlUtil/arrayUtil/series_compress.pro)
PROCEDURE:
share_colors
PURPOSE:
Procedure that allows multiple IDL sessions to share the same color table.
The procedure should be called in each session before any
windows are created.
USAGE:
Typically this procedure will be put in a startup routine. such as:
share_colors,first=f
if f then loadct,39
KEYWORDS:
FIRST Named variable that will be set to 1 if this is the
first session, and set to 0 otherwise.
SIDE EFFECTS:
Creates a temporary file with the name 'idl_cmap:NAME' on the users home
directory where NAME is the name of the display machine.
This file is deleted upon exiting IDL.
The procedure is only useful on UNIX for users with a common home directory.
(See idlUtil/windGeneral/misc/share_colors.pro)
NAME:
smooth_periodic
FUNCTION: smooth_periodic, old_image, n
PURPOSE: Uses box car smoothing of a surface with sperical periodic boundary
conditions.
INPUT:
old_image: 2d matrix
n: size of boxcar averaging window
Output: smoothed image.
CREATED BY: Davin Larson
LAST MODIFICATION: @(#)smooth_periodic.pro 1.5 95/10/04
(See idlUtil/windGeneral/science/smooth_periodic.pro)
PROCEDURE: spec2d,data
PURPOSE:
Plots 2d data as energy spectra.
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)
COLOR - array of colors to be used for each bin
ANGLE: intarr(n) n=1 nearest angle to be plotted
n=2 angle range to be plotted
n>2 angle list to be plotted
ARANGE: intarr(2) angle bin range to be plotted
BINS - bytarr(dat.nbins) bins to be plotted
OVERPLOT - Overplots last plot if set.
LABEL - Puts bin labels on the plot if set.
LABSIZE - Change label size on plot.
NO_SORT - if set will prevent sorting by angle bin
ERROR_BARS - set to plot error bars
XMARGIN - change xmargin from default
YMARGIN - change ymargin from default
THICK - line thickness
PSYM - plot symbol added to lineplot
See "pitch2d", "contour2d" for another means of plotting data.
See "conv_units" to change units.
CREATED BY: J. McFadden 96-11-21 (from spec3d.pro)
FILE: spec2d.pro
VERSION 1
LAST MODIFICATION: 97/02/24
MOD HISTORY:
97/02/24 MSEC keyword added,
98/03/4 xmargin,ymargin,thick keywords added
98/06/10 psym keyword added
(See idlUtil/science/spec2d.pro)
PROCEDURE: spec3d,data
Plots 3d data as energy spectra.
INPUTS:
data - structure containing 3d data (obtained from get_??() routine)
e.g. "get_el"
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
COLOR - array of colors to be used for each bin
BINS - array of bins to be plotted (see "edit3dbins" to change)
OVERPLOT - Overplots last plot if set.
LABEL - Puts bin labels on the plot if set.
See "plot3d" for another means of plotting data.
See "conv_units" to change units.
See "time_stamp" to turn time stamping on and off.
CREATED BY: Davin Larson June 1995
FILE: spec3d.pro
VERSION 1.21
LAST MODIFICATION: 97/01/26
(See idlUtil/windGeneral/science/spec3d.pro)
PROCEDURE specplot,x,y,z
NAME:
specplot
PURPOSE:
Creates a spectrogram plot.
All plot limits and plot positions are handled by the keyword LIMITS.
INPUT:
x: xaxis values: dimension N.
y: yaxis values: dimension M. (Future update will allow (N,M))
Z: color axis values: dimension (N,M).
All options are passed in through a single structure.
KEYWORDS:
LIMITS: A structure that may contain any combination of the following
elements:
X_NO_INTERP: Prevents interpolation along the x-axis.
Y_NO_INTERP: Prevents interpolation along the y-axis.
NO_COLOR_SCALE: Prevents drawing of color bar scale.
ALL plot keywords such as:
XLOG, YLOG, ZLOG,
XRANGE, YRANGE, ZRANGE,
XTITLE, YTITLE,
TITLE, POSITION, REGION etc. (see IDL documentation for a description)
DATA: A structure that provides an alternate means of supplying
the data and options. This is the method used by "TPLOT".
Notes:
- The arrays x and y MUST be monotonic! (increasing or decreasing)
- The default is to interpolate in both the x and y dimensions.
- Data gaps can be included by setting the z values to NAN (!values.f_nan).
- If ZLOG is set then non-positive zvalues are treated as missing data.
See Also: "XLIM", "YLIM", "ZLIM", "OPTIONS", "TPLOT", "DRAW_COLOR_SCALE"
(See idlUtil/windGeneral/tplot/specplot.pro)
PROCEDURE sphere_to_cart,r,theta,phi, x,y,z PURPOSE: transform from spherical to cartesian coordinates INPUTS: r, theta, phi (array or scaler) OUTPUTS: x, y, z (will have the same dimensions as r,theta,phi) KEYWORD OUTPUT: VEC: a named variable in which the vector [x,y,z] is retur