This page was created by the IDL library routine
mk_html_help2.
Last modified: Mon Jul 30 20:14:04 2007.
NAME:
test_leap_yr
CALLING SEQUENCE:
lyr=test_leap_yr(iyr,modays=modays)
PURPOSE:
Determines whether a given year is a leap year, and
returns the number of days in every month
INPUT:
iyr = The year, as an integer
OUTPUT:
lyr= 1 if iyr is a leap year and 0 if not
KEYWORDS:
modays= the number of days in each month
modays= [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] for
a leap yr, [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] otherwise
HISTORY:
Written 19-OCt-93 by JM
Rewritten, 9-jul-2007, jmm
(See themis/common/thm_ui_timefix.pro)
NAME: thm_check_valid_name PURPOSE: checks a string or array input against another array and 'all' to find matches. CALLING SEQUENCE: ok_names = thm_check_valid_name(names, valid_names) INPUT: names = a string array of possible names for data types, stations, etc... valid_names = those names that will be valid OUTPUT: ok_names = the valid data names, if there are none, then the null string is returned KEYWORDS: include_all = if set, include 'all' in the possible datanames HISTORY: 22-jan-2007, jmm, jimm@ssl.berkeley.edu $LastChangedBy: kenb-mac $ $LastChangedDate: 2007-01-26 15:52:34 -0800 (Fri, 26 Jan 2007) $ $LastChangedRevision: 241 $ $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/thmsoc/trunk/idl/themis/common/thm_check_valid_name.pro $
(See themis/common/thm_check_valid_name.pro)
PRO themis_config
This procedure serves as the themis configuration file. It sets global (system)
variables and initializes devices
This procedure will define the location of data files and the data server.
This procedure is intended to be called from within the "THM_INIT" procedure.
This should be the only THEMIS file that requires modification for use in different
locations.
There is no need to modify this file if:
- Your computer is an SSL UNIX machine that mounts "/disks/data/" (i.e. ALL Linux and Solaris machines at SSL)
- You use a portable computer that will be caching files on a local hard drive.
Settings in this file will be overridden by settings in the environment.
(see setup_themis or setup_themis_bash for examples of setting environment
variables on UNIX-like systems. The environment can also be set on Windows
systems.)
KEYWORDS
no_color_setup added to prevent cronjob to crash, hfrey, 2007-02-10
Author: Davin Larson Nov 2006
jmm, 2007-05-17, Altered to read thm_comfig text file,
this removes the need for someone to alter this program
jmm, 2007-07-02, applies slashes to remote and local
directories, if they are not there
$LastChangedBy: kenb-mac $
$LastChangedDate: 2007-07-03 09:10:02 -0700 (Tue, 03 Jul 2007) $
$LastChangedRevision: 987 $
$URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/thmsoc/tags/tdas_2_00/idl/themis/common/thm_config.pro $
(See themis/common/thm_config.pro)
Function: thm_config_filedir.pro Purpose: Get the applications user directory for THEMIS data analysis software $LastChangedBy$ $LastChangedDate$ $LastChangedRevision$ $URL$
(See themis/common/thm_config_filedir.pro)
Function: THM_DATA_CALIBRATED
Purpose: Determine whether the data stored in a particular TPLOT variable has already been calibrated by examining the contents of it's DLIMIT structure.
Calling Sequence:
tplot_var = 'tha_eff'
get_data, tplot_var, data=d, limit=l, dlimit=dl
if thm_data_calibrated( dl) then return
; -- or --
if thm_data_calibrated('tha_eff') then return
Arguements:
DL, Anonymous STRUCT or tplot varaible name
Notes:
None.
$LastChangedBy: kenb-mac $
$LastChangedDate: 2007-05-02 17:25:43 -0700 (Wed, 02 May 2007) $
$LastChangedRevision: 629 $
$URL $
(See themis/common/thm_data_calibrated.pro)
PROCEDURE: thm_file_download PURPOSE: This is a general purpose routine will download all THEMIS data files within a given time range. It looks for all procedures that match: "thm_load_*.pro" and executes them with the /DOWNLOADONLY keyword set. Warning - This is a BETA routine and may be deleted in a future release.
(See themis/common/thm_file_download.pro)
Purpose: To make mission overview plots of all instruments
Inputs: SC: spacecraft ('a','b','c','d','e')
DATE: the date string or seconds since 1970 ('2007-03-23')
DUR: duration (default units are days)
DAYS: redundant keyword to set the units of duration (but its comforting to have)
HOURS: keyword to make the duration be in units of hours
DEVICE: sets the device (x or z) (default is x)
MAKEPNG: keyword to generate 5 png files
DIRECTORY: sets the directory where the above pngs are placed (default is './')
FEARLESS: keyword that prevents program from quitting when it fears its in an infinite loop
(infinite loop is feared when catch statement has been call 1000 times)
DONT_DELETE_DATA: keyword to not delete all existing tplot variables before loading data in for
the overview plot (sometimes old variables can interfere with overview plot)
Example: thm_gen_overplot,sc='a',date='2007-03-23',dur=1
The above example will produce a full day plot in the X window.
Version:
$LastChangedBy$
$LastChangedDate$
$LastChangedRevision$
$URL$
(See themis/common/thm_gen_overplot.pro)
NAME:
thm_gui
PURPOSE:
GUI for THEMIS data analysis
CALLING SEQUENCE:
thm_gui
INPUT:
none
OUTPUT:
none
HISTORY:
Version 2.0 jmm, jimm@ssl.berkeley.edu 25-apr-2007
jmm, 21-may-2007, Currently Only Loads data
jmm, 7-jun-2007, all buttons are now defined
$LastChangedBy$
$LastChangedDate$
$LastChangedRevision$
$URL$
(See themis/common/thm_gui.pro)
PROCEDURE: thm_init
PURPOSE: Initializes system variables for themis. Can be called from idl_startup to set
custom locations.
The system variable !THEMIS is defined here. The elements of this structure are explained below:
!THEMIS.LOCAL_DATA_DIR This is the root location for all THEMIS data files.
The THEMIS software expects all data files to reside in specific subdirectories relative
to this root directory.;
!THEMIS.REMOTE_DATA_DIR This is the URL of the server that can provide the data files.
(default is: "http://sprg.ssl.berkeley.edu/data/themis/")
if the software does not find a needed file in LOCAL_DATA_DIR,
then it will attempt to download the data from the URL and REMOTE_DATA_DIR is defined,
the software will attempt to download the file from REMOTE_DATA_DIR, place it in LOCAL_DATA_DIR
with the same relative pathname, and then continue processing.
KEYWORDS:
RESET: Reset !themis to values in environment (or values in keywords).
LOCAL_DATA_DIR: use given value for local_data_dir, rather than environment. Only works on
initial call or reset.
REMOTE_DATA_DIR: Use given value for remote_data_dir, rather than env. Only works on inital
call or reset.
NO_COLOR_SETUP do not set colors if already taken care of
Typical examples:
Desktop UNIX/LINUX computer located at SSL
LOCAL_DATA_DIR = '/disks/data/themis/' ; This master directory is read only.
REMOTE_DATA_DIR = '' ; Should be empty sting. (/disks/data/themis and server are the same)
Desktop WINDOWS computer located at SSL
LOCAL_DATA_DIR = '\\justice\data\themis\' ; Justice is a samba server (physically the same as /disk/data/themis)
REMOTE_DATA_DIR = ''
laptop WINDOWS computer located far from a data server, but with internet connection.
LOCAL_DATA_DIR = 'C;\data\themis\' ; Local (portable) directory on laptop
REMOTE_DATA_DIR = 'http://sprg.ssl.berkeley.edu/data/themis/' ; URL used to download data to LOCAL_DATA_DIR
MacOS computer located away from SSL without a nearby data server
LOCAL_DATA_DIR = '/data/themis/' ; Local (portable) directory on laptop
REMOTE_DATA_DIR = 'http://sprg.ssl.berkeley.edu/data/themis/' ; URL used to download data to LOCAL_DATA_DIR
Note: If automatic downloads are used. (i.e. REMOTE_DATA_DIR is not an empty string) the user must ensure that
LOCAL_DATA_DIR is writeable.
Note to WINDOWS users: the WINDOWS version of IDL accepts both the '\' and '/' character as the directory
separation character. The converse is not true.
HISTORY
Written by Davin Larson
2006-12-16 KRB Can now be called from idl_startup to set paths using
optional keywords.
2007-07-02, jmm, Adds trailing slash to local and remote data dirs,
if not there
$LastChangedBy: kenb-mac $
$LastChangedDate: 2007-07-03 09:10:02 -0700 (Tue, 03 Jul 2007) $
$LastChangedRevision: 987 $
$URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/thmsoc/tags/tdas_2_00/idl/themis/common/thm_init.pro $
(See themis/common/thm_init.pro)
Procedure: THM_LOAD_PROC_ARG
Purpose: Generic argument validation routine for THEMIS Data File Loading
routines, meant to be called by
instrument-specific thm_load procedures.
keywords:
post_process_proc: name of procedure to call after cdf2tplot is called
will be called w/ keywords sname, dt (datatype), lvl,
and _extra.
relpath_funct: name of routine to call in place of file_dailynames
may simply be a wrapper.
will be called w/ keywords sname, dt (datatype), lvl,
and _extra.
cdf_to_tplot: user-supplied procedure to override cdf2tplot
sname = site or probe name. The default is 'all',
type_sname = string, set to 'probe' or 'site'
vsnames = space-separated list of valid probes/sites
datatype = The type of data to be loaded, for this case, there is only
one option, the default value of 'fgm', so this is a
placeholder should there be more that one data type. 'all'
can be passed in also, to get all variables.
vdatatypes = space-separated list of valid data types
file_vdatatypes = space-separated list of file types corresponding to each
valid data type. If there is a one-to-one correpspondence
between filetype and datatype, vfiletypes may be left undefined.
If all datatypes are in a single file, then vfiltypes may contain
a single name, rather than a list.
vL2datatypes= space-separated list of datatypes valid for L2 data
vL2coord= space-separated list of coordinates valid for L2 data
file_vL2datatypes=same as file_vdatatypes, but for L2 data. Defaults to
value of file_vdatatypes.
TRANGE= (Optional) Time range of interest (2 element array), if
this is not set, the default is to prompt the user. Note
that if the input time range is not a full day, a full
day's data is loaded
level = the level of the data, the default is 'l1', or level-1
data. A string (e.g., 'l2') or an integer can be used. 'all'
can be passed in also, to get all levels.
vlevels
CDF_DATA: named variable in which to return cdf data structure: only works
for a single spacecraft and datafile name.
VARNAMES: names of variables to load from cdf: default is all.
/GET_SUPPORT_DATA: load support_data variables as well as data variables
into tplot variables.
/DOWNLOADONLY: download file but don't read it.
/valid_names, if set, then this routine will return the valid probe, datatype
and/or level options in named variables supplied as
arguments to the corresponding keywords.
files named varible for output of pathnames of local files.
/VERBOSE set to output some useful info
Output Keywords:
oft distinct file types that need to be loaded. Array of strings.
ofdt datatypes corresponding to each file type in ofts. Array of
strings, each containing a space-separate list of datatypes .
odt validated datatypes
olvl validated levels.
Notes:
This routine is a utility function used to implement thm_load_??? routines.
$LastChangedBy: kenb-mac $
$LastChangedDate: 2007-07-20 13:28:09 -0700 (Fri, 20 Jul 2007) $
$LastChangedRevision: 1195 $
$URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/thmsoc/tags/tdas_2_00/idl/themis/common/thm_load_proc_arg.pro $
(See themis/common/thm_load_proc_arg.pro)
Procedure: THM_LOAD_XXX
Purpose: Generic THEMIS Data File Loading routine, meant to be called by
type specific thm_load procedures.
keywords:
post_process_proc: name of procedure to call after cdf2tplot is called
will be called w/ keywords sname, dt (datatype), lvl,
and _extra.
relpath_funct: name of routine to call in place of file_dailynames
may simply be a wrapper.
will be called w/ keywords sname, dt (datatype), lvl,
and _extra.
cdf_to_tplot: user-supplied procedure to override cdf2tplot
sname = site or probe name. The default is 'all',
type_sname = string, set to 'probe' or 'site'
/all_sites_in_one: set this if all sites are contained in a single file.
vsnames = space-separated list of valid probes/sites
datatype = The type of data to be loaded, for this case, there is only
one option, the default value of 'fgm', so this is a
placeholder should there be more that one data type. 'all'
can be passed in also, to get all variables.
vdatatypes = space-separated list of valid data types
file_vdatatypes = space-separated list of file types corresponding to each
valid data type. If there is a one-to-one correpspondence
between filetype and datatype, vfiletypes may be left undefined.
If all datatypes are in a single file, then vfiltypes may contain
a single name, rather than a list.
TRANGE= (Optional) Time range of interest (2 element array), if
this is not set, the default is to prompt the user. Note
that if the input time range is not a full day, a full
day's data is loaded
level = the level of the data, the default is 'l1', or Level 1
data. A string (e.g., 'l2') or an integer can be used.
vlevels=A space-separated list of valid levels, e.g. 'l1 l2'
vL2datatypes= space-separated list of datatypes valid for L2 data
vL2coord= space-separated list of coordinates valid for L2 data
file_vL2datatypes=same as file_vdatatypes, but for L2 data. Defaults to
value of file_vdatatypes.
coord = coordinate system of data to be loaded. For L2, may be an array or
space-separated list, which will checked against vL2coord.
For L1, no checking: passed on to post_process_proc.
CDF_DATA: named variable in which to return cdf data structure: only works
for a single spacecraft and datafile name.
VARNAMES: names of variables to load from cdf: default is all.
/GET_SUPPORT_DATA: load support_data variables as well as data variables
into tplot variables.
/DOWNLOADONLY: download file but don't read it.
/valid_names, if set, then this routine will return the valid probe, datatype
and/or level options in named variables supplied as
arguments to the corresponding keywords.
files named varible for output of pathnames of local files.
/VERBOSE set to output some useful info
suffix suffix to add to names of tplot variables loaded from CDF
Notes:
This routine is (should be) platform independent.
$LastChangedBy: jimm $
$LastChangedDate: 2007-07-20 13:04:44 -0700 (Fri, 20 Jul 2007) $
$LastChangedRevision: 1194 $
$URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/thmsoc/tags/tdas_2_00/idl/themis/common/thm_load_xxx.pro $
(See themis/common/thm_load_xxx.pro)
NAME:
thm_read_config
PURPOSE:
Reads the thm_config file
CALLING SEQUENCE:
cstruct = thm_read_config()
INPUT:
none, the filename is hardcoded, 'thm_config.txt',and is s put in a
folder given by the routine thm_config_filedir, that uses the IDL
routine app_user_dir to create/obtain it: my linux example:
/disks/ice/home/jimm/.idl/themis/thm_config-4-linux
OUTPUT:
cstruct = a structure with the changeable fields of the !themis
structure
HISTORY:
17-may-2007, jmm, jimm@ssl.berkeley.edu
2-jul-2007, jmm, 'Add trailing slash to data directories, if necessary
$LastChangedBy$
$LastChangedDate$
$LastChangedRevision$
$URL$
(See themis/common/thm_read_config.pro)
Function: THM_TPLOT_VAR Purpose: Creates TPLOT variable name from SC id and data qty strings. keywords: /VERBOSE or VERBOSE=n ; set to enable diagnostic message output. higher values of n produce more and lower-level diagnostic messages. /ALL Example: sc = 'a' name = 'eff' tplot_var = thm_tplot_var( sc, name) Notes: $LastChangedBy: kenb-mac $ $LastChangedDate: 2007-02-08 10:02:45 -0800 (Thu, 08 Feb 2007) $ $LastChangedRevision: 329 $ $URL $
(See themis/common/thm_tplot_var.pro)
NAME: thm_ui_call_cal_data PURPOSE: A wrapper for thm_ui_cal_data that handles history correctly CALLING SEQUENCE: thm_ui_cal_data, widget_id, instrument INPUT: widget_id = the state structure of the calling widget instrument = the type of data to calibrate, 'EFI','FBK','FIT', 'FGM', 'MOM' OUTPUT: None explicit HISTORY: 10-apr-2007, jmm, rewritten again... 29-may-2007, jmm, changed to a widget of its own for new version of thm_gui $LastChangedBy$ $LastChangedDate$ $LastChangedRevision$ $URL$
(See themis/common/thm_ui_call_cal_data.pro)
NAME:
thm_ui_call_tplot
PURPOSE:
A widget interface for calling tplot from the themis_w widget,
currently of limited usefulness, but expandable
CALLING SEQUENCE:
thm_ui_call_tplot, master_widget_id
INPUT:
master_widget_id = the id number of the widget that calls this
OUTPUT:
none, there are buttons to push for plotting, setting limits, not
sure what else yet...
HISTORY:
14-dec-2006, jmm, jimm@ssl.berkeley.edu
13-feb-2007, jmm, fixed problem with !p.background resetting in
set_plot commands
12-mar-2007, jmm, Added wavelet button
2-apr-2007, jmm, Added pwrspc options, NEEDS TESTING.
jun-2007, jmm, split from dproc widget.
12-jul-2007, jmm, added a message widget, for invalid user input
errors, grays out all buttons while processing
$LastChangedBy: kenb-mac $
$LastChangedDate: 2007-01-26 15:52:34 -0800 (Fri, 26 Jan 2007) $
$LastChangedRevision: 241 $
$URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/thmsoc/trunk/idl/themis/common/thm_ui_call_tplot.pro $
(See themis/common/thm_ui_call_tplot.pro)
NAME:
thm_ui_check4spin
PURPOSE:
given a THEMIS tplot variable name, check to see if spin period and
phase exist, for coordinate transformations, If they do not, load
the state data for the appropriate time period
CALLING SEQUENCE:
thm_ui_check4spin, vname, vname_spin1, vname_spin2, history_out
INPUT:
vname = tplot variable name
OUTPUT:
vname_spin1 = the tplot variable containing the spin period. or
spinras
vname_spin2 = the tplot variable containing the spin phase or
spindec
history_out = a history string, if data needs loading
KEYWORDS:
rasdec = if set, return the variables for spinras, and spindec used
for dsl <-> gse tranformations
HISTORY:
26-feb-2007, jmm, jimm@ssl.berkeley.edu
$LastChangedBy$
$LastChangedDate$
$LastChangedRevision$
$URL$
(See themis/common/thm_ui_check4spin.pro)
NAME:
thm_ui_choose_dtype
PURPOSE:
A widget for choosing data for the THEMIS data analysis GUI
CALLING SEQUENCE:
thm_ui_choose_dtype, instr, dtyp, station, astation, probe
INPUT:
instr = the instrument, one of ['asi', 'ask', 'esa_pkt', $
'efi', 'fbk', 'fft', 'fgm', $
'fit', 'gmag', 'mom', 'scm', 'sst', 'state']
OUTPUT:
dtyp = the output datatype, a string of instr/datatype/datalevel,
e.g., 'state/spinras/l1'
station = the ground station(s) if gmag data was chosen
astation = the ground station(s) if asi data was chosen
probe = the spacecraft if spacecraft data was chosen
HISTORY:
jmm, jimm@ssl.berkeley.edu 1-may-2007
jmm, Changed the probe list to reflect probe assigments:
A (P5), B (P1), C (P2), D (P3) and E (P4)
14-jun-2007
jmm, correctly handles level 1 and level 2 datatypes, 11-jul-2007
jmm, really correctly handles level 1 and 2 data types, by using a
common block to handle them
$LastChangedBy$
$LastChangedDate$
$LastChangedRevision$
$URL$
(See themis/common/thm_ui_choose_dtype.pro)
NAME: thm_ui_config PURPOSE: A widget that allows the user to set some of the fields in the !themis system variable: Also allows the user to set the themis configuration text file, and save it HISTORY: 17-may-2007, jmm, jimm@ssl.berkeley.edu 2-jul-2007, jmm, 'Add trailing slash to data directories, if necessary $LastChangedBy$ $LastChangedDate$ $LastChangedRevision$ $URL$
(See themis/common/thm_ui_config.pro)
NAME:
thm_ui_cotrans
PURPOSE:
Widget for coordinate transforms
CALLING SEQUENCE:
thm_ui_cotrans, gui_id
INPUT:
gui_id = the widget id of the thm_gui widget that called this one.
OUTPUT:
none explicit, new variables are created
HISTORY:
26-feb-2007, jmm, jimm@ssl.berkeley.edu
10-apr-2007, jmm, changed input from state to the variable names
31-may-2007, jmm, rewrite to become its own widget, and to call
thm_cotrans, rather than cotrans directly
12-jul-2007, jmm, added a message widget, for invalid user input errors
$LastChangedBy$
$LastChangedDate$
$LastChangedRevision$
$URL$
(See themis/common/thm_ui_cotrans.pro)
NAME:
thm_ui_dproc
PURPOSE:
A widget interface for calling tplot from the themis_w widget,
currently of limited usefulness, but expandable
CALLING SEQUENCE:
thm_ui_dproc, master_widget_id
INPUT:
master_widget_id = the id number of the widget that calls this
OUTPUT:
none, there are buttons to push for plotting, setting limits, not
sure what else yet...
HISTORY:
14-dec-2006, jmm, jimm@ssl.berkeley.edu
13-feb-2007, jmm, fixed problem with !p.background resetting in
set_plot commands
12-mar-2007, jmm, Added wavelet button
2-apr-2007, jmm, Added pwrspc options, NEEDS TESTING.
5-jun-2007, jmm, rewritten
12-jul-2007, jmm, added a message widget, for invalid user input
errors, grays out all buttons while processing
$LastChangedBy: kenb-mac $
$LastChangedDate: 2007-01-26 15:52:34 -0800 (Fri, 26 Jan 2007) $
$LastChangedRevision: 241 $
$URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/thmsoc/trunk/idl/themis/common/thm_ui_dproc.pro $
(See themis/common/thm_ui_dproc.pro)
NAME: thm_ui_error PURPOSE: A widget to display, edit and save the file 'thm_gui_error.txt' error $LastChangedBy$ $LastChangedDate$ $LastChangedRevision$ $URL$
(See themis/common/thm_ui_error.pro)
NAME: thm_ui_help PURPOSE: A widget to display the file 'thm_gui.txt' help $LastChangedBy$ $LastChangedDate$ $LastChangedRevision$ $URL$
(See themis/common/thm_ui_help.pro)
NAME:
thm_ui_load_data_fn
PURPOSE:
A widget interface to load CDF data for whatever instrument
CALLING SEQUENCE:
varnames = thm_ui_load_data_fn(st_time, en_time, $
dtype = dtype, $
station = station, $
astation = astation, $
probe = probe)
INPUT:
st_time, en_time = start and end times in seconds from
1-jan-1970 0:00
KEYWORDS:
dtype, the type of data, a string, of form
'instrument/datatype/datalevel', the default is 'gmag/mag/l2'
station, the ground station of the gmag data, default is '*', for all
astation, the ground station of the asi data, default is '*', for all
probe = one or more of ['a','b','c','d','e'], default is ['a','b','c','d','e']
OUTPUT:
varnames = an array of tplot variable names, to pass into tplot
HISTORY:
22-sep-2006, jmm, jimm@ssl.berkeley.edu
23-oct-2006, jmm, changed to call cdf2tplot
30-oct-2006, jmm, changed again, to call load_thg_mag, also added
dtype and station as inputs
13-nov-2006, jmm, changed the argument list, now the output is a
data id string, added a check for start time > end
time
08-dec-2006, krb, changed load_thg_mag to thm_load_gmag
13-dec-2006, jmm, Added call to cdf2tplot for data for which there
is no load program...
14-dec-2006, jmm, returns an array of variable names and
subscripts, which should be easier to read..
15-dec-2006, jmm, Added calls to thm_load_fgm, fit, sst, efi,
ask,probe can be an array
16-jan-2007, jmm, Add all of the thm_load routines
5-feb-2007, jmm, update calls to load routines
10-apr-2007, jmm, removed history tracking, which is now handled in
thm_gui_event, also changed dtype, station
astation and probe to keywords
1-may-2007, jmm, New version, new argument list,etc....
10-may-2007, jmm, New version, new argument list,etc... that last
one lasted a long time, didn't it
30-jul-2007, jmm, allow for string time input, this is needed to
run histories.
$LastChangedBy$
$LastChangedDate$
$LastChangedRevision$
$URL$
(See themis/common/thm_ui_load_data_fn.pro)
This program creates a string for the history array when multiple datatypes, spacecraft or stations are chosen, for use in the themis_w_event routine $LastChangedBy: kenb-mac $ $LastChangedDate: 2007-01-26 15:52:34 -0800 (Fri, 26 Jan 2007) $ $LastChangedRevision: 241 $ $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/thmsoc/trunk/idl/themis/common/thm_ui_multichoice_history.pro $
(See themis/common/thm_ui_multichoice_history.pro)
NAME:
thm_ui_npar
PURPOSE:
Simple widget that asks for n parameter
CALLING SEQUENCE:
new_value = thm_ui_npar(name, init_value)
INPUT:
name = the name of the parameter, can be an array
init_value = the initial value of the parameter, e.g., '1.0', must
be a string array of the smae size as name
OUTPUT:
new_value = the output value of the parameter, a string, e.g., '4.67'
HISTORY:
5-feb-2007, jmm, jimm@ssl.berkeley.edu
$LastChangedBy$
$LastChangedDate$
$LastChangedRevision$
$URL$
(See themis/common/thm_ui_npar.pro)
NAME: thm_ui_only_trange PURPOSE: This program oprerates on the tplot data_quants to strip out data the is not in the input time range: start time, end time, and the subscripts of the appropriate data_quants structures are used, this is designed to be used in thm_ui_load_data_fn only... jmm, 13-nov-2006 INPUT: st_time, en_time = time in seconds from 1-jan-1970 0:00 data_ss = the subscripts of the data array to on which to operate OUTPUT: None explicit, the tplot variables are changed HISTORY: jmm, 13-nov-2006, jimm@ssl.berkeley.edu jmm, 13-dec-2006, made to work for non thg_mag data $LastChangedBy: kenb-mac $ $LastChangedDate: 2007-01-26 15:52:34 -0800 (Fri, 26 Jan 2007) $ $LastChangedRevision: 241 $ $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/thmsoc/trunk/idl/themis/common/thm_ui_only_trange.pro $
(See themis/common/thm_ui_only_trange.pro)
NAME:
thm_ui_par
PURPOSE:
Simple widget that asks for a parameter
CALLING SEQUENCE:
new_value = thm_ui_par(name, init_value)
INPUT:
name = the name of the parameter, e.g., 'time_resolution'
init_value = the initial value of the parameter, e.g., '1.0', must
be a string.
OUTPUT:
new_value = the output value of the parameter, a string, e.g., '4.67'
HISTORY:
22-jan-2007, jmm, jimm@ssl.berkeley.edu
$LastChangedBy: kenb-mac $
$LastChangedDate: 2007-01-26 15:52:34 -0800 (Fri, 26 Jan 2007) $
$LastChangedRevision: 241 $
$URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/thmsoc/trunk/idl/themis/common/thm_ui_par.pro $
(See themis/common/thm_ui_par.pro)
NAME:
thm_ui_progobj__define
PURPOSE:
defines an object to pass through into file_retrieve and
file_http_copy that allows updates to the thm_gui progress widget
METHODS DEFINED IN THIS CLASS:
set = sets the parameter (only one, the gui widget id)
get = returns the parameter
update = if called, this updates the thm_gui progress widget, with
the input text
checkcancel = Currently does nothing, but will eventually allow the
user to cancel a download.
HISTORY:
15-may-2007, jmm, jimm@ssl.berkeley.edu
24-jul-2007, jmm, activated checkcancel, to see if it can do anything...
$LastChangedBy$
$LastChangedDate$
$LastChangedRevision$
$URL$
(See themis/common/thm_ui_progobj__define.pro)
This puts the input data structure into the tplot common block as the data_quants structure, and undefines all of the other variables in the common block, using temporary, the original common block is saved in a different common block. This is needed to call the stackmagplot routine on a subset of stations 13-nov-2006, jmm, jimm@ssl.berkeley.edu $LastChangedBy: kenb-mac $ $LastChangedDate: 2007-01-26 15:52:34 -0800 (Fri, 26 Jan 2007) $ $LastChangedRevision: 241 $ $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/thmsoc/trunk/idl/themis/common/thm_ui_reset_common_block.pro $
(See themis/common/thm_ui_reset_common_block.pro)
NAME: thm_ui_sclist PURPOSE: creates an array for the different themis spacecraft, to be used in a list widget CALLING SEQUENCE: sclist = thm_ui_sclist() INPUT: none OUTPUT: sclist = ['THA', 'THB', 'THC', 'THD', 'THE'] $LastChangedBy: kenb-mac $ $LastChangedDate: 2007-01-26 15:52:34 -0800 (Fri, 26 Jan 2007) $ $LastChangedRevision: 241 $ $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/thmsoc/trunk/idl/themis/common/thm_ui_sclist.pro $
(See themis/common/thm_ui_sclist.pro)
NAME:
thm_ui_set_active_dset
PURPOSE:
sets active datasets in themis GUI to given tplot varnames, used in
the call_tplot widget.
CALLING SEQUENCE:
ss = thm_ui_set_active_dset(gui_id, active_names)
INPUT:
gui_id = the widget id for the master widget
active_names = the tplot variable names
HISTORY:
22-jan-2007, jmm, jimm@ssl.berkeley.edu
27-feb-2007, jmm, removed call to set_state_ptrs routine
10-may-2007, jmm, changed argument list, to use the GUI_ID and not
the state structure
$LastChangedBy: kenb-mac $
$LastChangedDate: 2007-01-26 15:52:34 -0800 (Fri, 26 Jan 2007) $
$LastChangedRevision: 241 $
$URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/thmsoc/trunk/idl/themis/common/thm_ui_set_active_dset.pro $
(See themis/common/thm_ui_set_active_dset.pro)
NAME: thm_ui_set_data_id PURPOSE: This program sets the data_id values of the pointer in the thm_gui state structure, given the tplot common block: INPUT: state_or_id = thm_gui state structure, or gui_id HISTORY: 26-feb-2007, jmm, jimm@ssl.berkeley.edu 10-may-2007, jmm, allow for input of the gui_id instead of the state $LastChangedBy:$ $LastChangedDate:$ $LastChangedRevision:$ $URL:$
(See themis/common/thm_ui_set_data_id.pro)
NAME: thm_ui_set_trange PURPOSE: A widget interface for setting time ranges for the thm_gui widget CALLING SEQUENCE: thm_ui_set_trange, master_widget_id INPUT: master_widget_id = the id number of the widget that calls this OUTPUT: none, the start and end time are set HISTORY: 9-may-2007, jmm, jimm@ssl.berkeley.edu 12-jul-2007, jmm, Removed ability to type in time values.. 19-jul-2007, jmm, typed time values are back.. $LastChangedBy:$ $LastChangedDate:$ $LastChangedRevision:$ $URL:$
(See themis/common/thm_ui_set_trange.pro)
NAME: thm_ui_summplot PURPOSE: This widget prompts the user for a choice of probe, and then Calls the thm_ui_temp_overplot routine, This should be superceded HISTORY: 21-jun-2007, jmm, jimm@ssl.berkeley.edu $LastChangedBy$ $LastChangedDate$ $LastChangedRevision$ $URL$
(See themis/common/thm_ui_summplot.pro)
NAME: thm_ui_timefix PURPOSE: Will fix an input time string of yyyy-mm-dd hh:mm:ss.xxxx if there is only 1 digit in the day or hour or second, etc. Will also return an error message, if the months, days, hours, seconds are not valid $LastChangedBy$ $LastChangedDate$ $LastChangedRevision$ $URL$ unction thm_ui_timefix, time_in, progobj = progobj, _extra = _extra
(See themis/common/thm_ui_timefix.pro)
NAME: thm_ui_tselect PURPOSE: A list widget for time selection, this is a blocking widget, it must be exited for anything to happen CALLING SEQUENCE: thm_ui_teslect INPUT: none OUTPUT: the selected time is held in the common block saved_time_sel HISTORY: sep-2006, jmm, jimm@ssl.berkeley.edu $LastChangedBy: kenb-mac $ $LastChangedDate: 2007-01-26 15:52:34 -0800 (Fri, 26 Jan 2007) $ $LastChangedRevision: 241 $ $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/thmsoc/trunk/idl/themis/common/thm_ui_tselect.pro $
(See themis/common/thm_ui_tselect.pro)
Calls the thm_tselect widget, returns the value.. 16-jul-2007, jmm added the init_time input $LastChangedBy: kenb-mac $ $LastChangedDate: 2007-01-26 15:52:34 -0800 (Fri, 26 Jan 2007) $ $LastChangedRevision: 241 $ $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/thmsoc/trunk/idl/themis/common/thm_ui_tselect_fn.pro $
(See themis/common/thm_ui_tselect_fn.pro)
NAME: thm_ui_update_data_all PURPOSE: Calls thm_ui_set_data_idm thm_ui_set_active_dset and thm_ui_update_data_display in one procedure, CALLING SEQUENCE: thm_ui_update_data_all, gui_id, active_vnames INPUT: gui_id = a widget id for the gui OUTPUT: none HISTORY: 5-jun-2007, jmm, jimm@ssl.berkeley.edu $LastChangedBy$ $LastChangedDate$ $LastChangedRevision$ $URL$
(See themis/common/thm_ui_update_data_all.pro)
NAME: thm_ui_update_data_display PURPOSE: update the loaded-data display for the themis_w widget CALLIMG SEQUENCE: thm_ui_update_data_display, widget_id INPUT: widget_id = the id number of the widget HISTORY: dec-2006, jmm jimm@ssl.berkeley.edu 18-jun-2007, jmm, changed to access 'active data' widget 16-jul-2007, jmm, changed to add coordinate system to display $LastChangedBy: kenb-mac $ $LastChangedDate: 2007-01-26 15:52:34 -0800 (Fri, 26 Jan 2007) $ $LastChangedRevision: 241 $ $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/thmsoc/trunk/idl/themis/common/thm_ui_update_data_display.pro $
(See themis/common/thm_ui_update_data_display.pro)
NAME:
thm_ui_update_history
PURPOSE:
Adds the string input to the state structure history array
INPUT:
string = a string to add to the history array. Note that this is
returned undefined, if it is passed in by reference, i/e/, if it's a
named variable.
OUTPUT:
state.history is updated
HISTORY:
sep-2006, jmm, jimm@ssl.berkeley.edu
26-feb-2007, jmm, fixed problem with multiple lines when choosing
multiple probes, datatypes, sataiotns, etc...
8-may-2007, jmm, changed so that the thm_gui widget id is now passed
in, since the history widget is now on the main
widget, removed some error checking, if things are
undefined in here i want to know
$LastChangedBy: kenb-mac $
$LastChangedDate: 2007-01-26 15:52:34 -0800 (Fri, 26 Jan 2007) $
$LastChangedRevision: 241 $
$URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/thmsoc/trunk/idl/themis/common/thm_ui_update_history.pro $
(See themis/common/thm_ui_update_history.pro)
NAME: thm_ui_update_progress PURPOSE: Write a string into the progress widget for the THEMIS GUI CALLING SEQUENCE: thm_ui_update_progress, gui_id, input_string INPUT: gui_id = the widget_id for the GUI input_string = a 1 line string to be displayed OUTPUT: None HISTORY: jmm, 9-may-2007, jimm@ssl.berkeley.edu $LastChangedBy$ $LastChangedDate$ $LastChangedRevision$ $URL$
(See themis/common/thm_ui_update_progress.pro)
NAME: thm_ui_userdef PURPOSE: A widget that allows the user to define his own operator to be used on the data from a tplot variable, e.g., the user types in the string '2.0*!pi*q', and a temporary function is created which takes the data and does this multiplication. This is pretty experimental. CALLING SEQUENCE: thm_ui_userdef, gui_id INPUT: gui_id = the id of the main gui widget OUTPUT: none explicit, hopefully new tplot variables are created HISTORY: 7-jun-2007, jmm, jimm@ssl.berkeley.edu $LastChangedBy$ $LastChangedDate$ $LastChangedRevision$ $URL$
(See themis/common/thm_ui_userdef.pro)
NAME:
thm_ui_valid_dtype
PURPOSE:
get valid datatype names from thm_load_* routines, using the
valid_names keyword and returns a list of data types that can be
loaded for each instrument.
CALLING SEQUENCE:
datalist = thm_ui_valid_dtype(instrument)
INPUT:
none
OUTPUT:
datalist = a list of the datatypes that can be loaded
instrument = the instrument responsible for this datatype, note that
if there is no way to get at the valid_names from the thm_load
procedure for a given instrument, then the instrument = the
datatype.
llist = the level of the data, some have 'l1', some have 'l2' some
have one for each
HISTORY:
16-jan-2007, jmm, jimm@ssl.berkeley.edu
29-jan-2007, jmm, various changes, now station isn't returned, gmag
and asi output are hard-wired, other changes will ensue when load
routines are standardized.
4-feb-2007, jmm, Rewritten back to the old hard-wired version....
5-jul-2007, jmm, Added level information
$LastChangedBy: kenb-mac $
$LastChangedDate: 2007-01-26 15:52:34 -0800 (Fri, 26 Jan 2007) $
$LastChangedRevision: 241 $
$URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/thmsoc/trunk/idl/themis/common/thm_ui_valid_dtype.pro $
(See themis/common/thm_ui_valid_dtype.pro)
NAME:
thm_ui_wavelet
PURPOSE:
wavelet transform of the input tplot variables, fist calls split_vec
to split up any multi-component vectors.
CALLING SEQUENCE:
thm_ui_wavelet, vnames, new_names, polar=polar,_extra=_extra
INPUT:
vnames = the tplot variable names to transform
OUTPUT:
new_names = new variable names generated by the process
KEYWORDS:
polar = if set, passes the /polar keyword into the split_vec
procedure, new variable names for 3-d data will be polar,
and not '_x','_y','_z'
HISTORY:
12-mar-2007, jmm, jimm@ssl.berkeley.edu
5-jun-2007, jmm, no longer handles history
$LastChangedBy$
$LastChangedDate$
$LastChangedRevision$
$URL$
(See themis/common/thm_ui_wavelet.pro)
function thm_valid_input
purpose:
for thm_load routines to validate the input keyword and set it to a standard
format ('l1', 'l2', etc.).
parameters:
input: keyword input to be validated from thm_load routine: array or scalar
label: name of input keyword that is being validated
keywords:
vinputs: a space-separated string, like 'l1 l2'
definput: a string like 'l2'. Required.
include_all: if set will accept multiple values on input, and include 'all'
as a valid input. 'all' is equivalent to '*'
verbose: to maintain control of verbosity
format: format to use to convert numerical input to string. Numerical input
disallowed if absent. examples: "('l',I1)" or "('v', I02)"
return value:
a scalar string, e.g. 'l1'
if /include_all: an array of strings
on error: empty string: ''
example:
lvl = thm_valid_input(level,'Level',vinputs='l1 l2',definput='l1',$
foramt="('l', I1)", verbose=verbose)
if lvl eq '' then return
(See themis/common/thm_valid_input.pro)
function thm_valid_level
purpose:
for thm_load routines to validate the level keyword and set it to a standard
format ('l1', 'l2', etc.). Only a single level is allowed.
keywords:
level: level keyword input from thm_load routine
vlevels: a space-separated string, like 'l1 l2'
deflevel: a string like 'l2'. defaults to 'l1'
example:
lvl = thm_valid_level('l1','l1 l2','l1')
(See themis/common/thm_valid_level.pro)
NAME:
thm_write_config
PURPOSE:
Writes the thm_config file
CALLING SEQUENCE:
thm_write_config, copy=copy
INPUT:
none, the filename is hardcoded, 'thm_config.txt',and is s put in a
folder given by the routine thm_config_filedir, that uses the IDL
routine app_user_dir to create/obtain it: my linux example:
/disks/ice/home/jimm/.idl/themis/thm_config-4-linux
OUTPUT:
the file is written, and a copy of any old file is generated
KEYWORD:
copy = if set, the file is read in and a copy with the !stime
appended is written out
HISTORY:
17-may-2007, jmm, jimm@ssl.berkeley.edu
$LastChangedBy$
$LastChangedDate$
$LastChangedRevision$
$URL$
(See themis/common/thm_write_config.pro)
NAME:
tpwrspc
PURPOSE:
wapper for pwrspc.pro for calling from GUI, a split_vec is performed
on the data if necessary
CALLING SEQUENCE:
thm_ui_pwrspc, varnames, new_names, trange, history_ext, $
polar = polar, dynamic = dynamic, _extra = _extra
INPUT:
varnames = an array (or scalar) of tplot variable names
Output
new_names = the variable names of any new variables
HISTORY:
28-mar-2007, jmm, jimm.ssl.berkeley.edu
2-apr-2007, jmm, added the /dynamic keyword
5-jun-2007, jmm, no longer handles history
$LastChangedBy$
$LastChangedDate$
$LastChangedRevision$
$URL$
(See themis/common/thm_ui_pwrspc.pro)
NAME: yesno_widget_fn PURPOSE: Simple widget that asks for a yes or no CALLING SEQUENCE: yn=yesno_widget_fn(title, list = list, _extra = _extra) INPUT: title = a title, or a question OUTPUT: yn = 0 for no, 1 for yes KEYWORDS: list, a string array to put in the widget, as an aid HISTORY: 27-nov-2006, jmm, jimm@ssl.berkeley.edu $LastChangedBy: kenb-mac $ $LastChangedDate: 2007-01-26 15:52:34 -0800 (Fri, 26 Jan 2007) $ $LastChangedRevision: 241 $ $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/thmsoc/trunk/idl/themis/common/yesno_widget_fn.pro $
(See themis/common/yesno_widget_fn.pro)