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
25 changes: 25 additions & 0 deletions docs/user/environment/1-atm-models/forecast.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,31 @@ Other generic forecasts can also be imported.
the same kind of pressure-level forecast as plain JSON, see
:ref:`open_meteo`.

.. note::

Within one Python session, RocketPy keeps in memory the forecasts it
Comment thread
Gui-FernandesBR marked this conversation as resolved.
Resolved
downloaded with the shortcuts on this page (``file="GFS"``, ``"NAM"`` and
so on), so that asking again for the same forecast, as when a notebook
cell is run again, takes a couple of seconds instead of a full download.
When the same model, place and launch time are asked for again, it asks
the server which model run is current and downloads the data again only
if the server published something new. Each forecast takes about 50 kB of
memory and the 100 most recent ones are kept.

To keep forecasts between sessions, pass ``cache=True``:

.. code-block:: python

env.set_atmospheric_model(type="Forecast", file="GFS", cache=True)

The forecast is then also saved on disk, in the cache folder of your
system (``~/.cache/rocketpy`` on Linux), and a later session uses it while
the server says its model run is still the latest one. If the server
cannot be reached, the saved forecast is used anyway, with a warning that
it may not be the latest. A warning tells you every time a saved forecast
is used, and forecasts saved more than 7 days ago are deleted. Without
``cache=True`` nothing is saved on disk.


.. _global-forecast-system:

Expand Down
10 changes: 10 additions & 0 deletions docs/user/environment/1-atm-models/reanalysis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ One common reanalysis dataset is the ERA5.
2021 onwards, :ref:`open_meteo` retrieves them straight from an API, with
no file to download.

.. note::

A reanalysis can also be read from a web address (an OPeNDAP address)
instead of a local file. Pass ``cache=True`` to
:meth:`rocketpy.Environment.set_atmospheric_model` to save what RocketPy
reads on disk, in the cache folder of your system (``~/.cache/rocketpy`` on
Linux), and use it in later sessions without downloading it again.
Reanalysis data does not change, so the saved copy is always used, and a
warning says so each time.

ERA5
----

Expand Down
2 changes: 2 additions & 0 deletions docs/user/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ The following packages are needed in order to run RocketPy:
- requests
- pytz
- simplekml
- platformdirs

All of these packages, are automatically installed when RocketPy is installed using either ``pip`` or ``conda``.
However, in case the user wants to install these packages manually, they can do so by following the instructions bellow.
Expand All @@ -121,6 +122,7 @@ The packages needed can be installed via ``pip`` by running the following lines
pip install requests
pip install pytz
pip install simplekml
pip install platformdirs

Installing Required Packages Using ``conda``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ matplotlib>=3.9.0 # Released May 15th 2024
netCDF4>=1.6.4
requests
pytz
platformdirs # system cache folder of Environment.set_atmospheric_model(cache=True)
simplekml
dill
Loading
Loading