aazuspan/wxee

define scale in wx.to_xarray()

Daniel-Trung-Nguyen opened this issue · 2 comments

Hi, I have a Landsat time-series in epsg:4326 downloaded from the google earth engine that I am trying to convert to xarray.
The area covers the entire Las Vegas. Using ds = landsat_ts.wx.to_xarray() resulted in a ds with coarse scale of 1 decimal degree.
My question is how to define scale and crs parameters in the wx.to_xarray() function to get the raw Landsat's resolution of 30m?
Thanks,
Daniel

Attributes:
transform :
(1.0, 0.0, -116.0, 0.0, -1.0, 37.0)
crs :
+init=epsg:4326
res :
(1.0, 1.0)
is_tiled :
1
nodatavals :
(-32768.0,)
scales :
(1.0,)
offsets :
(0.0,)
AREA_OR_POINT :
Area
TIFFTAG_RESOLUTIONUNIT :
1 (unitless)
TIFFTAG_XRESOLUTION :
1
TIFFTAG_YRESOLUTION :
1

Hi @Daniel-Trung-Nguyen, the to_xarray method takes crs and scale parameters, so you could do the following:

# Choose your CRS
crs = "EPSG:5070"
ds = landsat_ts.wx.to_xarray(scale=30, crs=crs)

If you're trying to download an entire scene at 30m, you will probably run into Earth Engine's pixel count or grid size limit, in which case you'd have to download a smaller area using the region argument.

i did the same with Sentinel 1 GRD scenes, the issue is some values are just converted as NaN,
why such issue ???
So i am getting a major backscatter values as Nan, why such issue ?