I have 18 TIFF files in the MODIS sinusoidal grid I would like to convert to one file in NetCDF format. I have converted the tifs to an xarray xarray.core.dataset.Dataset
format called stacked
. At this point if my projection is WGS 84 I can usually export to NetCDF like so:
stacked.lat.attrs['long_name'] = 'latitude'
stacked.lat.attrs['units'] = 'degrees_north'
stacked.lat.attrs['standard_name'] = 'latitude'
stacked.long.attrs['long_name'] = 'longitude'
stacked.long.attrs['units'] = 'degrees_east'
stacked.long.attrs['standard_name'] = 'longitude'
stacked[variable].attrs['coordinates'] = 'time lat long'
but since MODIS is not in degrees this causes a problem. I tried to change the units to 'meters'
but that did not work. Is there a way to export to NetCDF with MODIS (https://spatialreference.org/ref/sr-org/modis-sinusoidal-3/) instead of WGS 84?