Skip to content

View and Download animations on Gadi/ARE #16

@max-anu

Description

@max-anu

When animations are made, Jupyter notebooks on Gadi are unable to display them and you are unable to directly download them using its button.

Error message: "No video with supported format and MIME type found."

Example code:

lv = accessvis.plot_earth(waves=True, when=dt, blendtex=True, vertical_exaggeration=15, sunlight=False)

#Shading/colour/lighting settings
lv.brightness_contrast_saturation(0.5, 0.525, 0.45)

#Setup lighting
lv.set_properties(diffuse=0.4, ambient=0.65, specular=0.4, shininess=0.045, light=[1,1,0.98,1])

#Northern hemisphere view for snow
lv.translation(0.0, 0.0, -16.75)
lv.rotation(40.775, -38.462, -21.42)


rinc = 0.02

filename = os.path.abspath('seasons.mp4')
print(f'Saving to {filename}')

with lv.video(filename=filename, quality=3, resolution=(1440,1440), width=1440//2, height=1080//2, params="autoplay") as v:    
    step = 4 #2
    for d in tqdm(range(0,366,step), desc='Day'):
        dt = datetime.datetime.strptime(f'04 {str(d+1).zfill(3)} 12:00', '%y %j %H:%M')
        dt = dt.replace(tzinfo=datetime.timezone.utc)
        accessvis.update_earth_datetime(lv, when=dt, sunlight=True)
        lv["title"] = '+' + dt.strftime("%d/%m/%Y")
        lv.rotate('y', rinc) #Rotate about axis too
        lv.render()

    #Final frames
    for f in range(30):
        lv.rotate('y', rinc)
        lv.render()

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions