Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Geostrophic and Ageostrophic Wind

Plot a 1000-hPa map calculating the geostrophic from MetPy and finding the ageostrophic wind from the total wind and the geostrophic wind.

This uses the geostrophic wind calculation from metpy.calc to find the geostrophic wind, then performs the simple subtraction to find the ageostrophic wind. Currently, this needs an extra helper function to calculate the distance between lat/lon grid points.

Additionally, we utilize the ndimage.zoom method for smoothing the 1000-hPa height contours without smoothing the data.

Imports

Set up access to the data

---------------------------------------------------------------------------
HTTPError                                 Traceback (most recent call last)
Cell In[2], line 22
     18                 'u-component_of_wind_isobaric',
     19                 'v-component_of_wind_isobaric')
     20 query.vertical_level(100000)
     21 
---> 22 data = ncss.get_data(query)
     23 
     24 ds = xr.open_dataset(NetCDF4DataStore(data)).metpy.parse_cf()

File ~/micromamba/envs/metpy-cookbook/lib/python3.14/site-packages/siphon/ncss.py:114, in NCSS.get_data(self, query)
     93 def get_data(self, query):
     94     """Fetch parsed data from a THREDDS server using NCSS.
     95 
     96     Requests data from the NCSS endpoint given the parameters in `query` and
   (...)    112 
    113     """
--> 114     resp = self.get_query(query)
    115     return response_handlers(resp, self.unit_handler)

File ~/micromamba/envs/metpy-cookbook/lib/python3.14/site-packages/siphon/http_util.py:406, in HTTPEndPoint.get_query(self, query)
    386 """Make a GET request, including a query, to the endpoint.
    387 
    388 The path of the request is to the base URL assigned to the endpoint.
   (...)    403 
    404 """
    405 url = self._base[:-1] if self._base[-1] == '/' else self._base
--> 406 return self.get(url, query)

File ~/micromamba/envs/metpy-cookbook/lib/python3.14/site-packages/siphon/http_util.py:488, in HTTPEndPoint.get(self, path, params)
    486     else:
    487         text = resp.text
--> 488     raise requests.HTTPError(f'Error accessing {resp.request.url}\n'
    489                              f'Server Error ({resp.status_code: d}: {text})')
    490 return resp

HTTPError: Error accessing https://www.ncei.noaa.gov/thredds/ncss/grid/model-gfs-g4-anl-files-old/201608/20160822/gfsanl_4_20160822_1800_003.grb2?var=u-component_of_wind_isobaric&var=v-component_of_wind_isobaric&var=Geopotential_height_isobaric&time=2016-08-22T21%3A00%3A00&west=-115&east=-80&south=30&north=50&vertCoord=100000
Server Error ( 404: FileNotFound: No such file or directory)