Error in vertical interpolation on a 3D grid
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Inizia con la chiamata a interplevel e la validazione in specialdec.py intorno alla riga 681. Confronta la forma segnalata di height_levels (10, 159, 154) con la forma di Z (49, 159, 154) e determina le dimensioni previste per i livelli verticali 3D. Il lavoro è completato quando il caso di interpolazione segnalato viene gestito in modo coerente oppure la forma di input richiesta è chiaramente stabilita.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Hello all,
I'm trying to vertically interpolate few variables on a 3D grid. I have created 10 vertical levels between the 5m to mixing height. The height_levels are defined separately for each grid point. It is a 3D array with shape (10,159,154), where 159 are the latitudes and 154 are the longitudes.
num_levels= 10
for t in range(len(ds['Time'])):
pblh_t = ds['PBLH'].isel(Time=t).values
height_levels = np.logspace(np.log10(5), np.log10(pblh_t), num_levels)
field = ds[var].isel(Time=t)
Z = ds['Z_center'].isel(Time=t)
interpolated_data = interplevel(field, Z, height_levels)
The shape and the dimension of field and Z is matching exactly. However, this code is giving the following error:
File ~/miniconda3/envs/spyder-env/lib/python3.9/site-packages/wrf/specialdec.py:685 in func_wrapper
"the same leftmost and rightmost "
ValueError: argument 1 and 2 must have the same leftmost and rightmost dimensions.
If i give a list of values to interpolate, for example: height_levels = [50, 100,200,300]. code works fine and give the results without any error.
on inspecting the specialdec.py file, following are the lines which are raising the error
line:681
if is2dlev:
if levels.ndim != 2:
if (levels.shape[0:-2] != z.shape[0:-3] or
levels.shape[-2:] != z.shape[-2:]):
raise ValueError("argument 1 and 2 must have "
"the same leftmost and rightmost "
"dimensions")
For my case, levels.shape[-2:] = z.shape[-2:]),
height_levels.shape[-2:]
Out[99]: (159, 154)
Z.shape[-2:]
Out[100]: (159, 154)
but,
height_levels.shape[0:-2]
Out[101]: (10,)
Z.shape[0:-3]
Out[102]: ()
Z.shape[0:-3] is empty since the Z has only 3 dimensions (49,159,154). Here, 49 is the number of the model levels.
Can anyone please help me fix this.
Thank you for your time!!!
- Lingua principale
- Python
- Stelle
- 498
- Fork
- 178
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di NCAR/wrf-python
-
Add netCDF4 dependency and/or make it truly optionalForse di nuovo libera @kafitzgerald l’ha presa 219 giorni fa e non c’è nessuna pull request aperta. Aperta
NCAR/wrf-python#309 · 1 assegnatario ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
NCAR/wrf-python#307 · 5 commenti ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
NCAR/wrf-python#286 · 3 commenti ·
-
Windows builds and testingAperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
NCAR/wrf-python#282 · 1 commento ·
-
PyPI releasesForse di nuovo libera @kafitzgerald l’ha presa 436 giorni fa e non c’è nessuna pull request aperta. Aperta
NCAR/wrf-python#274 · 5 commenti · 1 reazione · 1 assegnatario ·
Tutte le issue di NCAR/wrf-python
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
gradio-app/gradio#13895 ·
I maintainer di solito rispondono entro 1 giorno
-
build-error
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
spack/spack-packages#6713 ·
I maintainer di solito rispondono entro 1 giorno
-
Use issue templatesAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
ActivityWatch/activitywatch#1464 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: The ckg tool drops the return type of every decorated Python method in class search resultsAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
bytedance/trae-agent#483 ·
I maintainer di solito rispondono entro 1 giorno