automatic script generation

Post any questions, ideas, or topics related to Jython and Python scripting.
Post Reply
User avatar
joleenf
Posts: 1123
Joined: Mon Jan 19, 2009 7:16 pm

automatic script generation

Post by joleenf »

Hi,

Over the past few days I have used the "Save Current" Preference of the Metadata settings to learn the correct header format for my text file and the File>Export feature in the View>Flythrough menu to find out the correct format of an xml file for that feature so that I could import an xml file with specific data points. These features are extremely helpful learning tools. Would it be possible to replicate something like this as the scripting functions are being developed and the improved shell is under development. One sequence which would be very helpful is the display setup. If someone uses the interactive display, would there be a way to dump the commands to set up the screen dimensions, centering and zoom. This may need to include the data loaded (or lack of it). Jon! -Not sure how crazy this would be to code, just asking if its a possibility :).

Thanks,
Joleen
User avatar
Rick
Posts: 404
Joined: Fri Jan 16, 2009 8:20 pm

Re: automatic script generation

Post by Rick »

If I understand Joleen correctly, it would nice to have a text file with x,y and z values so you could create you own fly through locations.
User avatar
joleenf
Posts: 1123
Joined: Mon Jan 19, 2009 7:16 pm

Re: automatic script generation

Post by joleenf »

Hi Rick,

Importing your own xml is already possible in flythrough, the documentation for that is incomplete on the idv website, but I think that it may have been unintentional since the documentation ends mid-sentence. I included the flythrough information as an example of something which is extremely helpful in a few of the McV features. The feature which exports to a file information entered interactively, has been a great learning tool. The export feature formats the information in a way which makes it possible to import back into McV. In this way, I can learn how to format my own data for import into McV. I was thinking of a similar feature for scripting...

A user loads their data
Sets the screen size to 500x500
Centers on a lat/lon of -15 55
Clicks zoom twice (or scrolls in - how scripts will handle this is being decided).
Then they might click a File>Export>Export as python script

and get something like
withManagedDataSource("magic") #magic refers to the fact that testing this is on my todo list
#and I don't know how to use this yet
idv.getStateManager().setViewSize(java.awt.Dimension(500,500))
theDisplay=createDisplay('imagedisplay',a)
mydisplay=firstDisplay() # replaces vms=idv.getVMManager().getViewManagers()

mydisplay.center(-15,55, 2.0)
...



Joleen
User avatar
barryr
Posts: 213
Joined: Thu Jan 08, 2009 5:42 pm
Contact:

Re: automatic script generation

Post by barryr »

Joleen,

Thanks for the request. I wrote it up in McV inquiry 1131 as an enhancement request:
http://mcidas.ssec.wisc.edu/inquiry-v/?inquiry=1131

Barry
User avatar
joleenf
Posts: 1123
Joined: Mon Jan 19, 2009 7:16 pm

Re: automatic script generation

Post by joleenf »

Hi Barry,

I spoke with Tom W. He said it would not be possible to separate all the java instances and create a coherent script. In general, the purpose of the bundle was to fulfill the need to do something like I describe in the original post. At the same time, it would be really useful to have a few very simple scripts in the documentation which illustrate how to set up a display through a script. We have talked about this at scripting meetings, so it may be covering old ground.

Joleen
User avatar
barryr
Posts: 213
Joined: Thu Jan 08, 2009 5:42 pm
Contact:

Re: automatic script generation

Post by barryr »

Hi Joleen,

Thanks for the follow-up. This new info and request to add simple scripts which illustrate how to set up a display through a script will be in the inquiry so will be addressed there.

Barry
Post Reply