...
Read one of the Xml tutorials (for example: http://www.freewebmasterhelp.com/tutorials/xml/)
Read the Google Earth Kml tutorial
Dowload the Madrigal kml source code to your home directory.
Log on to jupiter
ssh -X jupiter
and runtar -xf madrigalKml.tar
Run the python code
/opt/solaris/madrigal/bin/python madrigalKml.py
from your home directory.The code should produce some *.kml files in your home directory. Open up Google Earth, choose Open, and then one the kml files. Look at the result.
...
Note that I have listed some of these points in terms of elevation, azimuth, and range, but you will need to convert everything to latitude, longitude, and altitude. To do this you will need import geopy
and then call the method:
altitude,latitude,longitude = geopy.radarToGeodetic(radarLat, radarLong, radarAlt, az,el,range)
So in the RadarWedge init method, you want to create one new attribute called dataTriangleList, which will contain a list of 4 DataTriangle objects in exactly the order listed above.
...
In exercise 9, we produce a full kml file. You will create a new method createKmlFile in the RadarExperimentCollection class. The one input argument will be the kml filename to save. This method will add the text from the documentTemplate string in the old madrigalKml.py _createKmlText method. To do this:
Replace
%s %s
in the documentTemplate string with a single%s
.Create the string you are going to insert in the middle of documentTemplate by creating a blank string. Then loop through each RadarExperiment in radarExperimentList, call createKmlText, and then add it to the string.
Use the
%
operator to insert that newly created string into documentTemplate, and write that that string to the ini file.
...
Create a madrigalWeb.MadrigalData as before to help get information. But this time use
http://cedar.openmadrigal.org/
instead ofhttp://madrigal.haystack.mit.edu/madrigal/
.Loop through each instrument code in self.instrumentList.
Find the lat, long, and alt of that radar.
Call getExperiments for that instrument code, and use startDatetime and endDateTime to get the time arguments.
For each experiment you get back, create a new RadarExperimentSummary object.
Append it to self.radarExperimentList
...
The times are both in the format YYYY-MM-DD HH:MM:SS
. The location is the radar location in latitude, longitude, and altitude in km.
...
Code Block |
---|
"""simple example code to write a GoggleEarth ini file $Id: writeGoogleEarthIni.py,v 1.1 2012/07/06 20:46:21 brideout Exp $ """ import ConfigParser config = ConfigParser.RawConfigParser() config.add_section('Experiment61234') config.set('Experiment61234', 'startTime', '2003-10-29 03:00:00') config.set('Experiment61234', 'endTime', '2003-11-04 23:30:00') config.set('Experiment61234', 'wedges', '30 35 -90 -85 600, 30 35 -85 -80 630') config.set('Experiment61234', 'url', 'http://madrigal.haystack.mit.edu/cgi-bin/madrigal/madExperiment.cgi?exp=experiments/2003/mlh/29oct03&displayLevel=0&expTitle=Local%20Storm') config.set('Experiment61234', 'location', '42.619,-71.49,0.146') config.add_section('Experiment61235') config.set('Experiment61235', 'startTime', '2003-11-20 05:00:00') config.set('Experiment61235', 'endTime', '2003-11-21 21:30:00') config.set('Experiment61235', 'wedges', '60 70 -90 -85 600, 60 70 -85 -80 630') config.set('Experiment61235', 'url', 'http://madrigal.haystack.mit.edu/cgi-bin/madrigal/madExperiment.cgi?exp=experiments/2003/mlh/20nov03&displayLevel=0&expTitle=Storm') config.set('Experiment61235', 'location', '42.619,-71.49,0.146') f = open('exGoogleEarth.ini', 'w') config.write(f) f.close() |
Here's example code that reads and prints everything in the above ini file:
...