Skip to content
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

[Feat] r.sim.water: temporal output should start at t=0 instead of t=1 #4764

Open
chaedri opened this issue Nov 26, 2024 · 13 comments
Open

[Feat] r.sim.water: temporal output should start at t=0 instead of t=1 #4764

chaedri opened this issue Nov 26, 2024 · 13 comments
Labels
enhancement New feature or request raster Related to raster data processing
Milestone

Comments

@chaedri
Copy link
Contributor

chaedri commented Nov 26, 2024

Is your feature request related to a problem? Please describe.
r.sim.water can output a space-time raster or vector dataset when using the -t flag. This will create a output time series that starts at timestep 1. For example, if the timestep is two minutes and the duration (niteration) is 10 minutes, the resulting outputs will be at 2, 4, 6, 8, and 10 minutes. There is no way to see the initial conditions, i.e., output at 0 minutes.

Describe the solution you'd like
I think that the initial conditions should be included in the output so that, in the example above, the results are at 0, 2, 4, 6, 8, and 10 minutes.

@chaedri chaedri added the enhancement New feature or request label Nov 26, 2024
@neteler neteler added the raster Related to raster data processing label Dec 7, 2024
@neteler neteler added this to the 8.5.0 milestone Dec 7, 2024
@aniket2405
Copy link
Contributor

aniket2405 commented Jan 10, 2025

Hey, can someone help me with the steps to reproduce the issue (or where to find the steps), so as to understand the requirements better?
I can't seem to find how to output a space-time raster.
Thanks a lot!

@chaedri
Copy link
Contributor Author

chaedri commented Jan 10, 2025

Using the -t flag and the increment parameter should create a space-time dataset. You could check it's created with t.list.

Here's an excerpt from the documentation that I modified (with the -t flag and increment parameter) to have a temporal output. It's using the North Carolina full sample dataset.

# set computational region
g.region raster=elev_lid792_1m -p

# compute dx, dy
r.slope.aspect elevation=elev_lid792_1m dx=elev_lid792_dx dy=elev_lid792_dy

# simulate (this may take a minute or two)
r.sim.water -t elevation=elev_lid792_1m dx=elev_lid792_dx dy=elev_lid792_dy depth=water_depth disch=water_discharge nwalk=10000 rain_value=100 niter=5 output_step=2

@aniket2405
Copy link
Contributor

Running the r.sim.water -t elevation=elev_lid792_1m dx=elev_lid792_dx dy=elev_lid792_dy depth=water_depth disch=water_discharge nwalk=10000 rain_value=100 niter=5 increment=2 command does not create the output datasets for me (with the names water_depth and water_discharge)

What might be going wrong?

Following the steps you mentioned.

@chaedri
Copy link
Contributor Author

chaedri commented Jan 15, 2025

It should create a bunch of raster layers named water_depth_01, water_depth_02... and so forth. I realized that, although the output is a time series, it's not yet registered to a space time raster dataset (strds). Check g.list type=raster to make sure they were created (sorry, I jumped the gun with t.list).

@veroandreo
Copy link
Contributor

There's no increment option in r.sim.water, instead it is called output_step. I just edited the commands above. I get 4 maps:

water_depth.02
water_depth.04
water_discharge.02
water_discharge.04

@aniket2405
Copy link
Contributor

Hey all,
Thanks for the help.
I'm having difficulty importing the North Carolina full sample dataset to Grass.

I previously used a self-created dataset (which might be causing my error).

Can someone help me how I can import the required dataset to the Grass GUI application? Thanks a lot!

@echoix
Copy link
Member

echoix commented Jan 16, 2025

In the gui, there's a button to download sample datasets, at the top of the data tab

@aniket2405
Copy link
Contributor

Sorry, I couldn't figure out clearly which button you mean. And how do we navigate to North Carolina full sample dataset from there?

@echoix
Copy link
Member

echoix commented Jan 16, 2025

Sorry, I couldn't figure out clearly which button you mean. And how do we navigate to North Carolina full sample dataset from there?

Image

After that its selecting the name and starting the download

@aniket2405
Copy link
Contributor

Thanks a lot for the help, @echoix
I could reproduce the issue now.

@aniket2405
Copy link
Contributor

Just to clarify,

To test any change that I make in the code - I am currently building the entire code again and, as a result, creating the application again to run.

Is there a faster/simpler way to test my changes on the GUI?

@petrasovaa
Copy link
Contributor

Generally it's enough to build just the part of the code you changed, so in your case raster/r.sim/.

@aniket2405
Copy link
Contributor

What is the command used to build a part of the code?
I generally build the entire codebase using grass-conda repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request raster Related to raster data processing
Projects
None yet
Development

No branches or pull requests

6 participants