-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to add my DEM data to simulate the evolution process? #35
Comments
You can first load your DEM file as an xarray DataArray using rioxarray. The default models in fastscape like basic_model have an "init_topography" process that computes the initial topography (e.g., flat surface with random perturbations, escarpment, etc., see initial conditions). If you already have an initial topography, you can just drop this process from the model: from fastscape.models import basic_model
model = basic_model.drop_processes("init_topography") The newly created
You can then assign your loaded DEM as simulation input: import rioxarray
import xsimlab as xs
dem = rioxarray.open_rasterio("dem.tif")
ds_in = xs.create_setup(
model=model,
input_vars={
...,
"topography__elevation": dem,
},
...
)
# check_dims="transpose" is only useful if rioxarray does not load the
# DEM with x and y coordinates in the same order
ds_out = ds_in.xsimlab.run(model=model, check_dims="transpose") |
Thanks a lot! I will try. |
Sorry, I didn't see any example of adding a DEM download from other websites as a simulated object. I don't know how to add my DEM to the program if the fastscape supports doing that. I appreciate that someone could help with that. Thanks.
For example, I have a DEM in the file ("E:/PhD/TopoToolbox/TTLEMStudy/ttlem/topotoolbox-master/DEMdata/WulongshanForTTLEM30.tif"), and I try to use it but into failure. I want to find some examples of this problem, but nothing.
The text was updated successfully, but these errors were encountered: