Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/user/environment/1-atm-models/ensemble.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ Global Ensemble Forecast System (GEFS)

.. danger::

**GEFS shortcut unavailable**: ``file="GEFS"`` is currently disabled in
RocketPy because NOMADS OPeNDAP is deactivated for this endpoint.
**GEFS unavailable**: ``file="GEFS"`` is currently disabled in
RocketPy because NOMADS OPeNDAP has been deactivated.

.. note::

Expand Down
93 changes: 90 additions & 3 deletions docs/user/environment/1-atm-models/forecast.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Forecasts
Weather forecasts can be used to set the atmospheric model in RocketPy.

Here, we will showcase how to import global forecasts such as GFS, as well as
local forecasts like NAM and RAP for North America, all available through
OPeNDAP on the `NOAA's NCEP NOMADS <http://nomads.ncep.noaa.gov/>`_ website.
local forecasts like NAM, RAP and HRRR for North America, all available through
OPeNDAP on the `UCAR THREDDS <https://thredds.ucar.edu/>`_ server.
Other generic forecasts can also be imported.

.. important::
Expand All @@ -22,6 +22,10 @@ Other generic forecasts can also be imported.
Global Forecast System (GFS)
----------------------------

GFS is NOAA's global numerical weather prediction model. It provides worldwide
atmospheric forecasts and is usually a good default choice when you need broad
coverage, consistent availability, and launch planning several days ahead.

Using the latest forecast from GFS is simple.
Set the atmospheric model to ``forecast`` and specify that GFS is the file you want.
Note that since data is downloaded from a remote OPeNDAP server, this line of code can
Expand All @@ -48,9 +52,34 @@ take longer than usual.
`GFS overview page <https://www.emc.ncep.noaa.gov/emc/pages/numerical_forecast_systems/gfs.php>`_.


Artificial Intelligence Global Forecast System (AIGFS)
------------------------------------------------------

AIGFS is a global AI-based forecast product distributed through the same THREDDS
ecosystem used by other RocketPy forecast inputs. It is useful when you want a
global forecast alternative to traditional physics-only models.

RocketPy supports the latest AIGFS global forecast through THREDDS.

.. jupyter-execute::

env_aigfs = Environment(date=tomorrow)
env_aigfs.set_atmospheric_model(type="forecast", file="AIGFS")
env_aigfs.plots.atmospheric_model()

.. note::

AIGFS is currently available as a global 0.25 degree forecast product on
UCAR THREDDS.


North American Mesoscale Forecast System (NAM)
----------------------------------------------

NAM is a regional forecast model focused on North America. It is best suited
for launches inside its coverage area when you want finer regional detail than
global models typically provide.

You can also request the latest forecasts from NAM.
Since this is a regional model for North America, you need to specify latitude
and longitude points within North America.
Expand Down Expand Up @@ -78,6 +107,10 @@ We will use **SpacePort America** for this, represented by coordinates
Rapid Refresh (RAP)
-------------------

RAP is a short-range, high-frequency regional model for North America. It is
especially useful for near-term operations, where fast update cycles are more
important than long forecast horizon.

The Rapid Refresh (RAP) model is another regional model for North America.
It is similar to NAM, but with a higher resolution and a shorter forecast range.
The same coordinates for SpacePort America will be used.
Expand Down Expand Up @@ -111,6 +144,17 @@ The same coordinates for SpacePort America will be used.
High Resolution Window (HIRESW)
-------------------------------

HIRESW is a convection-allowing, high-resolution regional system designed to
resolve local weather structure better than coarser grids. It is most useful
for short-range, local analysis where small-scale wind and weather features
matter.

The High Resolution Window (HIRESW) model is a sophisticated weather forecasting
system that operates at a high spatial resolution of approximately 3 km.
It utilizes two main dynamical cores: the Advanced Research WRF (WRF-ARW) and
the Finite Volume Cubed Sphere (FV3), each designed to enhance the accuracy of
weather predictions.

.. danger::

**HIRESW shortcut unavailable**: ``file="HIRESW"`` is currently disabled in
Expand All @@ -121,6 +165,33 @@ you can still load it explicitly by passing the path/URL in ``file`` and an
appropriate mapping in ``dictionary``.


High-Resolution Rapid Refresh (HRRR)
------------------------------------

HRRR is a high-resolution, short-range forecast model for North America with
hourly updates. It is generally best for day-of-launch weather assessment and
rapidly changing local conditions.

RocketPy supports HRRR through a dedicated THREDDS shortcut.
Like NAM and RAP, HRRR is a regional model over North America.

If you have a HIRESW-compatible dataset from another provider (or a local copy),
you can still load it explicitly by passing the path/URL in ``file`` and an
appropriate mapping in ``dictionary``.

env_hrrr = Environment(
date=now_plus_twelve,
latitude=32.988528,
longitude=-106.975056,
)
env_hrrr.set_atmospheric_model(type="forecast", file="HRRR")
env_hrrr.plots.atmospheric_model()

.. note::

HRRR is a high-resolution regional model with approximately 2.5 km grid
spacing over CONUS. Availability depends on upstream THREDDS data services.


Using Windy Atmosphere
----------------------
Expand Down Expand Up @@ -154,6 +225,10 @@ to EuRoC's launch area in Portugal.
ECMWF
^^^^^

ECMWF (HRES) is a global, high-skill forecast model known for strong
medium-range performance. It is often a good choice for mission planning when
you need reliable synoptic-scale forecasts several days ahead.

We can use the ``ECMWF`` model from Windy.com.

.. jupyter-execute::
Expand All @@ -173,6 +248,10 @@ We can use the ``ECMWF`` model from Windy.com.
GFS
^^^

Windy's GFS option provides NOAA's global model through Windy's interface. It
is a practical baseline for global coverage and for comparing against other
models when assessing forecast uncertainty.

The ``GFS`` model is also available on Windy.com. This is the same model as
described in the :ref:`global-forecast-system` section.

Expand All @@ -186,6 +265,10 @@ described in the :ref:`global-forecast-system` section.
ICON
^^^^

ICON is DWD's global weather model, available in Windy for broad-scale
forecasting. It is useful as an independent global model source to cross-check
wind and temperature trends against GFS or ECMWF.

The ICON model is a global weather forecasting model already available on Windy.com.

.. jupyter-execute::
Expand All @@ -203,6 +286,10 @@ The ICON model is a global weather forecasting model already available on Windy.
ICON-EU
^^^^^^^

ICON-EU is the regional European configuration of ICON, with higher spatial
detail over Europe than ICON-Global. It is best for European launch sites when
regional structure is important.

The ICON-EU model is a regional weather forecasting model available on Windy.com.

.. code-block:: python
Expand All @@ -228,4 +315,4 @@ Also, the servers may be down or may face high traffic.
.. seealso::

To browse available NCEP model collections on UCAR THREDDS, visit
`THREDDS NCEP Catalog <https://thredds.ucar.edu/thredds/catalog/grib/NCEP/GFS/Global_0p25deg/catalog.html>`_.
`THREDDS NCEP Catalog <https://thredds.ucar.edu/thredds/catalog/grib/NCEP/GFS/Global_0p25deg/catalog.html>`_.
2 changes: 1 addition & 1 deletion docs/user/environment/1-atm-models/soundings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Integrated Global Radiosonde Archive (IGRA).

These options can be retrieved as a text file in GSD format. However,
RocketPy no longer provides a dedicated ``set_atmospheric_model`` type for
NOAA RUC Soundings.
NOAA RUC Soundings, since NOAA has discontinued the OPENDAP service.

.. note::

Expand Down
5 changes: 2 additions & 3 deletions docs/user/environment/3-further/other_apis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,10 @@ Instead of a custom dictionary, you can pass a built-in mapping name in the
- ``"ECMWF_v0"``
- ``"NOAA"``
- ``"GFS"``
- ``"AIGFS"``
- ``"NAM"``
- ``"RAP"``
- ``"HRRR"``
- ``"HIRESW"`` (mapping available; latest-model shortcut currently disabled)
- ``"GEFS"`` (mapping available; latest-model shortcut currently disabled)
- ``"MERRA2"``
Expand All @@ -116,10 +118,7 @@ legacy aliases:
- ``"NAM_LEGACY"``
- ``"NOAA_LEGACY"``
- ``"RAP_LEGACY"``
- ``"CMC_LEGACY"``
- ``"GEFS_LEGACY"``
- ``"HIRESW_LEGACY"``
- ``"MERRA2_LEGACY"``

Legacy aliases primarily cover older variable naming patterns such as
``lev``, ``tmpprs``, ``hgtprs``, ``ugrdprs`` and ``vgrdprs``.
Expand Down
52 changes: 34 additions & 18 deletions rocketpy/environment/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@
import pytz

from rocketpy.environment.fetchers import (
fetch_aigfs_file_return_dataset,
fetch_atmospheric_data_from_windy,
fetch_gefs_ensemble,
fetch_gfs_file_return_dataset,
fetch_hiresw_file_return_dataset,
fetch_hrrr_file_return_dataset,
fetch_nam_file_return_dataset,
fetch_open_elevation,
fetch_rap_file_return_dataset,
Expand Down Expand Up @@ -369,9 +371,11 @@ def __initialize_constants(self):
self.__weather_model_map = WeatherModelMapping()
self.__atm_type_file_to_function_map = {
"forecast": {
"AIGFS": fetch_aigfs_file_return_dataset,
"GFS": fetch_gfs_file_return_dataset,
"NAM": fetch_nam_file_return_dataset,
"RAP": fetch_rap_file_return_dataset,
"HRRR": fetch_hrrr_file_return_dataset,
"HIRESW": fetch_hiresw_file_return_dataset,
},
"ensemble": {
Expand Down Expand Up @@ -665,9 +669,11 @@ def __resolve_dictionary_for_dataset(self, dictionary, dataset):
def __validate_dictionary(self, file, dictionary):
# removed CMC until it is fixed.
available_models = [
"AIGFS",
"GFS",
"NAM",
"RAP",
"HRRR",
"HIRESW",
"GEFS",
"ERA5",
Expand Down Expand Up @@ -1132,8 +1138,9 @@ def set_atmospheric_model( # pylint: disable=too-many-statements
- ``"windy"``: one of ``"ECMWF"``, ``"GFS"``, ``"ICON"`` or
``"ICONEU"``.
- ``"forecast"``: local path, OPeNDAP URL, open
``netCDF4.Dataset``, or one of ``"GFS"``, ``"NAM"`` or ``"RAP"``
for the latest available forecast.
``netCDF4.Dataset``, or one of ``"AIGFS"``, ``"GFS"``,
``"NAM"``, ``"RAP"``, ``"HRRR"`` or ``"HIRESW"`` for the
latest available forecast.
- ``"reanalysis"``: local path, OPeNDAP URL, or open
``netCDF4.Dataset``.
- ``"ensemble"``: local path, OPeNDAP URL, open
Expand All @@ -1143,8 +1150,9 @@ def set_atmospheric_model( # pylint: disable=too-many-statements
Variable-name mapping for ``"forecast"``, ``"reanalysis"`` and
``"ensemble"``. It may be a custom dictionary or a built-in
mapping name (for example: ``"ECMWF"``, ``"ECMWF_v0"``,
``"NOAA"``, ``"GFS"``, ``"NAM"``, ``"RAP"``, ``"HIRESW"``,
``"GEFS"``, ``"MERRA2"`` or ``"CMC"``).
``"NOAA"``, ``"AIGFS"``, ``"GFS"``, ``"NAM"``, ``"RAP"``,
``"HRRR"``, ``"HIRESW"``, ``"GEFS"``, ``"MERRA2"`` or
``"CMC"``).

If ``dictionary`` is omitted and ``file`` is one of RocketPy's
latest-model shortcuts, the matching built-in mapping is selected
Expand Down Expand Up @@ -1761,13 +1769,17 @@ def process_forecast_reanalysis(self, file, dictionary): # pylint: disable=too-
# Some THREDDS datasets use projected x/y coordinates.
if dictionary.get("projection") is not None:
projection_variable = data.variables[dictionary["projection"]]
x_units = getattr(lon_array, "units", "m")
target_lon, target_lat = geodesic_to_lambert_conformal(
self.latitude,
self.longitude,
projection_variable,
x_units=x_units,
)
if dictionary.get("projection") == "LambertConformal_Projection":
x_units = getattr(lon_array, "units", "m")
target_lon, target_lat = geodesic_to_lambert_conformal(
self.latitude,
self.longitude,
projection_variable,
x_units=x_units,
)
else:
target_lon = self.longitude
target_lat = self.latitude
else:
target_lon = self.longitude
target_lat = self.latitude
Expand Down Expand Up @@ -2065,13 +2077,17 @@ class for some dictionary examples.
# coordinate system before locating the nearest grid cell.
if dictionary.get("projection") is not None:
projection_variable = data.variables[dictionary["projection"]]
x_units = getattr(lon_array, "units", "m")
target_lon, target_lat = geodesic_to_lambert_conformal(
self.latitude,
self.longitude,
projection_variable,
x_units=x_units,
)
if dictionary.get("projection") == "LambertConformal_Projection":
x_units = getattr(lon_array, "units", "m")
target_lon, target_lat = geodesic_to_lambert_conformal(
self.latitude,
self.longitude,
projection_variable,
x_units=x_units,
)
else:
target_lon = self.longitude
target_lat = self.latitude
else:
target_lon = self.longitude
target_lat = self.latitude
Expand Down
Loading
Loading