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
Loading
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
#
# Copyright 2019 Scott Wales
#
# Author: Scott Wales <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import xarray
import dask
def least_sq_correlation(da, test):
"""
Calculate the least squares correlation against multiple
locations simultaneously
Args:
da (xarray.DataArray): Input data field
import xarray
import numpy
from dask.diagnostics import ProgressBar
in_path = '/g/data/w35/saw562/b.e11.B1850C5CN.f19_g16.0850cntl.001.pop.h.RHO.185001-200512.nc'
out_path = '/g/data/w35/saw562/test.nc'
min_lat = -35.5
max_lat = 0.5
min_lon = 18.5
#!/usr/bin/env python
import netCDF4
import glob
import multiprocessing
path = '/g/data/rr3/publications/CMIP5/output1/CSIRO-BOM/ACCESS1-3/rcp85/day/atmos/day/r1i1p1/latest/tas/*.nc'
path = '/g/data/ub4/era5/netcdf/surface/2T/199?/*.nc'
def process(p):
@ScottWales
ScottWales / plot_significant.ipynb
Last active March 22, 2019 05:34
Plot significant
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ScottWales
ScottWales / grid_radar.py
Created March 20, 2019 04:46
Gridding radar data
import pyart
import cftime
import multiprocessing
import os
import sys
def grid_radar(infile):
"""
Given the name of a radar file, create a file
``$PBS_JOBFS/gridded.{time}.nc`` containing a gridded representation of
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.