Showing posts with label general nerdery. Show all posts
Showing posts with label general nerdery. Show all posts

18.11.08

# Girl with the Perl Earring

!/usr/bin/bash/perl

open (FILE1, "perl_earring.jpg") || die "cannot open\n";

# Comments go here --- if you dont get it, dont worry, it just means you have yet to descend to the 7th level of coding hell.close (FILE1);

15.10.08

Geocaching what what?!

My officemate is actually VERY tall...


What, what?! There's a treasures in these campus hills!


Its soo gurd!

28.8.08

August 28, 2008 - I knew it was coming...

Slave! Make me a map! No, not with fancy graphical software, write the code from scratch or I'll flog you with the sinuous dried up hopes and dreams of the all the failed graduate students before you!

Ok, my advisor didnt really say that, it was more like... I dont know how to do this, can you help? But its coming, I know, he's just being nice because its the first week...


Anyways, here's the map I made first thing this morning (while brushing my teeth no less). Its the Southwest Nevada Volcanic Field. It also includes the infamous Yucca Mountains and thier proposed nuclear repository site...joy!

It still needs a scale ect.. but Im a slacker you know... and because Im that much of a dork, Im posting the code... that and Im covering my ass for the day when I cant find it anywhere else.

srtm2xyz.pl

for (my $i = 0; $i < _ =" <">;
($key, $value) = split " ",$_;
$H{$key} = $value;
print STDERR "$key $value\n";
}

@data;
$xstart = $H{xllcorner};
$ystart = $H{yllcorner}+5;
$nodata = $H{NODATA_value};
$grid = $H{cellsize};
print STDERR "Starting location: $xstart $ystart\n";
#$grid = 0.000833333333;
$x = $xstart;
$y = $ystart;

$min_val = 1e6;
$max_val = $nodata;
while (<>) {
@data = split " ",$_;
foreach my $cell (@data) {
#if ($cell == -500) {$cell = 0;}
if ($cell > $nodata) {
if ($cell < $min_val) {$min_val = $cell;} if ($cell > $max_val) {$max_val = $cell;}
}
printf "%.12f %.12f %d\n", $x, $y, $cell;
$x += $grid;
}
$y -= $grid;
$x = $xstart;
}

SNVF.gmt

# File: SNVF.gmt
# Format: UNIX
# Author: Hintz, AR
# Date: August 27 ,2008
# Purpose: This code will generate a shaded relief map of the SNVF

#xyz2grd SNVF.dat.ll -GSNVF.grd -I0.000833333 -R-116.833/-116.1666/36.4166/37.25 -V

makecpt -Cgray.cpt -T-1500/2500/5 -V > SNVF.cpt

grdgradient SNVF.grd -Gintensity.grd -E60/30/=/0.5 -Nt0.5 -V

grdimage SNVF.grd -R -JM10i -CSNVF.cpt -P -E100 -Iintensity.grd -K -V > SNVF.eps

psbasemap -JM -R -Ba0.25g0.25 -V -O -K -P >> SNVF.eps

#psscale -Df-116.2/36.5/10 -P -V >> SNVF.eps

9.7.08

July 8, 2008


Well Im off to one hell of a boring start for my Project 365 so far, how many pathetic things can you spot in this picture? BTW Its a crappy camera phone picture because I left my good camera at Sophie's apartment.