Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions scripts/icar_visualization.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# IPython log file

import os
import xarray as xr
import matplotlib.pyplot as plt

ds=xr.open_dataset("output_simple/icar_out_000001_2000-10-01_00-00-00.nc") # image 000001 domain partition
data_dir_path=os.environ.get("TRAINING_DATA")
ds=xr.open_dataset(data_dir_path + "/training_input-image-_100.nc") # temporarily hardcoded file
print(ds)
ds["precipitation"][-1].plot() # -1 refers to last time step
ds["precipitation"][-1].plot(vmax=2) # set max of color scale (for a longer time, try vmax ~ 2000)
Expand All @@ -13,4 +15,4 @@
plt.clf()
ds["precipitation"][i].plot(vmax=2)
plt.pause(0.1) # 0.1 sec pause between frames
plt.savefig("file_name.png") # edit this to insert frame number into file name to prevent overwrites
plt.savefig("file_name" + str(i) + ".png")