Skip to content

Instantly share code, notes, and snippets.

View rsignell-usgs's full-sized avatar

Rich Signell rsignell-usgs

View GitHub Profile
@rsignell-usgs
rsignell-usgs / ugly.txt
Created March 4, 2013 20:15
Ugly text file I need to read
InnerDiameterOrWidth::0.1,InnerHeight::0.1,Length2dCenterToCenter::44.6743867864386,Length3dCenterToCenter::44.6768028159989,Tag::<NULL>,{StartPoint::7858.35924983374[%2C]1703.69341358077[%2C]-3.075},{EndPoint::7822.85045874375[%2C]1730.80294308742[%2C]-3.53962362760298}
InnerDiameterOrWidth::0.1,InnerHeight::0.1,Length2dCenterToCenter::57.8689351603823,Length3dCenterToCenter::57.8700464193429,Tag::<NULL>,{StartPoint::7793.52927597915[%2C]1680.91224357457[%2C]-3.075},{EndPoint::7822.85045874375[%2C]1730.80294308742[%2C]-3.43363070193163}
InnerDiameterOrWidth::0.1,InnerHeight::0.1,Length2dCenterToCenter::68.7161350545728,Length3dCenterToCenter::68.7172034962765,Tag::<NULL>,{StartPoint::7858.35924983374[%2C]1703.69341358077[%2C]-3.075},{EndPoint::7793.52927597915[%2C]1680.91224357457[%2C]-3.45819643838485}
@rsignell-usgs
rsignell-usgs / ugly.py
Created March 4, 2013 20:22
python to read ugly.txt
import csv
#
with open('ugly.txt', 'rb') as fin, open('output.csv', 'wb') as fout:
reader = csv.reader(fin)
writer = csv.writer(fout)
for i, line in enumerate(reader):
mysplit = [item.split('::') for item in line if item.strip()]
if not mysplit: # blank line
continue
keys, vals = zip(*mysplit)
@rsignell-usgs
rsignell-usgs / necofs_velocity.ipynb
Created March 5, 2013 18:37
Forecast ocean currents from the NECOFS model
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rsignell-usgs
rsignell-usgs / oscar_timing.ipynb
Created March 7, 2013 18:22
OSCAR compression testing
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rsignell-usgs
rsignell-usgs / Timing_time_series_extraction.ipynb
Created March 15, 2013 14:53
Timing extraction of 1D time series from aggregations of GRIB1, GRIB2 and NetCDF data
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rsignell-usgs
rsignell-usgs / roms_3d.ipynb
Created March 15, 2013 15:21
ROMS 3D data demo, using a vertical section to show correct computation of 3D z values from CF-Compliant specification of ocean_s_coordinates.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rsignell-usgs
rsignell-usgs / opuls_ugrid_demo2.ipynb
Created March 18, 2013 15:39
UGRID OPULS Subset Demo 2: subsetting depth on nodes and velocity on faces
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.
@rsignell-usgs
rsignell-usgs / selfe_currents.ipynb
Created March 25, 2013 11:27
Access SELFE data via OPeNDAP
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rsignell-usgs
rsignell-usgs / nate001.ipynb
Created March 26, 2013 17:08
Nate Lesson 1, read date, time and temp from log file
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.