コード例 #1
0
#ag_commnds['rlat'] = 'MEAN'
#ag_commnds['rlon'] = 'MEAN'
#####################################################################

####################### NAMELIST PLOT #######################
nDPlot = 2  # How many dimensions should plot have (1 or 2)
i_diffPlot = 0  # Draw plot showing difference filtered - unfiltered # TODO
plotOutDir = '../00_plots/04_coldPools'
import os
if not os.path.exists(plotOutDir):
    os.makedirs(plotOutDir)
#hrStr = '{num:02d}'.format(num=hour)
#dtStr = format(startTime,'%d_%H')
plotName = '11_WVP_1_1_1400_1700'

an = analysis.analysis(inpPath, fieldNames)

an.subSpaceInds = subSpaceIndsIN
an.ag_commnds = ag_commnds
an.i_info = i_info
an.i_resolutions = i_resolutions

# RUN ANALYSIS
an.run()

import matplotlib
if i_plot == 2:
    matplotlib.use('Agg')
import matplotlib.pyplot as plt

widthStretch = 13.8
コード例 #2
0
        elif fieldName == 'zQV':
            absMin = 0
            absMax = 14
            step = 0.7
        Mticks = list(np.arange(absMin, absMax + 0.001, step))
    elif fieldName in ['zT', 'zU', 'zV']:
        autoTicks = 1
        cmapM = 'seismic'
    else:
        autoTicks = 1
    MThrMinRel = 0.15  # Relative amount of max value to mask (see Mmask)
    # COLORBAR Models
    cmapD = 'bwr'  # colormap for Difference output (bwr)
    #####################################################################

    an = analysis.analysis(inpPath, [fieldName])

    an.subSpaceInds = ssI
    an.ag_commnds = ag_commnds
    an.i_info = i_info
    an.i_resolutions = i_resolutions

    # RUN ANALYSIS
    an.run()

    # If temperature remove lapse rate
    if fieldName == 'zT':
        for res in an.resolutions:
            for mode in an.modes:
                field = an.vars['zT'].ncos[res + mode].field
                alts = field.dims['altitude'].vals
コード例 #3
0
ファイル: fig_05_06.py プロジェクト: Potopoles/MScTh
##### 2D Contour ######
contourTranspose = 0  # Reverse contour dimensions?
plotContour = 0  # Besides the filled contour, also plot the contour?
cmapM = 'jet'  # colormap for Model output (jet, terrain, inferno, YlOrRd)
axis = 'equal'  # set 'equal' if keep aspect ratio, else 'auto'
# COLORBAR Models
autoTicks = 0  # 1 if colorbar should be set automatically
Mmask = 1  # Mask Model values lower than MThrMinRel of maximum value?
MThrMinRel = 0.02  # Relative amount of max value to mask (see Mmask)
Mticks = list(np.arange(10, 125, 10))
# COLORBAR Models
cmapD = 'bwr'  # colormap for Difference output (bwr)
#####################################################################

an = analysis.analysis(inpPath, fieldNames, use_obs=True)

#an.subSpaceInds = subSpaceInds
an.subSpaceInds = ssI
an.ag_commnds = ag_commnds
an.i_info = i_info
an.i_resolutions = i_resolutions

# RUN ANALYSIS
an.run()
print(an.vars['nTOT_PREC'].ncos['RAW1'].field.vals.shape)
#quit()

import matplotlib
if i_plot == 2:
    matplotlib.use('Agg')
コード例 #4
0
elif i_resolutions == 2:
    ress = ['4.4', '2.2']
elif i_resolutions == 3:
    ress = ['4.4', '2.2', '1.1']
elif i_resolutions == 4:
    ress = ['2.2']
elif i_resolutions == 5:
    ress = ['1.1']
modes = ['', 'f']

for fieldName in fieldNames:
    print(fieldName)
    fieldList = [fieldName]

    print('ANALYSIS')
    an = analysis.analysis(inpPath, fieldList)

    an.subSpaceInds = subSpaceInds
    an.ag_commnds = {}
    an.i_info = i_info
    an.i_resolutions = i_resolutions

    # RUN ANALYSIS
    an.run()

    print('SAVING')
    for res in ress:
        for mode in modes:
            print('\t' + str(res) + mode)
            nco = an.vars[fieldName].ncos[res + mode]
            outFilePath = outPath + '/' + res + mode + '/' + fieldName + '.nc'