Skip to content

Instantly share code, notes, and snippets.

View lukecampbell's full-sized avatar

Luke Campbell lukecampbell

View GitHub Profile
@lukecampbell
lukecampbell / supervisord.service
Created November 18, 2015 15:41
Systemd for Supervisor with Virtualenv
[Unit]
Description=supervisord - Supervisor process control system for UNIX
Documentation=http://supervisord.org
After=network.target
[Service]
Type=forking
User=dev
ExecStart=/bin/bash -c 'cd /home/dev/code; source /home/dev/.virtualenvs/comt/bin/activate; /home/dev/.virtualenvs/comt/bin/supervisord -c /home/dev/code/supervisord.conf'
ExecReload=/bin/bash -c 'source /home/dev/.virtualenvs/comt/bin/activate; /home/dev/.virtualenvs/comt/bin/supervisorctl -c /home/dev/code/supervisord.conf reload '
#!/usr/bin/env python
import sys
def main(args):
return 0
if __name__ == '__main__':
from argparse import ArgumentParser
{
"error": null,
"id": 1,
"result": {
"measurement": "sea_water_temperature",
"report_name": "Water Temperature",
"units": "C",
"values": {
"time": [
"2015-10-01 01:00:00",
{
"error": null,
"id": 1,
"result": {
"constellation": "cbibs",
"measurement": [
"air_pressure",
"air_temperature",
"dew_point_temperature",
"grid_latitude",
@lukecampbell
lukecampbell / qcflags.sql
Created October 12, 2015 12:55
CBIBS QC Flags
-- get_bulk_qc_flags(site_code, start_time, end_time)
SELECT
DISTINCT ON (o.measure_ts, v.actual_name, l.elevation)
o.measure_ts,
s.site_code,
v.actual_name,
u.netcdf,
l.elevation,
o.obs_value,
qc.qa_code as "Primary QC",
@lukecampbell
lukecampbell / example.json
Created September 17, 2015 18:42
Here's an example response that contains a WMS endpoint information.
{
"records": [
{
"abstract": "Aggregation of Chlorophyll from Lake Michigan and surrounding waters from MODIS satellites.",
"categories": [
"satellite"
],
"end_time": [
"2013-01-13T18:55:00"
@lukecampbell
lukecampbell / metadata.md
Last active September 10, 2015 17:41
GLOS Metadata

Metadata

References

Identifier

We need a unique key to associate with this metadata. Unfortunately, I don't think geonetwork (or any other CSW for that matter) ensure identifier

@lukecampbell
lukecampbell / nc_iso.sh
Created September 2, 2015 19:08
Shell script to run NcISO
#!/bin/bash
# Put the ncISO jar in to $HOME/lib
# Example nciso.sh -ts http://tds.glos.us/thredds/catalog/glos/habs/lakes/catalog.xml -iso true -waf /tmp/waf -num 1024
java -cp "$HOME/lib/*" -Xms1024m -Xmx1024m -jar $HOME/lib/ncISO-2.3.jar $@
@lukecampbell
lukecampbell / response.xml
Last active August 29, 2015 14:27
BaseX Catalog Response
<csw:GetRecordsResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ows="http://www.opengis.net/ows" xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:ogc="http://www.opengis.net/ogc" xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" version="2.0.2" xsi:schemaLocation="http://www.opengis.net/cat/csw/2.0.2 http://schemas.opengis.net/csw/2.0.2/CSW-discovery.xsd">
<csw:RequestId/>
<csw:SearchStatus timestamp="2015-08-17T19:17:38.59Z"/>
<csw:SearchResults nextRecord="2" numberOfRecordsMatched="1" numberOfRecordsReturned="1" recordSchema="http://www.isotc211.org/2005/gmd">
<gmd:MD_Metadata>
<gmd:fileIdentifier xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:srv="http://www.isotc211.org/2005/srv" xmlns:gts="http://www.isotc211.org/2005/gts" xmlns:gss="http://www.isotc211.org/2005/gss" xmlns:gsr="http://www.isotc211.org/2005/gsr" xmlns:gmx="http://www.isotc211.org/2005/gmx" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:gco="http://www.is
netcdf cbibs-Currents_44043_2014-08-01 {
dimensions:
time = 31 ;
depth = 16 ;
variables:
int crs ;
crs:grid_mapping_name = "latitude_longitude" ;
crs:epsg_code = "EPSG:4326" ;
crs:semi_major_axis = 6378137.f ;
crs:inverse_flattening = 298.2572f ;