conrad-blucher-institute / semaphore

Creative Commons Zero v1.0 Universal
1 stars 0 forks source link

Compare hohonus actuals and the magnolia models predictions #409

Open abeasley1722 opened 1 month ago

ccftissot commented 3 weeks ago

@abeasley1722 thanks for picking up that story. I started working on it last weekend but I don't have cbocp setup on my box yet so I run into a few issues. One way I was going to go about it is simply modify the code in cbocp that pulls the predictions from Semaphore to pull predictions also for dates in the past, at least for the 12 hour predictions. Then just let highcharts graph it so we can graphically compare measurements to predictions in the past.

So basically, modify the query description in semaphore_driver.py for magnolia to pull things in the past. so something like: {'model_name': 'magnolia_transform_12', 'model_version': '2.0.0', 'series': 'pWl', 'location': 'MagnoliaBeach', 'datum': 'D2W' , 'interval': 3600, 'range': [-100, 12]},

One problem I ran into when doing this was that the Hohonu measurement are every 6 minutes and so the graphs get pretty wacked up since our prediction interval is every hour. To fix that, you can manipulate the hohonu measurement dataframe in merge_semaphore.py to remove all rows that are not at the top of the hour (something like: hohonu_df = hohonu_df[hohonu_df['date'].dt.minute == 0].

I didn't get to wrap this up because I was hitting semaphore dev and I started getting errors when pulling data from the semaphore API. But I thought I would share what i had done so far in case it helps. Let me know if you would like more details on this.

lovelysandlonelys commented 3 weeks ago