Comments (5)
I can confirm I do not see this behavior with another EE dataset. For example, the only change in the below is switching over to an ERA5 dataset:
# specify study area
ur = [35.89, -81.87] # y, x
ll = [35.83, -81.945] # y, x # full region
coords = [ll[1], ll[0], ll[1], ur[0], ur[1], ur[0], ur[1], ll[0]]
geom = ee.Geometry.Polygon(coords)
# Specify image collections
ic = ee.ImageCollection("ECMWF/ERA5_LAND/MONTHLY_AGGR").filterDate('2016-06-01', '2024-01-01').filterBounds(geom).select('temperature_2m')
ds = xr.open_dataset(
ic,
engine='ee',
crs='EPSG:32617', # utm zone 17n
scale=500,
geometry=geom
)
# plot lai, average across x and y
ds['temperature_2m'].mean(dim=['X', 'Y']).plot()
And this yields the same result every time, as expected.
from xee.
Is there a mismatch between the bounds CRS and the requested CRS of the dataset? I am not exactly sure why the issue is non-deterministic as a result. I ran this on my own test area, ParΓ‘, Brazil, and observed similar zero values until I adjusted this. When I assume EPSG:4326 for your bounds, I think the boundary is in Antarctica, so the LAI is 0 as expected.
With the original code:
import ee
import geopandas as gpd
from shapely.geometry import mapping
import xarray as xr
import xee
from ingest.consts import SERVICE_PATH, EMAIL
credentials = ee.ServiceAccountCredentials(EMAIL, SERVICE_PATH)
ee.Initialize(credentials)
bounds = gpd.read_file("/home/noah/ingest/configs/data/acre_tiny_test_site.geojson").iloc[0].geometry
geom = ee.Geometry(mapping(bounds))
# Specify image collections
ic = ee.ImageCollection("MODIS/061/MCD15A3H").filterDate('2016-06-01', '2024-01-01').filterBounds(geom).select('Lai')
ds = xr.open_dataset(
ic,
engine='ee',
crs='EPSG:32617',
scale=500,
geometry=geom
)
# plot lai, average across x and y
ds['Lai'].mean(dim=['X', 'Y']).plot()
![image](https://private-user-images.githubusercontent.com/923761/295327580-80fb13aa-4ae2-400c-b3d4-9b6096dd4a93.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIxMjYyNzgsIm5iZiI6MTcyMjEyNTk3OCwicGF0aCI6Ii85MjM3NjEvMjk1MzI3NTgwLTgwZmIxM2FhLTRhZTItNDAwYy1iM2Q0LTliNjA5NmRkNGE5My5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzI4JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcyOFQwMDE5MzhaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1mNWI1YzhlN2Q4YjNkYzY0YjRjMTVhY2NkMWFlNDgxMzMzMWJmZDQ3OWQ1NGY3MjhhZWE1ZjAyYjZiMTczOGRlJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.6TfvrNGvdhSH5TWxKC8600O72rCsYQlNhFzwVoLKapE)
With the following variant, setting CRS to 4326, we see no zeros and expected seasonal variation:
# Specify image collections
ic = ee.ImageCollection("MODIS/061/MCD15A3H").filterDate('2016-06-01', '2024-01-01').filterBounds(geom).select('Lai')
ds = xr.open_dataset(
ic,
engine='ee',
crs='EPSG:4326',
geometry=geom
)
# plot lai, average across x and y
ds['Lai'].mean(dim=['lon', 'lat']).plot()
![image](https://private-user-images.githubusercontent.com/923761/295326896-567a2cea-6df7-403b-8f5b-3d332642ef07.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIxMjYyNzgsIm5iZiI6MTcyMjEyNTk3OCwicGF0aCI6Ii85MjM3NjEvMjk1MzI2ODk2LTU2N2EyY2VhLTZkZjctNDAzYi04ZjViLTNkMzMyNjQyZWYwNy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzI4JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcyOFQwMDE5MzhaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0xNTBlNGZlMzNlYzJhMGE3NzE5NmU4OTY3ODYyZTgyNTZkMTkwMzk2ODhhOTIxMTZlZjRmOTMxMmNlNmI5NjQ2JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.Rh1kz_kbQC2_KlvF63R4ZgORGtu6HmIflsYpIBwZRbg)
from xee.
Thank you @noahgolmant for trying this out! I don't know what happened, perhaps an update on GEE's side, but the code I listed in my first message now produces expected results, with no zeros and no code changes. Very strange!
I'd be curious if you re-ran your first code block if you also now get expected results?
from xee.
Strange - running the same troubleshooting code pasted above again is resulting in spurious/missing values. Any further thoughts on this?
Copying the troubleshooting code here:
# specify study area
ur = [35.89, -81.87] # y, x
ll = [35.83, -81.945] # y, x # full region
coords = [ll[1], ll[0], ll[1], ur[0], ur[1], ur[0], ur[1], ll[0]]
geom = ee.Geometry.Polygon(coords)
# Specify image collections
ic = ee.ImageCollection("MODIS/061/MCD15A3H").filterDate('2016-06-01', '2024-01-01').filterBounds(geom).select('Lai')
ds = xr.open_dataset(
ic,
engine='ee',
crs='EPSG:32617',
scale=500,
geometry=geom
)
# plot lai, average across x and y
ds['Lai'].mean(dim=['X', 'Y']).plot()
from xee.
Sounds like this is related to #119. We're looking into it.
from xee.
Related Issues (20)
- Scaling Considerations
- ValueError: unrecognized engine ee must be one of: ['scipy', 'rasterio', 'store'] HOT 1
- crs and geometry not working properly HOT 8
- download MODIS (crs: SR-ORG:6974) data appears obscured HOT 8
- Long-running code results in `requests` `ChunkedEncodingError` exception (broken connection) HOT 1
- Xee and SSL HOT 3
- Transposing MODIS data introduces data artifacts HOT 1
- Missing values outside ee.Image boundaries potentially in data range
- Documentation infra HOT 11
- Inconsistent Dimensions When Loading Processed ImageCollection HOT 3
- Add docs for running integration tests locally
- Xee does not provide correct data for resampled image HOT 3
- Error when Xee attempts to cast image data to an expected dtype HOT 2
- FeatureCollection integration with Dask Dataframes HOT 9
- Error when passing in ee.Projection() as parameter for open_dataset() HOT 2
- Output change for the same code HOT 2
- Cannot pin specific version of xee in my conda recipe
- Start testing GIL-free python
- How do I use io_chunks to let xee auto-compute a chunk size relative to the request byte limit?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xee.