UCLALES utilities
Project description
UCLALES utils in python
This package contains utilities for working with output from the UCLALES model.
Installation
Install uclales-utils
with pip
from pypi to get the
most recent tagged version:
pip install uclales-utils
or directly from github to get the development version:
pip install git+https://github.com/leifdenby/uclales-utils#egg=uclales-utils
Usage
Extracting 2D cross-sections and 3D fields from UCLALES output
Because UCLALES creates a netCDF for each individual core (when running
multi-core simulations using MPI) these files must be aggregated together to
extract the full 3D field (or a 2D cross-section) for a variable.
uclales-utils
has functionality implemented to extract the 3D field for a
single timestep or 2D cross-section of a specific variable. To make the
extraction faster, and to break the extraction down into individual steps that
can be checked, this is implemented using the
luigi pipeline package. Executing the
pipeline may either be done using a single worker, or if your computer has
multiple CPUs you may speed up the extraction process by using multiple
workers.
For serial executing of the extraction run
python -m luigi --module uclales.output Extract --kind <3d or 2d> --file-prefix <file-prefix> --var-name <variable> [--tn <timestep>] [--orientation <cross-section-orientation>] --local-scheduler
For example, to extract the 3D vertical velocity (w
) field at the 5th timestep
(counting the initial time at 0
) from a collecting of output files prefixed
by rico
in the filename (i.e. the 3D files are called rico.########.nc
)
python -m luigi --module uclales.output Extract --kind 3d --file-prefix rico --tn 5 --var-name w --local-scheduler
Or to extract say the 2D field liquid-water path (lwp
) you would run
python -m luigi --module uclales.output Extract --kind 2d --file-prefix rico --var-name lwp --orientation xy --local-scheduler
You can optionally provide the arguments --source-path
and --dest-path
to
set which paths to search for input from and where the output will be stored
(the default is the current working path by default). Intermediate files will
be stored in partials
.
To run the extraction across multiple workers in parallel you must start
luigid
in a separate process, and then run the above command replacing
--local-scheduler
with --workers <number-of-workers>
For example if you have 8 cores on your machine you might run
python -m luigi --module uclales.output Extract --kind 3d --file-prefix rico --tn 5 --var-name w --workers 8
While luigid
is running you can check the progress on the extraction process
by using luigi's web-interface and opening the URL http://localhost:8082/ in your
browser.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file uclales_utils-0.1.4-py3-none-any.whl
.
File metadata
- Download URL: uclales_utils-0.1.4-py3-none-any.whl
- Upload date:
- Size: 16.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72af2f583f73d962a07dca726f1b3673ba3dff3781db919ddcb407c8e185c10f |
|
MD5 | 416116135493a85dd1430b8987187884 |
|
BLAKE2b-256 | 08d87aa3b42cba1781c7f16b804ed20af483993bc9fef9a6b1370451f58ed04f |