ehmatthes / sitka_irg_analysis

An analysis of the correlation between the Indian River stream gauge and landslide activity in the Sitka area.
4 stars 1 forks source link

Only includes first slide in a critical period #13

Open ehmatthes opened 3 years ago

ehmatthes commented 3 years ago

On 11/1-2/2020, there were two slides. The first was around 19:25 on 11/1, and the second was around 03:00 on 11/2. Only the first of these two slides shows up on the output.

It's probably a simple change to look for additional slides during a critical period.

ehmatthes commented 3 years ago

Here's get_relevant_slide() in plot_heights.py:

def get_relevant_slide(readings, known_slides):
    """If there's a relevant slide during this set of readings, 
    return that slide.
    Otherwise, return None.
    """
    relevant_slide = None
    for slide in known_slides:
        if readings[0].dt_reading <= slide.dt_slide <= readings[-1].dt_reading:
            print(f"Slide in range: {slide.name} - {slide.dt_slide}")
            relevant_slide = slide
            break

    return relevant_slide

This needs to be modified to get_relevant_slides(), and the caller needs to process the multiple slides.