pyyeti.cla.DR_Def¶
- class pyyeti.cla.DR_Def(defaults=None)[source]¶
Data recovery definitions.
This class inherits from
collections.OrderedDictand defines how data recovery will be done. The entries are created through repeated calls to member functionadd()(typically from a “prepare_4_cla.py” script). Within a single instance of this class, the order that items are added also defines the data recovery order (as done inDR_Results.time_data_recovery(), for example). When using multiple instances, the data recovery order of the instances is determined by the order they are added to an instance ofDR_EventviaDR_Event.add().DR_Event.set_dr_order()can be used to modify the final order.pyyeti.ytools.reorder_dict()can also be used for that purpose.- defaults¶
Dictionary with any desired defaults for the parameters listed in
add(). If None, it is initialized to an empty dictionary.- Type:
dict or None; optional
- ncats¶
The number of data recovery categories defined. This is a static class variable. This means that if you have multiple instances of this class, ncats will end up being the total number of categories over all instances (and there is nothing wrong with that).
- Type:
integer
Notes
The keys, with the exception of the key ‘_vars’, are the short names of each data recovery category. These names are defined by the name parameter in successive calls to
add(). The values for these categories are SimpleNamespaces that fully describe the category containing the description, units, row labels, shock response spectra requests, etc, and even provides (directly or indirectly) the function for performing data recovery for the category.As noted above, there is one other entry in the dictionary: the ‘_vars’ entry. This entry is also a SimpleNamespace with two attributes: drms and nondrms. The drms attribute contains the data recovery matrices; it is a regular Python dictionary indexed by the superelement ID number. The nondrms attribute contains any other information needed for performing data recovery; it is also a regular Python dictionary indexed by the superelement ID number.
For illustration, we’ll use
pyyeti.pp.PP()to display sections of this dictionary for an example mission:PP(drdefs):
<class 'cla.DR_Def'>[n=9] 'SC_atm' : <class 'types.SimpleNamespace'>[n=20] 'SC_dtm' : <class 'types.SimpleNamespace'>[n=20] 'SC_ifl' : <class 'types.SimpleNamespace'>[n=20] 'SC_ltma' : <class 'types.SimpleNamespace'>[n=20] 'SC_ltmd' : <class 'types.SimpleNamespace'>[n=20] 'SC_cg' : <class 'types.SimpleNamespace'>[n=20] 'SC_ifa' : <class 'types.SimpleNamespace'>[n=20] 'SC_ifa_0rb': <class 'types.SimpleNamespace'>[n=20] '_vars' : <class 'types.SimpleNamespace'>[n=2]PP(drdefs[‘SC_ifa’], 2):
<class 'types.SimpleNamespace'>[n=20] .desc : 'S/C Interface Accelerations' .drfile : '/loads/CLA/Rocket/missions/.../drfuncs.py' .drfunc : 'SC_ifa' .filterval : 1e-06 .histlabels: [n=12]: ['I/F Axial Accel X sc', ... lv'] .histpv : slice(None, 12, None) .histunits : 'G, rad/sec^2' .ignorepv : None .labels : [n=12]: ['I/F Axial Accel X sc', ... lv'] .misc : None .se : 500 .srsQs : [n=2]: (25, 50) .srsconv : 1.0 .srsfrq : float64 ndarray 990 elems: (990,) .srslabels : [n=12]: ['$X_{SC}$', '$Y_{SC}$', '$Z_ ...}$'] .srsopts : <class 'dict'>[n=2] 'eqsine': 1 'ic' : 'steady' .srspv : slice(None, 12, None) .srsunits : 'G, rad/sec^2' .uf_reds : [n=4]: (1, 1, 1.25, 1) .units : 'G, rad/sec^2'PP(drdefs[‘_vars’], 3):
<class 'types.SimpleNamespace'>[n=2] .drms : <class 'dict'>[n=1] 500: <class 'dict'>[n=7] 'SC_ifl_drm': float64 ndarray 1296 ... (12, 108) 'SC_cg_drm' : float64 ndarray 1512 ... (14, 108) 'SC_ifa_drm': float64 ndarray 1296 ... (12, 108) 'scatm' : float64 ndarray 28944 ... (268, 108) 'scdtmd' : float64 ndarray 9396 ... (87, 108) 'scltma' : float64 ndarray 15768 ... (146, 108) 'scltmd' : float64 ndarray 15768 ... (146, 108) .nondrms: <class 'dict'>[n=1] 500: <class 'dict'>[n=0]- __init__(defaults=None)[source]¶
- Parameters:
defaults (dict or None; optional) – Sets the defaults attribute; see
DR_Def.
Methods
__init__([defaults])add(*, name, labels[, active, drms, drfunc, ...])Adds a data recovery category.
add_0rb(*args)Add zero-rigid-body versions of selected categories.
addcat(func)Decorator to ensure
add()is called to add category.amend(*, name[, overwrite_drms])Amend a category
clear()copy()copycat(categories, name_addon, **kwargs)Copy a category with optional modifications.
excel_summary([excel_file])Make excel file with summary of data recovery information.
fromkeys(iterable[, value])Create a new ordered dictionary with keys from iterable and values set to value.
get(key[, default])Return the value for key if key is in the dictionary, else default.
items()keys()merge(first, *args)Merge DR_Def instances together to make a new instance
move_to_end(key[, last])Move an existing element to the end (or beginning if last is false).
pop(key[,default])If the key is not found, return the default if given; otherwise, raise a KeyError.
popitem([last])Remove and return a (key, value) pair from the dictionary.
setdefault(key[, default])Insert key with a value of default if key is not in the dictionary.
update([E, ]**F)If E is present and has a .keys() method, then does: for k in E.keys(): D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
values()Attributes