VOEvent v2.0, some thoughts

Roy Williams roy at cacr.caltech.edu
Tue Jan 22 07:49:42 PST 2008



Petr Kubanek wrote:
> Will somebody provide me with a tool which will transform complex STC to
> simple actual RA DEC I can feed to telescope and start observing? 

Petr
This is what I use. It is Python.
There is another package called W3CDate to read the date.
Roy



import xml.dom.minidom

doc = xml.dom.minidom.parse(stream)
strRA,strDec,strDate,strPointingErr = findLocationTime(doc)

def findLocationTime(doc):
  strRA = ""
  strDec = ""
  strDate = ""
  strPointingErr = ""

  for node in doc.getElementsByTagName("ObservationLocation"):
    for innerNode in node.getElementsByTagName("C1"): # RA
      for subNode in innerNode.childNodes:
        if subNode.nodeType == node.TEXT_NODE: strRA = subNode.data

    for innerNode in node.getElementsByTagName("C2"): # DEC
      for subNode in innerNode.childNodes:
        if subNode.nodeType == node.TEXT_NODE: strDec = subNode.data

    for innerNode in node.getElementsByTagName("ISOTime"): # Observation 
Time
      for subNode in innerNode.childNodes:
        if subNode.nodeType == node.TEXT_NODE: strDate = subNode.data

    for innerNode in node.getElementsByTagName("Error2Radius"):
      for subNode in innerNode.childNodes:
        if subNode.nodeType == node.TEXT_NODE: strPointingErr = subNode.data

  return strRA, strDec, strDate, strPointingErr

-- 

California Institute of Technology
626 395 3670



More information about the voevent mailing list