Sunspotter Talk

ECG analysis and solarsoft

  • Mjtbarrett by Mjtbarrett

    Going slightly off topic, but if one of the aims of the Sunspotter project is to improve the performance of computer algorithms in forecasting, I may still be ok!

    I am struck by the similarities between medical electrocardiograph (ECG) presentations and the solarsoft software appearance.

    ECG example: http://www.google.co.uk/search?q=ecg+display+software&client=safari&hl=en&tbm=isch&tbo=u&source=univ&sa=X&ei=mu8WU7mZKJGBhAfi_IDoCQ&ved=0CEMQ7Ak&biw=1024&bih=644#biv=i|17%3Bd|yh2yzxbv1UC6fM%3A

    Solarsoft example: http://www.lmsal.com/solarsoft/last_events/

    Whilst the two examples given here don't immediately appear to be similar looking, there may be some mileage in drawing an analogy? Most UK ambulances carrry ECG machines which, after correct lead placement and recording, will happily interpret and publish the result of that analysis by printing it on the tracing. They are not always accurate analyses, and should be treated with caution, but are a useful tool in arriving at a working diagnosis. Complex waveforms are analysed and diagnosed within seconds.

    Some very clever algorithms must be lurking in the machines in order to even attempt such a feat. 😃 Given that the machines are made commercially available I suspect that the manufacturers jealously guard their algorithms under lock and key as "commercially sensitive information." There must be experts in the development of such software who could be of value in creating high performing solar flare forecasting software though?

    Open source software such as this http://sourceforge.net/projects/ecgtoolkit-cs/ is available if anyone has too much time on their hands and wants to have a play 😃 NB: caution-this is a free download that is on the internet and I haven't tried or virus checked... 😃

    Posted

  • dvdgc13 by dvdgc13 translator, scientist

    Hey @Mjbarrett thanks for pointing us in possible directions. One of the things that have been happened more and more in the last years is the cross-domains collaborations. I remember during my undergrad that a friend of mine started to work with the radiology department in a hospital because the tools we were using in astronomy to count and classify stars automatically could be used by them to count some data in radiology plates. Before that collaboration they were doing it by hand! Taking days what it was done in seconds by the astrophysics package.

    The difference I see between the ECG and the Sun is that our hearth is a 'simple' machined (well, not take that literally) and is periodic. The Sun, however, is not that simple and the flares do not have some (known) periodicity, so I'm not sure how much algorithms we could re-use. But as I said above, all parallelism could be use in one way or in another.

    If you are interested in open source you could try SunPy. There you can plot and analyse a lot of solar data. You could try to download the images that you like from sunspotter and find out the values of the magnetic field and other stuff that we do on our daily life 😃

    And please! if you find other software or data analysis analogies, keep telling us about them!!

    Posted

  • Mjtbarrett by Mjtbarrett

    Good Morning dvdgc13, and thanks for taking the time to reply, I appreciate it. I am on slightly safer ground here than trying to figure out aspects of particle physics when I never got past long division at school! 😃
    Just to explain why I think that the analogy may still hold I offer the following:
    The heart is essentially a simple(ish) mechanical double pump. In simple terms, as I understand it, an ECG machine displays only the amount of electrical activity in the heart. The conductive pathway in the heart is well understood and in normal health a trace can be obtained which is a graph of the amount of electrical activity over time. The waveform produced is described as a normal sinus rhythm if the value of each segment in the graph conforms to the known normal values.

    But the heart is a mechanical pump. What good is it knowing what is happening electrically if it tells you nothing about the pressure of the blood that is flowing through the pump? The clever part is that each element of the "graph" can be directly linked to contraction or relaxation of various parts of the heart muscle and therefore tells you what the heart muscle is doing at any point during a normal heart beat. So far so good. At least everything is, as you say, periodic.

    There are, however, times when the heart of a patient isn't working normally. For example, in a patient having a heart attack, the S-T segment may be raised say four millimetres above the isoelectric line. A paramedic or Doctor would know that the mechanical problem related to this diagnostic electrical activity is most likely to be a blood clot in one of the coronary arteries, and could therefore treat the patient accordingly. Similarly a very rapid rate of wide complexes may suggest ventricular tachycardia. In this case the mechanical problem is that the atria simply don't have enough time between beats to adequately refill. If left untreated the patient may become hypoxic and meet an untimely demise. There are other warning dysthymia (R on T ectopics, bundle branch blocks etc.) that give us a glimpse into the future. Ventricular Fibrillation is completely chaotic activity that will rapidly lead to the demise of the patient if not corrected; quite the opposite to having a known periodicity!

    My point is that we can (reasonably accurately) forecast the future for a patient if these things are left alone, based on the presentation of the ECG. In the same way I wonder if the activity recorded on solarsoft could be analysed using some of the same algorithms to indicate the "health" of sunspots? If sunspots exhibit a certain known series of physical processes prior to flaring, that can be seen and interpreted from the data, it might help to know which sunspots are likely to put out an x class flare, or an M or a C class flare and so on.

    The analogy breaks down at the level of treatment. We are unlikely to be able to prevent a flare from happening for a couple of years yet... In another few thousand years we may choose to build a Dyson sphere or prevent a flare from progressing, but we have to start somewhere. 😉

    Sorry for this over-long post. It was just a thought...

    As for the open source stuff, I'm afraid that that's way over my head. I had to ask someone yesterday how to read a message that I had been sent on Facebook! Thanks very much indeed for the encouragement though. 😃

    Posted

  • dvdgc13 by dvdgc13 translator, scientist

    @Mjbarrett! this is AWESOME!! Thanks so much for such explanation. I didn't know we could predict that well from an ECG. Also, thanks for the new vocabulary. I'm looking up all of it!

    I'm thinking that the best analogy I can give you at the moment is to think that what we get from the plots in solarsoft is something like if we would have an ECG of different species (humans, giraffes, rats, ...) all together as a single output plot. There may be a high chance that we could understand from the flares itself the structure within the sunspot (or even inside the sun) as you explained with the heart. I'm going to try to make some graphs where they just show the X-ray flux of a single sunspot group over a few days, though it could seem simple it's not so because the X-ray flux we get in these plots is from the whole sun, and some times we don't really know which sunspot produced the flare. I'll come to you -hopefully soon 😃

    Posted

  • Mjtbarrett by Mjtbarrett

    http://www.sciencedirect.com/science/article/pii/S093336570100077X looks like it may be interesting (but yet again behind a pay wall!!). In trying to develop a strategy the concept of differential diagnosis may be worth having a quick look at...? http://en.wikipedia.org/wiki/Differential_diagnosis

    Posted

  • pahiggins by pahiggins

    Regarding the pay-wall issue, I have emailed the author of that paper, asking them to make their work open-access. I have uploaded this email template for making future requests of this kind:

    http://zooniverse.solarsurfer.org/open_access/letter_to_author_requesting_paper.txt

    Even if every one of them says, 'No', I still think it is important to push the idea of 'free access to scientific knowledge'. Whoever needs access to a paper, please tag the message with #paywall or something, so I can find all the requests and email the authors.

    Posted

  • Mjtbarrett by Mjtbarrett

    Brilliant idea!! That's a great way to get people involved and do a bit of campaigning at the same time. We tend not to credit the authors when including a link to the full paper (or pre-print) in Talk since their names are on the paper. If we copy and paste a quote we usually try to give the lead author a mention (when we remember).

    Thanks very much for that. 😃 All the zooniverse projects should do the same... Potentially a million people all asking for the same thing. Great idea!

    Posted

  • kdleka by kdleka

    Howdy; one of the science team finally learning how to leave posts here. The comment about the ECG is really cool -- but unfortunately the behavior of the flares (what is plotted in the solarsoft plots is the X-ray and EUV output) depends on a lot of things such as where the flare occurs, what's nearby when it does, whether something went off very recently, etc. SolarSoft is a huge package of software -- and people are looking for patterns in the early behavior (like the first few seconds) of solar flares to help predict how big they're going to get, etc. So - you're definitely on to something! But yeah, in comparison, the heart system is fairly simple... Many of us are looking at "pre-flare" conditions and output, indeed using many of the SolarSoft tools. I'll post a blog on that maybe in the next few months. This complexity question is a real part of it! But the ECG comments have definitely gotten me thinking. Cheers!

    Posted

  • pahiggins by pahiggins

    I am really looking forward to a blog post on that, KD!
    Fascinating stuff.

    Posted

  • Mjtbarrett by Mjtbarrett

    Me too. I have some thoughts on both the early behaviour of solar flares and pre-flare conditions and think that the ecg analysis still holds up reasonably well. I should be able to post a better response mid-week when I can get my computer back. I will try to post some links here in the meantime as a placeholder but I'll put a bit of thought into it before I post a better reply. 😃

    Posted

  • Mjtbarrett by Mjtbarrett

    https://www.inkling.com/read/medical-physiology-rodney-rhoades-david-bell-4th/chapter-12/electrophysiology-of-cardiac
    Automaticity analogy

    Posted

  • Mjtbarrett by Mjtbarrett

    @kdleka you're quite right about the relative simplicity of the heart (although I wouldn't want to be the one to say that to a Cardiology Consultant 😮) Perhaps a fairer comparison between the heart and the sun with regard to the monitoring would be to say that the ecg is to patient monitoring what xray flux is to solarsoft. It is, of course, only a part of the whole. Solarsoft measures a number of parameters in the same way that in a patient monitoring device values are displayed for things like oxygen saturation, capnography, blood pressure, mean arterial pressure and pulse rate etc.. But I had to start somewhere 😉

    Posted

  • Mjtbarrett by Mjtbarrett

    There are two factors involved; the shape of a single complex, and the pattern of complexes seen in sequence. pre-flare activity may be seen best in the sequential pattern, the early seconds of a flare would correspond to a section of the individual complex.
    As I said, the ECG analogy would only represent one line of the data (ie a form of x-rays) but all the other data could have a similar function to, for example, temperature, EEG, capnography or bp. The whole picture would give a set of symptoms that defined the "health" of the sun and help to predict sunspot activity and the likelihood (and potentially the severity) of flaring, CMEs and so on?

    Perhaps there may be some opportunity for Big Data analytics to join things up a bit?
    http://www.analyticbridge.com/profiles/blogs/daily-and-weekly-summaries-of-big-data-analytics-statistics-and

    http://searchbusinessanalytics.techtarget.com/definition/big-data-analytics

    Posted

  • pahiggins by pahiggins

    Well if you are talking about prediction, you need a stable, near real-time stream of a number of types of data. Social networking sites do this very well-> they funnel data about the activities of millions of users to marketing firms, and those firms input the data into some sort of statistical predictive algorithm to decide which ads to show you when you are surfing the net. As sinister as it might sound, it works well, in some ways (i.e., you always get an answer- whether its right or wrong is anyones guess).

    Unfortunately the same is not true of solar physics/ space weather! Many times raw data is not supplied - only plots of the data, and often the coverage and reliability of the services is very poor. There are few data standards adhered to... etc. As a human 'expert' flare forecaster, I can browse around and look at the plots of these near real-time data to make my prediction, but statistical prediction algorithms are useless, because they have very few data available to ingest, and the data tend to lag significantly.

    A group of us flare forecasters have just submitted a proposal to have collaboration meetings on the subject, and figure out how we can improve the situation!

    Posted

  • Mjtbarrett by Mjtbarrett

    Hello @pahiggins. Thanks very much for sticking with me; I clearly didn’t understand the true complexity of this problem.

    I don’t want to keep flogging what is looking like a very poorly horse so I will try (at last) to tidy this thread up a bit before putting it to bed...
    In a nutshell I am simply saying that there are (to me at least) some striking similarities between the presentation and interpretation ofan ECG trace of the human heart and the presentation and interpretation of some of the data used in analysing the processes at work in the sun. I wonder if there may be some value in exploring a biological model when interpreting the solar data?

    In normal health the journey of an electrical impulse through the heart follows a known route as described here: http://www.nottingham.ac.uk/nursing/practice/resources/cardiology/function/conduction.php A healthy heart will produce a normal ECG..The interesting part comes when you compare the” normal” ECG trace obtained from a patient possessing a “normal” healthy heart and the trace obtained from a poorly patient who has a conductive pathway defect..

    This is a really good site for explaining how the ECG works and its relationship to the body and the mechanical processes. This page from the site gives examples of some waveforms that differ from the norm and provides a brief description of each: http://ecg.utah.edu/lesson/5-2
    You can largely ignore the esoteric text but note the link between each ecg example and the known (named) defective rhythms. [ In agreeing with @kdleka about the relative simplicity of the heart I emphasise the word “relative.” The interpretation of an ecg is fairly obviously a complex process as illustrated by some of the previous examples!]

    The analysis of an ECG can be done using a cardiac monitor in the field. A Paramedic carries the monitor/defibrillator into a patient’s house and printed copy of an ECG is obtained which usually provides a printed interpretation for consideration. The point here is that the real trick in making a diagnosis lies in pattern recognition. Every abnormal ECG can be described and conditions identified by recognising the key features that differ from the norm. Clearly the cardiac monitors used in medicine are capable of recognising many of these complex patterns within seconds...

    So how does all this relate to the sun?

    If the known processes in the sun could be linked to historic patterns in the data, the emergence of similar patterns in current data could help identify likely major flare candidates in the near future, thereby helping to give more confidence to predictions of major flare activity? If (just for the sake of an example) you compare the normal conductive pathway of the heart to the Wiki description of Sporer’s Law: http://en.wikipedia.org/wiki/Spörer's_law and Joy’s Law: http://en.wikipedia.org/wiki/Joy's_Law_(astronomy) you could (at a stretch) argue that there’s a similarity?

    Is there a similarity between the example of automaticity of individual cells in the heart: http://en.wikipedia.org/wiki/Cardiac_action_potential (although not seen in the ECG) and the “flickering” of otherwise stable flux tubes? Or ectopic beats http://en.wikipedia.org/wiki/Ectopic_beat ? I don’t know if the action potential threshold concept would help to understand any of the anomalies or not. And so to bed...

    Good luck with the proposal for collaboration meetings; I hope that they send you somewhere nice and sunny 

    Posted