Skip to content

Conversation

@rjleveque
Copy link
Member

WIP: Need to add better doc string to read_netcdf.

In both crop and read_netcdf functions, I have added arguments buffer and align.

buffer insures that the new topo returned extends beyond the region/extent requested by this many cells (if possible). The default buffer = 0 gives the previous behavior, but if the regions specified agrees with the computational domain you plan to use it with, sometimes the topofile thus obtained doesn't quite cover the domain. Setting buffer = 1 may be better.

align = (xalign, yalign) is used only if coarsen > 1 and subsampling is being done.
This parameter may be useful to insure that the subsampling starts at an appropriate index. For example, if the original topo has

topo.x = [0, 0.5, 1, 1.5, 2, 2.5]

then coarsening by 2 would result in

newtopo.x = [0, 1, 2]   # if align[0] is an integer

or

newtopo.x = [0.5, 1.5, 2.5]   # if align[0] is an integer + 0.5 

Often in GeoClaw, if the original topofile is aligned with integer longitudes and latitudes, for example, then we want any subsampled topo to have the same property.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant