Skip to content

Instantly share code, notes, and snippets.

@n-a-t-e
n-a-t-e / Dockerfile
Last active August 13, 2019 21:00
Custom writeISO19115 function inserted into ERDDAP docker
FROM axiom/docker-erddap:1.82
# Copy new writeISO19115 function into container
COPY ./java/writeISO19115.java /writeISO19115.java
RUN \
# setup javac
apt-get update && \
apt --assume-yes install openjdk-8-jdk && \
cd /usr/local/tomcat/webapps/erddap/WEB-INF && \
@n-a-t-e
n-a-t-e / datasets.xml
Last active February 25, 2020 19:21
CIOOS Required attributes in ERDDAP datasets.xml
<!--
This is a guide to adding metadata required to get a CIOOS-compatible dataset into ERDDAP
This example is for an english language dataset. For french use language=fra, title_eng, summary_eng etc
For entire list of supported attributes, see https://github.com/cioos-siooc/metadata-xml
-->
<!--
This setting is required to get our custom CIOOS ISO XML served by ERDDAP
The dataset ID is found in the top line of the dataset's definition <dataset type=... datasetID=...>
@n-a-t-e
n-a-t-e / metadata.yml
Last active May 23, 2020 01:11
cioos metadata in yaml format
mcf:
version: 1.0
metadata:
naming_authority_en: namingauthority in eng
naming_authority_fr: namingauthority in fr
identifier: 3f342f64-9348-11df-ba6a-0014c2c00eab
language: en
language_alternate: fr
maintenance_note_en: maintenance_note
@n-a-t-e
n-a-t-e / dates.js
Last active October 26, 2020 17:36
excel4node one hour off
const xl = require("excel4node");
const workbook = new xl.Workbook();
cell = "2020-03-06T15:38:00Z";
workbook.addWorksheet("My Data").cell(1, 1).date(cell).style({
numberFormat: "yyyy-mm-dd hh:mm:ss",
});
@n-a-t-e
n-a-t-e / odf_to_pandas.py
Last active February 5, 2021 19:18
Read an ODF file in Python using rpy2 to interface with R libraries
#!/usr/bin/env python3
"""
Use OCE R package from Python3 to read an ODF file
You will need to install R and libraries 'oce' and 'RJSONIO' by running
the following commands in R. I am using R version 3.6.2
install.packages("devtools")
library(devtools)
@n-a-t-e
n-a-t-e / read_odf.m
Created March 26, 2021 16:54
Matlab read_odf code
function S = read_odf(varargin)
%Reads in the specified ODF file. If none specified, a file select window appears to select one.
%
% Source: Dave Kellow, 902-426-2245, kellowd@mar.dfo-mpo.gc.ca
% Modified by David Chang, Evans Computer, Feb. 29, 2008
%
%Description: READ_ODF reads in the specified ODF file.
% If none specified, a file select window appears to select one.
%
% Syntax:
@n-a-t-e
n-a-t-e / downloader_input.json
Last active June 8, 2021 19:39
downloader_input.json
{
"user_query": {
"time_min": "1990-01-01",
"time_max": "1991-01-01",
"lat_min": 49,
"lat_max": 50,
"lon_min": -123,
"lon_max": -123.1,
"eovs": ["sea temperature"],
"email": "cozycoops@gmail.com"
import { Map, NavigationControl } from "maplibre-gl";
import mapboxgl from "mapbox-gl";
import MapboxDraw from "@mapbox/mapbox-gl-draw";
export default function createMap() {
console.log("create map called");
var map = new Map({
container: "map",
style: {
version: 8,
@n-a-t-e
n-a-t-e / ceda_changes.md
Last active November 11, 2021 02:03
CIOOS Dataset recommended changes for CIOOS Data Explorer
@n-a-t-e
n-a-t-e / all_datasets.py
Last active November 22, 2021 21:43
All datasets from all ERDDAPS
#!/usr/bin/env python
# coding: utf-8
import pandas as pd
erddaps_json_url="https://raw.githubusercontent.com/IrishMarineInstitute/awesome-erddap/master/erddaps.json"
erddaps_json=pd.read_json(erddaps_json_url)
erddaps=list(erddaps_json['url'])
df_all=pd.DataFrame()