Specifying keywords to setAutoRotate and writeMovie

Post any questions, ideas, or topics related to Jython and Python scripting.
Post Reply
User avatar
__PG__
Posts: 1
Joined: Fri Jun 07, 2013 1:12 am

Specifying keywords to setAutoRotate and writeMovie

Post by __PG__ »

Hello all.

I'm attempting to create a nice composite of animated geostationary imagery across the whole globe. At the moment I'm displaying MTSAT, GOES (W) and METEOSAT data.

Here is my current script:

Code: Select all


movieDir=('/home/ho/others/'+myuser+'/McIDAS-V/') 

addeParmsMTSAT = dict(
    debug=True, 
    server='satds.bom.gov.au',
    dataset='MTSAT',
    descriptor='IR1',
    band=2,   
    unit='BRIT',
    coordinateSystem=LATLON,
    size='ALL',
)

addeParmsMETEOSAT = dict(
    debug=True, 
    server='satds.bom.gov.au',
    dataset='METEOSAT',
    descriptor='HRIR1',
    band=9,   
    unit='BRIT',
    coordinateSystem=LATLON,
    size='ALL',
)

addeParmsGOES = dict(
    debug=True, 
    server='satds.bom.gov.au',
    dataset='GOES',
    descriptor='IR',
    band=4,   
    unit='BRIT',
    coordinateSystem=LATLON,
    size='ALL',
)

# Setting the bounds of the loop using the 4 most recent times
# METEOSAT is available every 6 hours on satds.bom.gov.au

METEOLoop=[]
for pos in range(-4,1):
    metadata,myImages=getADDEImage(position=(pos),**addeParmsMETEOSAT)
    METEOLoop.append(myImages)

# Plot MTSAT data every 6th hour
# MTSAT is available every hour on satds.bom.gov.au (actual valid time is 32mins after the hour)

MTSATLoop=[]
for pos in range(-24,1,6):
    metadata,myImages=getADDEImage(position=(pos),**addeParmsMTSAT)
    MTSATLoop.append(myImages)

# Plot GOES data every 6th hour
# GOES is available every 3 hours on satds.bom.gov.au

GOESLoop=[]
for pos in range(-8,1,2):
    metadata,myImages=getADDEImage(position=(pos),**addeParmsGOES)
    GOESLoop.append(myImages)

# Building the display window

panel = buildWindow(height=800, width=1000, panelTypes=GLOBE)

#Turn off wireframe
panel[0].setWireframe(0)

METEOlayer = panel[0].createLayer('Image Sequence Display',METEOLoop) #Plots image
MTSATlayer = panel[0].createLayer('Image Sequence Display',MTSATLoop) #Plots image
GOESlayer = panel[0].createLayer('Image Sequence Display',GOESLoop) #Plots image

#Set autorotate
panel[0].setAutoRotate(1)
# Capturing the movie and saving it to your specified movieDir directory

GOESlayer.setLayerLabel(label='%displayname% %timestamp%', size=15, color='blue')
writeMovie(movieDir+'ir-loop-rotate.gif')


Here is the output.
Image

What I'd like to do is
a) Slow down the rotation speed
b) Run the film for longer so that I get at least one rotation of the Earth to complete for the whole film.

Can this be done with keywords to setAutoRotate and writeMovie? Or am I better off using writeImage and manually rotating the globe and advancing the image frames?

Ideally I'd like to run more images on the globe itself (it only uses five at the moment) but that's another bridge to cross.

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

Re: Specifying keywords to setAutoRotate and writeMovie

Post by barryr »

Hi Paul,

I asked one of our scripting programmers about your questions. He gave the following answer for your first question (how to slow the rotation speed):
... use this:

panel[0].getNavigatedDisplay().rotateSlower()
# or the opposite...
panel[0].getNavigatedDisplay().rotateFaster()


Alternatively, you can set the "rotate delay" explicitly like this:

delayTime = 10 # this is the time between "rotations", in milliseconds (should be >= 1)
panel[0].getNavigatedDisplay().setRotateDelay(delayTime)


He said that the answer to your other question (how to run the film for longer...) is more complicated. We can continue to look into it next week if you still need assistance. Also, you may find the information in this other forum thread useful (including the sample script in the last post):
viewtopic.php?f=31&t=898&start=0

Barry
Post Reply