general/misc/
smooth_in_time.pro
NAME: smooth_in_time PURPOSE: Runs smooth for irregular grids, after regularising grid CALLING SEQUENCE: ts = smooth_in_time(array, time_array, dt, /backward, /forward, /double, /no_time_interp) INPUT: array = a data array, can be 2-d (ntimes, n_something_else), the first index is smoothed or averaged. time_array = a time array (in units of seconds) dt = the averaging time (in seconds) KEYWORDS: backward = if set, perform an average over the previous dt, the default is to average from t-dt/2 to t_dt/2 forward = if set, perform an average over the next dt double = if set, do calculation in double precision regardless of input type. (If input data is double calculation is always done in double precision) no_time_interp = if set, do *not* interpolate the data to the minimum time resolution. The default procedure is to interpolate the data to a regularly spaced grid, and then use ts_smooth to get the running average. This alternative can be slow. smooth_nans = if set, replace Nan values in the input array with the average values calculated using the ts_smooth process. This has not been implemented for the no_time_interp option. true_t_integration = if set, subtract 1/2 of the end points of the integration from each value, to obtain the value for an integration over time of the appropriate interval. This has not been implemented for the no_time_interp option. Ths is created for the high_pass_filter. interp_resolution = If time interpolation is being used, set this option to control the number of seconds between interpolated samples. The default is to use the value of the smallest separation between samples. Any number higher than this will sacrifice output resolution to save memory. (NOTE: This option will not be applied if no interpolation is being performed because either (1) no_time_interp is set or (2) the sample rate of the data is constant) dtx_min_fraction = When interp_resolution is not set, the default is to use the value of the smallest separation between samples, with the caveat that this value of smallest separation has to occur relatively frequently. Dtx_min_fraction is used to get an effective value for the minimum of the input time resolution. If a suspected minimum value occurs less than dtx_min_fraction times the peak of a histogram of time resolutions, it is discarded. The default value is 0.10 interactive_warning = if keyword is set pops up a message box if there are memory problems and asks the user if they would like to continue interactive_varname = set this to a string indicating the name of the quantity to be used in the warning message. warning_result = assign a named variable to this keyword to determine the result of the computation display_object = Object reference to be passed to dprint for output. OUTPUT: ts = the data array smoothed or averaged HISTORY: 13-mar-2008, jmm, jimm@ssl.berkeley.edu, hacked from high_pass_filter.pro and added ts_smooth as the default 13-mar-2008, ts_smooth is way too slow, just uses smooth.pro now 6-may-2008, jmm, added sort for input data for cases with non-monotonic time_arrays 23-apr-2008, pcruce, Added padding for no_time_interp option, added _extra keyword 28-apr-2008, pcruce, Added interp_resolution option, added memory warning, mod to guarantee that precision of output is at least as large as precision of input $LastChangedBy: jimmpc1 $ $LastChangedDate: 2012-06-28 13:25:02 -0700 (Thu, 28 Jun 2012) $ $LastChangedRevision: 10658 $ $URL: svn+ssh://thmsvn@ambrosia.ssl.berkeley.edu/repos/spdsoft/trunk/general/misc/smooth_in_time.pro $
Routines
Routines from smooth_in_time.pro
result = temp_dtx_test(dtx0, min_dtx_fraction=min_dtx_fraction, _extra=_extra)
result = temp_t_integration(array, n)
result = smooth_in_time(array, time_array, dt, backward=backward, forward=forward, double=double, no_time_interp=no_time_interp, smooth_nans=smooth_nans, true_t_integration=true_t_integration, interp_resolution=interp_resolution, interactive_warning=interactive_warning, interactive_varname=interactive_varname, warning_result=warning_result, display_object=display_object, _extra=_extra)
Routine details
top source temp_dtx_test
result = temp_dtx_test(dtx0, min_dtx_fraction=min_dtx_fraction, _extra=_extra)
Parameters
- dtx0
Keywords
- min_dtx_fraction
- _extra
top source smooth_in_time
result = smooth_in_time(array, time_array, dt, backward=backward, forward=forward, double=double, no_time_interp=no_time_interp, smooth_nans=smooth_nans, true_t_integration=true_t_integration, interp_resolution=interp_resolution, interactive_warning=interactive_warning, interactive_varname=interactive_varname, warning_result=warning_result, display_object=display_object, _extra=_extra)
Parameters
- array
- time_array
- dt
Keywords
- backward
- forward
- double
- no_time_interp
- smooth_nans
- true_t_integration
- interp_resolution
- interactive_warning
- interactive_varname
- warning_result
- display_object
- _extra
File attributes
Modification date: | Thu Feb 13 16:43:48 2014 |
Lines: | 167 |