clawpack / visclaw

Clawpack visualization tools
http://www.clawpack.org
BSD 3-Clause "New" or "Revised" License
29 stars 48 forks source link

Google Earth : Add place marks for gauge plots #132

Closed donnacalhoun closed 9 years ago

donnacalhoun commented 9 years ago

add place marks in GE that the user can click on to get gauge data

donnacalhoun commented 9 years ago

It looks like KML tools is already placing gauge place marks. A possible extension is to include gauge figures in the placemark balloons. Maybe also also get rid of the "driving directions" to the gauges (:-))

screen shot 2015-04-13 at 9 32 14 pm

donnacalhoun commented 9 years ago

I added the capability to view gauge plots when clicking Placemarks. The only thing (assuming this is a desirable feature) is that I didn't quite know how to get the proper figure name to refer to. It looks like this might require additional arguments to the gauges2kml routine, but wasn't sure. If someone would like to take a look, that would be great.

mandli commented 9 years ago

You mean the title of the plot?

donnacalhoun commented 9 years ago

I mean the actual file name - something like "gauges32412fig300.png". Since only the rundata is passed into gauges2kml, I don't have easy access to the figure number. And even if I had plotdata, I am not sure how I would go about matching up the gauge data set in rundata with the corresponding figures stored in plotdata. (I just checked kmltools again, and see that I can just call setplot.py from gauges2kml directly, so maybe this partially solves the problem).

A related question is where should gauges2kml (and regions2kml) be called from. Right now, I think that Randy just calls these from the command line. But it could be called from within plotpages (when the KML files are being created) or from frametools (which might have easier access to the rundata).

mandli commented 9 years ago

Oh, hmmm. Do you have access to the figure objects? You could snag the title of the axes and discern the name of the figure from that possibly.

I would favor calling gauges2kml from within plotpages or where ever makes the most sense rather than having a separate call.

donnacalhoun commented 9 years ago

I got something working using plotdata._gauge_pngfile. It could use a look over, but seem to be working well with the two examples I have tried so far.

mandli commented 9 years ago

What file and lines are the implementation on?

donnacalhoun commented 9 years ago

For example, line 405 in kmltools.py (my googleearth branch)

mandli commented 9 years ago

Sorry for being daft but where is the kmltools.py file?

donnacalhoun commented 9 years ago

geoclaw/src/python/geoplot/kmltools.py

mandli commented 9 years ago

Looks fine to me, there would be better ways to do this if they keys were not so weird.

donnacalhoun commented 9 years ago

great - thanks for taking a look. Can I close this issue? Or would you like to give this a spin with your code? Shouldn't be too hard ...see the setplot.py file in the chile2010 example.

mandli commented 9 years ago

I just tried it out and it works for me.