exoclim / aeolus

Analysis and visualisation of atmospheric model output powered by iris.
https://exoclim.github.io/aeolus
GNU Lesser General Public License v3.0
15 stars 4 forks source link

ValueError: Insufficient matching coordinate metadata to resolve cubes, cannot map dimension (0,) of the RHS cube ((260,), 'stellar_flux') to the LHS cube ((260,), 'Stash code = 1755') #60

Closed DibyaBharatiPradhan closed 1 year ago

DibyaBharatiPradhan commented 1 year ago

While I am trying to run aeolus for generating transmission spectra for UM output (Stash code = 1755), I get the following error while calling calc_transmission_spectrum function :

''' ValueError: Insufficient matching coordinate metadata to resolve cubes, cannot map dimension (0,) of the RHS cube ((260,), 'stellar_flux') to the LHS cube ((260,), 'Stash code = 1755') '''

The dimensions of stellar flux and planet_transmn variables are (260,) and (260, 90, 144) respectively. The file is attached for reference.

aelous_transmisn_spectra.pdf

dennissergeev commented 1 year ago

In short, your planet_transmn cube's metadata isn't matching that of stellar_flux, namely in the leftmost dimension (spectral band index): planet_transmn had it under the name pseudo, and its units didn't match, etc. The route case of this was most likely that you used xconv to post-process the transmission flux file. Don't use xconv.

The easiest solution for this kind of problems is to change the coordinate metadata, e.g.

planet_transmn.coord("pseudo").units = 1

or just by copying metadata from a "clean" cube:

planet_transmn.coord("pseudo").metadata = stellar_flux.coord("spectral_band_index").metadata