Documentation for /home/davin/idl/socware/

Generated by IDLdoc

single page | use frames     summary     class     fields     routine details     file attributes

projects/themis/spacecraft/fields/

thm_cal_efi.pro


Procedure THM_PUT_ELEMENT() Purpose: Put data into a substructure (1 level down) given the structure, the substructure tag name, and the data tag name. Syntax: thm_put_element , struct, sstruct_tag, data_tag, data where STRUCT: The structure to receive the data. SSTRUCT_TAG: The substructure tag name to receive the data (need not exist). DATA_TAG: The data tag name. DATA: The data. Keywords: None. Code: W. Michael Feuerstein, 16 June, 2009.

function THM_GET_EFI_EDC_OFFSET() Purpose: Estimate the EDC offset by low-pass filtering the ADC data with a moving estimation window. Returns all NaNs, if the data interval is shorter than the minimum number of spins (see MIN_N_SPINS kw). Syntax: result = thm_get_efi_edc_offset(Y, Sample_Rate, N_Spins, Spin_Period [, Offset_Estimation_Window_Truncated] [, NEW_N_SPINS] [, MIN_N_SPINS = ]) where Y (n-element array) Input The ADC data needing the EDC offset calculation. Sample_Rate Input The data rate. N_Spins Input The width of the estimation window in # of spins Spin_Period Input The period of a spin [s]. Edge_Truncate Input Passed to SMOOTH, if SMOOTH is the estimation function. Offset_Estimation_Window_Truncated Output Indicates that the data interval is shorter than the estimation window requested, so the estimation window has been truncated to the greatest integral number of spins that fit into the data interval. New_N_Spins Output If OFFSET_ESTIMATION_WINDOW_TRUNCATED is set, then this will contain the adjusted number of spins. Keywords: MIN_N_SPINS I/O, long. 1 <= MIN_N_SPINS <= NOMINAL_N_SPINS. Specify the lower limit for NOMINAL_N_SPINS. Defaults to 1.

THM_UPDATE_EFI_LABELS.PRO PURPOSE: To be used on THEMIS EFI 3-vectors. Labels x-axis as "E12 ()" for spinning coordinate systems and "Ex ()" for despun coordinate systems. Y and Z axes are upadated correspondingly. Call after coordinate transformations. SYNTAX: thm_update_efi_labels , Arguments: : A TPLOT variable name referring to a 3-vector TPLOT variable. Code: W. Michael Feuerstein, 7/2008.

Routines

Routines from thm_cal_efi.pro

thm_put_element, struct, sstruct_tag, data_tag, data
result = thm_get_efi_edc_offset(y, samp_rate, n_spins, spin_period, edge_truncate, offset_estimation_window_truncated, n_spins_temp, min_n_spins=min_n_spins)
thm_update_efi_labels, tvarname
thm_cal_efi, probe=probe, datatype=datatype, valid_names=valid_names, verbose=verbose, coord=coord, in_suffix=in_suffix, out_suffix=out_suffix, max_angle=max_angle, min_bz=min_bz, max_bxy_bz=max_bxy_bz, bz_offset=bz_offset, fgm_datatype=fgm_datatype, fgm_level=fgm_level, test=test, stored_tnames=stored_tnames, onthefly_edc_offset=onthefly_edc_offset, no_edc_offset=no_edc_offset, calfile_edc_offset=calfile_edc_offset, gap_trigger_value=gap_trigger_value, nominal_n_spins=nominal_n_spins, min_n_spins=min_n_spins, offset_estimation_func=offset_estimation_func, edge_truncate=edge_truncate, gap_end=gap_end, gap_begin=gap_begin, try_despike=try_despike, despike_width=despike_width, despike_threshold=despike_threshold, _extra=_extra

Procedure: THM_CAL_EFIPurpose: Converts raw EFI (V, EDC, and EAC waveform) data into physical quantities.

Routine details

top source thm_put_element

thm_put_element, struct, sstruct_tag, data_tag, data

Parameters

struct
sstruct_tag
data_tag
data

top source thm_get_efi_edc_offset

result = thm_get_efi_edc_offset(y, samp_rate, n_spins, spin_period, edge_truncate, offset_estimation_window_truncated, n_spins_temp, min_n_spins=min_n_spins)

Parameters

y
samp_rate
n_spins
spin_period
edge_truncate
offset_estimation_window_truncated
n_spins_temp

Keywords

min_n_spins

top source thm_update_efi_labels

thm_update_efi_labels, tvarname

Parameters

tvarname

top source thm_cal_efi

thm_cal_efi, probe=probe, datatype=datatype, valid_names=valid_names, verbose=verbose, coord=coord, in_suffix=in_suffix, out_suffix=out_suffix, max_angle=max_angle, min_bz=min_bz, max_bxy_bz=max_bxy_bz, bz_offset=bz_offset, fgm_datatype=fgm_datatype, fgm_level=fgm_level, test=test, stored_tnames=stored_tnames, onthefly_edc_offset=onthefly_edc_offset, no_edc_offset=no_edc_offset, calfile_edc_offset=calfile_edc_offset, gap_trigger_value=gap_trigger_value, nominal_n_spins=nominal_n_spins, min_n_spins=min_n_spins, offset_estimation_func=offset_estimation_func, edge_truncate=edge_truncate, gap_end=gap_end, gap_begin=gap_begin, try_despike=try_despike, despike_width=despike_width, despike_threshold=despike_threshold, _extra=_extra

Procedure: THM_CAL_EFI Purpose: Converts raw EFI (V, EDC, and EAC waveform) data into physical quantities. Syntax: THM_CAL_EFI [, ] keywords: VERBOSE: Input, >= 1. Set to enable diagnostic message output. Higher values of produce more and lower-level diagnostic messages. DATATYPE: Input, string. Default setting is to calibrate all raw quantites and also produce all _0 and _dot0 quantities. Use DATATYPE kw to narrow the data products. Wildcards and glob-style patterns accepted (e.g., ef?, *_dot0). PROBE: Input, string. Specify space-separated probe letters, or string array (e.g., 'a c', ['a', 'c']). Defaults to all probes. VALID_NAMES: Output, string. Return valid datatypes, print them, and return. COORD: I/O, string. Set to coordinate system of output (e.g., 'gse', 'spg', etc,... see THEMIS Sci. Data Anal. Software Users Guide). Defaults to 'dsl'. IN_SUFFIX: Input, scalar or array string. Suffix to expect when parsing input TPLOT variable names. OUT_SUFFIX: I/O, scalar or array string. Suffix to append to output TPLOT variable names in place of IN_SUFFIX (usally = IN_SUFFIX). TEST: 1 or 0. Disables selected /CONTINUE to MESSAGE. For QA testing only. STORED_TNAMES: OUTPUT, string array. Returns each TPLOT variable name invoked in a STORE_DATA operation (chron. order). (Not sorted or uniqued.) ONTHEFLY_EDC_OFFSET:OUTPUT, float. Return the EDC offset array calculated on-the-fly in a structure (tag name = probe letter, subtagname = datatype). *** WARNING: This kw can use a lot of memory, if processing many datatypes, or long time periods. *** NO_EDC_OFFSET: I/O, 0 or 1. If set, do not preform an EDC offset calculation. Will also avoid dot0 and_0 calculations, and not perform coordinate transforms GAP_TRIGGER_VALUE: I/O, float, > 0. For on-the-fly EDC offset calculation, consider anything greater than or equal to GAP_TRIGGER_VALUE to be a gap in the data. Default: 0.5 s. NOMINAL_N_SPINS: I/O, long, >= 1. Specify the number of spins for the on-the-fly EDC offset calculation estimation window, or read out the default (20 spins). MIN_N_SPINS: I/O, long, 1 <= MIN_N_SPINS <= NOMINAL_N_SPINS. Specify the lower limit for NOMINAL_N_SPINS. OFFSET_ESTIMATION_FUNC: OUTPUT, scalar string. The name of the function used to estimate the EDC offset for the on-the-fly window. /EDGE_TRUNCATE: I/O, numeric, 0 or 1. Set to 0 to disable edge truncation in SMOOTH (for the on-the-fly offset calculation). Assign to a variable to read the default (= 1). Undefined, if on-the-fly offset not done. GAP_BEGIN, GAP_END: OUTPUT, double, >= 0. Return (if they exist), the double-precision start and end times of all gaps detected in preparation for on-the-fly offset calculation. See kw ONTHEFLY_EDC_OFFSET for structure format and warnings. TRY_DESPIKE: If set, despike the raw E field data before calibration, uses function SIMPLE_DESPIKE_1d for the calculation. DESPIKE_THRESHOLD: Threshold in ADC units for despike calculation, the default is 200 DESPIKE_WIDTH: Half Width of the median filter used for the despike calculation, the default is 11 keyword parameters for _dot0 computation: MAX_ANGLE: Input, float. Maximum angle of B field to spin axis to calculate _dot0. Typical = 80 degrees. No default. MIN_BZ: I/O, float. Minimum value of Bz. Typical value is 2.0 nT. Default= 1.0 nT. If argument not defined, returns default. Not compatible with MAX_ANGLE keyword. MAX_BXY_BZ: Input, float. Maximum value of abs(bx/bz) or abs(by/bz). Typical value is 5. ~= tan(79 degrees) (think of Bx/Bz). Default is not to use this method (no default value). BZ_OFFSET: I/O, float. Offset in nT that will be added to Z axis measurement of B. Defaults to 0.0. If argument not defined, returns default. FGM_DATATYPE: Input, string. 'fgl', 'fgh', 'fgs' or 'fge'. FGM_LEVEL: Input, 'l1' or 'l2', default is 'l2' use_eclipse_corrections: Only applies when loading and calibrating Level 1 data. Defaults to 0 (no eclipse spin model corrections applied). use_eclipse_corrections=1 applies partial eclipse corrections (not recommended, used only for internal SOC processing). use_eclipse_corrections=2 applies all available eclipse corrections. Example: thm_cal_efi, probe='c' Modifications: Added boom_shorting_factor_e12, boom_shorting_factor_e34, offset_e12, offset_e34, offset_dsc_x, offset_dsc_y fields to data_att structure in the default limits structure. Also, added mechanism to fill new field from THM_GET_EFI_CAL_PARS.PRO, W.M.Feuerstein, 2/26-27/2008. Changed "History" to "Modifications" in header, made "1000" a float ("."), switched all internal calibration parameters over to those read through THM_GET_EFI_CAL_PARS.PRO, WMF, 3/12/2008. Updated DATA_ATT fields to match revised cal. files, WMF, 3/12/2008. Updated error handling, updated doc'n, WMF, 3/12/2008. Updated doc'n, made datatypes more consistent (speed), WMF, 3/14/2008. Changed "no default" for MIN_BZ kw to default=1.0 nT, fixed MAX_ANGLE and MIN_BZ kwd's "both set" handling, WMF, 3/14/2008. Changed an NaN multiplication to an assignment (speed), simplified MIN_BZ default assignment, turned on good practice compile options, reorganized opening statements (flow), turned off ARG_PRESENT(MAX_BXY_BZ) bug (no default for this kw), updated doc'n, WMF, 3/17/2008. Now calculates Ez (_dot0 section) AFTER implementing MAX_BXY_BZ kw as per J. Bonnell's request (it also happens to be faster), updated doc'n, WMF, 3/18/2008. Removed redundant datatype conversions, WMF, 3/20/2008. Using BOOM_SHORTING_FACTOR in field calibration, WMF, 3/20/2008 (Th). Fixed potential logical vs. bitwise conditional bug, WMF, 3/21/2008 (F). Updated doc'n, WMF, 3/27/2008. Removed "TWEAK_GAINS" kw to THM_EFI_DESPIN.PRO per J.Bonnell's req., WMF, 4/4/2008 (F). Added TEST kw to disable certain /CONTINUE to MESSAGE, and passed TEST through to THM_GET_EFI_CAL_PARS.PRO, WMF, 4/7/2008 (M). Implemented time-dependent EAD/EDC gain conditional, WMF, 4/22/2008 (Tu). Implemented time-dependent calibration parameters for v?? and e?? datatypes, WMF, 5/21 - 6/5/2008. Reconciled last three changes from non-time-dependent version: COORD kw is now not case sensitive, made sure 'E12','E34','E56' labels go with SSL and SPG coordinates and 'Ex','Ey','Ez' go with all other coordinate systems (THM_UPDATE_EFI_LABELS.PRO), fixed COORD='gse' crash, WMF, 8/21/2008. Added error message for hed_ac = 255, WMF, 8/26/2008. Renamed from "thm_cal_efi_td.pro" to "thm_cal_efi.pro", WMF, 9/9/2008. Put in cases for 2 and 4 spin-dependent offsets in the boom plane, WMF, 3/4/2009. Insert on NaN on FGM degap, memory management, WMF, 5/5/2009. added no_edc_offset and _extra keywords, 19-aug-2010, jmm Notes: -- fixed, nominal calibration pars used (gains and frequency responses), rather than proper time-dependent parameters. $LastChangedBy: $ $LastChangedDate: $ $LastChangedRevision: $ $URL: $

Keywords

probe
datatype
valid_names
verbose
coord
in_suffix
out_suffix
max_angle
min_bz
max_bxy_bz
bz_offset
fgm_datatype
fgm_level
test
stored_tnames
onthefly_edc_offset
no_edc_offset
calfile_edc_offset
gap_trigger_value
nominal_n_spins
min_n_spins
offset_estimation_func
edge_truncate
gap_end
gap_begin
try_despike
despike_width
despike_threshold
_extra

File attributes

Modification date: Tue Oct 21 13:53:34 2014
Lines: 696