This file contains 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
source("firehistory.R") | |
d <- read.fhx("17P.fhx") | |
# Make a copy of the data we read-in in case we fuck-up. | |
d.new <- d | |
# Reverse the level ordering for the type factor -- the plotting looks better. | |
d.new$rings$type <- factor(d$rings$type, levels = rev(levels(d$rings$type))) |
This file contains 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 | |
from mpl_toolkits.basemap import Basemap, shiftgrid, cm | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from netCDF4 import Dataset | |
# The netCDF file is from ftp://ftp.cdc.noaa.gov/Datasets/noaa.ersst/sst.mnmean.nc | |
d = Dataset("sst.mon.anom.nc") | |
sst = d.variables["sst"][:][0, :, :] # Should take the first time slice. |
This file contains 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 | |
from mpl_toolkits.basemap import Basemap, shiftgrid, cm | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from netCDF4 import Dataset | |
import datetime | |
datetime_origin = datetime.datetime(1, 1, 1, 0, 0, 0, 0) | |
# In this case, this is 500 mb. Can check below with d.variables["level"][:] |
This file contains 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 scipy.io as sio | |
import matplotlib.pyplot as plt | |
class BadSeriesError(Exception): pass | |
class MatRwl(object): | |
""" Read MATLAB files from Meko's RWL Velmex script. | |
""" |
This file contains 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 Rscript | |
# 2011-11-07 | |
# Convert full-ring .mat files from Meko's velmex script to common Tucson | |
# format. | |
suppressMessages(require(R.matlab)) | |
suppressMessages(require(dplR)) | |
args <- commandArgs(trailingOnly = TRUE) |
This file contains 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 bash | |
# publishTex.sh | |
# 2010-06-08 | |
# This is a quick script to help produce a PDF from .tex files for AMS publication. | |
# Run it from Bash like so: | |
# ./publishTex.sh sample.tex | |
if [ ! -e "$1" ] | |
then | |
echo "The file or directory given does not seem to exist." |
This file contains 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 | |
# Copyright 2014 by S. Brewster Malevich <[email protected]> | |
# This script adds `Time` variable to all netCDF files in the current working | |
# directory (CWD) and then concatenates them all into a single netCDF file | |
# `all.nc` in the CWD. This this uses Bash's `ncks` and `ncecat`. | |
import os | |
from shutil import rmtree |
This file contains 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 bash | |
# 2014-05-02 | |
# S. B. Malevich <[email protected]> | |
# Dump netCDF files in CWD to a text CDF file. Change `time = 1 ;` dimension | |
# to `time = UNLIMITED`, and then convert the CDF back into a netCDF file, | |
# overwriting the original. | |
for f in *.nc; do | |
cp $f $f.original # Make copy for safety. Might want to comment this out. |
This file contains 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/csh -f | |
# 2014-10-11 | |
# S. B. Malevich <[email protected] | |
# Example of vorticity advection plotting script for weather analysis: | |
# You might want to change the fill plotting colors. | |
set IN_FILE = 'waf_assignment2_data.gem' | |
set OUT_FILE = 'totally_super_awesome_vadvec_map.gif' |
This file contains 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 python3 | |
# 2015-01-22 | |
# Copyright 2015 S. Brewster Malevich <[email protected]> | |
# Parse a directory's ITRDB .xml files. The target directory should be the first | |
# argument when calling this script. The default is to use the current working | |
# directory. This script extract select data from each XML file and writes the | |
# metadata to a tab-delimited file, `OUTFILE_NAME`. | |
# | |
# When the XML files are in the current working directory with this script, run: |
OlderNewer