Skip to content

Instantly share code, notes, and snippets.

View adamml's full-sized avatar

Adam Leadbetter adamml

View GitHub Profile
@adamml
adamml / P01-to-QUDT_Units.ipynb
Created May 6, 2026 10:52
BODC Parameter Usage Vocabulary terms to QUDT possible units of measure
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@adamml
adamml / cpMapViewerConfig.json
Last active May 21, 2026 15:02
Ocean Decade Atlas Config
{
"appName": "UNOceanDecadeDigitalAtlas",
"lang": "en",
"map": {
"center": [0, 0],
"initialZoom": 4,
"minZoom": 1,
"maxZoom": 16,
"projection": "EPSG:3857"
},
@adamml
adamml / query.rq
Created December 9, 2025 22:23
Ocean Data Information System - Essential Ocean Variable query
prefix sdo: <https://schema.org/>
SELECT DISTINCT ?name ?keywords ?contentUrl WHERE {
?uri ?a sdo:Dataset.
?uri sdo:name ?name.
?uri sdo:distribution ?uri2.
?uri2 sdo:contentUrl ?contentUrl.
?uri sdo:keywords ?keywords
FILTER REGEX(lcase(str(?keywords)), "temperature")
} LIMIT 50
@adamml
adamml / argoAnimPlotter.py
Created October 31, 2024 19:22
Argo data animation builder
"""A Python script to pull Argo float location data through time from a JSON
file and add it to a Matplotlib animation with colour coding for a dependent
parameter.
Data can be obtained from
https://erddap.ifremer.fr/erddap/tabledap/ArgoFloats.html
The full URL used for this version is:
https://erddap.ifremer.fr/erddap/tabledap/ArgoFloats.json?
time%2Clatitude%2Clongitude%2Cpres%2Ctemp&
@adamml
adamml / waves_blender.py
Created September 1, 2022 21:06
Render wave time series from Erddap in Blender
import json
import bmesh
import urllib.request
import datetime
import math
def drawpolygon(xdata, ydata,
xnorm = None, ynorm=None, zscale=None, colour=(1, 1, 1, 1)):
if xnorm is not None:
xdata = list(map(lambda x, seriesmax=max(xdata), seriesmin=min(xdata), norm=xnorm: (((x - seriesmin)/(seriesmax - seriesmin)) * (norm[1]-norm[0])) + norm[0], xdata))
@adamml
adamml / valentia.ipynb
Created June 25, 2022 14:58
Exploring the Valentia Observatory Monthly Data time-series
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@adamml
adamml / requirements.txt
Last active May 29, 2022 20:01
Tour de France villes etape data exploration / map builder
matplotlib
@adamml
adamml / nvs_collection_to_owl_named_individuals.py
Last active May 9, 2022 15:25
NERC Vocabulary Server Concept Collection to OWL Named Individuals
import urllib.request
from rdflib import Graph, Literal, OWL, RDF, RDFS, URIRef, SKOS
import rdflib.namespace
def nvs_fetcher(nvs_collection: str, others: list) -> Graph:
"""Fetches a NERC Vocabulary server collection and returns it
as a set of OWL Named Individuals with optional additional OWL or
RDF classes added to the graph.
@adamml
adamml / query.rq
Last active November 13, 2019 15:48
NVS Hierarchy
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT DISTINCT ?url ?label ?date WHERE
{
{
SELECT (?a AS ?url) (?c AS ?label)
WHERE {
VALUES ?a {<http://vocab.nerc.ac.uk/collection/P01/current/PSALCU01/> <http://vocab.nerc.ac.uk/collection/P01/current/ALATZZ01/>}
?a skos:prefLabel ?c
@adamml
adamml / nvsP01query.rq
Last active May 16, 2019 09:17
Search the P01 Vocabu;lary on the NERC Vocabulary Server
PREFIX dc:<http://purl.org/dc/elements/1.1/>
PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT ?p ?q WHERE {
<http://vocab.nerc.ac.uk/collection/P01/current/> rdf:type skos:Collection.
<http://vocab.nerc.ac.uk/collection/P01/current/> ?o ?p.
?p skos:prefLabel ?q
FILTER REGEX(lcase(str(?q)), "solar")
}