Skip to content

Commit

Permalink
Added summary swe
Browse files Browse the repository at this point in the history
  • Loading branch information
micahjohnson150 committed Aug 20, 2024
1 parent f71c095 commit ff2a077
Showing 1 changed file with 24 additions and 6 deletions.
30 changes: 24 additions & 6 deletions scripts/remove_data/remove_bad_utm.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,17 @@ def delete_data(session, qry):
print('Aborted!')


def main():
credentials = ''

def remove_bad_gpr(session):
print('Querying DB for GPR with bad EPSG...')
# Remove GPR data with bad EPSG in AK
engine, session = get_db("localhost/snowex", credentials=credentials)
# Filter to AK
qry = session.query(PointData).filter(PointData.utm_zone==6)
# Filter to GPR used in AK by CSU
qry = qry.filter(PointData.observers=='Randall Bonnell')
qry = qry.filter(PointData.instrument == 'pulseEkko pro 1 GHz GPR')
delete_data(session, qry)


def remove_bad_pits(session):
print('Querying DB for Pits with bad EPSG...')
# Delete the AK pits with bad EPSG.
qry = session.query(LayerData).filter(LayerData.utm_zone==6)
Expand All @@ -36,10 +34,30 @@ def main():
'specific_surface_area', 'grain_type','temperature',
'hand_hardness'
]
qry = qry.filter(LayerData.types.in_(types_pit))
qry = qry.filter(LayerData.type.in_(types_pit))
delete_data(session, qry)


def remove_summary_swe(session):
print('Querying DB for summary swe with bad EPSG...')

# Delete the AK summary swe with bad EPSG.
types = ['snow_void', 'swe', 'density', 'depth']

qry = session.query(PointData).filter(LayerData.utm_zone==6)
qry = qry.filter(PointData.type.in_(types))
qry = qry.filter(PointData.instrument==None)
delete_data(session, qry)


def main():
credentials = ''
engine, session = get_db("localhost/snowex", credentials=credentials)
# remove_bad_gpr(session)
# remove_bad_pits(session)
remove_summary_swe(session)
session.close()


if __name__ == '__main__':
main()

0 comments on commit ff2a077

Please sign in to comment.