Monday, April 4, 2016

Getting into SunPy

Part 2: Pull Request: Spectrogram log y axis #291  

 

I have found data that can be used with Sunpy's spectrogram class! A solar radio spectrometer called CALLISTO is used internationally for networking solar radio data (with direct access!). Technically, I am using the CallistoSpectrogram class in sunpy.spectra to open data that I'll use to test the Spectrogram class. Using this data, I am confident that the format loaded into the class I'd like to test is correct.

>>> import spectrogram
>>> import matplotlib.pyplot as plt
>>> from sunpy.spectra.sources.callisto import CallistoSpectrogram
>>> spectra = CallistoSpectrogram.from_file('ALASKA_20160404_000000_59.fit')
>>> gram = spectrogram.Spectrogram(spectra.data, spectra.time_axis, spectra.freq_axis, spectra.start, spectra.end)
>>> gram.plot()
>>> plt.show()
Woot, data loaded successfully!

Next, the pull request asks if: instead of the frequency being on a linear scale, is it possible to make it a log scale? Looking at the spectra.spectrogram class in sunpy, I see that the linear frequency scale took some work to implement. Simply implementing a logy keyword would be confusing with the linear keyword already in place. So, I am trying to implement the axes.set_yscale('log') after the linear scale is established. Perhaps this could be changed just before plotting for an easy addition to the class. Otherwise, I plan to implement a log frequency axis in a similar way to the linear frequency axis.

To be continued.

***

reference to helpful sunpy help page

No comments:

Post a Comment