diff --git a/README.html b/README.html index b54b1ed..83e36b0 100644 --- a/README.html +++ b/README.html @@ -80,7 +80,7 @@ - + @@ -811,7 +811,7 @@
- Last updated on 14 June 2024.
+ Last updated on 17 June 2024.
PandasIndex(Index([20.5, 21.5, 22.5, 23.5, 24.5, 25.5, 26.5, 27.5, 28.5, 29.5, 30.5, 31.5, + dtype='float64', name='lon'))
PandasIndex(Index([20.5, 21.5, 22.5, 23.5, 24.5, 25.5, 26.5, 27.5, 28.5, 29.5, 30.5, 31.5, 32.5, 33.5, 34.5, 35.5, 36.5, 37.5, 38.5, 39.5, 40.5, 41.5, 42.5, 43.5, 44.5, 45.5, 46.5, 47.5, 48.5, 49.5, 50.5, 51.5, 52.5, 53.5, 54.5, 55.5, 56.5, 57.5, 58.5, 59.5, 60.5], - dtype='float64', name='lat'))
PandasIndex(Index([1000.0, 975.0, 950.0, 925.0, 900.0, 875.0, 850.0, 825.0, 800.0, + dtype='float64', name='lat'))
PandasIndex(Index([1000.0, 975.0, 950.0, 925.0, 900.0, 875.0, 850.0, 825.0, 800.0, 775.0, 750.0, 725.0, 700.0, 650.0, 600.0, 550.0, 500.0, 450.0, 400.0, 350.0, 300.0, 250.0, 200.0], - dtype='float64', name='lev'))
- Last updated on 14 June 2024.
+ Last updated on 17 June 2024.
- Last updated on 14 June 2024.
+ Last updated on 17 June 2024.
- Last updated on 14 June 2024.
+ Last updated on 17 June 2024.
/tmp/ipykernel_2455/1703524492.py:2: UserWarning: Vertical dimension number not found. Defaulting to (..., Z, Y, X) order.
+/tmp/ipykernel_2444/1703524492.py:2: UserWarning: Vertical dimension number not found. Defaulting to (..., Z, Y, X) order.
vort_adv_500 = mpcalc.advection(avor_500, u_500, v_500,) * 1e9
-/tmp/ipykernel_2455/1703524492.py:2: UserWarning: Latitude and longitude computed on-demand, which may be an expensive operation. To avoid repeating this computation, assign these coordinates ahead of time with .metpy.assign_latitude_longitude().
+/tmp/ipykernel_2444/1703524492.py:2: UserWarning: Latitude and longitude computed on-demand, which may be an expensive operation. To avoid repeating this computation, assign these coordinates ahead of time with .metpy.assign_latitude_longitude().
vort_adv_500 = mpcalc.advection(avor_500, u_500, v_500,) * 1e9
@@ -1047,7 +1047,7 @@ Miller Composite Chart
- Last updated on 14 June 2024.
+ Last updated on 17 June 2024.
- Last updated on 14 June 2024.
+ Last updated on 17 June 2024.
- Last updated on 14 June 2024.
+ Last updated on 17 June 2024.
- Last updated on 14 June 2024.
+ Last updated on 17 June 2024.
- Last updated on 14 June 2024.
+ Last updated on 17 June 2024.
- Last updated on 14 June 2024.
+ Last updated on 17 June 2024.
- Last updated on 14 June 2024.
+ Last updated on 17 June 2024.
- Last updated on 14 June 2024.
+ Last updated on 17 June 2024.
- Last updated on 14 June 2024.
+ Last updated on 17 June 2024.
- Last updated on 14 June 2024.
+ Last updated on 17 June 2024.
- Last updated on 14 June 2024.
+ Last updated on 17 June 2024.
- Last updated on 14 June 2024.
+ Last updated on 17 June 2024.
- Last updated on 14 June 2024.
+ Last updated on 17 June 2024.
- Last updated on 14 June 2024.
+ Last updated on 17 June 2024.
- Last updated on 14 June 2024.
+ Last updated on 17 June 2024.
- Last updated on 14 June 2024.
+ Last updated on 17 June 2024.
/tmp/ipykernel_2815/1982158916.py:30: MatplotlibDeprecationWarning: The get_cmap function was deprecated in Matplotlib 3.7 and will be removed two minor releases later. Use ``matplotlib.colormaps[name]`` or ``matplotlib.colormaps.get_cmap(obj)`` instead.
+/tmp/ipykernel_2836/1982158916.py:30: MatplotlibDeprecationWarning: The get_cmap function was deprecated in Matplotlib 3.7 and will be removed two minor releases later. Use ``matplotlib.colormaps[name]`` or ``matplotlib.colormaps.get_cmap(obj)`` instead.
cmap = plt.cm.get_cmap('BuPu')
-
+
- Last updated on 14 June 2024.
+ Last updated on 17 June 2024.
Text(1.0, 1.0, 'Valid Time: 2016-10-31 12:00:00')
- Last updated on 14 June 2024.
+ Last updated on 17 June 2024.
/tmp/ipykernel_2870/3729036084.py:5: UserWarning: Vertical dimension number not found. Defaulting to (..., Z, Y, X) order.
+/tmp/ipykernel_2892/3729036084.py:5: UserWarning: Vertical dimension number not found. Defaulting to (..., Z, Y, X) order.
vort_adv = mpcalc.advection(avor, uwnd_500er, vwnd_500er) * 1e4
@@ -645,10 +645,10 @@ Map Creation
-<matplotlib.quiver.Barbs at 0x7f126c158f10>
+<matplotlib.quiver.Barbs at 0x7f7a77c3baf0>
-
+
@@ -965,7 +965,7 @@ Map Creation
- Last updated on 14 June 2024.
+ Last updated on 17 June 2024.
- Last updated on 14 June 2024.
+ Last updated on 17 June 2024.
Text(1.0, 1.0, 'Valid Time: 2010-10-26 12:00:00')
- Last updated on 14 June 2024.
+ Last updated on 17 June 2024.
/tmp/ipykernel_2954/72829660.py:2: UserWarning: Vertical dimension number not found. Defaulting to (..., Z, Y, X) order.
+/tmp/ipykernel_2981/72829660.py:2: UserWarning: Vertical dimension number not found. Defaulting to (..., Z, Y, X) order.
adv = mpcalc.advection(temp_850, u_wind_850, v_wind_850)
@@ -914,7 +914,7 @@ Begin map creation
- Last updated on 14 June 2024.
+ Last updated on 17 June 2024.
- Last updated on 14 June 2024.
+ Last updated on 17 June 2024.
- Last updated on 14 June 2024.
+ Last updated on 17 June 2024.
/tmp/ipykernel_3032/3635212219.py:2: UserWarning: Vertical dimension number not found. Defaulting to (..., Z, Y, X) order.
+/tmp/ipykernel_3063/3635212219.py:2: UserWarning: Vertical dimension number not found. Defaulting to (..., Z, Y, X) order.
tadv_700 = mpcalc.advection(tmpk_700, uwnd_700, vwnd_700)
-/tmp/ipykernel_3032/3635212219.py:3: UserWarning: Vertical dimension number not found. Defaulting to (..., Z, Y, X) order.
+/tmp/ipykernel_3063/3635212219.py:3: UserWarning: Vertical dimension number not found. Defaulting to (..., Z, Y, X) order.
tadv_300 = mpcalc.advection(tmpk_300, uwnd_300, vwnd_300)
@@ -695,7 +695,7 @@ Make Four Panel PlotText(1.0, 1.0, 'Valid: 1993-03-13 18:00:00')
- Last updated on 14 June 2024.
+ Last updated on 17 June 2024.
/tmp/ipykernel_3061/2639708157.py:10: DeprecationWarning: Please import `gaussian_filter` from the `scipy.ndimage` namespace; the `scipy.ndimage.filters` namespace is deprecated and will be removed in SciPy 2.0.0.
+/tmp/ipykernel_3091/2639708157.py:10: DeprecationWarning: Please import `gaussian_filter` from the `scipy.ndimage` namespace; the `scipy.ndimage.filters` namespace is deprecated and will be removed in SciPy 2.0.0.
from scipy.ndimage.filters import gaussian_filter
@@ -869,19 +869,19 @@ Geostrophic Wind and Other Calcuations
@@ -1316,30 +1316,30 @@ Geostrophic Wind and Other Calcuations
@@ -1734,30 +1734,30 @@ Geostrophic Wind and Other Calcuations
@@ -2132,7 +2132,7 @@ Geostrophic Wind and Other Calcuations
- Last updated on 14 June 2024.
+ Last updated on 17 June 2024.
@@ -2186,7 +2186,7 @@ Geostrophic Wind and Other Calcuations
-
+
@@ -541,7 +541,7 @@ Isentropic Analysis
-/tmp/ipykernel_3085/414936893.py:1: UserWarning: Interpolation point out of data bounds encountered
+/tmp/ipykernel_3117/414936893.py:1: UserWarning: Interpolation point out of data bounds encountered
isent_anal = mpcalc.isentropic_interpolation(isentlevs,
@@ -637,10 +637,10 @@ Isentropic Analysis
-Text(1.0, 1.0, 'VALID: 2024-06-14 12:00:00 UTC')
+Text(1.0, 1.0, 'VALID: 2024-06-17 12:00:00 UTC')
-
+
@@ -936,7 +936,7 @@ Isentropic Analysis
- Last updated on 14 June 2024.
+ Last updated on 17 June 2024.
@@ -990,7 +990,7 @@ Isentropic Analysis
-
+
@@ -623,7 +623,7 @@ Map CreationText(1.0, 1.0, 'Valid Time: 2010-10-26 12:00:00')
-
+
@@ -938,7 +938,7 @@ Map Creation
- Last updated on 14 June 2024.
+ Last updated on 17 June 2024.
A helper function for obtaining radiosonde station information (e.g., -latitude/longitude) requried to plot data obtained from each station. -Original code by github user sgdecker.
-def station_info(stid):
- r"""Provide information about weather stations.
-
- Parameters
- ----------
- stid: str or iterable object containing strs
- The ICAO or IATA code(s) for which station information is requested.
- with_units: bool
- Whether to include units for values that have them. Default True.
-
- Returns
- -------
- info: dict
- Information about the station(s) within a dictionary with these keys:
- 'state': Two-character ID of the state/province where the station is located,
- if applicable
- 'name': The name of the station
- 'lat': The latitude of the station [deg]
- 'lon': The longitude of the station [deg]
- 'elevation': The elevation of the station [m]
- 'country': Two-character ID of the country where the station is located
-
- Modified code from Steven Decker, Rutgers University
-
- """
- # Provide a helper function for later usage
- def str2latlon(s):
- deg = float(s[:3])
- mn = float(s[-3:-1])
- if s[-1] == 'S' or s[-1] == 'W':
- deg = -deg
- mn = -mn
- return deg + mn / 60.
-
- # Various constants describing the underlying data
- url = 'https://www.aviationweather.gov/docs/metar/stations.txt'
- # file = 'stations.txt'
- state_bnds = slice(0, 2)
- name_bnds = slice(3, 19)
- icao_bnds = slice(20, 24)
- iata_bnds = slice(26, 29)
- lat_bnds = slice(39, 45)
- lon_bnds = slice(47, 54)
- z_bnds = slice(55, 59)
- cntry_bnds = slice(81, 83)
-
- # Generalize to any number of IDs
- if isinstance(stid, str):
- stid = [stid]
-
- # Get the station dataset
- infile = urllib.request.urlopen(url)
- data = infile.readlines()
-
- state = []
- name = []
- lat = []
- lon = []
- z = []
- cntry = []
-
- for s in stid:
- s = s.upper()
- for line_bytes in data:
- line = line_bytes.decode('UTF-8')
- icao = line[icao_bnds]
- iata = line[iata_bnds]
- if len(s) == 3 and s in iata or len(s) == 4 and s in icao:
- state.append(line[state_bnds].strip())
- name.append(line[name_bnds].strip())
- lat.append(str2latlon(line[lat_bnds]))
- lon.append(str2latlon(line[lon_bnds]))
- z.append(float(line[z_bnds]))
- cntry.append(line[cntry_bnds])
-
- break
- else:
- state.append('NA')
- name.append('NA')
- lat.append(np.nan)
- lon.append(np.nan)
- z.append(np.nan)
- cntry.append('NA')
-
- infile.close()
-
- return {'state': np.array(state), 'name': np.array(name), 'lat': np.array(lat),
- 'lon': np.array(lon), 'elevation': np.array(z), 'country': np.array(cntry),
- 'units': {'lat': 'deg', 'lon': 'deg', 'z': 'm'}}
-
Set a date and time for upper-air observations (should only be 00 or 12 @@ -693,65 +593,33 @@
---------------------------------------------------------------------------
-HTTPError Traceback (most recent call last)
-Cell In[5], line 21
- 18 df = data[data_subset]
- 20 # Get station lat/lon from look-up file; add to Dataframe
----> 21 stn_info = station_info(list(df.station.values))
- 22 df.insert(10, 'latitude', stn_info['lat'])
- 23 df.insert(11, 'longitude', stn_info['lon'])
-
-Cell In[3], line 52, in station_info(stid)
- 49 stid = [stid]
- 51 # Get the station dataset
----> 52 infile = urllib.request.urlopen(url)
- 53 data = infile.readlines()
- 55 state = []
-
-File ~/miniconda3/envs/cookbook-dev/lib/python3.10/urllib/request.py:216, in urlopen(url, data, timeout, cafile, capath, cadefault, context)
- 214 else:
- 215 opener = _opener
---> 216 return opener.open(url, data, timeout)
-
-File ~/miniconda3/envs/cookbook-dev/lib/python3.10/urllib/request.py:525, in OpenerDirector.open(self, fullurl, data, timeout)
- 523 for processor in self.process_response.get(protocol, []):
- 524 meth = getattr(processor, meth_name)
---> 525 response = meth(req, response)
- 527 return response
-
-File ~/miniconda3/envs/cookbook-dev/lib/python3.10/urllib/request.py:634, in HTTPErrorProcessor.http_response(self, request, response)
- 631 # According to RFC 2616, "2xx" code indicates that the client's
- 632 # request was successfully received, understood, and accepted.
- 633 if not (200 <= code < 300):
---> 634 response = self.parent.error(
- 635 'http', request, response, code, msg, hdrs)
- 637 return response
-
-File ~/miniconda3/envs/cookbook-dev/lib/python3.10/urllib/request.py:563, in OpenerDirector.error(self, proto, *args)
- 561 if http_err:
- 562 args = (dict, 'default', 'http_error_default') + orig_args
---> 563 return self._call_chain(*args)
-
-File ~/miniconda3/envs/cookbook-dev/lib/python3.10/urllib/request.py:496, in OpenerDirector._call_chain(self, chain, kind, meth_name, *args)
- 494 for handler in handlers:
- 495 func = getattr(handler, meth_name)
---> 496 result = func(*args)
- 497 if result is not None:
- 498 return result
-
-File ~/miniconda3/envs/cookbook-dev/lib/python3.10/urllib/request.py:643, in HTTPDefaultErrorHandler.http_error_default(self, req, fp, code, msg, hdrs)
- 642 def http_error_default(self, req, fp, code, msg, hdrs):
---> 643 raise HTTPError(req.full_url, code, msg, hdrs, fp)
-
-HTTPError: HTTP Error 308: Permanent Redirect
+/home/runner/miniconda3/envs/cookbook-dev/lib/python3.10/site-packages/metpy/io/station_data.py:194: SettingWithCopyWarning:
+A value is trying to be set on a copy of a slice from a DataFrame.
+Try using .loc[row_indexer,col_indexer] = value instead
+
+See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
+ df['latitude'] = np.nan
+/home/runner/miniconda3/envs/cookbook-dev/lib/python3.10/site-packages/metpy/io/station_data.py:195: SettingWithCopyWarning:
+A value is trying to be set on a copy of a slice from a DataFrame.
+Try using .loc[row_indexer,col_indexer] = value instead
+
+See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
+ df['longitude'] = np.nan
+Downloading file 'sfstns.tbl' from 'https://github.com/Unidata/MetPy/raw/v1.6.2/staticdata/sfstns.tbl' to '/home/runner/.cache/metpy/v1.6.2'.
+
+
+Downloading file 'master.txt' from 'https://github.com/Unidata/MetPy/raw/v1.6.2/staticdata/master.txt' to '/home/runner/.cache/metpy/v1.6.2'.
+
+
+Downloading file 'stations.txt' from 'https://github.com/Unidata/MetPy/raw/v1.6.2/staticdata/stations.txt' to '/home/runner/.cache/metpy/v1.6.2'.
+
+
+Downloading file 'airport-codes.csv' from 'https://github.com/Unidata/MetPy/raw/v1.6.2/staticdata/airport-codes.csv' to '/home/runner/.cache/metpy/v1.6.2'.
---------------------------------------------------------------------------
-KeyError Traceback (most recent call last)
-File ~/miniconda3/envs/cookbook-dev/lib/python3.10/site-packages/pandas/core/indexes/base.py:3805, in Index.get_loc(self, key)
- 3804 try:
--> 3805 return self._engine.get_loc(casted_key)
- 3806 except KeyError as err:
-
-File index.pyx:167, in pandas._libs.index.IndexEngine.get_loc()
-
-File index.pyx:196, in pandas._libs.index.IndexEngine.get_loc()
-
-File pandas/_libs/hashtable_class_helper.pxi:7081, in pandas._libs.hashtable.PyObjectHashTable.get_item()
-
-File pandas/_libs/hashtable_class_helper.pxi:7089, in pandas._libs.hashtable.PyObjectHashTable.get_item()
-
-KeyError: 'longitude'
-
-The above exception was the direct cause of the following exception:
-
-KeyError Traceback (most recent call last)
-Cell In[7], line 7
- 2 mapcrs = ccrs.LambertConformal(
- 3 central_latitude=45, central_longitude=-100, standard_parallels=(30, 60))
- 5 # Set up station locations for plotting observations
- 6 point_locs = mapcrs.transform_points(
-----> 7 ccrs.PlateCarree(), df['longitude'].values, df['latitude'].values)
- 9 # Start figure and set graphics extent
- 10 fig = plt.figure(1, figsize=(17, 15))
-
-File ~/miniconda3/envs/cookbook-dev/lib/python3.10/site-packages/pandas/core/frame.py:4102, in DataFrame.__getitem__(self, key)
- 4100 if self.columns.nlevels > 1:
- 4101 return self._getitem_multilevel(key)
--> 4102 indexer = self.columns.get_loc(key)
- 4103 if is_integer(indexer):
- 4104 indexer = [indexer]
-
-File ~/miniconda3/envs/cookbook-dev/lib/python3.10/site-packages/pandas/core/indexes/base.py:3812, in Index.get_loc(self, key)
- 3807 if isinstance(casted_key, slice) or (
- 3808 isinstance(casted_key, abc.Iterable)
- 3809 and any(isinstance(x, slice) for x in casted_key)
- 3810 ):
- 3811 raise InvalidIndexError(key)
--> 3812 raise KeyError(key) from err
- 3813 except TypeError:
- 3814 # If we have a listlike key, _check_indexing_error will raise
- 3815 # InvalidIndexError. Otherwise we fall through and re-raise
- 3816 # the TypeError.
- 3817 self._check_indexing_error(key)
-
-KeyError: 'longitude'
+/tmp/ipykernel_3174/1340384606.py:75: MatplotlibDeprecationWarning: The collections attribute was deprecated in Matplotlib 3.8 and will be removed two minor releases later.
+ for c in cs2.collections:
+
- Last updated on 14 June 2024.
+ Last updated on 17 June 2024.
/tmp/ipykernel_3163/1356670571.py:43: MatplotlibDeprecationWarning: The legendHandles attribute was deprecated in Matplotlib 3.7 and will be removed two minor releases later. Use legend_handles instead.
+/tmp/ipykernel_3202/1356670571.py:43: MatplotlibDeprecationWarning: The legendHandles attribute was deprecated in Matplotlib 3.7 and will be removed two minor releases later. Use legend_handles instead.
legend.legendHandles[0].set_color('gold')
-/tmp/ipykernel_3163/1356670571.py:44: MatplotlibDeprecationWarning: The legendHandles attribute was deprecated in Matplotlib 3.7 and will be removed two minor releases later. Use legend_handles instead.
+/tmp/ipykernel_3202/1356670571.py:44: MatplotlibDeprecationWarning: The legendHandles attribute was deprecated in Matplotlib 3.7 and will be removed two minor releases later. Use legend_handles instead.
legend.legendHandles[1].set_color('cornflowerblue')
-/tmp/ipykernel_3163/1356670571.py:45: MatplotlibDeprecationWarning: The legendHandles attribute was deprecated in Matplotlib 3.7 and will be removed two minor releases later. Use legend_handles instead.
+/tmp/ipykernel_3202/1356670571.py:45: MatplotlibDeprecationWarning: The legendHandles attribute was deprecated in Matplotlib 3.7 and will be removed two minor releases later. Use legend_handles instead.
legend.legendHandles[2].set_color('deeppink')
-
+
- Last updated on 14 June 2024.
+ Last updated on 17 June 2024.
- Last updated on 14 June 2024.
+ Last updated on 17 June 2024.
- Last updated on 14 June 2024.
+ Last updated on 17 June 2024.