Re: [idvusers] Jython To Read Catalog

On 4/30/2013 9:19 PM, Kevin Manross wrote:

Hello!

I'm *just* now starting to explore the jython capabilities in the IDV. I
would like to write a script that the user enters a lat/lon and a
date/time and from that, have the IDV plot an image for a radar nearest
to that point and nearest that time.  This would be run headless for web
images.

I'm working on a "nearest radar chooser", but the big hurdle I'm facing
is: is there a way with IDV/Jython to read and parse the top level catalog

http://motherlode.ucar.edu:8080/thredds/catalog/nexrad/level2/catalog.xml

or even

http://motherlode.ucar.edu:8080/thredds/catalog/nexrad/level2/Kxxx/catalog.xml


to get the available dates and times so I could then build the url for
makeDataSource?

-kevin.


Kevin,
     This is a very interesting idea.
In the IDV, we use a table (xml file) to store all radar stations information. There are a few APIs in the TDSRadarDatasetCollection class you can use to get a list of stations. You need to write an API to find the nearest radar station with the input of lat/lon. This probably the big hurdle for you. After that, there are APIs already that can be used to parse the server catalog and communicate with the server. You can reference the TDSRadarChooser and TDSRadarDatasetCollection classes.

The benefit of using Jython is that you can invoke many Java class directly, so I think this project is very interesting. Let us know if you need more help.



Yuan