Open pmav99 opened 9 months ago
I have second thoughts about adding it to the post-processing. The code is
import pyposeidon.mesh as pm
#add boundary nodes
mesh = pm.set(type='tri2d', mesh_file=os.path.join(b.rpath + 'hgrid.gr3'))
out_total = xr.merge([out,mesh.Dataset[['type','node','id']]])
but it would take long for a big global mesh and the data will be in every output file. I suggest we save mesh.Dataset[['type','node','id']]
to a single file once and this can be used to identify boundaries for all runs.
Sure, it can be part of the model definition.
That being said, do we need to call xr.merge()
? Wouldn't that be faster?
out_total = out.assign(
btype=mesh.Dataset.type,
bnode=mesh.Dataset.node,
bid=mesh.Dataset.id
)
I agree if we needed to merge them. We will not do that. We are just going to save to a netcdf
file that relates to the model and is unique.
import pyposeidon.mesh as pm
#add boundary nodes
mesh = pm.set(type='tri2d', mesh_file=os.path.join(b.rpath + 'hgrid.gr3'))
mesh.Dataset[['type','node','id']]].to_netcdf("boundary_connectivity.nc")
This will be done once and the file can be used to identify boundary nodes for all outputs, if need be. It doesn't need to be part of pyposeidon
.
I think we can close this issue.
Should we export this file by default? Should we also be able to read it? And/or to add a reference it in the *model.json
? Or maybe just document, that extracting this information can be done with the snippet above?
This is needed for GDACS