pyyeti.cla.DR_Results

class pyyeti.cla.DR_Results[source]

Subclass of collections.OrderedDict that contains data recovery results

Notes

This data structure is designed to contain and operate on a hierarchy of event results, not unlike a directory tree on a computer. For example, it could be just one level deep and contain only the ‘Liftoff’ results. Or, it could contain all events from a CLA and each event could have sub-events under them.

You can be creative in your organization to simplify otherwise cumbersome tasks. For example, say you want to form SRS envelope plots for all Stage-1 events separately from all Stage-2 events. This is trivial if you organize your structure accordingly; for example:

Top Level
    Stage-1
       Liftoff
       Transonics
       Max-Q
    Stage-2
       S2 Engine Start
       S2 Engine Cutoff

For illustration, the following shows how this task might be done. To perhaps make this example more useful, it is assumed that we have five separate DR_Results instances and we have to organize them. After that, we can make the SRS plots very easily. Note that we could also write out various results and comparison tables at the different levels. For this example, we’ll form three separate SRS plots: the first showing the Stage-1 and Stage-2 enveloping curves together, the second showing the Stage-1 Liftoff, Transonics, and Max-Q curves together, and the third showing the Stage-2 Engine Start and Cutoff curves together:

# first, organize the results as shown above:
results = cla.DR_Results()

results['Stage-1'] = cla.DR_Results()
results['Stage-1']['Liftoff'] = lo_results
results['Stage-1']['Transonics'] = trans_results
results['Stage-1']['Max-Q'] = maxq_results

results['Stage-2'] = cla.DR_Results()
results['Stage-2']['S2 Engine Start'] = ses_results
results['Stage-2']['S2 Engine Cutoff'] = seco_results

# next, compute extreme results at all levels:
results.form_extreme()

# srs plot number 1; will have 2 curves:
results['extreme'].srs_plots(
    direc='S1_S2_srs', Q=20, showall=True)

# srs plot number 2; will have 3 curves:
results['Stage-1']['extreme'].srs_plots(
    direc='S1_events_srs', Q=20, showall=True)

# srs plot number 3; will have 2 curves:
results['Stage-2']['extreme'].srs_plots(
    direc='S2_events_srs', Q=20, showall=True)

Below are a couple example DR_Results instances named results. Note that this structure contains all the data recovery matrix information originally collected by calls to DR_Def.add() (in a “prepare_4_cla.py” script, for example).

The first example is from a PSD buffet run (after running results.form_extreme()):

PP(results):

<class 'cla.DR_Results'>[n=2]
    'MaxQ' : <class 'cla.DR_Results'>[n=12]
    'extreme': <class 'cla.DR_Results'>[n=12]

PP(results[‘MaxQ’]):

<class 'cla.DR_Results'>[n=12]
    'PAF_ifatm'    : <class 'types.SimpleNamespace'>[n=17]
    'PAF_ifatm_0rb': <class 'types.SimpleNamespace'>[n=17]
    'PAF_ifltm'    : <class 'types.SimpleNamespace'>[n=17]
    'SC_atm'       : <class 'types.SimpleNamespace'>[n=17]
    'SC_dtm'       : <class 'types.SimpleNamespace'>[n=15]
    'SC_ifl'       : <class 'types.SimpleNamespace'>[n=17]
    'SC_ltma'      : <class 'types.SimpleNamespace'>[n=15]
    'SC_ltmd'      : <class 'types.SimpleNamespace'>[n=15]
    'SC_cg'        : <class 'types.SimpleNamespace'>[n=15]
    'SC_ifa'       : <class 'types.SimpleNamespace'>[n=17]
    'SC_ifa_0rb'   : <class 'types.SimpleNamespace'>[n=17]
    'Box_CG'       : <class 'types.SimpleNamespace'>[n=17]

PP(results[‘MaxQ’][‘SC_ifa’], 3):

<class 'types.SimpleNamespace'>[n=17]
    .cases  : [n=1]: ['MaxQ']
    .domain : 'freq'
    .drminfo: <class 'types.SimpleNamespace'>[n=20]
        .desc      : 'S/C Interface Accelerations'
        .drfile    : '/loads/CLA/Rocket/missions/...funcs.py'
        .drfunc    : 'SC_ifa'
        .filterval : 1e-06
        .histlabels: [n=12]: ['I/F Axial Accel     X sc', ...]
        .histpv    : slice(None, 12, None)
        .histunits : 'G, rad/sec^2'
        .ignorepv  : None
        .labels    : [n=12]: ['I/F Axial Accel     X sc', ...]
        .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}$', ...']
        .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'
    .event  : 'MaxQ Buffet'
    .ext    : float64 ndarray 24 elems: (12, 2)
    .ext_x  : float64 ndarray 24 elems: (12, 2)
    .freq   : float64 ndarray 2332 elems: (2332,)
    .maxcase: [n=12]: ['MaxQ', 'MaxQ', 'MaxQ' ...'MaxQ']
    .mx_x   : float64 ndarray 12 elems: (12, 1)
    .mincase: [n=12]: ['MaxQ', 'MaxQ', 'MaxQ' ...'MaxQ']
    .mn_x   : float64 ndarray 12 elems: (12, 1)
    .mission: 'Rocket / Spacecraft VLC'
    .mn     : float64 ndarray 12 elems: (12, 1)
    .mx     : float64 ndarray 12 elems: (12, 1)
    .psd    : float64 ndarray 27984 elems: (1, 12, 2332)
    .rms    : float64 ndarray 12 elems: (12, 1)
    .srs    : <class 'types.SimpleNamespace'>[n=5]
        .ext  : <class 'dict'>[n=2]
            25: float64 ndarray 11880 elems: (12, 990)
            50: float64 ndarray 11880 elems: (12, 990)
        .frq  : float64 ndarray 990 elems: (990,)
        .srs  : <class 'dict'>[n=2]
            25: float64 ndarray 11880 elems: (1, 12, 990)
            50: float64 ndarray 11880 elems: (1, 12, 990)
        .type : 'eqsine'
        .units: 'G, rad/sec^2'

Here is another example from a time-domain case where the extreme values are computed statistically from all cases:

PP(results[‘SC_ifa’], 4):

<class 'types.SimpleNamespace'>[n=16]
    .cases  : [n=21]: ['SECO2 1', 'SECO2 2', 'SECO2 3 ... 21']
    .domain : 'time'
    .drminfo: <class 'types.SimpleNamespace'>[n=20]
        .desc      : 'S/C Interface Accelerations'
        .drfile    : '/loads/CLA/Rocket/missions/...funcs.py'
        .drfunc    : 'SC_ifa'
        .filterval : 1e-06
        .histlabels: [n=12]: ['I/F Axial Accel     X sc', ...]
        .histpv    : slice(None, 12, None)
        .histunits : 'G, rad/sec^2'
        .ignorepv  : None
        .labels    : [n=12]: ['I/F Axial Accel     X sc', ...]
        .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}$', ...']
        .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'
    .event  : 'SECO2'
    .ext    : float64 ndarray 24 elems: (12, 2)
    .ext_x: None
    .hist   : float64 ndarray 2520252 elems: (21, 12, 10001)
    .maxcase: None
    .mx_x   : float64 ndarray 252 elems: (12, 21)
    .mincase: None
    .mn_x   : float64 ndarray 252 elems: (12, 21)
    .mission: 'Rocket / Spacecraft VLC'
    .mn     : float64 ndarray 252 elems: (12, 21)
    .mx     : float64 ndarray 252 elems: (12, 21)
    .srs    : <class 'types.SimpleNamespace'>[n=5]
        .ext  : <class 'dict'>[n=2]
            25: float64 ndarray 11880 elems: (12, 990)
            50: float64 ndarray 11880 elems: (12, 990)
        .frq  : float64 ndarray 990 elems: (990,)
        .srs  : <class 'dict'>[n=2]
            25: float64 ndarray 249480 elems: (21, 12, 990)
            50: float64 ndarray 249480 elems: (21, 12, 990)
        .type : 'eqsine'
        .units: 'G, rad/sec^2'
    .time   : float32 ndarray 10001 elems: (10001,)
__init__(*args, **kwargs)

Methods

__init__(*args, **kwargs)

add_maxmin(cat, mxmn, maxcase[, mincase, ...])

Add maximum and minimum values from an external source

all_base_events([top_level_name])

A generator for looping over all base events

all_categories()

A generator for looping over all data recovery categories

all_nonbase_events([top_level_name])

A generator for looping over all non-base events

calc_ext()

Calculate the .ext attribute from the .mx and .mn attributes

calc_stat_ext(k)

Calculate statistical extreme response for event results

clear()

copy()

delete_data(attributes[, pathfunc])

Recursively deletes data from DR_Results structure

delete_extreme()

Delete any 'extreme' entries

form_extreme([ext_name, case_order, doappend])

Form extreme response over sets of results

frf_data_recovery(sol, nas, case, DR, n, j)

Frequency response data recovery function

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.

init(Info, mission, event[, cats])

Build initial results data structure.

init_extreme_cat(cases, oldcat[, ext_name, ...])

Initialize an "extrema" data recovery category

items()

keys()

merge(results_iter[, rename_dict])

Merge CLA results together into a larger DR_Results hierarchy.

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.

psd_data_recovery(case, DR, n, j[, dosrs, ...])

PSD data recovery function

resp_plots(*[, event, drms, inc0rb, fmt, ...])

Make time or frequency domain responses plots.

rptext([event, drms, direc, doabsmax, ...])

Writes .ext files for all max/min results.

rptpct(refres[, names, event, drms, ...])

Write comparison files for all max/min data in results.

rpttab([event, drms, direc, count_filter, excel])

Write results tables with bin count information.

setdefault(key[, default])

Insert key with a value of default if key is not in the dictionary.

solvepsd(nas, case, DR, fs, forcepsd, t_frc, ...)

Solve equations of motion in frequency domain with PSD forces

split()

Split results apart into a new DR_Results structure

srs_plots(*[, event, Q, drms, inc0rb, fmt, ...])

Make SRS plots with optional printing to .pdf or .png files.

strip_hists()

Strips out response histories and non-extreme srs data

time_data_recovery(sol, nas, case, DR, n, j)

Time-domain data recovery function

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()