Skip to content

Instantly share code, notes, and snippets.

View cbuelo's full-sized avatar

Cal Buelo cbuelo

View GitHub Profile
@cbuelo
cbuelo / getAOSSdata.txt
Created November 12, 2019 19:18
Download meteorological data from UW AOSS rooftop station
Data comes from "RIG tower" at: http://metobs.ssec.wisc.edu/data/
wget -r -nH --no-parent -e robots=off --cut-dirs=5 -w 1 --random-wait -R "index.html*" http://metobs.ssec.wisc.edu/pub/cache/aoss/tower/nc/
# add -nc to not re-download data you already have
@cbuelo
cbuelo / updateIP.sh
Created July 21, 2017 19:17
Script for getting local computer's current IP address and writing it to remote server
#!/bin/bash
# this script and "currentIP.txt" must be in the same directory
# run "(hostname -I) > currentIP.txt" in bash before running this script the first time
ip_rightNow=$(hostname -I)
ip_prev=$(cat currentIP.txt)
if [[ "$ip_rightNow" != "$ip_prev" ]]; then
echo $ip_rightNow > currentIP.txt
scp currentIP.txt [email protected]:/path/to/directory
@cbuelo
cbuelo / download_weatherData.sh
Created October 18, 2016 17:26
bash file to download surface station weather data from NOAA's National Climatic Data Center
#!/bin/bash
# Script to download weather data
STATION='726228-99999'
STARTYEAR=1973
ENDYEAR=2005
USER='ftp'
PASSWD='[email protected]'
HOST='ftp.ncdc.noaa.gov'
@cbuelo
cbuelo / LM_mbkkp_test.R
Last active March 27, 2018 17:22
LakeMetabolizer meta.bookkeep() example
#Test case for calculating metabolism
library(LakeMetabolizer)
#set up test example where DO starts and ends at same level, is at saturation (= no flux)
DOobs = c(3, 2, 3, 4, 3)
DOsat = c(3, 2, 3, 4, 3)
kGas = c(.2, .2, .2, .2, .2)
zMix = c(1, 1, 1, 1, 1)
irr = c(0, 1, 1, 0, 0)