Skip to content

Getting GFS forecast variables for sounding-plotting #2474

Discussion options

You must be logged in to vote

When using isel from Xarray, you have to provide integers which correspond to the index into the lat/lon array that you want (like you do for time, using time=0). If you want to use actual lat/lon values, you have to use plain sel:
https://docs.xarray.dev/en/latest/user-guide/indexing.html

You can string together your selection I think like this:
temp_raw.isel(time=0).sel(lat=##.####,lon=-##.####)

Note that I am not very familiar with lat/lon and using sel. If the exact lat/lon value of your sounding site isn't found within the lat/lon array, there may be ways you can tell Xarray how to select the "best" one by interpolating, or doing nearest, etc. For example: https://docs.xarray.dev/en/…

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@DanielAdriaansen
Comment options

@kylejgillett
Comment options

@kylejgillett
Comment options

@DanielAdriaansen
Comment options

@dopplershift
Comment options

Answer selected by dopplershift
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants