Пример #1
0
        diff_count += 1
    if diff_count > 1:
        exp_key = 'Combined'
    return data.waveBand, exp_key

def setupDefaults(grid):
    ax = grid[0]
    ax.xaxis.set_major_locator(plt.MultipleLocator(5))
    ax.set_xlim(-15, 15)
    ax.set_ylim(0, 50)

plt.rcParams['font.size'] = 12
plots.defaults.axisDefaults.setup = setupDefaults
data_cache = DataCache('ref_runs', make_key, ('band', 'exp'))
data_cache.key_sorter = sorter
wavelengths,exps = data_cache.sub_keys()

for lam_text, exp_text in [('C', 'Control'), ('X', 'Control')]:
    data = data_cache[lam_text, exp_text]
    with datatypes.PlotInfoContext(wavelength=data.wavelength):
        for desc,moms in [('Single', (datatypes.Reflectivity, datatypes.DopplerVelocity, datatypes.SpectrumWidth)),
                          ('Dual', (datatypes.ZDR, datatypes.RhoHV, datatypes.PhiDP)),
                          ('Attenuation', (datatypes.Attenuation, datatypes.DiffAtten))]:
            source = 'calc' if desc=='Attenuation' else 'ts'
            moments = [data.fields.grab(moment, pol='H', source=source) for moment in moms] 

            fig = plt.figure(figsize=(11, 6), dpi=200)
            if len(moments) == 3:
                rect = [0.07, 0.05, 0.88, 0.95]
            else:
                rect = [0.07, 0.05, 0.88, 0.82]
Пример #2
0
def load_spatial_experiments(data_dir, glob='*'):
    data_cache = DataCache(data_dir, make_spatial_key, ('band', 'exp'),
        pattern=glob)
    data_cache.key_sorter = spatial_sorter
    wavelengths,exps = data_cache.sub_keys()
    return data_cache