lstid_processing.model.analysis =============================== .. py:module:: lstid_processing.model.analysis .. autoapi-nested-parse:: Analyse concatonated SAMI3 files. .. !! processed by numpydoc !! Functions --------- .. autoapisummary:: lstid_processing.model.analysis.get_default_indices lstid_processing.model.analysis.get_time_index lstid_processing.model.analysis.get_f2_peaks lstid_processing.model.analysis.get_dominant_acceleration lstid_processing.model.analysis.get_topside_peaks lstid_processing.model.analysis.find_linear_breaks lstid_processing.model.analysis.fit_lines_to_peaks Module Contents --------------- .. py:function:: get_default_indices(time_array=None, lat_array=None) Get the default indices for the C/NOFS and DMSP F16 field lines. :Parameters: **time_array** : array-like or NoneType Array of times, from which the conjugate time index may be selected. **lat_array** : array-like or NoneType Array of latitudes with dimensions of time x nl x nf x nz. :Returns: **nlind** : int SAMI3 'nl' index for the C/NOFS and DMSP F16 location **nfindc** : int SAMI3 'nf' index for the C/NOFS location **nfindc** : int SAMI3 'nf' index for the DMSP F16 location **nt** : int or NoneType None if `time_array` is None, time index for the satelite conjuction otherwise **nzindc** : int None if `lat_array` or `time_array` is None; otherwise the altitude index for the C/NOFS location **nzindd** : int None if `lat_array` is None or `time_array` is None; otherwise altitude index for the DMSP F16 location .. rubric:: Notes C/NOFS is at: 11.3 N, 33.2 E, 479.4 km DMSP F16 is at: 11.3 N, 33.2 E, 845.8 km Conjunction at: 26 March 2014 at 02:49:59 UT .. !! processed by numpydoc !! .. py:function:: get_time_index(time_array, dtime) Retrieve the index corresponding to the closest time value. :Parameters: **time_array** : array-like Array of times, from which the desired time index may be selected. **dtime** : dt.datetime Desired time as a datetime object :Returns: **nt** : int Time index .. !! processed by numpydoc !! .. py:function:: get_f2_peaks(nlind, nfind, sami) Get the F2 peak locations for a specified field line. :Parameters: **nlind** : int SAMI3 `nl` index for the field line **nfind** : int SAMI3 `nf` index for the field line **sami** : xr.Dataset Dataset with SAMI3 values :Returns: **f2_inds** : dict Dict with keys 'south' and 'north' that contain arrays of indicies corresponding to the altitude indices for the F2 peak across all times. Note that these will only be valid if the field line reaches into the topside ionosphere. .. !! processed by numpydoc !! .. py:function:: get_dominant_acceleration(sami) Get the dominant acceleration variation term indices. :Parameters: **sami** : xr.Dataset SAMI3 concatonated data with acceleration variation terms :Returns: **dom_acc** : array-like Array of numbers indicating which acceleration term has the greatest variability; has values of 1, 2, and 3 .. rubric:: Notes 1 is the plasma pressure gradient, 2 is the ion-neutral collisions, and 3 is the ion-ion collisions .. !! processed by numpydoc !! .. py:function:: get_topside_peaks(sami, nzinds, dat_keys, dat_scale, peak_height) Get the variation peaks across a range of altitudes. :Parameters: **sami** : xr.Dataset Dataset with SAMI3 values for the desired time period **nzinds** : list-like Lists of altitude indices at which peaks will be calculated **dat_keys** : list-like List of data keys to evaluate, expects relative variation keys like ['rel_dene_d'] **dat_scale** : list-like List of scaling parameters to divide from the data **peak_height** : list-like List of heights that peaks must meet in order to qualify in the detection, can be None to include all peaks regardless of significance :Returns: **min_ind** : dict Dict with keys corresponding to data keys and values contianing a list of indices that locate significant peak minima **max_ind** : dict Dict with keys corresponding to data keys and values contianing a list of indices that locate significant peak maxima .. !! processed by numpydoc !! .. py:function:: find_linear_breaks(sami, nlind, nfind, nzinds, peak_ind, lat_break=6.0, sec_break=900, max_lat=20.0) Identify the breaks in peaks that indicate a change in wavefront. :Parameters: **sami** : xr.Dataset Dataset with SAMI3 values for the desired time period **nlind** : int 'nl' index for the relative data included in the minima and maxima data keys **nfind** : int 'nf' index for the relative data included in the minima and maxima data keys **nzinds** : list-like Lists of altitude indices at which peaks were calculated **peak_ind** : dict Dict with keys corresponding to data keys and values contianing a list of indices that locate significant peak minima or maxima **lat_break** : float Change in latitude that indicates a break (default=6.0) **sec_break** : int Change in time (seconds) that indicates a break (default=900) **max_lat** : float Maximum latitude for data, starting point for breaks (default=20.0) :Returns: **peak_lat** : dict Latitudes corresponding to the peak indices with keys corresponding to data variables **peak_sec** : dict Seconds from the starting time corresponding to the peak indices with keys corresponding to data variables **lat_break_inds** : dict Indices of the latitude breaks with keys corresponding to data variables .. rubric:: Notes Only identifies North-to-South trends automatically .. !! processed by numpydoc !! .. py:function:: fit_lines_to_peaks(peak_lat, peak_sec, lat_break, min_pnts=40) Calculate linear fits to the maxima and minima for each pass. :Parameters: **peak_lat** : dict Latitudes corresponding to the peak indices with keys corresponding to data variables **peak_sec** : dict Seconds from the starting time corresponding to the peak indices with keys corresponding to data variables **lat_break** : dict Indices of the latitude breaks with keys corresponding to data variables **min_pnts** : int Minimum number of points needed to calculate a linear fit (default=40) :Returns: **lin_fit** : dict Output from scipy.stats.linregress for each valid fit period .. !! processed by numpydoc !!