Skip to content

Instantly share code, notes, and snippets.

Doug Latornell douglatornell

Block or report user

Report or block douglatornell

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@douglatornell
douglatornell / NowcastResultsViz.ipynb
Created Dec 8, 2016
GoMSS Nowcast Production 08dec16
View NowcastResultsViz.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View gist:ca2e978bc1f3a7fc5e10970ce88b5970
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Visualize Results of a GoMSS Nowcast Run\n",
"\n",
"A quick collection of plots of results from a 1 day GoMSS nowcast system run."
]
@douglatornell
douglatornell / gist:550c46ebd38c0f627a3e
Last active Aug 29, 2015
Notes from plot_thresholds_all() code review on 2015-03-10
View gist:550c46ebd38c0f627a3e
from collections import OrderedDict
# Here's a possible data structure to hold constant values for the sites
# that we report ssh for. The outer dict has 2 keys: DFO and NOAA. Each of
# those keys has an OrderedDict as its value. OrderedDicts are defined by
# lists of key-value 2-tuples. Here the keys of the DFO OrderedDict are the
# names of the DFO sites, and the values are a dict of constant values.
# So, iterating over SITES['DFO'].items() will return the constants for
# Point Atkinson, Campbell River, and Victoria, in that order. The Campbell
# River extreme_ssh is accessed by SITES['DFO']['Campbell River']['extreme_ssh'].
View gist:2e3fece81bde45e7a15e
{
"metadata": {
"name": "",
"signature": "sha256:9e4150b049ad8b9ee7600a8fe76567ad97f185a1fd5cf7f86f63e60c83795bf7"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
@douglatornell
douglatornell / gist:2151f2ab1173e7985594
Created Sep 17, 2014
Commands to concatenate hourly EC research 2.5km GEM files to create a 1-day forcing file for NEMO
View gist:2151f2ab1173e7985594
ncrcat -4 -L4 2014091000_00?_2.5km_360x300.nc ../NEMO-atmos/y2014m09d10.nc
ncrcat -4 -L4 -A ../NEMO-atmos/y2014m09d10.nc 2014091000_01?_2.5km_360x300.nc ../NEMO-atmos/y2014m09d10.nc
ncrcat -4 -L4 -A ../NEMO-atmos/y2014m09d10.nc 2014091000_02?_2.5km_360x300.nc ../NEMO-atmos/y2014m09d10.nc
@douglatornell
douglatornell / script_runs_example.py
Created Jul 22, 2014
Example of a script to execute a series of Salish Sea NEMO model runs.
View script_runs_example.py
"""Example script to define and execute a series of Salish Sea NEMO model runs.
"""
from __future__ import absolute_import
import os
import salishsea_cmd.api
def main():
@douglatornell
douglatornell / WestgridJun2014.ipynb
Last active Aug 29, 2015
Analysis of Jun-2014 Salish Sea NEMO runtime profile tests on westgrid.ca machines
View WestgridJun2014.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@douglatornell
douglatornell / gist:11020457
Created Apr 18, 2014
IPython Notebook Exploring How netCDF4 Variable fill_value=0 Works
View gist:11020457
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
View namelist.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Fortran namelist parser. Converts nameslists to python dictionaries.
Should be fairly robust. Cannot be used for verifying fortran namelists as it
is rather forgiving.
Error messages during parsing are kind of messy right now.
@douglatornell
douglatornell / get_EC_xml_weather_obs.py
Last active Jan 6, 2017
Pulling hourly historical weather data from http://climate.weather.gc.ca/
View get_EC_xml_weather_obs.py
import cStringIO
import requests
from xml.etree import cElementTree as ElementTree
url = 'http://climate.weather.gc.ca/climateData/bulkdata_e.html'
query = {
# Spelling of keys is case-sensitive at the URL-processor end
'timeframe': 1,
'stationID': 6831, # Sandheads
'format': 'xml',
You can’t perform that action at this time.