Well, I’ve taken quite a break in between posts, I think it’s about time I remedy this, and for good reason. Recently, a rather big moment (atleast for me) happened in my quest to develop code for SunPy: I built a functioning HEK to VSO translating module. Now it still has room for improvements and already I know of a couple of tweaks that I need to make, but as far as it goes it works and I was able to demo it to my mentors and other members of the SunPy group last Friday. With that said, this post will focus on recapitulating the demo and be a “how to” for using it.
First I would like to start with some background: this module arose from a need to translate the results from a HEK query into a usable data type that can be used in turn to query the VSO web-service. This module successfully performs this operation and returns the eventual VSO results in the form of a list. With that, let me show you how to use this module.
First, make sure you have the most recent copy of my fork which can be found with:
git pull https://github.com/mjm159/sunpy.git master
Next, open a python interpreter, my example will be done with ipython (which if you haven’t tried it yet, it’s awesome and totally worth the time and bandwidth to install).
Import the following modules:
from sunpy.net import hek2vso from sunpy.net import hek
tstart = '2011/08/09 07:23:56' tend = '2011/08/09 12:40:29' event_type = 'FL'
h2v = hek2vso.H2VClient()
results = h2v.query(hek.attrs.Time(tstart, tend), hek.attrs.EventType(event_type))
h2v.return_hek_results() h2v.return_vso_results()
h2v.return_num_records()
vso_formatted_query = h2v.translate_results_to_query(list_of_hek_results)
That’s all for now, following below are a list of intended future improvements:
- Organize VSO results via the corresponding original HEK query
- Break up the query stages to give multiple points in the process for the user to influence
- Include the VSO.get() method
With that, that’s all my demo entailed, updates will come as I tweak the code and implement the desired improvements. If there are any questions in regard to this module, please message me either via wordpress or github.
Thanks everybody I’m calling it a night.