@@ -142,11 +142,11 @@ class Environment:
142142 Environment.atmospheric_model_type : string
143143 Describes the atmospheric model which is being used. Can only assume the
144144 following values: ``standard_atmosphere``, ``custom_atmosphere``,
145- ``wyoming_sounding``, ``NOAARucSounding``, `` Forecast``, ``Reanalysis``,
145+ ``wyoming_sounding``, ``Forecast``, ``Reanalysis``,
146146 ``Ensemble``.
147147 Environment.atmospheric_model_file : string
148148 Address of the file used for the atmospheric model being used. Only
149- defined for ``wyoming_sounding``, ``NOAARucSounding``, `` Forecast``,
149+ defined for ``wyoming_sounding``, ``Forecast``,
150150 ``Reanalysis``, ``Ensemble``
151151 Environment.atmospheric_model_dict : dictionary
152152 Dictionary used to properly interpret ``netCDF`` and ``OPeNDAP`` files.
@@ -1053,24 +1053,6 @@ def set_atmospheric_model( # pylint: disable=too-many-statements
10531053
10541054 .. _weather.uwyo: http://weather.uwyo.edu/upperair/sounding.html
10551055
1056- - ``NOAARucSounding``: sets pressure, temperature, wind-u
1057- and wind-v profiles and surface elevation obtained from
1058- an upper air sounding given by the file parameter through
1059- an URL. This URL should point to a data webpage obtained
1060- through NOAA's Ruc Sounding servers, which can be accessed
1061- in `rucsoundings`_. Selecting ROABs as the
1062- initial data source, specifying the station through it's
1063- WMO-ID and opting for the ASCII (GSD format) button, the
1064- following example URL opens up:
1065-
1066- https://rucsoundings.noaa.gov/get_raobs.cgi?data_source=RAOB&latest=latest&start_year=2019&start_month_name=Feb&start_mday=5&start_hour=12&start_min=0&n_hrs=1.0&fcst_len=shortest&airport=83779&text=Ascii%20text%20%28GSD%20format%29&hydrometeors=false&start=latest
1067-
1068- Any ASCII GSD format page from this server can be read,
1069- so information from virtual soundings such as GFS and NAM
1070- can also be imported.
1071-
1072- .. _rucsoundings: https://rucsoundings.noaa.gov/
1073-
10741056 - ``windy_atmosphere``: sets pressure, temperature, wind-u and
10751057 wind-v profiles and surface elevation obtained from the Windy API.
10761058 See file argument to specify the model as either ``ECMWF``,
@@ -1279,8 +1261,6 @@ def set_atmospheric_model( # pylint: disable=too-many-statements
12791261 self .process_standard_atmosphere ()
12801262 elif type == "wyoming_sounding" :
12811263 self .process_wyoming_sounding (file )
1282- elif type == "noaarucsounding" :
1283- self .process_noaaruc_sounding (file )
12841264 elif type == "custom_atmosphere" :
12851265 self .process_custom_atmosphere (pressure , temperature , wind_u , wind_v )
12861266 elif type == "windy" :
@@ -1689,108 +1669,18 @@ def process_noaaruc_sounding(self, file): # pylint: disable=too-many-statements
16891669
16901670 See also
16911671 --------
1692- More details can be found at: https://rucsoundings.noaa.gov/ .
1672+ This method is deprecated and will be fully deleted in version 1.8.0 .
16931673
16941674 Returns
16951675 -------
16961676 None
16971677 """
1698- # Request NOAA Ruc Sounding from file url
1699- response = fetch_noaaruc_sounding (file )
1700-
1701- # Split response into lines
1702- lines = response .text .split ("\n " )
1703-
1704- # Process GSD format (https://rucsoundings.noaa.gov/raob_format.html)
1705-
1706- # Extract elevation data
1707- for line in lines :
1708- # Split line into columns
1709- columns = re .split (" +" , line )[1 :]
1710- if len (columns ) > 0 :
1711- if columns [0 ] == "1" and columns [5 ] != "99999" :
1712- # Save elevation
1713- self .elevation = float (columns [5 ])
1714- else :
1715- # No elevation data available
1716- pass
1717-
1718- pressure_array = []
1719- barometric_height_array = []
1720- temperature_array = []
1721- wind_speed_array = []
1722- wind_direction_array = []
1723-
1724- for line in lines :
1725- # Split line into columns
1726- columns = re .split (" +" , line )[1 :]
1727- if len (columns ) < 6 :
1728- # skip lines with less than 6 columns
1729- continue
1730- if columns [0 ] in ["4" , "5" , "6" , "7" , "8" , "9" ]:
1731- # Convert columns to floats
1732- columns = np .array (columns , dtype = float )
1733- # Select relevant columns
1734- altitude , pressure , temperature , wind_direction , wind_speed = columns [
1735- [2 , 1 , 3 , 5 , 6 ]
1736- ]
1737- # Check for missing values
1738- if altitude == 99999 :
1739- continue
1740- # Save values only if they are not missing
1741- if pressure != 99999 :
1742- pressure_array .append ([altitude , pressure ])
1743- barometric_height_array .append ([pressure , altitude ])
1744- if temperature != 99999 :
1745- temperature_array .append ([altitude , temperature ])
1746- if wind_direction != 99999 :
1747- wind_direction_array .append ([altitude , wind_direction ])
1748- if wind_speed != 99999 :
1749- wind_speed_array .append ([altitude , wind_speed ])
1750-
1751- # Convert lists to arrays
1752- pressure_array = np .array (pressure_array )
1753- barometric_height_array = np .array (barometric_height_array )
1754- temperature_array = np .array (temperature_array )
1755- wind_speed_array = np .array (wind_speed_array )
1756- wind_direction_array = np .array (wind_direction_array )
1757-
1758- # Converts 10*hPa to Pa and save values
1759- pressure_array [:, 1 ] = 10 * pressure_array [:, 1 ]
1760- self .__set_pressure_function (pressure_array )
1761- # Converts 10*hPa to Pa and save values
1762- barometric_height_array [:, 0 ] = 10 * barometric_height_array [:, 0 ]
1763- self .__set_barometric_height_function (barometric_height_array )
1764-
1765- # Convert C to K and save values
1766- temperature_array [:, 1 ] = temperature_array [:, 1 ] / 10 + 273.15
1767- self .__set_temperature_function (temperature_array )
1768-
1769- # Process wind-u and wind-v
1770- # Converts Knots to m/s
1771- wind_speed_array [:, 1 ] = wind_speed_array [:, 1 ] * 1.852 / 3.6
1772- wind_heading_array = wind_direction_array [:, :] * 1
1773- # Convert wind direction to wind heading
1774- wind_heading_array [:, 1 ] = (wind_direction_array [:, 1 ] + 180 ) % 360
1775- wind_u = wind_speed_array [:, :] * 1
1776- wind_v = wind_speed_array [:, :] * 1
1777- wind_u [:, 1 ] = wind_speed_array [:, 1 ] * np .sin (
1778- np .deg2rad (wind_heading_array [:, 1 ])
1779- )
1780- wind_v [:, 1 ] = wind_speed_array [:, 1 ] * np .cos (
1781- np .deg2rad (wind_heading_array [:, 1 ])
1678+ warnings .warn (
1679+ "NOAA RUC models are no longer available. "
1680+ "This method is deprecated and will be fully deleted in version 1.8.0." ,
1681+ DeprecationWarning ,
17821682 )
17831683
1784- # Save wind data
1785- self .__set_wind_direction_function (wind_direction_array )
1786- self .__set_wind_heading_function (wind_heading_array )
1787- self .__set_wind_speed_function (wind_speed_array )
1788- self .__set_wind_velocity_x_function (wind_u )
1789- self .__set_wind_velocity_y_function (wind_v )
1790-
1791- # Save maximum expected height
1792- self .max_expected_height = pressure_array [- 1 , 0 ]
1793-
17941684 def process_forecast_reanalysis (
17951685 self , file , dictionary
17961686 ): # pylint: disable=too-many-locals,too-many-statements
0 commit comments