[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[IDV #EKY-504245]: Jython script for 2D plot movie



Hi Roman.

Sorry this took so long. We have been somewhat understaffed  this week and 
last. Things should be returning to normal shortly. I was able to get the 
ncfile in question.

Since this is Jython you may have to get your hands dirty by looking at the 
actual IDV source. I try to answer some of your questions here:

Display unit: dc.setDisplayUnit("K")

Color range on the color table: Do you want to create your own, or use a 
prebuilt color table? You could do something like 
dc.setColorTableName("Temperature").  Otherwise, I suppose you could create 
your own color via Jython.

In your script, it looks like you are already modifying the contour parameters. 
Is there something wrong with that?

Setting the level ought to be possible, but I have not figured out how to do it 
since the PlanViewControl.setLevel method takes an Java Object type. I do not 
know how that Object is instantiated. I am still looking into that.

For the time range, there is a dc.setDataTimeRange. You will have to figure out 
how to properly construct a DataTimeRange object to supply to that function 
call.

About the order, Python is an imperative / functional as opposed to a 
declarative language so yes order is important.

This is probably enough to get you started. Let us know if you have more 
questions.

-Julien

> Hi,
> I tried multiple times to upload the netcdf file, but it doesn't show
> up afterwards in the RAMADDA directory. I even tried zipping the
> netcdf file, but the zip file couldn't upload either. Could it be that
> the files are too large? My netcdf file is about 23 MB while the ZIP
> file is about 10.5 MB.
> 
> -Roman
> 
> 
> 
> On Fri, Nov 12, 2010 at 4:38 PM, Unidata IDV Support
> <address@hidden> wrote:
> > Hi Roman.
> >
> > I am not finding your netcdf file (IDVmitmodel2.nc) on motherlode.
> >
> > Would it be possible for you to upload it again.
> >
> > Thanks.
> >
> > -Julien
> >
> >
> >
> >> Thank you. A quicker response would be much appreciated.
> >>
> >> Regards,
> >> Roman
> >>
> >>
> >> On Mon, Nov 8, 2010 at 4:16 PM, Unidata IDV Support
> >> <address@hidden> wrote:
> >> > Hi Roman.
> >> >
> >> > Yuan is in China until Monday.
> >> >
> >> > I will try to catch up on this thread, and see what is going on.
> >> >
> >> > -Julien
> >> >
> >> >> Hi Yuan,
> >> >> Any updates on the Jython script? Did you receive the NetCDF file,
> >> >> IDVmitmodel2.nc? I uploaded the file last Thursday.
> >> >>
> >> >> Thanks,
> >> >> Roman
> >> >>
> >> >>
> >> >>
> >> >> On Thu, Nov 4, 2010 at 3:09 PM, Roman Kowch <address@hidden> wrote:
> >> >> > As requested the NetCDF file, IDVmitmodel2.nc, has been uploaded to
> >> >> > the "Support Uploads" section.
> >> >> > -Roman
> >> >> >
> >> >> >
> >> >> > On Thu, Nov 4, 2010 at 10:15 AM, Unidata IDV Support
> >> >> > <address@hidden> wrote:
> >> >> >>> Name: Roman Kowch
> >> >> >>> E-mail: address@hidden
> >> >> >>> Organization: MIT PAOC
> >> >> >>> Software Package: IDV 2.7u2
> >> >> >>> Operating System: Linux Ubuntu
> >> >> >>> Subject: Jython script for 2D plot movie
> >> >> >>>
> >> >> >>> **MESSAGE**
> >> >> >>>
> >> >> >>>
> >> >> >>> Hi,
> >> >> >>>
> >> >> >>> I am trying to write a simple script in Jython that commands
> >> >> >>> IDV to make a 2D display of potential temperature from a Netcdf
> >> >> >>> file and write a movie file. So far, the following code below only 
> >> >> >>> seems
> >> >> >>> to make the display as if I just selected the potential temperature
> >> >> >>> field and hit "Create
> >> >> >>> Display" in the interactive mode:
> >> >> >>>
> >> >> >>>
> >> >> >>> setOffScreen(1)
> >> >> >>> idv.getStateManager().setViewSize(java.awt.Dimension(400,400))
> >> >> >>> ds = 
> >> >> >>> makeDataSource("/disk7/rkowch/IDV/mitfluids/netcdf/IDVmitmodel2.nc","netcdf.grid")
> >> >> >>> a = getData(ds.getName(),"Temp")
> >> >> >>> dc = createDisplay('planviewcontourfilled',a)
> >> >> >>> pause()
> >> >> >>>
> >> >> >>
> >> >> >>  Hi Roman,
> >> >> >>    please upload this IDVmitmodel2.nc file here:
> >> >> >>  http://motherlode.ucar.edu/repository/alias/idvupload
> >> >> >>
> >> >> >> Yuan
> >> >> >>> dc.setDisplayListTemplate("Potential Temperature 2D plot");
> >> >> >>> dc.setColorTableName("default")
> >> >> >>> dc.range.set(-50.0,25.0)
> >> >> >>> dc.setContourInfoParams("interval=2.0;min=-90.0;max=45.0;base=-230.0")
> >> >> >>> dc.applyPreferences();
> >> >> >>> writeMovie("2DThetaLoop.mov")
> >> >> >>>
> >> >> >>>
> >> >> >>> How could this script be modified to correctly set the display unit
> >> >> >>> (e.g. degC, K), color range on the color table, contouring 
> >> >> >>> parameters,
> >> >> >>> height level, and what times to use (which is specified before you 
> >> >> >>> hit
> >> >> >>> "Create Display")?
> >> >> >>>
> >> >> >>> Could you modify the script above to give an example of how this 
> >> >> >>> could
> >> >> >>> be done? What commands are commonly used in scripts like this? Also,
> >> >> >>> is there a certain order that must be followed when writing the
> >> >> >>> commands in the text file?
> >> >> >>>
> >> >> >>> I've been looking at the IDV documentation at this website, but
> >> >> >>> there's quite a bit
> >> >> >>> of info to sort through:
> >> >> >>>
> >> >> >>> http://www.unidata.ucar.edu/software/idv/docs/javadoc/
> >> >> >>>
> >> >> >>>
> >> >> >>>
> >> >> >>> Thanks for your help,
> >> >> >>> Roman
> >> >> >>>
> >> >> >>>
> >> >> >>
> >> >> >>
> >> >> >> Ticket Details
> >> >> >> ===================
> >> >> >> Ticket ID: EKY-504245
> >> >> >> Department: Support IDV
> >> >> >> Priority: Normal
> >> >> >> Status: Open
> >> >> >>
> >> >> >>
> >> >> >
> >> >>
> >> >>
> >> >
> >> >
> >> > Ticket Details
> >> > ===================
> >> > Ticket ID: EKY-504245
> >> > Department: Support IDV
> >> > Priority: Normal
> >> > Status: Open
> >> >
> >> >
> >>
> >>
> >
> >
> > Ticket Details
> > ===================
> > Ticket ID: EKY-504245
> > Department: Support IDV
> > Priority: Normal
> > Status: Open
> >
> >
> 
> 


Ticket Details
===================
Ticket ID: EKY-504245
Department: Support IDV
Priority: Normal
Status: Closed