Skip to content

Commit

Permalink
migrate xarray to rioxarray
Browse files Browse the repository at this point in the history
  • Loading branch information
crvernon committed Mar 21, 2024
1 parent 7d032f5 commit 255ab4e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cerf/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import numpy as np
import pandas as pd
import rasterio
import rioxarray
import xarray as xr
import geopandas as gpd
from shapely.geometry import Point
Expand Down Expand Up @@ -253,7 +253,7 @@ def raster_to_coord_arrays(template_raster):
"""

# Read the data
da = xr.open_dataset(template_raster, engine="rasterio")
da = rioxarray.open_rasterio(template_raster)

# Compute the lon/lat coordinates with rasterio.warp.transform
x, y = np.meshgrid(da['x'], da['y'])
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
numpy>=1.19.4
pandas>=1.1.4
rasterio>=1.2.3
xarray>=0.16.1
rioxarray>=0.15.1
PyYAML>=5.4.1
requests>=2.25.1
joblib>=1.0.1
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def get_requirements():
'numpy>=1.19.4',
'pandas>=1.1.4',
'rasterio>=1.2.3',
'xarray>=0.16.1',
'rioxarray>=0.15.1',
'PyYAML>=5.4.1',
'requests>=2.25.1',
'joblib>=1.0.1',
Expand Down

0 comments on commit 255ab4e

Please sign in to comment.