NOAA-OWP / ngen-forcing

Other
3 stars 6 forks source link

Regrid AORC using ExactExtract python bindings #8

Closed jduckerOWP closed 6 months ago

jduckerOWP commented 2 years ago

The concept of this script is similar to regrid_ExactExtract.py workflow (use ExactExtract regridding tools to produce NextGen netcdf file) except for the following details:

  1. The ExactExtract regridding method is done through a series of python wrapped C+ functions. This allows the user to directly extract the regridded ExactExtract data into a pandas data frame to use dynamically within a python module. The repository for the python bindings can be found here: (https://github.com/jduckerOWP/exactextract-pythonbind/tree/add-pybindings-with-netcdf-OWP). To install the python bindings to your anaconda environment, please follow the set of instructions on the GitHub repository page found here: (https://github.com/jduckerOWP/exactextract-pythonbind/tree/add-pybindings-with-netcdf-OWP/python).

  2. We use multithreading capabilities to directly obtain the regridded ExactExtract pandas data frames to return to the main program and assign the results to global arrays for each meteorological variable. This logic would essentially enable us to directly return the regridded meteorological forcings to other model components with a Basic Model Interface designed for a Meteorological forcing dataset.

  3. The ExactExtract regridding process is completed through our own user defined function called "python_ExactExtract()". In this function, we directly use the python gdal library to read in the sub datasets for a netcdf file to separately regrid each raster at once through the series of ExactExtract python wrapped C+ functions. This workflow process however also enabled us to directly use gdal to read grib2 files and separate each band of data into a raster array as well. Therefore, we advocate for this approach moving forward as a baseline methodology to use ExactExtract python bindings.

[Short description explaining the high-level reason for the pull request]

Additions

-

Removals

-

Changes

-

Testing

1.

Screenshots

Notes

-

Todos

-

Checklist

Testing checklist

Target Environment support