
Code I use to stage and krig the ISTI station data.

Seth McGinnis, mcginnis@ucar.edu


#################

preprocess:

This is the shellscript that converts files from the ISTI format to a
more minimal whitespace-delimited plain-text format that only contains
the data needed for our space-time modeling analysis.

It will download the raw ISTI data and the set of regions that Jared
put together. It then loops over the regions, editing just the
stations of interest, creating timeseries files, synoptic files, and a
station.data file with the coordinates and start/end times of each
station in the region.  All the output is put into a subdirectory
named for the region.

This is all fairly time-consuming, so at the moment the bits that do
the downloading are commented-out, and it only does Madagascar and
Switzerland.  Edit the file to do everything.

For testing purposes, we're starting in 1950, so it restricts the
analysis by moving all the files from before 1950 into a separate
directory (pre-1950-synoptic).



#################

test.R

This krigs the first file in the synoptic/ directory and plots the
results.



#################

orog.nc

NetCDF file with 0.25-degree topography for the world.  (Needed by
test.R to predict the etazed field.) 



#################

krig.R

Krigs each of the files in the synoptic/ directory and places the
results in outkrig0/ .  Output files contain the fields zed, eta, and
eta+zed at the input station locations.  Takes a few seconds per file
on a yellowstone login node, so for the Switzerland post-1950 test
case, it's about an hour to do everything.  Could be faster on an
unshared machine.



#################

convert.syn.ts

A shellscript that converts the synoptic files in outkrig0/ to
timeseries files in eta0/ .  Run this after running krig.R to produce
the files to pass back to the timeseries modeling.

