Closed evasinha closed 3 months ago
The file can be found here: https://web.lcrc.anl.gov/public/e3sm/inputdata/share/meshes/homme/ne30pg2_scrip_c20191218.nc (Edit: corrected file)
Hi @evasinha
The minimal example you provided looks correct to me. The reason the node_lon
appears to be all zeros is because it is only printing a handfull of the values for the repr.
I'd suggest taking a look at our User Guide section on Plotting
@rytam2 is also working on an E3SM visualuzation notebook in #836
Thanks @philipc2
When I try to generate a plot using uxarray it show up as blank:
import uxarray as ux
import matplotlib.pyplot as plt
grid_path = file_path + 'ne30pg2_scrip_c20191218.nc'
fname = '20240703_SSP245_ZATM_BGC_ne30pg2_f09_oEC60to30v3.eam.h0.2075-06.nc'
uxds = ux.open_dataset(grid_path, fname)
uxds['SFCO2'][0].plot()
plt.savefig('SFCO2.png')
Is it possible that there are some issues rendering the image and if so how can those be resolved?
The file mentioned above can be downloaded from - https://web.lcrc.anl.gov/public/e3sm/diagnostic_output/ac.eva.sinha/tmp/
@evasinha
Here's a slightly modified example that works for me. Our plotting API is written using HoloViews, so I needed to make a few modifications to the code you provided.
import uxarray as ux
import holoviews as hv
hv.extension('matplotlib')
grid_path = "/Users/philipc/Downloads/ne30pg2_scrip_c20191218.nc"
data_path = "/Users/philipc/Downloads/20240703_SSP245_ZATM_BGC_ne30pg2_f09_oEC60to30v3.eam.h0.2075-06.nc"
uxds = ux.open_dataset(grid_path, data_path)
# generate and store a plot as a variable
out = uxds['SFCO2'][0].plot(backend='matplotlib',
fig_size=350,
pixel_ratio=4.0)
# safe plot as a PNG
hv.save(out, 'SFCO2.png', fmt='png')
@philipc2 Thank you very much for the modified working example. The modified script worked effortlessly for me as well.
@philipc2 is there a similar example that also specifies a map projection?
Proposed new feature or change:
I would like to plot E3SM,
eam.h0
output files that are atne30np4.pg2
. As a first step, I am trying to read the grid file:However as shown in the outputs below the lon values being read are all zero:
Can you provide a simple example of plotting E3SM unstructured outputs?