4
$\begingroup$

I have calculated the $∂θ_\varepsilon/∂z$ with 'Height', 'Latitude', 'Longitude' dimensions.

import numpy as np import xarray as xr from wrf import (getvar) eth = np.array(getvar(ncfile, "eth", timeidx=time)) z = np.array(getvar(ncfile, "z", timeidx=time, units="km")) deth = np.gradient(eth, axis=0) dz = np.gradient(z, axis=0) deth_dz = deth/dz dthdz = xr.DataArray(data=deth_dz, dims=['Height', 'Latitude', 'Longitude']) 

I would like to plot the horizontal depth or thickness (in km) of the dthdz. It is a bit similar to this question. But when I do dthdz.sum(dim='Height'), I get very low depth values. I just want to know where I'm doing it wrong. Thank you!

$\endgroup$
4
  • $\begingroup$ For programming related questions unless you provide the dataset very few here can help you $\endgroup$ Commented Sep 14, 2021 at 7:44
  • $\begingroup$ Why not use MetPy's thickness API - unidata.github.io/MetPy/latest/api/generated/… ? $\endgroup$ Commented Sep 14, 2021 at 7:45
  • $\begingroup$ thanks @gansub! this uses conventional wrfout data. i tried the thickness_hydrostatic but it outputs in 1D. i was hoping to make a horizontal plot of the depth $\endgroup$ Commented Sep 14, 2021 at 8:36
  • $\begingroup$ Suggest you take this over to MetPy gitter and then ask the question over there. $\endgroup$ Commented Sep 14, 2021 at 8:49

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.