Skip to content

Commit

Permalink
Remove refs and test for deprecated NetCDF export #69
Browse files Browse the repository at this point in the history
  • Loading branch information
aazuspan committed Aug 26, 2023
1 parent a81bcd6 commit 254c650
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 112 deletions.
9 changes: 1 addition & 8 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ convenient methods for data processing, aggregation, downloading, and ingestion.

Features
--------
* Time series image collections to `xarray <https://wxee.readthedocs.io/en/latest/examples/image_collection_to_xarray.html>`__, `NetCDF <https://wxee.readthedocs.io/en/latest/examples/image_collection_to_xarray.html>`_, or `GeoTIFF <https://wxee.readthedocs.io/en/latest/examples/downloading_images_and_collections.html>`_ in one line of code
* Time series image collections to `xarray <https://wxee.readthedocs.io/en/latest/examples/image_collection_to_xarray.html>`__ or `GeoTIFF <https://wxee.readthedocs.io/en/latest/examples/downloading_images_and_collections.html>`_ in one line of code
* `Climatological anomalies <https://wxee.readthedocs.io/en/latest/examples/climatology_anomaly.html>`_ and temporal `aggregation <https://wxee.readthedocs.io/en/latest/examples/temporal_aggregation.html>`_, `interpolation <https://wxee.readthedocs.io/en/latest/examples/temporal_interpolation.html>`_, `smoothing <https://wxee.readthedocs.io/en/latest/generated/wxee.time_series.TimeSeries.rolling_time.html>`_, and `gap-filling <https://wxee.readthedocs.io/en/latest/generated/wxee.time_series.TimeSeries.fill_gaps.html>`_ in Earth Engine
* `Color composite plots <https://wxee.readthedocs.io/en/latest/examples/color_composites.html>`_ from **xarray** datasets
* Parallel processing for fast downloads
Expand Down Expand Up @@ -108,13 +108,6 @@ xarray
ee.ImageCollection("IDAHO_EPSCOR/GRIDMET").wx.to_xarray()
NetCDF
^^^^^^

.. code-block:: python
ee.ImageCollection("IDAHO_EPSCOR/GRIDMET").wx.to_xarray(path="data/gridmet.nc")
GeoTIFF
^^^^^^^

Expand Down
71 changes: 14 additions & 57 deletions docs/examples/image_collection_to_xarray.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Usage
Basic Features
--------------

Basic :code:`wxee` functionality like downloading image collections to :code:`xarray`, :code:`GeoTiff`, and :code:`NetCDF`
Basic :code:`wxee` functionality like downloading image collections to :code:`xarray` and :code:`GeoTiff`
are extended through the :code:`wx` accessor, like so:

.. code-block:: python
Expand Down
29 changes: 0 additions & 29 deletions test/test_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,35 +110,6 @@ def test_to_xarray():
assert all(ds.band.mean(["x", "y"]).values == [0.0, 1.0, 2.0])


@pytest.mark.ee
def test_to_netcdf():
"""Test that to_xarray saves a NetCDF when a path is given"""
test_list = [
ee.Image.constant(0)
.set("system:id", "first_image", "system:time_start", ee.Date("2020-01-01"))
.rename("band"),
ee.Image.constant(1)
.set("system:id", "first_image", "system:time_start", ee.Date("2020-01-02"))
.rename("band"),
ee.Image.constant(2)
.set("system:id", "first_image", "system:time_start", ee.Date("2020-01-03"))
.rename("band"),
]
region = ee.Geometry.Point(0, 0).buffer(10).bounds()
crs = "epsg:3857"

collection = ee.ImageCollection(test_list)
out_path = os.path.join("test", "test_data", "test.nc")

collection.wx.to_xarray(
path=out_path, region=region, scale=20, crs=crs, progress=False
)

assert os.path.isfile(out_path)

os.remove(out_path)


@pytest.mark.ee
def test_download_with_prefix():
"""Test that prefixes are added to file IDs with to_tif"""
Expand Down
17 changes: 0 additions & 17 deletions test/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,23 +112,6 @@ def test_to_xarray_unmasked():
assert da.band_name.mean().values.item() == -999


@pytest.mark.ee
def test_to_netcdf():
"""Test that to_xarray saves a NetCDF when a path is given"""
img = (
ee.Image.constant(42)
.set("system:time_start", ee.Date("2000"))
.rename("band_name")
)
region = ee.Geometry.Point(0, 0).buffer(10).bounds()
out_path = os.path.join("test", "test_data", "test.nc")
img.wx.to_xarray(path=out_path, region=region, scale=20, progress=False)

assert os.path.isfile(out_path)

os.remove(out_path)


@pytest.mark.ee
def test_to_tif():
"""Check that file and band names are set correctly when downloading to GeoTIFF"""
Expand Down

0 comments on commit 254c650

Please sign in to comment.