Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interpolation #52

Closed
EricEngle-NOAA opened this issue Dec 5, 2022 · 1 comment
Closed

Interpolation #52

EricEngle-NOAA opened this issue Dec 5, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@EricEngle-NOAA
Copy link
Collaborator

Implement grid interpolation via the NCEPLIBS-ip library. This is a Fortran library so the appropriate interface will need to be created using f2py.

Also, NCEPLIBS IP and sp libraries must support shared object libraries.

@EricEngle-NOAA EricEngle-NOAA added the enhancement New feature or request label Dec 5, 2022
@EricEngle-NOAA EricEngle-NOAA added this to the v2.0 milestone Dec 5, 2022
@EricEngle-NOAA EricEngle-NOAA self-assigned this Dec 5, 2022
EricEngle-NOAA added a commit that referenced this issue Dec 6, 2022
First of several commits to add support for spatial interpolation via
NCEPLIBS-ip library.

interpolate.f90: contains subroutine, interpolate, that is the epxlicit
interface from within the grib2io package to NCEPLIBS-ip. This
subroutine calls ipolates_grib2, which performs is the top-level
subroutine for GRIB2 for interpolation of "scalar" fields, as opposed to
vector fields with ipolatev_grib2 which will be added in a future
commit.

interpolate.pyf: contains the f2py signature of how the Python stuff
should handle the Fortran subroutine arguments.

setup.py: updated to handle building the fortan code and interfacing
with NCEPLIBS-(ip,sp) libraries.

At this time, the latest releases of these libs do not support
shared-objbect library builds.

This commit references issue #52
EricEngle-NOAA added a commit that referenced this issue Dec 6, 2022
_grib2io.py updated to support interpolation.

The interpolation is available in 2 ways:

module-level function, interpolate(), that accepts a multi-dimensional
data array, interpolation options, and input/output grid specs.

grib2io.Grib2Message method interpolate(), that works with data from
self. This eventually calls the module function interpolate() and
returns a new Grib2Message object where all GRIB2 metadata are similar
except for grid and data metadata.

This commit references issue #52
EricEngle-NOAA added a commit that referenced this issue Dec 6, 2022
This commit references issue #52
EricEngle-NOAA added a commit that referenced this issue Dec 12, 2022
Update interpolate.f90 and .pyf to remove rlat, rlon from the subroutine
argument list. We decided to keep only 1 method of generating lats and
lons using pyproj. The lats and lons from ip will "fall on the floor" at
the Fortran level.

Adjusted grib2io interpolate() to remove latlons kwarg.

Hardened rules for interpolate() module function to accept only 2D or 3D
arrays shaped (ny,nx) or (:, ny, nx).

This commit references issue #52
EricEngle-NOAA added a commit that referenced this issue Dec 13, 2022
Update the module function interpolate(), and Grib2Message method
interpolate() to clean up the arguments to the functions.

This commit references issue #52.
@EricEngle-NOAA
Copy link
Collaborator Author

The interpolation functionality in grib2io is working. The interpolation depends on new releases of the NCEP ip and sp libraries that support shared-object libraries. Work to support shared-object libraries has been done. See PRs below.

NOAA-EMC/NCEPLIBS-ip#128

NOAA-EMC/NCEPLIBS-sp#68

EricEngle-NOAA added a commit that referenced this issue Mar 12, 2023
First of several commits to add support for spatial interpolation via
NCEPLIBS-ip library.

interpolate.f90: contains subroutine, interpolate, that is the epxlicit
interface from within the grib2io package to NCEPLIBS-ip. This
subroutine calls ipolates_grib2, which performs is the top-level
subroutine for GRIB2 for interpolation of "scalar" fields, as opposed to
vector fields with ipolatev_grib2 which will be added in a future
commit.

interpolate.pyf: contains the f2py signature of how the Python stuff
should handle the Fortran subroutine arguments.

setup.py: updated to handle building the fortan code and interfacing
with NCEPLIBS-(ip,sp) libraries.

At this time, the latest releases of these libs do not support
shared-objbect library builds.

This commit references issue #52
EricEngle-NOAA added a commit that referenced this issue Mar 12, 2023
_grib2io.py updated to support interpolation.

The interpolation is available in 2 ways:

module-level function, interpolate(), that accepts a multi-dimensional
data array, interpolation options, and input/output grid specs.

grib2io.Grib2Message method interpolate(), that works with data from
self. This eventually calls the module function interpolate() and
returns a new Grib2Message object where all GRIB2 metadata are similar
except for grid and data metadata.

This commit references issue #52
EricEngle-NOAA added a commit that referenced this issue Mar 12, 2023
This commit references issue #52
EricEngle-NOAA added a commit that referenced this issue Mar 12, 2023
Update interpolate.f90 and .pyf to remove rlat, rlon from the subroutine
argument list. We decided to keep only 1 method of generating lats and
lons using pyproj. The lats and lons from ip will "fall on the floor" at
the Fortran level.

Adjusted grib2io interpolate() to remove latlons kwarg.

Hardened rules for interpolate() module function to accept only 2D or 3D
arrays shaped (ny,nx) or (:, ny, nx).

This commit references issue #52
EricEngle-NOAA added a commit that referenced this issue Mar 12, 2023
Update the module function interpolate(), and Grib2Message method
interpolate() to clean up the arguments to the functions.

This commit references issue #52.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant