You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When plotting two instruments with different frequency units on to the same subplot, the subplot ignores one of the units and assumes it is the same units as the other instrument.
Expected vs Actual behavior
Take wind waves as an example:
When getting data from FIDO, RAD1 is in kHz and RAD2 is in MHz.
Plotting in different subplots shows this correctly. The units are in the y-label and the values are correct.
If you want to plot as a continuum, you need to plot in same subplot. When plotting in the same subplot, it displays at the same value, disregarding the units. So 10MHz in RAD2 will be displayed as 10kHz in a subplot with RAD1 which is already in kHz.
The correct behaviour would be that 10MHz would be displayed as 10^4 kHz or displaying everything in MHz.
Steps to Reproduce
Below is code to reproduce the bug.
Codegoesherefromdatetimeimportdatetimeimportastropy.unitsasuimportnumpyasnpfromastropy.timeimportTime# from astropy.io import fitsfrommatplotlibimportpyplotaspltfrommatplotlib.colorsimportLogNormfromsunpy.netimportFido, attrsasafromradiospectraimportnet#let Fido know about the radio clientsfromradiospectra.spectrogram2importSpectrogram# in the process of updating old spectrogramif__name__=="__main__":
# Fidoquery=Fido.search(a.Time('2020-07-11T02:15', '2020-07-11T02:50'), a.Instrument.waves)
waves_files=Fido.fetch(query['waves'])
waves_spec=Spectrogram(sorted(waves_files))
waves_mm_l=np.percentile(waves_spec[0].data, [1,99])
waves_mm_h=np.percentile(waves_spec[1].data, [1,99])
fig, axes=plt.subplots(2, 1, sharex=True, figsize=(10, 11.5))
waves_spec[0].plot(axes=axes[0], norm=LogNorm(vmin=waves_mm_l[0], vmax=waves_mm_l[1]))
waves_spec[1].plot(axes=axes[1], norm=LogNorm(vmin=waves_mm_h[0], vmax=waves_mm_h[1]))
# # by default y-axis low to hight flip so moving away fro sun with timeaxes[0].set_ylim(reversed(axes[0].get_ylim()))
axes[1].set_ylim(reversed(axes[1].get_ylim()))
# log y-axisaxes[0].set_yscale('log')
axes[1].set_yscale('log')
axes[0].set_xlim(datetime(2020, 7, 11, 2,15), datetime(2020, 7, 11, 2,50))
plt.show(block=False)
fig, axes=plt.subplots(2, 1, sharex=True, figsize=(10, 11.5))
waves_spec[0].plot(axes=axes[0], norm=LogNorm(vmin=waves_mm_l[0], vmax=waves_mm_l[1]))
waves_spec[1].plot(axes=axes[0], norm=LogNorm(vmin=waves_mm_h[0], vmax=waves_mm_h[1]))
# # by default y-axis low to hight flip so moving away fro sun with timeaxes[0].set_ylim(reversed(axes[0].get_ylim()))
# log y-axisaxes[0].set_yscale('log')
axes[0].set_xlim(datetime(2020, 7, 11, 2,15), datetime(2020, 7, 11, 2,50))
plt.show(block=False)
System Details
SunPy Version: 3.0.1
Astropy Version: 4.2.1
Python Version: Python 3.8.8
OS information: Mac OS 10.16
radiospectra version: 0.3.1.dev24+g075df3f
The text was updated successfully, but these errors were encountered:
Description
When plotting two instruments with different frequency units on to the same subplot, the subplot ignores one of the units and assumes it is the same units as the other instrument.
Expected vs Actual behavior
Take wind waves as an example:
When getting data from FIDO, RAD1 is in kHz and RAD2 is in MHz.
Plotting in different subplots shows this correctly. The units are in the y-label and the values are correct.
If you want to plot as a continuum, you need to plot in same subplot. When plotting in the same subplot, it displays at the same value, disregarding the units. So 10MHz in RAD2 will be displayed as 10kHz in a subplot with RAD1 which is already in kHz.
The correct behaviour would be that 10MHz would be displayed as 10^4 kHz or displaying everything in MHz.
Steps to Reproduce
Below is code to reproduce the bug.
System Details
The text was updated successfully, but these errors were encountered: