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 Rscript | |
| # 2015-02-25 S. B. Malevich | |
| # Combine all FHX files in the current working directory and try to output it | |
| # as a single FHX file (`OUTFILE`). You need to have "firehistory.R" in the | |
| # same directory, too. | |
| ARGS <- commandArgs(TRUE) | |
| source("firehistory.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
| call plug#begin('~/.vim/plugged') | |
| Plug 'sickill/vim-monokai' | |
| Plug 'dikiaap/minimalist' | |
| Plug 'w0ng/vim-hybrid' | |
| Plug 'vim-airline/vim-airline' | |
| Plug 'vim-airline/vim-airline-themes' | |
| "Plug 'scrooloose/nerdtree' | |
| Plug 'scrooloose/syntastic' | |
| Plug 'scrooloose/nerdcommenter' | |
| Plug 'ctrlpvim/ctrlp.vim' |
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 python3 | |
| # 2015-11-13 | |
| # S. B. Malevich <malevich@email.arizona.edu> | |
| # Animate netCDF files. Can use in shell like: | |
| # | |
| # ./animate_bignetcdf.py SSH 5days_SSH_Brewster.nc ./plots/ | |
| # | |
| # This is ./animate_bignetcdf.py [variable_name] [netCDF_file] [output_dir] |
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 bash | |
| # 2016-04-28 | |
| # Download everything from a specific directory in the ITRDB. | |
| TARGET_URL="ftp://ftp.ncdc.noaa.gov/pub/data/paleo/treering/measurements/northamerica/usa/*" | |
| WAIT_SECONDS=1 | |
| wget -r -nH --cut-dirs=7 -w $WAIT_SECONDS --tries=10 $TARGET_URL -o log.txt |
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
| plot_season <- function(x, binwidth=10) { | |
| # Plot seasonality of fire scars through time. | |
| # | |
| # Args: | |
| # x : An fhx object. | |
| # binwidth : Integer. The bin-size (number of years in each bar) for the | |
| # output plot. Default is 10. | |
| # | |
| # Returns: | |
| # A ggplot2 object. |
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
| require(dplR) | |
| # setwd ("/you/had/your/path/here") | |
| # Global variables. We'll use these below. I put them here so we can easily | |
| # change them, if need be. | |
| PATH_ITRDB <- 'itrdb.csv' | |
| GREP_PATTERN <- '/usa/.*?\\.rwl' # matches strings that end in "/usa/*.rwl" |
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
| # 2011-04-04 | |
| # v0.2 | |
| # Copyright 2011 C. Guiterman & S. B. Malevich <malevich@email.arizona.edu> | |
| # Based on dplR spag.plot function - by A. Bunn. | |
| # Function to add a spline to dplR's spagetti plot. | |
| require(dplR) | |
| #source('ffcsaps.R') | |
| spag.spline <- function(rwl, zfac=1, spline.nyrs=32, f=0.5, spline.col=2, |
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 scipy | |
| import numpy as np | |
| def matern(u, phi, kappa): | |
| """Computes Matérn correlation function for given distances and parameters | |
| Roughly based on the matern function from Ribeiro and Diggle's 'geoR' | |
| package for R. | |
| Parameters: |
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
| # 2017-07-14 | |
| # S. Brewster Malevich <malevich@email.arizona.edu> | |
| # How to pull hyperlinks from an html directory, read with read_fhx() in a | |
| # somewhat error-resistant way. | |
| # There are a couple ways to do this. Python or `wget` would be far | |
| # better options, but let's do this with R. | |
| # Another thing, this pesters the poor NCDC server every time you run this. |
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 bash | |
| # 2018-01-12 | |
| # Make a netCDF file that's diff between TS and TOS (TS - TOS). | |
| cp data/regrid/tos_sfc_Odec_CCSM3_TraCE21ka_TSREGRID.nc data/combined_tmp.nc | |
| ncks -A data/ts_sfc_Adec_CCSM3_TraCE21ka.nc data/combined_tmp.nc | |
| ncap2 -s 'tdif=(ts-tos)' data/combined_tmp.nc data/combined.nc | |
| # Cleanup |