コード例 #1
0
ファイル: obs.py プロジェクト: hhuangmeso/WEM
 def get_subdomain(self,Nlim,Elim,Slim,Wlim):
     """
     Return data array between bounds
     """
     data,lats,lons = utils.return_subdomain(self.data,self.lats,
                             self.lons,Nlim,Elim,Slim,Wlim)
     return data,lats,lons
コード例 #2
0
ファイル: obs.py プロジェクト: johnrobertlawson/WEM
    def get_subdomain(self,Nlim,Elim,Slim,Wlim,overwrite=False):
        """
        Return data array between bounds

        If overwrite is True, replace class data with new subdomain
        """
        data,lats,lons = utils.return_subdomain(self.data,self.lats,
                                self.lons,Nlim,Elim,Slim,Wlim)

        if overwrite:
            self.lats = lats
            self.lons = lons
            self.data = data
            return
        else:
            return data,lats,lons
コード例 #3
0
ファイル: obs.py プロジェクト: everdaniel/WEM
    def get_subdomain(self, Nlim, Elim, Slim, Wlim, overwrite=False):
        """
        Return data array between bounds

        If overwrite is True, replace class data with new subdomain
        """
        data, lats, lons = utils.return_subdomain(self.data, self.lats,
                                                  self.lons, Nlim, Elim, Slim,
                                                  Wlim)

        if overwrite:
            self.lats = lats
            self.lons = lons
            self.data = data
            return
        else:
            return data, lats, lons
コード例 #4
0
DATA = {}

# cross-section labels
latA = 40.3
lonA = -99.3
latB = 39.0
lonB = -98.2

for nest in ("SINGLE","NESTED"):
    DATA[nest] = {}
    DATA[nest]['W'] = WRFOut(os.path.join(ncdir[nest],ncfile))
    # import pdb; pdb.set_trace()
    DATA[nest]['U'] = DATA[nest]['W'].get('U',utc=utc,level=lv)[0,0,:,:]
    DATA[nest]['U'],lats,lons = utils.return_subdomain(DATA[nest]['U'],
                    DATA[nest]['W'].lats1D,DATA[nest]['W'].lons1D,
                    fmt='latlon',**lims)
    DATA[nest]['V'] = DATA[nest]['W'].get('V',utc=utc,level=lv)[0,0,:,:]
    DATA[nest]['V'],lats,lons = utils.return_subdomain(DATA[nest]['V'],
                    DATA[nest]['W'].lats1D,DATA[nest]['W'].lons1D,
                    fmt='latlon',**lims)

U_diff = DATA['SINGLE']['U'] - DATA['NESTED']['U']
V_diff = DATA['SINGLE']['V'] - DATA['NESTED']['V']

# difference plot
diffplot = 0
if diffplot:
    fig,ax = plt.subplots(1,figsize=(4,4))
    F = BirdsEye(ax=ax,fig=fig)
    F.bmap,F.x,F.y = F.basemap_setup(lats=lats,lons=lons,)
コード例 #5
0
ファイル: difference_plots.py プロジェクト: NicWayand/WEM
utc = (2013, 8, 15, 21, 0, 0)
outdir = "/home/jrlawson/public_html/bowecho/paper2"
lims = {"Nlim": 41.0, "Elim": -97.4, "Slim": 38.3, "Wlim": -101.0}

fig, ax = plt.subplots(1, figsize=(4, 4))
DATA = {}

for nest in ("SINGLE", "NESTED"):
    DATA[nest] = {}
    DATA[nest]["W"] = WRFOut(os.path.join(ncdir[nest], ncfile))
    import pdb

    pdb.set_trace()
    DATA[nest]["U"] = DATA[nest]["W"].get("U", utc=utc, level=lv)[0, 0, :, :]
    DATA[nest]["U"], lats, lons = utils.return_subdomain(
        DATA[nest]["U"], DATA[nest]["W"].lats1D, DATA[nest]["W"].lons1D, fmt="latlon", **lims
    )
    DATA[nest]["V"] = DATA[nest]["W"].get("V", utc=utc, level=lv)[0, 0, :, :]
    DATA[nest]["V"], lats, lons = utils.return_subdomain(
        DATA[nest]["V"], DATA[nest]["W"].lats1D, DATA[nest]["W"].lons1D, fmt="latlon", **lims
    )

U_diff = DATA["SINGLE"]["U"] - DATA["NESTED"]["U"]
V_diff = DATA["SINGLE"]["V"] - DATA["NESTED"]["V"]

F = BirdsEye(ax=ax, fig=fig)
F.bmap, F.x, F.y = F.basemap_setup(lats=lats, lons=lons)
n = 3
U_diff2 = -1 * U_diff[::n, ::n]
V_diff2 = -1 * V_diff[::n, ::n]
x = F.x[::n, ::n]