lautenberger / elmfire

Eulerian Level set Model of FIRE spread
https://elmfire.io
Eclipse Public License 2.0
30 stars 13 forks source link

Feature request: timings at specified locations #31

Closed vvvvalvalval closed 1 year ago

vvvvalvalval commented 1 year ago

Problem statement

For some use cases, it is valuable to know when (if ever) each fire burns certain spatial locations.

Proposed solution

Example elmfire.data:

& INPUTS
TIMED_LOCATIONS_CSV = 'path/to/my-timed-locations.csv'

...

& OUTPUTS
TIMED_LOCATIONS_EVENTS_CSV = 'path/to/my-timed-locations-events.csv'
...

TIMED_LOCATIONS_CSV is an input CSV listing the points at which timings are required, in EPSG:5070 coordinates:

timed_location_id, x, y
42, 572416.24, 1067098.27
17, 572412.32, 1067091.28
...

The number of rows in this CSV will typically be much smaller than the number of pixels in the landscape, maybe one point every square kilometer or so. timed_location_id is an opaque id for each location, which ELMFIRE will convey unchanged to outputs, making it easier for callers to relate inputs to outputs. Ideally any data type should be allowed, but I guess it's fine to make it, say, a 64 bits integer if that makes the implementation easier for ELMFIRE.

TIMED_LOCATIONS_EVENTS_CSV is an output CSV emitted by ELMFIRE, describing which fire burned which location at what Time-of-Arrival:

icase, timed_location_id, toa_hr
1789, 17, 35.8
1791, 42, 21.12

For example, the 2nd row says that fire number icase=1791 burned location timed_location_id=42 at 21.12 simulated hours from ignition.

Callers should not expect any guarantees on the order of the rows - let them sort them themselves if needed.

lautenberger commented 1 year ago

Do you see the locations as points or areas? If area, we may want to add another column to TIMED_LOCATIONS_CSV:

timed_location_id, x, y, r

Where r is a search radius

vvvvalvalval commented 1 year ago

@lautenberger I see the locations as points.

lautenberger commented 1 year ago

Excellent, that makes it much more straightforward algorithmically!

lautenberger commented 1 year ago

This is implemented in commit https://github.com/lautenberger/elmfire/commit/0ca65b18efb61cb4d4582dc6181b2c3f5d3049f9, closing this issue!