digger.utils.dtopo
¶
Module Contents¶
Functions¶
Create a dtopotype 1 file based on a set of gridded output. |
API¶
- digger.utils.dtopo.nc2dtopo(wdir: str = '.', output_type: str = 'fgout', gdir: str = '_output', dtopo_file: str = 'out.dtopo', tmax: float = None, dh_min: float = 0, epsg: int = None) None ¶
Create a dtopotype 1 file based on a set of gridded output.
One option for initializing a Geoclaw or D-Claw simulation is to use a dtopo file that specifies the vertical displacement of the basal topographic surface.
If one has run a landslide simulation without an ocean and then wants to use the vertical displacement due to landslide motion to initialize a second simulation containing an initially flat ocean, one needs to convert the output of the first simulation into a dtopo file. This function accomplishes that task.
Details regarding the dtopo file format can be found in the clawpack documentation.
- Inputs:
- wdirstr
Working directory within which D-Claw was run. This directory is expected to contain the standard .data files associated with a clawpack run.
- output_typestr
Type of gridded output. Options are
"fgout"
, indicating clawpack fgout-style output that will be read using the xarray FGOutBackend. Alternatively,"netcdf4"
indicates netcdf files.netcdfs are expected to have the variables for depth (h), surface elevation (eta), depth times x-directed velocity (hu), depth times y-directed velocity (hv), and depth times solid fraction (hm).
If
bing==True
then hm is not used and it is assumed that all material is landslide material.- gdirstr
The name of the directory within
wdir
that contains the gridded output files.- dtopo_filestr
The path where you want the dtopo file written.
- tmaxfloat
The maximum time from the first simulation that you want considered for the dtopo file. Output from the first simulation with t>`tmax` will not be used.
- dh_minfloat
The minimum change in the topographic surface anywhere in the simulation needed to write a dtopo file.
- epsgint
The EPSG code of the simulation.
- Outputs:
- None
The only output is the file specified by
dtopo_file
.