This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from netCDF4 import * | |
from numpy import * | |
from scipy.stats import binned_statistic | |
# Overturning in rho z coords | |
def rhozmoc (data_file,grid_file,minval=1002,maxval=1030,inc=0.1): | |
print 'Reading file ',grid_file | |
input1 = Dataset(grid_file, 'r') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from netCDF4 import * | |
from numpy import * | |
from scipy.stats import binned_statistic | |
# Can't use multiprocessing.dummy as binned_statistic doesn't release the GIL | |
import multiprocessing | |
def binsum(binarray, valarray, bins): | |
summed, bin_edges, bin_number = binned_statistic(binarray, valarray, sum, bins, (min(bins),max(bins)) ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module quart | |
implicit none | |
type quaternion | |
! q(4) = (w, x, y, z) where w is the scalar part | |
real :: q(4) | |
! Flags to tell us if we want to keep the quaternion unitised, and | |
! also if the quaternion represents an improper rotation (rotation + inversion) | |
logical :: unit | |
logical :: improper |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from netCDF4 import Dataset | |
import sys | |
import xarray | |
from xarray.ufuncs import * | |
from glob import glob | |
import os | |
import string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
! Open an iced restart file, report times. Write new iced restart with modified time header | |
! single processor (not parallelized) | |
! intel compiler: | |
! ifort edit_time.f90 -o edit_time -i4 -r8 -convert big_endian -assume byterecl | |
program edit_time | |
implicit none |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# A cross-node version of gnu parallel | |
# | |
# node-parallel [command [arguments]] < list_of_arguments | |
# node-parallel [command [arguments]] ( ::: arguments | :::: argfile(s) )* | |
# | |
# The command can use gnu parallel replace tags (e.g. '{}' is replaced with an | |
# argument), see 'man parallel' for full details. | |
# Note that unlike gnu parallel a '{}' will not be automatically added if not | |
# present, it must be manually added. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import netCDF4 as nc | |
import sys | |
import numpy as np | |
import itertools as it | |
name_var = sys.argv[1] | |
orig = sys.argv[2] | |
new = sys.argv[3] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
import matplotlib.colors as mpc | |
import matplotlib as mpl | |
import cartopy.crs as ccrs | |
import cartopy.feature as cpf | |
from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER | |
# set the size limits |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import xarray | |
from scipy.stats import norm | |
import numpy as np | |
import matplotlib.mlab as mlab | |
import matplotlib.pyplot as plt | |
list_indices = ['tasmax'] | |
indices = list_indices[0] | |
data = xarray.open_dataset('/g/data3/w97/dc8106/AMZ_def_EXPs/test/tasmax_sc_001GPsc_E0_test.nc', chunks={'time':1000}) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer