Skip to content

Instantly share code, notes, and snippets.

View tommylees112's full-sized avatar
🐘

Tommy Lees tommylees112

🐘
View GitHub Profile
@tommylees112
tommylees112 / 2018.csv
Created May 27, 2023 09:32
Cotswold Way Ultra 100 Mile 2018
Position Bib# Time Surname First Name Category Nationality Affiliation year gender hours
0 1 18 0 days 20:33:50 Bunn Spencer MV45 GBR 2018 M 20.563888888888886
1 2 26 0 days 20:33:50 Clark Douglas MSnr GBR 2018 M 20.563888888888886
2 3 15 0 days 20:45:41 Browne Kevin MSnr GBR 2018 M 20.76138888888889
3 4 22 0 days 21:33:05 Chataway Matthew MSnr GBR Mornington Chasers 2018 M 21.551388888888887
4 5 3 0 days 21:41:46 Antrobus Richard MSnr GBR 2018 M 21.69611111111111
5 6 86 0 days 22:13:28 Rees Tom MV45 GBR 2018 M 22.224444444444444
6 7 83 0 days 22:47:04 Prosser Clare FV45 GBR Town & Country Harriers 2018 F 22.784444444444443
7 8 70 0 days 22:47:05 McLaughlin James MV50 IRL Hook Norton Harriers 2018 M 22.78472222222222
8 9 9 0 days 22:58:50 Bennett James MV40 GBR Transition Running 2018 M 22.980555555555554
@tommylees112
tommylees112 / 2019.csv
Created May 27, 2023 09:31
Cotswold Way Ultra 100 Mile 2019
We can make this file beautiful and searchable if this error is corrected: It looks like row 8 should actually have 20 columns, instead of 2. in line 7.
,Position,Bib#,Time,Name,Category,Affiliation,Aggs,Birdlip,Painswick,Coaley,Wotton,Horton,Tormarton,Cold Ashton,Weston,start_date,year,gender,hours
0,1.0,69,0 days 20:25:08,"Migliuolo, Tommaso",MSnr,,16:39,18:40,20:28,23:01,01:45,04:00,05:32,06:40,07:56,2019-06-29,2019,M,20.41888888888889
1,2.0,93,0 days 20:34:28,"Sherley-Dale, Zen",MSnr,,16:38,18:51,20:37,23:21,02:05,04:29,05:54,06:52,08:10,2019-06-29,2019,M,20.574444444444445
2,3.0,13,0 days 20:59:50,"Chapman, Toby",MSnr,Bournemouth AC,16:39,18:51,20:37,23:20,02:05,04:29,05:10,07:07,08:32,2019-06-29,2019,M,20.99722222222222
3,4.0,76,0 days 21:16:53,"Nieuwenhuys, Greg",MSnr,,16:50,19:11,21:15,00:01,02:35,04:40,06:13,07:14,08:48,2019-06-29,2019,M,21.28138888888889
4,5.0,55,0 days 21:40:46,"Lang, Mike",MV50,Corsham Running Club,17:03,19:17,21:15,00:04,02:40,04:57,06:30,07:40,09:01,2019-06-29,2019,M,21.679444444444446
5,6.0,64,0 days 22:15:10,"Mendes, Mauricio",MV40,,16:38,19:00,20:53,23:55,02:40,04:57,06:59,08:09,09:46,2019-06-29,2019,M,22.25277777777778
6,7.0
@tommylees112
tommylees112 / 2021.csv
Created May 27, 2023 09:31
Cotswold Way Ultra 100 Mile 2021
Position Time Name Category Affiliation year gender hours
0 1 0 days 21:41:17 Daniel Hendriksen MV50 2021 M 21.688055555555554
1 2 0 days 22:21:13 Craig Rumble MV40 Corsham Running Club 2021 M 22.35361111111111
2 3 0 days 23:12:42 Colin Crowhurst MSnr 2021 M 23.211666666666666
3 4 0 days 23:36:35 Mathew Favell MV45 2021 M 23.60972222222222
4 5 0 days 23:39:00 Greg Moore MV40 2021 M 23.65
5 6 0 days 23:39:00 Andrew Stevens MV40 2021 M 23.65
6 7 0 days 23:40:36 David Musgrove MV45 Cirencester AC 2021 M 23.676666666666666
7 8 1 days 00:52:34 Andrew Gaskell MV40 2021 M 24.87611111111111
8 9 1 days 01:00:39 Adrian Busolini MSnr Fairlands Valley Spartans 2021 M 25.010833333333334
@tommylees112
tommylees112 / 2022.csv
Created May 27, 2023 09:30
Cotswold Way Ultra 100 Mile 2022
Position Bib Name Time Last Location year Category gender hours
0 1 13 Martin IndgeNoon Start 0 days 21:14:00 Finish 2022 M M 21.233333333333334
1 2 42 Nicholas BerryNoon Start 0 days 21:50:00 Finish 2022 M M 21.833333333333332
2 3 3 Will FrankNoon Start 0 days 21:50:00 Finish 2022 M M 21.833333333333332
3 4 45 Matthew KennedyNoon Start 0 days 23:42:00 Finish 2022 M M 23.7
4 5 24 Javier MonllorNoon Start 0 days 23:55:00 Finish 2022 M M 23.916666666666668
5 6 2 Dom JacksonNoon Start 1 days 00:27:00 Finish 2022 M M 24.45
6 7 29 Carl MorganNoon Start 1 days 01:27:00 Finish 2022 M M 25.45
7 8 51 Keith ShawNoon Start 1 days 01:43:00 Finish 2022 M M 25.716666666666665
8 9 9 Rachel GillingsNoon Start 1 days 02:25:00 Finish 2022 F F 26.416666666666668
import xarray as xr
import numpy as np
import pandas as pd
from pathlib import Path
import rioxarray
from tqdm import tqdm
from scripts.clip_netcdf_to_shapefile import (
prepare_rio_data,
rasterize_all_geoms,
create_timeseries_of_masked_datasets,
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
"""[summary]
1) Load the LDD map rasterio
2) Load numpy array into pyflwdir
PCRASTER convention
Value: 1-9 (5 is a bit, 1-8 is direction)
(alternate=arcgis 0-128)
3) Execute flwdir
`conda install pyflwdir -c conda-forge`
Documentation:
@tommylees112
tommylees112 / pysheds.sh
Created June 20, 2022 18:34
environment for pysheds
conda create -n pysheds --yes
conda activate pysheds
conda install -c conda-forge pysheds --yes
conda install -c conda-forge rioxarray --yes
conda install -c conda-forge ipython xarray seaborn jupyterlab --yes
@tommylees112
tommylees112 / sympy_calculations.py
Created May 24, 2022 21:36
for pibal tracking (tenerife fieldtrip), encode the equations that convert Lift Rate, Azimuth, Elevation, TimeDifference into wind speeds using trigonometry
"""
WIND SPEED = f(L, b_w, az₀, el₀, az₁, el₁, T₀, T₁)
____________________________________________________________
╱ ⎛ ⎛ ⎛az₀ az₁⎞⎞ ⎞
╱ ⎜ 2 2⋅T₀⋅T₁⋅cos⎜π⋅⎜─── - ───⎟⎟ 2 ⎟
╱ ⎜ T₀ ⎝ ⎝180 180⎠⎠ T₁ ⎟
╱ L⋅⎜─────────── - ────────────────────────── + ───────────⎟
╱ ⎜ 2⎛π⋅el₀⎞ ⎛π⋅el₀⎞ ⎛π⋅el₁⎞ 2⎛π⋅el₁⎞⎟
╱ ⎜tan ⎜─────⎟ tan⎜─────⎟⋅tan⎜─────⎟ tan ⎜─────⎟⎟
╱ ⎝ ⎝ 180 ⎠ ⎝ 180 ⎠ ⎝ 180 ⎠ ⎝ 180 ⎠⎠
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.