Пример #1
0
 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
    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
    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
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]