Single road Python version of NORTRIP
Containing scripts, example data and documentation for running NORTRIP in Python
- Python 3.12 or higher
- uv (recommended) or pip
uv is a fast Python package installer and resolver, written in Rust.
-
Install uv (if not already installed): uv installation guide
-
Clone the repository:
git clone https://github.com/metno/NORTRIP_python.git cd NORTRIP-python -
Install the packages:
uv sync
-
Clone the repository:
git clone https://github.com/metno/NORTRIP_python.git cd NORTRIP-python -
Create a virtual environment:
python -m venv .venv
-
Activate the virtual environment:
source .venv/bin/activate # On Linux/macOS # or .venv\Scripts\activate # On Windows
-
Install the packages:
pip install -e .
After setup, you can run NORTRIP using:
uv run nortrip model_paths/model_paths_and_files.xlsxor with venv active:
nortrip model_paths/model_paths_and_files.xlsxuv run nortrip --helpor with venv active:
nortrip --helpAll available arguments:
paths(required): Path to a.xlsxor.txtfile describing the file paths and filenames used in the model run.-p/--print: Print some plot results to the terminal.-f/--fortran: Run the Fortran model implementation (work in progress).-l/--log: Disable logging output except for errors.-pl/--plot <plot type>: Choose which plots to generate. Accepted values areall,none,normal(default),summary,temperature, or an 11-digit bitstring like11110000010. Passlistto see a numbered description of each plot.
The reading and saving of data is implied by the file type of each file in the model paths file. Supported file types are txt and xlsx.
For input files with multiple sheets the txt files end with with the sheet name.
Example:
If the Model parameter filename in the model paths file is Road_dust_parameter_table_example.txt then the model parameters will be read from the following files:
Road_dust_parameter_table_example_params.txtRoad_dust_parameter_table_example_flags.txtRoad_dust_parameter_table_example_activities.txt
If the Model output data filename in the model paths file ends with .txt then the model output data will be saved in txt format.
Important: Saving the used model parameters for the model run is only supported when saving is done in xlsx format.