Skip to content

Instantly share code, notes, and snippets.

View ScottWales's full-sized avatar

Scott Wales ScottWales

  • Bureau of Meteorology
  • Melbourne
View GitHub Profile
#!/usr/bin/env python
from __future__ import print_function
import xarray
import argparse
from dask.diagnostics import ProgressBar
import numpy
def main():
parser = argparse.ArgumentParser()
parser.add_argument('input')
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ScottWales
ScottWales / Untitled.ipynb
Last active July 20, 2018 00:32
Xarray time series to Pandas
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ScottWales
ScottWales / daily-animation-xarray.py
Last active October 24, 2022 15:49
Animated xarray+cartopy plot
#!/usr/bin/env python
from __future__ import print_function
import xarray
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
import matplotlib.animation as anim
import cartopy
filenames = ['/g/data3/w97/dc8106/AMZ_def_EXPs/121GPsc_E0/AMZDEF.daily_tasmax.1978_2011_121GPsc_E0_SAmerica.nc']
@ScottWales
ScottWales / residuals.ipynb
Created June 12, 2018 06:23
Precip residuals with xarray
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/bin/bash
module purge
module use /g/data3/hh5/public/modules
module load conda
/usr/bin/env python - $* << EOF
import os
import iris
import iris.fileformats.netcdf
from argparse import ArgumentParser