google / Xee

An Xarray extension for Google Earth Engine
Apache License 2.0
240 stars 28 forks source link

Missing values outside ee.Image boundaries potentially in data range #131

Closed observingClouds closed 6 months ago

observingClouds commented 7 months ago

Hi there 👋 ,

Thanks for developing this package. It makes working with the datasets stored on the Google Earth Engine much easier. I'm just starting out here and want to access Sentinel-1 GRD data for a specific region. Because the actual satellite product is not covering the entire domain, the returned array should contain a lot of missing values. However, only the minimal rectangular region encompassing the product is set to NaN, the rest of the domain is set to 0. While 0 is not a problematic value for this particular product, it might be within the data range of other products.

import ee
ee.Initialize(opt_url='https://earthengine-highvolume.googleapis.com')
lats = (7.5, 17)
lons = (-60.25, -45)
imgs = ee.ImageCollection([ee.Image('COPERNICUS/S1_GRD/S1A_IW_GRDH_1SDV_20200113T094313_20200113T094338_030780_0387B2_0E67')])
geobounds = ee.Geometry.Rectangle(lons[0],lats[0],lons[1],lats[1])
ds = xr.open_dataset(imgs, engine='ee', scale=0.01, geometry=geobounds)
ds.VV.plot()

image

It would be great if the entire domain is set to NaN outside of the product boundaries.

Cheers!