Question

How to calculate hourly 7-day preceding rainfall?


Hi,

I have hourly rainfall data (observed and forecast) and i'd like to calculate a 7 day preceding rainfall total for EACH HOUR. My first thought is to use AttributeManager and adjacent features to sum the preceding 166 features (hourly rainfall totals), but it only allows up to 100 adjacent features. Any help would be greatly appreciated!

Thanks.


12 replies

Userlevel 5
Badge +25

I'm confused... you already have the hourly observed rainfall data, right? Isn't that exactly what you want?

 

Or do you want the grand total of all rainfall for the preceding 7x 24 hours for every hour?

Userlevel 5
Badge +29

Convert the date/times of each measurement to epoch, then convert them to points using the vertex creator and x=epoch y=0.

 

Taking your point (time) of interest, add another vertex 7 days ago (subtract the number of seconds off the epoch) and again using the vertex creator, ADD a vertex. You now have a line representing the time period that intersects 166 points representing hourly data.

 

You can now use spatial operations to group and sum the preceding 7 days of rainfall for each hour

Convert the date/times of each measurement to epoch, then convert them to points using the vertex creator and x=epoch y=0.

 

Taking your point (time) of interest, add another vertex 7 days ago (subtract the number of seconds off the epoch) and again using the vertex creator, ADD a vertex. You now have a line representing the time period that intersects 166 points representing hourly data.

 

You can now use spatial operations to group and sum the preceding 7 days of rainfall for each hour

thanks @hkingsbury​ , sounds like an interesting way of doing it. I don't quite follow though. Is there 3 vertex creators in there?

I'm confused... you already have the hourly observed rainfall data, right? Isn't that exactly what you want?

 

Or do you want the grand total of all rainfall for the preceding 7x 24 hours for every hour?

So for each hour, i want the sum of the preceding 7days worth of hourly rainfall. So it is effectively a moving 7day sum

Userlevel 5
Badge +29

thanks @hkingsbury​ , sounds like an interesting way of doing it. I don't quite follow though. Is there 3 vertex creators in there?

No, just two. First to create points representing individual measurements, then a second to create a line representing the time frame to sum

thanks @hkingsbury​ , sounds like an interesting way of doing it. I don't quite follow though. Is there 3 vertex creators in there?

Thanks - got that bit working! Just need to figure out how to sum them :) Any suggestions? I'm trying InlineQuerier but not sure this is the right tool

Userlevel 5
Badge +29

thanks @hkingsbury​ , sounds like an interesting way of doing it. I don't quite follow though. Is there 3 vertex creators in there?

A spatial relator or point on line will allow you to place the lines id (will need to generate that) on the point, you can then use an aggregator to sum them together using groupby

Userlevel 1
Badge +21

Are you able to share some sample data?

 

If doing this in FME I would probably clone each data point then use the copy number to alter the datetime so that you have 166 data points sharing the same datetime, then aggregate by this. Fairly inefficient.

 

A python solution would be my go to if dealing with a lot of data.

 

 

Are you able to share some sample data?

 

If doing this in FME I would probably clone each data point then use the copy number to alter the datetime so that you have 166 data points sharing the same datetime, then aggregate by this. Fairly inefficient.

 

A python solution would be my go to if dealing with a lot of data.

 

 

HI @ebygomm​ , here's the data. Inefficiency isn't an issue for me if I can get a working solution :) Thanks.

Userlevel 1
Badge +21

HI @ebygomm​ , here's the data. Inefficiency isn't an issue for me if I can get a working solution :) Thanks.

Hopefully this makes sense, you would need to do a bit of tidying for the end of the dataset.

image(Also you have one duplicate data point in your sample, not sure if you are aware)

Userlevel 5
Badge +29

thanks @hkingsbury​ , sounds like an interesting way of doing it. I don't quite follow though. Is there 3 vertex creators in there?

@John Kreft​  here's an example with the data you shared below

Badge +2

@John Kreft​ similar approach described here

Reply