This page was created by the IDL library routine mk_html_help2.

Last modified: Wed May 14 01:32:11 2008.


Directory Listing of Routines


Routine Descriptions

THM_CAL_EFI

[Next Routine] [List of Routines]
the spectral matrix and the Z direction
		of the input
		ac field data. For magnetic field data in
		field aligned coordinates this is the
		wavenormal angle assuming a plane wave.

         Ellipticity:The ratio (minor axis)/(major axis) of the
		ellipse transcribed by the field variations of the
		components transverse to the Z direction. The sign
		indicates the direction of rotation of the field vector in
  		the plane. Negative signs refer to left-handed
		rotation about the Z direction. In the field
		aligned coordinate system these signs refer to
		plasma waves of left and right handed
		polarisation.

         Helicity:Similar to Ellipticity except defined in terms of the
	direction of minimum variance instead of Z. Stricltly the Helicity

(See themis/spacecraft/fields/thm_cal_efi.pro)


THM_CAL_FBK

[Previous Routine] [Next Routine] [List of Routines]
o
		plasma waves of left and right handed
		polarisation.

         Helicity:Similar to Ellipticity except defined in terms of the
	direction of minimum variance instead of Z. Stricltly the Helicity
	is defined in terms of the wavenormal direction or k.
	However since from single point observations the
	sense of k cannot be determined,  helicity here is
	simply the ratio of the minor to major axis transverse to the
       minimum variance direction without sign.


Written by : Kaori(I'll remember to get her last name soon)


 $LastChangedBy: pcruce $
 $LastChangedDate: 2007-12-06 14:56:54 -0800 (Thu, 06 Dec 2007) $
 $LastChangedRevision: 2161 $
 $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/ssl_general/trunk/misc/tplotxy.pro $
 NAME:
       thm_fgm_fit_correlate_tplot.pro

 Purpose:
       Uses thm_correlation_shift.pro to do a correlation shift
       analysis on the vector lengths(math not cs vectors) of a
       selected fgm mnemonic and fit data


(See themis/spacecraft/fields/thm_cal_fbk.pro)


THM_CAL_FFT

[Previous Routine] [Next Routine] [List of Routines]
d

       store_name: the name of a tplot variable in which to store the result
     
       correlation_floor: optional, if set filters all results where
       the correlation between functions is too poor(default:0.0)

       point_number: optional, the minimum number of points of
       overlap necessary to try correlating a bin(default:10)

       lag_step_number: optional, checks plus or minus lag_steps * time steps
       to correlate the vectors (default:5)

       time_step_size: optional, the size of the time step to use when
       interpolating and correlating the vectors, in
       seconds(default:1/8 seconds)

       bin_size: optional, the size of each bin in seconds
       (default:60 seconds)
       

 OUTPUTS:
       
       stores the time and the shift values in the selected tplot_var

 KEYWORDS:

 COMMENTS: This function will probably die horribly if time
  values are not monotonic.


 PROCEDURE:

(See themis/spacecraft/fields/thm_cal_fft.pro)


THM_CAL_FGM

[Previous Routine] [Next Routine] [List of Routines]
d
    gif_out    create a gif-file
    verbose    print some diagnostics
    pgm_file   do not read CDF, but pgm-files
    zbuffer    do in z-buffer, not on the screen
    thumb      use thumbnails instead of full resolution images
    exclude    string of station names that should not be plotted
    show       string of station names that should only be plotted
    top        top color to be used for polyfill
    special    special treatment for not mapped thumbnail
    scale               scale for map set
    central_lon         geographic longitude of center of plot
    central_lat         geographic latitude of center of plot
    xsize               xsize of window
    ysize               ysize of window
    color_continent     shade of continent fill
    color_background    shade of background
    position=position   position of plot on window (normal coordinates)
    noerase=noerase     do not erase current window (no effect if {x,y}size set
    cursor     finish with cursor info
    projection projection for map set, MAP_PROJ_INFO, PROJ_NAMES=names
    window     set window number
    rotation	rotate map

 OUTPUTS:
    None

 OPTIONAL OUTPUTS:
    None

 COMMON BLOCKS:
    None

 SIDE EFFECTS:
    None

 RESTRICTIONS:
    None

 EXAMPLE:
    THM_ASI_CREATE_MOSAIC,'2006-01-01/05:00:00'
    THM_ASI_CREATE_MOSAIC,'2007-03-01/04:00:00',/thumb,exclude='ekat'
 

 MODIFICATION HISTORY:
    Written by: Harald Frey, 02/06/2007
                based on example from Donovan/Jackel
                2007-03-15, hfrey, thumbnails, keyword exclude
                2007-03-27, hfrey, special treatment for not mapped
                thumbsnails
                2007-12-21, jmm, added explicit set_plot,'z' for zbuffer
 NOTES:

(See themis/spacecraft/fields/thm_cal_fgm.pro)


THM_CAL_FIT

[Previous Routine] [Next Routine] [List of Routines]
 labels	Names of GBO stations
    location	Geographic location of stations

 OPTIONAL OUTPUTS:
    None

 COMMON BLOCKS:
    None

 SIDE EFFECTS:
    None

 RESTRICTIONS:
    None

 EXAMPLE:
 

 MODIFICATION HISTORY:
    Written by: Harald Frey

(See themis/spacecraft/fields/thm_cal_fit.pro)


THM_CAL_SCM

[Previous Routine] [Next Routine] [List of Routines]
ey.edu/repos/thmsoc/trunk/idl/themis/ground/thm_asi_stations.pro $
     
 NAME:
       thm_gmag_stackplot.pro

 PURPOSE:
       To create 3 PNG files displaying the H,D and Z components of the magnetic field
	from multiple GBO stations out of GMAG data that is stored in CDF file.

 CALLING SEQUENCE:
       thm_gmag_stackplot, date, duration, stack_shift=stack_shift, no_expose=no_expose, make_png=make_png

 INPUTS:
       date: The start of the time interval to be plotted. (Format: 'YYYY-MM-DD/hh:mm:ss')
	duration: The length of the interval being plotted. (Floating point number of days -> 12hr=0.5), default=1
	stack_shift: Space between stations on the y-axis (units are nanotesla), default=50
	no_expose: Set this keyword to prevent the plot from being printed to the screen.
	make_png: Set this keyword to make the 3 PNG files.
	max_deviation:  Large spikes in the data (probably gliches) can screw up the y-axis scales.  This keyword allows
		you to set the maximum deviation the data can go from the median; points that exceed this value are omitted.
		The default value is plus or minus 1500 nT
	no_data_load:  This keyword prevents new data from being loaded; the routine will try to plot existing data if it exists.
	hi_lat:  Set this keyword to plot high latitude stations (above 49 degrees)
	lo_lat:  Set this keyword to plot low latitude stations (below 49 below)

 OUTPUTS:
       None, but it creates 3 PNG files in the directory that IDL is being run.

 PROCEDURE:
       Read in data from CDF files; plot the data using tplot.pro routines;
       make PNG files with makegif.pro routine

 EXAMPLE:
       thm_gmag_stackplot, '2006-11-11',1,/make_png, max_deviation=1500, stack_shift=200.

 MODIFICATION HISTORY:
       Written by:       Matt Davis
       October 23, 2006     Initial version
       Added dydt_spike_test, 7-apr-2008, jmm, jimm@ssl.berkeley.edu

NOTE: This program is still in development.  Features to be added:
	-generalizing the routine

 NAME:
    THM_LOAD_ASI_CAL

 SYNTAX:
    thm_load_asi_cal,'fykn',fykn_cal

 PURPOSE:
   load the ASI calibration parameters into tplot variables

 INPUTS:
   SITE	names of GBO stations requested

 OUTPUTS:
   CAL_STRUC   structure containing pointers to calibration parameters

 KEYWORDS:
   TRANGE= (Optional) Time range of interest  (2 element array).
   /VERBOSE : set to output some useful info
   /ALL	get data from all 20 THEMIS-GBO
   /DOWNLOADONLY   
   /VALID_NAMES
   /CURSOR	get time range with cursor

 HISTORY:
   adapted from thm_load_asi

Notes:

 To get an array of valid names make the following call;
   thm_load_asi_cal,valid_names=vn
 No further action will be taken.

Written by: Harald Frey,   Jan 26 2007
   $LastChangedBy: hfrey $
   $LastChangedDate: 2008-03-17 18:15:11 -0700 (Mon, 17 Mar 2008) $
   $LastChangedRevision: 2499 $
   $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/thmsoc/trunk/idl/themis/ground/thm_load_asi_cal.pro $
Procedure: THM_LOAD_ASI

(See themis/spacecraft/fields/thm_cal_scm.pro)


THM_COLLATE_INTERVALS

[Previous Routine] [Next Routine] [List of Routines]
.
          If present, no files will be downloaded, and no data will be loaded.
  /valid_names, if set, then this will return the valid site, datatype
                and/or level options in named variables, for example,

                thm_load_gmag, site = xxx, /valid_names

                will return the array of valid sites in the
                variable xxx
   /CURSOR	get time range with cursor
   /TIME       specify just one time (record) for data

Example:
   thm_load_asi,'fykn',time='2006-01-01/04:29:53'

(See themis/spacecraft/fields/thm_collate_intervals.pro)


THM_COMP_EAC_RESPONSE

[Previous Routine] [Next Routine] [List of Routines]
ction will be taken.


Written by: Ken Bromund ????,   Jan 5 2007
 $LastChangedBy: hfrey $
 $LastChangedDate: 2008-03-17 18:15:11 -0700 (Mon, 17 Mar 2008) $
 $LastChangedRevision: 2499 $
 $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/thmsoc/trunk/idl/themis/ground/thm_load_asi.pro $
Procedure: THM_LOAD_ASK

Purpose:  Loads THEMIS All Sky Keograms

keywords:
  site  = Observatory name, example, thm_load_gmag, site = 'fykn', the
          default is 'all', i.e., load all available stations . This
          can be an array of strings, e.g., ['fykn', 'gako'] or a
          single string delimited by spaces, e.g., 'fykn gako'
  datatype = request 'ast' or 'asf', default is 'asf', can also be 'all'.
  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

(See themis/spacecraft/fields/thm_comp_eac_response.pro)


THM_COMP_EFI_RESPONSE

[Previous Routine] [Next Routine] [List of Routines]
y of strings, e.g., ['fykn', 'gako'] or a
          single string delimited by spaces, e.g., 'fykn gako'
  datatype = request 'ast' or 'asf', default is 'asf', can also be 'all'.
  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 'l2', or level-2
          data. A string (e.g., 'l2') or an integer can be used. 'all'
          can be passed in also, to get all levels.
  /VERBOSE : set to output some useful info
  /downloadonly, if set, then only download the data, do not load it
                 into variables.
  /no_download: use only files which are online locally.
  relpathnames_all: named variable in which to return all files that are
          required for specified timespan, probe, datatype, and level.
          If present, no files will be downloaded, and no data will be loaded.
  /valid_names, if set, then this will return the valid site, datatype
                and/or level options in named variables, for example,

                thm_load_gmag, site = xxx, /valid_names

(See themis/spacecraft/fields/thm_comp_efi_response.pro)


THM_COMP_SCM_RESPONSE

[Previous Routine] [Next Routine] [List of Routines]
e passed in also, to get all levels.
  /VERBOSE : set to output some useful info
  /downloadonly, if set, then only download the data, do not load it
                 into variables.
  /no_download: use only files which are online locally.
  relpathnames_all: named variable in which to return all files that are
          required for specified timespan, probe, datatype, and level.
          If present, no files will be downloaded, and no data will be loaded.
  /valid_names, if set, then this will return the valid site, datatype
                and/or level options in named variables, for example,

                thm_load_gmag, site = xxx, /valid_names

                will return the array of valid sites in the
                variable xxx
  get_support_data = does nothing.  present only for consistency with other
                load routines
Example:
   thg_load_ask
Notes:
  This routine is (should be) platform independent.

(See themis/spacecraft/fields/thm_comp_scm_response.pro)


THM_FBK_DECOMPRESS

[Previous Routine] [Next Routine] [List of Routines]
             and/or level options in named variables, for example,

                thm_load_gmag, site = xxx, /valid_names

                will return the array of valid sites in the
                variable xxx
  get_support_data = does nothing.  present only for consistency with other
                load routines
Example:
   thg_load_ask
Notes:
  This routine is (should be) platform independent.


 $LastChangedBy: davin-win $
 $LastChangedDate: 2008-03-25 10:53:21 -0700 (Tue, 25 Mar 2008) $
 $LastChangedRevision: Added valid_names output option$

(See themis/spacecraft/fields/thm_fbk_decompress.pro)


THM_FFT_DECOMPRESS

[Previous Routine] [Next Routine] [List of Routines]
.


 $LastChangedBy: davin-win $
 $LastChangedDate: 2008-03-25 10:53:21 -0700 (Tue, 25 Mar 2008) $
 $LastChangedRevision: Added valid_names output option$
 $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/thmsoc/trunk/idl/themis/ground/thm_load_ask.pro $
Procedure: THM_LOAD_GMAG,
 thm_load_gmag, site = site, datatype = datatype, trange = trange, $
                level = level, verbose = verbose, $
                subtract_average = subtract_average, $
                subtract_median = subtract_median, $
                varname_out = varname_out, $
                subtracted_values = subtracted_values, $
                downloadonly = downloadonly, $
                valid_names = valid_names
keywords:

(See themis/spacecraft/fields/thm_fft_decompress.pro)


THM_FFT_FREQ_BINS[1]

[Previous Routine] [Next Routine] [List of Routines]
   subtract_average = subtract_average, $

(See themis/spacecraft/fields/thm_fft_freq_bins.pro)


THM_FFT_FREQ_BINS[2]

[Previous Routine] [Next Routine] [List of Routines]
= subtract_average, $
                subtract_median = subtract_median, $
                varname_out = varname_out, $
                subtracted_values = subtracted_values, $
                downloadonly = downloadonly, $
                valid_names = valid_names
keywords:
  site  = Observatory name, example, thm_load_gmag, site = 'bmls', the
          default is 'all', i.e., load all available stations . This
          can be an array of strings, e.g., ['bmls', 'ccmv'] or a
          single string delimited by spaces, e.g., 'bmls ccnv'
  datatype = The type of data to be loaded, for this case, there is only
          one option, the default value of 'mag', so this is a
          placeholder should there be more that one data type. 'all'
          can be passed in also, to get all variables.
  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 'l2', or level-2
          data. A string (e.g., 'l2') or an integer can be used. 'all'
          can be passed in also, to get all levels.
  /VERBOSE : set to output some useful info
  /SUBTRACT_AVERAGE, if set, then the average values are subtracted

(See themis/spacecraft/fields/thm_fft_freq_bins.pro)


THM_GET_EFI_CAL_PARS

[Previous Routine] [Next Routine] [List of Routines]
ue of 'mag', so this is a
          placeholder should there be more that one data type. 'all'
          can be passed in also, to get all variables.
  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 'l2', or level-2
          data. A string (e.g., 'l2') or an integer can be used. 'all'
          can be passed in also, to get all levels.
  /VERBOSE : set to output some useful info
  /SUBTRACT_AVERAGE, if set, then the average values are subtracted
                     from the loaded variables,
  /SUBTRACT_MEDIAN, if set, then the median values are subtracted
                     from the loaded variables,
  varname_out= a string array containing the tplot variable names for
               the loaded data, useful for the following keyword:
  subtracted_values = returns N_elements(varname_out) by 3 array
                      containing the average or median (or 0) values
                      subtracted from the data.
  /downloadonly, if set, then only download the data, do not load it
                 into variables.
  no_download: use only files which are online locally.
  relpathnames_all: named variable in which to return all files that are
          required for specified timespan, probe, datatype, and level.
          If present, no files will be downloaded, and no data will be loaded.
  /valid_names, if set, then this will return the valid site, datatype
                and/or level options in named variables, for example,

(See themis/spacecraft/fields/thm_get_efi_cal_pars.pro)


THM_GET_FBK_CAL_PARS

[Previous Routine] [Next Routine] [List of Routines]
ts(varname_out) by 3 array
                      containing the average or median (or 0) values
                      subtracted from the data.
  /downloadonly, if set, then only download the data, do not load it
                 into variables.
  no_download: use only files which are online locally.
  relpathnames_all: named variable in which to return all files that are
          required for specified timespan, probe, datatype, and level.
          If present, no files will be downloaded, and no data will be loaded.
  /valid_names, if set, then this will return the valid site, datatype
                and/or level options in named variables, for example,

                thm_load_gmag, site = xxx, /valid_names

                will return the array of valid sites in the
                variable xxx
 get_support_data = does nothing.  present only for consistency with other
                load routines
  
Example:
   thm_load_gmag, site = 'bmls', trange =
   ['2007-01-22/00:00:00','2007-01-24/00:00:00']

Written by: Davin Larson,   Dec 2006
 22-jan-2007, jmm, jimm@ssl.berkeley.edu rewrote argument list, added
 keywords, 
 1-feb-2007, jmm, added subtract_median, subtracted_value keywords
 19-mar-2007, jmm, fixed the station list...

(See themis/spacecraft/fields/thm_get_fbk_cal_pars.pro)


THM_GET_FFT_CAL_PARS

[Previous Routine] [Next Routine] [List of Routines]
:00:00','2007-01-24/00:00:00']

Written by: Davin Larson,   Dec 2006
 22-jan-2007, jmm, jimm@ssl.berkeley.edu rewrote argument list, added
 keywords, 
 1-feb-2007, jmm, added subtract_median, subtracted_value keywords
 19-mar-2007, jmm, fixed the station list...
 $LastChangedBy: jimm $
 $LastChangedDate: 2008-03-13 14:00:25 -0700 (Thu, 13 Mar 2008) $
 $LastChangedRevision: 2484 $
 $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/thmsoc/trunk/idl/themis/ground/thm_load_gmag.pro $
  Procedure thm_setprobe_colors [,tplotnames]
    Only scalar tplot variables will be changed.

  Keywords:
     tplotnames: the names of the variables you want modified
                 (accepts wildcards)

     default(optional): set to modify dlimits rather than limits

     tplotxy(optional): set to modify colors for use with tplotxy rather
                        than tplot

  Author: Davin Larson(davin@ssl.berkeley.edu)

 $LastChangedBy: pcruce $

(See themis/spacecraft/fields/thm_get_fft_cal_pars.pro)


THM_LOAD_EFI

[Previous Routine] [Next Routine] [List of Routines]
            than tplot

  Author: Davin Larson(davin@ssl.berkeley.edu)

 $LastChangedBy: pcruce $
 $LastChangedDate: 2008-01-16 16:54:40 -0800 (Wed, 16 Jan 2008) $
 $LastChangedRevision: 2283 $
 $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/ssl_general/trunk/tplot/tplotxy.pro $
 NAME:
    SEGMENT_TEST.PRO

 PURPOSE:
    Check a spinmodel segment structure to ensure that the model parameters
    b and c are consistent with the start and end times and
    spin counts

 CATEGORY:
   TDAS

 CALLING SEQUENCE:
   segment_test,probe,segment,result

  INPUTS:
    probe: A single character probe letter (only used in output messages).
    segment: A spinmodel_segment structure.

  OUTPUTS:
    result: 0 for failure, 1 for success

  KEYWORDS:
    None.

  PROCEDURE:
    Calls segment_interp_t to get spin count and spin phase at
       segment start/end times.
    Calls segment_interp_n to get sun pulse times of segment
       start/end counts.
    Cross check results of segment_interp_t and segment_interp_n,
       verifying that interp_t and interp_n results are consistent
       within modest tolerances (100 usec for times, 0.1 deg for
       phase angles).
    Check maxgap field against 4-hour threshold; large gaps are

(See themis/spacecraft/fields/thm_load_efi.pro)


THM_LOAD_FBK

[Previous Routine] [Next Routine] [List of Routines]
on block.

  EXAMPLE:
     model_ptr=spinmodel_get_ptr('a')
     spinmodel_test,model_ptr

Written by: Jim Lewis (jwl@ssl.berkeley.edu)
Change Date: 2007-10-08
 NAME:
    SPINMODEL_INTERP_N.PRO

 PURPOSE:
    Given a spin model and spin count  (or array of counts), calculate
    the sun pulse time and spin period at each input count.

 CATEGORY:
   TDAS

 CALLING SEQUENCE:
   spinmodel_interp_n,model=modelptr,count=input_counts,$
      time=output_times, spinper=output_spinper

  INPUTS:
    Model: pointer to a spinmodel structure
    Count: A long integer (or long integer array) specifying the spin
      count to use.  If the input is a scalar, all outputs
      will be scalars; otherwise, all outputs are arrays having
      the same size as the input counts.

  OUTPUTS:
    spinper: Optional keyword parameter to receive spin period values.
    time: Optional keyword parameter to receive sun pulse time
       of each input count.

  KEYWORDS:

  /MODEL: Required input keyword argument, specifying a pointer to a 
      spinmodel structure.
  /COUNT: Required input keyword argument specifying a time or array of times.
  /SPINPER: Optional keyword argument to receive spin period values.
  /TIME:  Optional keyword argument to receive sun pulse times.

  PROCEDURE:
     Find the spinmodel segment containing the input spin count.

(See themis/spacecraft/fields/thm_load_fbk.pro)


THM_LOAD_FFT

[Previous Routine] [Next Routine] [List of Routines]
e input is a scalar, all outputs will be scalars; otherwise, 
      all outputs are arrays having the same size as the input times.

  OUTPUTS:
    spinper: Optional keyword parameter to receive spin period values.
    tlast: Optional keyword parameter to receive sun pulse time
       immediately preceding each input time.
    spincount: Optional keyword parameter to receive count of spins
       since the start of the model.
    spinphase: Optional keyword parameter to receive the spin phase
       (ranging from 0.0 to 360.0 degrees) at each input time.

  KEYWORDS:

  /MODEL: Required input keyword argument, specifying a pointer to a 
      spinmodel structure.
  /TIME: Required input keyword argument specifying a time or array of times.
  /SPINPER: Optional keyword argument to receive spin period values.
  /T_LAST:  Optional keyword argument to receive sun pulse times
  /SPINCOUNT:  Optional keyword argument to receive spin counts
  /SPINPHASE:  Optional keyword argument to receive spin phase

  PROCEDURE:
     Find the spinmodel segment containing the input time.
     Use b and c segment parameters to determine the spin period,
       spin phase, and spin count at each input time
     Invert phi(t) function to find sun pulse time immediately preceding
       each input time.
  
  EXAMPLE:

  ; Assume 'input_times' and 'input_spinphase' already exist as a 
  ; IDL variables -- perhaps obtained from thm_load_state.
  ;
  ; Get a pointer to the spin model for probe A
  modelptr=spinmodel_get_ptr('a')
   
  ; Calculate spin phase at each time from spin model
 
  spinmodel_interp_t,model=modelptr,time=input_times,spinphase=output_spinphase

  ; Calculate spinphase differences between spin model and state 
  phi_diff=output_spinphase-input_spinphase

(See themis/spacecraft/fields/thm_load_fft.pro)


THM_LOAD_FGM

[Previous Routine] [Next Routine] [List of Routines]
ck or the spinmodel_get_ptr() function.
    This input must be a scalar.

  OUTPUTS:
    Prints "PASS"/"FAIL" messages depending on outcome of tests.

  KEYWORDS:
    None.

  PROCEDURE:
    Validate model_ptr input argument.
    Compare spin model capacity to actual number of segments.
    Validate pointer to model segments.
    Call segment_test on each model segment, check for any failures.
    Examine boundaries of adjacent segments, making sure time and
       spin_number endpoints are identical across each pair.
    Exercise spinmodel_interp_n by retrieving modeled sun pulse
       times by spin number.
    Exercise spinmodel_interp_t by recalculating the spin count
       and spin phase at each modeled sun pulse time.
    Cross check results of spinmodel_interp_n and spinmodel_interp_t
       to verify that the expected values are produced within
       modest tolerances (allowable phase error .01 deg at each
       modeled sun pulse time).

    

  EXAMPLE:
     model_ptr=spinmodel_get_ptr('a')
     spinmodel_test,model_ptr

Written by: Jim Lewis (jwl@ssl.berkeley.edu)
Change Date: 2007-10-08
Procedure: THM_LOAD_SPIN

Purpose:  Loads THEMIS spin model parameters, performs some post-processing
 of data loaded from the SPIN CDFs, and stashes the resulting spin model
 in a common block.

keywords:
  probe = Probe name. The default is 'all', i.e., load all available probes.
          This can be an array of strings, e.g., ['a', 'b'] or a
          single string delimited by spaces, e.g., 'a b'
          Flatsat data (probe 'f') is not returned unless explicitly

(See themis/spacecraft/fields/thm_load_fgm.pro)


THM_LOAD_FIT

[Previous Routine] [Next Routine] [List of Routines]
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
Example:
   thm_load_spin,probe=['a','b'] 

Written by: Jim Lewis (jwl@ssl.berkeley.edu)
Change Date: 2007-10-08
 Added progobj input for GUI access, 11-apr-2008, jmm, (jimm@ssl.berkleley.edu)
Procedure: thm_cotrans
Purpose:   Transform between various THEMIS  and geophysical coordinate systems
keywords:
  probe = Probe name. The default is 'all', i.e., transform data for all
          available probes.
          This can be an array of strings, e.g., ['a', 'b'] or a
          single string delimited by spaces, e.g., 'a b'
  datatype = The type of data to be transformed, can take any of the values
          allowed for datatype for the various thm_load routines. You
          can use wildcards like ? and [lh].
          'all' is not accepted. You can use '*', but you may get unexpected
          results if you are using suffixes.
  in_coord = 'spg', 'ssl', 'dsl', 'gse', 'gsm','sm', 'gei',or 'geo'
          coordinate system of input.
          This keyword is optional if the dlimits.data_att.coord_sys attribute
          is present for the tplot variable, and if present, it must match
          the value of that attribute.  See cotrans_set_coord,
          cotrans_get_coord
  out_coord = 'spg', 'ssl', 'dsl', 'gse', 'gsm', 'sm', 'gei',or 'geo'
           coordinate system of output.  This keyword is optional if
           out_suffix is specified and last 3 characters of suffix specify

(See themis/spacecraft/fields/thm_load_fit.pro)


THM_LOAD_SCM

[Previous Routine] [Next Routine] [List of Routines]
his keyword is optional if
           out_suffix is specified and last 3 characters of suffix specify
           the output coordinate system.
  in_suffix = optional suffix needed to generate the input data quantity name:
           'th'+probe+'_'datatype+in_suffix
  out_suffix = optional suffix to add to output data quantity name.  If
           in_suffix is present, then in_suffix will be replaced by out_suffix
           in the output data quantity name.
 valid_names:return valid coordinate system names in named varibles supplied to
           in_coord and/or out_coord keywords.
 support_suffix: if support_data is loaded with a suffix you can
 specify it here

 ignore_dlimits: set this keyword to true so that an error will not
be produced if the internal label of the coordinate system clashed
with the user provided coordinate system.

Optional Positional Parameters:
 in_name  Name(s) of input tplot variable(s) (or glob patern)
          (space-separated list or array of strings.).  If the in_name
          parameter is provided, the probe and datatype
          keywords will be ignored.  However, if the input name
          is not of format 'th[a-e]_*', use the probe keyword to indicate
          which probe's state data should be used for each input variable.
 out_name Name(s) of output tplot variable(s).  glob patterns not accepted.
          Number of output names must match number of input names (after glob
          expansion of input names).  (single string, or array of strings.)

Examples:
  thm_load_state, /get_support

  thm_cotrans, probe='a', datatype='fgl', out_suffix='_gsm'

  ; or equivalently

  thm_cotrans, 'tha_fgl', 'tha_fgl_gsm', out_coord='gsm'

  ; to transform all th?_fg?_dsl to th?_fg?_gsm

  thm_cotrans, 'th?_fg?', in_suffix='_dsl', out_suffix='_gsm'

(See themis/spacecraft/fields/thm_load_scm.pro)


THM_SCM_DECONVO_VEC

[Previous Routine] [Next Routine] [List of Routines]
tate/thm_cotrans.pro $
Procedure: thm_fac_matrix_make

Purpose:  generates a field aligned coordinate transformation matrix
from an input B vector array(and sometimes a position vector array)
then stores it in a tplot variable.

This code has been modified from fac_matrix_make to handle input data that are
in DSL coordinates.

Arguments:
   mag_var_name=the name of the tplot variable storing the magnetic field
   vectors to be used in transformation matrix generation
   pos_var_name(optional)=the name of the tplot variable storing the position
   vectors to be used in transformation matrix generation
   newname(optional)=the name of the tplot variable in which to store
   the output
   error(optional) = named variable that holds the error state of the
   computation 1 = success 0 = failure

(See themis/spacecraft/fields/thm_scm_deconvo_vec.pro)


THM_SPINFIT

[Previous Routine] [Next Routine] [List of Routines]
x generation
   newname(optional)=the name of the tplot variable in which to store
   the output
   error(optional) = named variable that holds the error state of the
   computation 1 = success 0 = failure
   other_dim(optional) = the second axis for the field aligned
   coordinate system.
   /DEGAP: Set to call TDEGAP to remove any gaps from the data. See TDEGAP for
           for other options that can be invoked using the _extra keyword.
           E.g. thm_fac_matrix_make, 'tha_fgs', other_dim='xgse', /degap, dt=3

   ************For all transformations Z = B************

   Warning about coordinate systems:
   B field tplot variable must be in gse,gsm, or dsl coordinates,
   depending on what transformation has been selected.
   Position tplot variable must be in gei coordinates. Gei is the default coordinate
   system of thm_load_state.

   Warning:  The resulting transformation matrices will only correctly
   transform data from the coordinate system of the input variable to
   the field aligned coordinate system.  So if mag_var_name is in dsl
   coordinates then you should only use the output matrices to transform
   other data in dsl coordinates.


   valid second coord(other_dim) options:

         'Xgse', (DEFAULT) translates from gse or gsm into FAC
                    Definition(works on GSE, or GSM):
                    X Axis = on plane defined by Xgse - Z
                    Second coordinate definition: Y = Z x X_gse
                    Third coordinate, X completes orthogonal RHS
                    (right hand system) triad: XYZ
         'Rgeo',translate from geo into FAC using radial position vector
                    Rgeo is radial position vector, positive radialy outwards.

(See themis/spacecraft/fields/thm_spinfit.pro)


THM_UNPACK_HED

[Previous Routine] [List of Routines]
Rgeo',translate from geo into FAC using radial position vector
                    Rgeo is radial position vector, positive radialy outwards.
                    Second coordinate definition: Y = Z x Rgeo (westward)
                    Third coordinate, X completes orthogonal RHS XYZ.
         'mRgeo',translate into FAC using radial position vector
                    mRgeo is radial position vector, positive radially inwards.
                    Second coordinate definition: Y = Z x mRgeo (eastward)
                    Third coordinate, X completes orthogonal RHS XYZ.
         'Phigeo', translate into FAC using azimuthal position vector
                    Phigeo is the azimuthal geo position vector, positive Eastward
                    First coordinate definition: X = Phigeo x Z (positive outwards)
                    Second coordinate, Y ~ Phigeo (eastward) completes orthogonal RHS XYZ
         'mPhigeo', translate into FAC using azimuthal position vector
                    mPhigeo is minus the azimuthal geo position vector; positive Westward
                    First coordinate definition: X = mPhigeo x Z (positive inwards)
                    Second coordinate, Y ~ mPhigeo (Westward) completes orthogonal RHS XYZ
         'Phism', translate into FAC using azimuthal Solar Magnetospheric vector.
                 Phism is "phi" vector of satellite position in SM coordinates.
                 Y Axis = on plane defined by Phism-Z, normal to Z
                 Second coordinate definition: X = Phism x Z
                 Third completes orthogonal RHS XYZ
         'mPhism', translate into FAC using azimuthal Solar Magnetospheric vector.
                 mPhism is minus "phi" vector of satellite position in SM coordinates.
                 Y Axis = on plane defined by Phism-Z, normal to Z
                 Second coordinate definition: X = mPhism x Z
                 Third completes orthogonal RHS XYZ
         'Ygsm', translate into FAC using cartesian Ygsm position as other dimension.
                 Y Axis on plane defined by Ygsm and Z
                 First coordinate definition: X = Ygsm x Z
                 Third completes orthogonal RHS XYZ
 Example:
  fac_matrix_make,'tha_fgs',other_dim='Xgse',pos_var_name='tha_pos',out_var_name='tha_fgs_fac_mat'

function: thm_interpolate_state

Purpose: interpolates the low res STATE file

         all variables are structures as produced by get_data

(See themis/spacecraft/fields/thm_unpack_hed.pro)