CIROH-UA / nwmurl

This library contains utility functions to generate National Water Model data URLs
MIT License
2 stars 4 forks source link

nwmurl

nwmurl is a Python library developed by CIROH 2023. It provides utility functions specifically designed to subset and generate National Water Model (NWM) data URLs. This library simplifies the process of accessing NWM data for various purposes such as analysis, modeling, and visualization.

Developed by CIROH 2023

Installation

You can install nwmurl using pip:

pip install nwmurl

Usage

  1. In the code, you can modify the input parameters, such as start_date, end_date, fcst_cycle, lead_time, varinput, geoinput, and runinput, to customize the NWM data retrieval.

  2. The code will generate a list of JSON header URLs tailored to your specified parameters using the generate_urls function.

Customize Your Data Retrieval for Operational Dataset

Customize Your Data Retrieval for Retrospective Dataset

  1. For Operational dataset:
    
    import nwmurl

start_date = "202201120000" end_date = "202201130000" fcst_cycle = [0,8] lead_time = [1,18] varinput = 1 geoinput = 1 runinput = 1 urlbaseinput = 2 meminput = 1 write_to_file = False

file_list = nwmurl.generate_urls_operational( start_date, end_date, fcst_cycle, lead_time, varinput, geoinput, runinput, urlbaseinput, meminput, write_to_file )


2. For Retrospective dataset:

import nwmurl

start_date = "200701010000" end_date = "200701030800" urlbaseinput = 2 selected_var_types = [1, 2] selected_object_types = [1]
write_to_file = True

file_list = nwmurl.generate_urls_retro( start_date, end_date, urlbaseinput, selected_object_types, selected_var_types, write_to_file )



## How to Contribute

We welcome contributions to nwmurl! To contribute to the development of this library, please follow these steps:

1. Fork the repository on GitHub.

2. Clone your fork to your local machine:` 

    `git clone https://github.com/CIROH-UA/nwmurl.git`

 3. Create a new branch for your contribution:` 

    `git checkout -b feature/your-feature-name`

4. Make your code changes and improvements.

5. Before submitting a pull request, make sure to update the package version in `setup.py` if necessary.

6. Commit your changes with descriptive commit messages.

7. Push your changes to your fork:`` 

8. Open a pull request on the main repository, describing your changes and why they should be merged.

We appreciate your contributions and will review your pull request as soon as possible. Thank you for helping improve nwmurl!