SnowEx / snowexsql

A project to access the SnowEx database holding data from the NASA SnowEx campaign
https://snowexsql.readthedocs.io/en/latest/readme.html
GNU General Public License v3.0
23 stars 6 forks source link

Restructure work - clear up site conditions vs site location #127

Open micah-prime opened 2 weeks ago

micah-prime commented 2 weeks ago

We now have a Site belonging to a Campaign. Previously SiteData had a date AND location associated with weather, conditions, etc.

To maintain this info, we can change SiteData to SiteConditions and link that to the Site.

https://github.com/SnowEx/snowexsql/blob/dev/snowexsql/tables/site_data.py#L11 https://github.com/SnowEx/snowexsql/blob/dev/snowexsql/tables/site.py#L20

Site can have the location and SiteConditions can have date-specific conditions. Each point or pit can link to a SiteCondition, belonging to a Site, belonging to a Campaign.

FYI @micahjohnson150

jomey commented 1 week ago
erDiagram
  Campaign ||--|{ Site : "has many"
  Site ||--|| SiteCondition : "has one"
  Campaign
  Site {
    int campaign_id
    int site_condition_id
    String plot_id
    date site_visit
  }
  SiteCondition {
    int site_id
  }
jomey commented 1 week ago

I imagine all of these pit header fields going into the Site table

image

micah-prime commented 1 week ago

I imagine all of these pit header fields going into the Site table

image

Yep, basically everything here https://github.com/SnowEx/snowexsql/blob/master/snowexsql/tables/site_data.py#L15-L28