Skip to content

Instantly share code, notes, and snippets.

@douglatornell
douglatornell / xarray_continental25.ipynb
Created February 15, 2024 21:50
Demonstrate Using xarray to Work with Atmospheric Forcing Datasets
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@douglatornell
douglatornell / dynmodes.ipynb
Created April 29, 2013 04:00
Calculation of Vertical Dynamic Ocean Modes Based on http://woodshole.er.usgs.gov/operations/sea-mat/klinck-html/dynmodes.html by John Klinck, 1999.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@douglatornell
douglatornell / backfill_hdf5-to-netcdf4.sh
Created June 23, 2021 16:28
Script to do HDF5 to netCDF4 conversion of MOHID results in MIDOSS project Monte-Carlo results tree. Created for post-processing of the `north_strait_5th362` batch of runs for which the in-job conversion failed because the `SLURM_TMPDIR` local scratch storage on the node filled.
#!/bin/bash
RESULTS_DIR="/scratch/dlatorne/MIDOSS/runs/monte-carlo/north_strait_5th362_2021-06-14T150753/results/north_strait_5th362"
HDF5_TO_NETCDF4="${HOME}/.local/bin/hdf5-to-netcdf4"
module load python/3.8.2
module load nco/4.9.5
TMPDIR="${SLURM_TMPDIR}"
@douglatornell
douglatornell / VTEProbWaterMask.ipynb
Created June 9, 2020 19:37
Effect of SalishSeaCast NEMO water mask for GeoTIFFs on calculation of monthly VTE probability
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/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 January 6, 2017 20:00
Pulling hourly historical weather data from http://climate.weather.gc.ca/
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',
@douglatornell
douglatornell / NowcastResultsViz.ipynb
Created December 8, 2016 20:27
GoMSS Nowcast Production 08dec16
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@douglatornell
douglatornell / gist:ca2e978bc1f3a7fc5e10970ce88b5970
Created November 17, 2016 18:47
GoMSS Nowcast Test 14nov16
{
"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."
]
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{