Skip to main content

Rainfall Issue

Issue Description

During the previous iteration of our exploration of Chama we fed in Rain gage name as part of the scope. Now we are going to have multiple rain gages not a single rain gage. Therefore The bias of 1 rain gage has to be eliminated. There are 2 choices here we and require the user to add all the rain gages from the file. we can see if PySWMM will give us a list of rain gages

Checking read the Docs for Rain gage information.

Question

Can PySWMM check for rain gages and give us a list?

Answer

There is a class pyswmm.raingages.RainGages(model). This seems to be what we want. We can get all of the rain gages in a sim.

Code Review

Where are we using raingages in the code and how can it be modified to use multible rain gages?

Rain Gages where are they being used

We are setting the rain gage in the config file. One of the first things we are doing in the main method is setting the rain gage. I would not do that. We are going to get all the rain gages from the PySWMM run, So no need to pass in a single or multiple rain gages.

Due to not passing from the config file we will not need to pass it into the generate_signals method.

In generate_singals method we do set the rain gage that we want to track to see if there is any rain. We are now going to have multiple rain gages so instead of tracking if there is rain at a specific rain gage we should be tracking if there is any rain at any rain gage in the system. Just because it may not be raining over a specific node currently does not mean that rainwater from a different different subcatchment is not running down the pipe. So the question is how to check if there is any rainfall at any rain gage in the network.

The easy way is as follows:

  1. Get all of the rainfall id's from pyswmm
  2. Current code checks if single rain gage rainfall > 0. but other than that the rainfall is not used. So an easy way to do this would be to iterate through all the rain gages adding the rainfall to 1 amount then checking if that amount is greater than 0. This way no other changes would have to me made to the rain gage code.