I am trying to read a GeoTIFF, perform calculations (radiometric correction) on all bands, and then output back to GeoTIFF. Most of the code I have works fine, up until trying to output.
import os import rioxarray as rxr import numpy as np import pandas as pd wv3tif = rxr.open_rasterio(os.path.join(os.getcwd(), "WV3 MUL GDA2020UTM55.tif")) sensorvals = pd.read_excel(os.path.join("WV3_band_details.xlsx")) L_bands =  for band in range(len(sensorvals['Band no.'])): L = np.add(np.multiply(wv3tif[band], (sensorvals['GAIN'][band] * sensorvals['abscalfactor'][band] / sensorvals['effectivebandwidth'][band])), sensorvals['OFFSET'][band]) L_bands.append(L) L_bands.rio.to_raster("WV3 MUL GDA2020UTM55 TOA radiance.tif")
The last line throws an error
'numpy.ndarray' object has no attribute 'rio' because the data is no longer an
xarray.core.dataarray.DataArray object. I have tried to
vstack but since that's a
numpy routine it only returns an
ndarray without the necessary output methods.
How do I stack the list of bands for output with
rioxarray, including outputting with original CRS and coords?