Compile and edit input data for the NanoFASE model
Project description
NanoFASE Data
The NanoFASE Data module is a set of scripts to compile and edit input data for the NanoFASE model.
See the NanoFASE documentation for full documentation.
Getting started
The package is available on PyPI or Conda, and the easiest way to use the package is to install one of these using Pixi, Conda/Mamba or Pip.
Conda:
$ conda install -c samharrison7 nfdata
Mamba:
$ mamba install -c samharrison7 nfdata
Pip:
$ pip install nfdata
Pixi (global):
$ pixi global install -c samharrison7 nfdata
Pixi (project):
$ pixi project channel add samharrison7
$ pixi add nfdata
Usage
usage: nfdata [-h] [--output OUTPUT] {create,edit,constants} file
Compile or edit data for the NanoFASE model.
positional arguments:
{create,edit,constants}
do you wish to create from scratch, edit the data or
create a constants file?
file path to the config file (create/edit tasks) or
constants file (constants task)
optional arguments:
-h, --help show this help message and exit
--output OUTPUT, -o OUTPUT
where to create the new constants file (for constants
task)
Creating a new dataset
Specifying the "create" option compiles a new NetCDF dataset and Fortran namelist constant file:
$ nfdata create /path/to/config.create.yaml
An annotated example config file is given: config.create.example.yaml. The file is quite self-explanatory, but a few further explanations are provided in this document.
The two files will be output to the paths specified in the config file.
Editing an existing dataset
To edit an existing NetCDF dataset, specify the "edit" option:
$ nfdata edit /path/to/config.edit.yaml
An annotated example config file is given: config.edit.example.yaml. This is similar (but not identical) in format to the creation config file, except only those variables you with to edit should be specified (all other variables are left as-is).
Certain variables can't be edited: flow_dir, is_estuary. Create a new dataset instead if you wish to change these variables.
The Fortran namelist file cannot be edited using this method and you should instead edit the file directly.
Only creating a new constants file
To simply convert a constants YAML file to a Fortran namelist file, you can use the constants option:
$ nfdata constants /path/to/constants.yaml -o /path/to/constants.nml
No config file is required. The location of the newly created constants file is given by the -o or --output argument.
Tips
- For the moment, all rasters must be the same CRS as the
flow_dirraster, and this must be a projected raster. We recommend ESPG:27700 (British National Grid). In addition, all rasters except forland_usemust be the same resolution asflow_dir. They can cover a large geographical region and the module will automatically clip them to the correct size. - Support for different file types is a bit sporadic at the moment. I suggest sticking the raster files for spatial variables, raster or CSV files for spatiotemporal variables (with 1 file per timestep for raster files) and shapefiles for point sources. You will trigger errors if you use an unsupported file.
- Example input data files are given in
data.example/thames_tio2_2015/. Running the model using the example config files uses these data.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nfdata-0.3.0.tar.gz.
File metadata
- Download URL: nfdata-0.3.0.tar.gz
- Upload date:
- Size: 25.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ef1b5eb2f7ee5e274b4a2561011a50fdd63e8847dcfae3f0fd84e7e50af86fa
|
|
| MD5 |
7eb051ccde6577d52ca6b473b9dcb20e
|
|
| BLAKE2b-256 |
784b7cd4ccbdf1d2821f552ed7999d2cebd21ef746b1887508d11b6f158ced6d
|
Provenance
The following attestation bundles were made for nfdata-0.3.0.tar.gz:
Publisher:
ci-cd.yaml on NERC-CEH/nanofase-data
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nfdata-0.3.0.tar.gz -
Subject digest:
5ef1b5eb2f7ee5e274b4a2561011a50fdd63e8847dcfae3f0fd84e7e50af86fa - Sigstore transparency entry: 203580483
- Sigstore integration time:
-
Permalink:
NERC-CEH/nanofase-data@9dfb85183ad5863346d5a2293315fbe960a27130 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/NERC-CEH
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci-cd.yaml@9dfb85183ad5863346d5a2293315fbe960a27130 -
Trigger Event:
push
-
Statement type:
File details
Details for the file nfdata-0.3.0-py3-none-any.whl.
File metadata
- Download URL: nfdata-0.3.0-py3-none-any.whl
- Upload date:
- Size: 27.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c611c736c97b2c5aeb92cb7c1d409ea54f4530d7dca3d7778d7b2c019790305d
|
|
| MD5 |
015b3f8812e0ccdf01a9a65ac2d893ea
|
|
| BLAKE2b-256 |
a480bf3099b8ef4a2f366690fac99ee923a1345a9b97d160d56039dea34af26a
|
Provenance
The following attestation bundles were made for nfdata-0.3.0-py3-none-any.whl:
Publisher:
ci-cd.yaml on NERC-CEH/nanofase-data
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nfdata-0.3.0-py3-none-any.whl -
Subject digest:
c611c736c97b2c5aeb92cb7c1d409ea54f4530d7dca3d7778d7b2c019790305d - Sigstore transparency entry: 203580487
- Sigstore integration time:
-
Permalink:
NERC-CEH/nanofase-data@9dfb85183ad5863346d5a2293315fbe960a27130 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/NERC-CEH
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci-cd.yaml@9dfb85183ad5863346d5a2293315fbe960a27130 -
Trigger Event:
push
-
Statement type: