spedas / bleeding_edge

IDL-based Space Physics Environment Data Analysis Software (bleeding edge)
http://www.spedas.org
Other
7 stars 0 forks source link

ysubtitle gets turned into an array if CDF units specified as array #89

Closed jameswilburlewis closed 1 year ago

jameswilburlewis commented 1 year ago

There is code in spd_cdf_info_to_tplot that sets the ysubtitle based on the value of the UNITS metadata. If UNITS is specified as an array (e.g. position variables in the THEMIS STATE CDF), ysubtitle becomes an array, and this causes problems in other code that expects a scalar.

thm_load_state actually overrides the CDF units, setting them to a string scalar, but this doesn't fix ysubtitle, which is set at CDF load time.

For now we can fix this by using units[0] if units is an array, but we should revisit the way we insert metadata (units, coordinate systems) into labels, subtitles, and other plot options.