Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@james-morrison-mowi
james-morrison-mowi / read_depomod_cage_xml.py
Last active March 6, 2018 15:14
Function for reading cage xml data from NewDEPOMOD and bringing it into a Pandas DataFrame and generating a csv file which can be read into QGIS as a delmited text layer
import xml.etree.ElementTree as ET
import pandas as pd
def read_cage_xml(cages_xml_file_path):
xml_cages = ET.fromstring(open(cages_xml_file_path).read())
cage_details = []
for x in xml_cages[0]:
if (x.tag[-4:]) == 'cage':
cage_details.append({'easting':float(x[1].text),'northing':float(x[2].text),'cageType':x[0].text,'length':x[4].text,'width':x[5].text})
cages_df = pd.DataFrame(cage_details)
@james-morrison-mowi
james-morrison-mowi / waves17_columns.py
Created January 22, 2018 08:11
Python list for column names for default wave log export ($WAVES17) from Teledyne Velocity/WavesMon for ADCPs with wave enabled and sampling less than 2Hz
waves17_columns =['Format','BurstNum','YY/MM/DD HH:MM:SS','Hs','Tp','Tz','T01','Tinv1','Dp','Dm','S0','WaterLevel','Temperature','HsSwell','TpSwell','DpSwell','HsSea','TpSea','DpSea','H13','T13','H10','T10','Hmax','Tmax','SurfTrackGd*HH']