20091026Eaglecrest

From Seamonster
Jump to: navigation, search
  513  head -5 /home/seamonster/EaglecrestSnowSite.txt 
  514  date +%s "20091001"
  515  date --help
  516  date +%s
  517  date -d "20091001" +%s
  518  rrdtool create snow.rrd --start 1254384000 DS:snow:GAUGE:600:0:1000
  519  rrdtool create snow.rrd --start 1254384000 DS:snow:GAUGE:600:0:1000 RRA:AVERAGE:0.5:1:600 RRA:AVERAGE:0.5:6:700 RRA:AVERAGE:0.5:24:775 RRA:AVERAGE:0.5:288:797 RRA:MIN:0.5:1:600 RRA:MIN:0.5:6:700 RRA:MIN:0.5:24:775 RRA:MIN:0.5:288:797
  520  rm snow.rrd 
  521  rrdtool create snow.rrd --start 1254384000 DS:snow:GAUGE:600:0:1000 RRA:AVERAGE:0.5:1:600 RRA:AVERAGE:0.5:6:700 RRA:AVERAGE:0.5:24:775 RRA:AVERAGE:0.5:288:797 RRA:MIN:0.5:1:600 RRA:MIN:0.5:6:700 RRA:MIN:0.5:24:775 RRA:MIN:0.5:288:797 RRA:MAX:0.5:1:600 RRA:MAX:0.5:6:700 RRA:MAX:0.5:24:775 RRA:MAX:0.5:288:797
  522  rrdtool create temp.rrd --start 1254384000 DS:temp:GAUGE:600:-50:150 RRA:AVERAGE:0.5:1:600 RRA:AVERAGE:0.5:6:700 RRA:AVERAGE:0.5:24:775 RRA:AVERAGE:0.5:288:797 RRA:MIN:0.5:1:600 RRA:MIN:0.5:6:700 RRA:MIN:0.5:24:775 RRA:MIN:0.5:288:797 RRA:MAX:0.5:1:600 RRA:MAX:0.5:6:700 RRA:MAX:0.5:24:775 RRA:MAX:0.5:288:797
  523  python /home/seamonster/eaglecrest_rrd/run.py 
  524  ls -lrt
  525  history
seamonster@Trogador:~/eaglecrest_rrd/rrd$ 

Heavner 20:40, 1 December 2010 (PST) Now trying to get RH, precip, incoming solar, Wind Speed, Wind Direction, and the latest_image all working..

It is now on nsrl1.. so, first.. here's the crontab entries associated w/ eaglecrest:

 # m h  dom mon dow   command 
 10,24,40,55 * * * * rm /home/seamonster/eaglecrest_rrd/data/data.backup; touch /home/seamonster/eaglecrest_rrd/data/data.backup
 5,20,35,50 * * * * python /home/seamonster/eaglecrest_rrd/run_mjh.py
 2,17,32,47 * * * * /home/seamonster/bin/eaglecrest_2009_dataflow.pl

and then I need to create the databases (in ~seamonster/eaglecrest_rrd/ .. temp.rrd and snow.rrd exist, I need rh.rrd, netrad.rrd, ws.rrd, israd.rrd, precip.rrd -- uncomment those in run_mjh.py --> or switch to just run.py again? (got error.. this rrd was created on another architecture..)

 rrdtool create rh.rrd --start 1254384000 DS:rh:GAUGE:600:-50:150 RRA:AVERAGE:0.5:1:600 RRA:AVERAGE:0.5:6:700 RRA:AVERAGE:0.5:24:775 RRA:AVERAGE:0.5:288:797 RRA:MIN:0.5:1:600 RRA:MIN:0.5:6:700 RRA:MIN:0.5:24:775 RRA:MIN:0.5:288:797 RRA:MAX:0.5:1:600 RRA:MAX:0.5:6:700 RRA:MAX:0.5:24:775 RRA:MAX:0.5:288:797

creating this rh.rrd in the /rrd directory moved the rrd error to the next (netrad) rrd.. so

 rrdtool create netrad.rrd --start 1254384000 DS:netrad:GAUGE:600:-50:150 RRA:AVERAGE:0.5:1:600 RRA:AVERAGE:0.5:6:700 RRA:AVERAGE:0.5:24:775 RRA:AVERAGE:0.5:288:797 RRA:MIN:0.5:1:600 RRA:MIN:0.5:6:700 RRA:MIN:0.5:24:775 RRA:MIN:0.5:288:797 RRA:MAX:0.5:1:600 RRA:MAX:0.5:6:700 RRA:MAX:0.5:24:775 RRA:MAX:0.5:288:797
 rrdtool create ws.rrd --start 1254384000 DS:ws:GAUGE:600:-50:150 RRA:AVERAGE:0.5:1:600 RRA:AVERAGE:0.5:6:700 RRA:AVERAGE:0.5:24:775 RRA:AVERAGE:0.5:288:797 RRA:MIN:0.5:1:600 RRA:MIN:0.5:6:700 RRA:MIN:0.5:24:775 RRA:MIN:0.5:288:797 RRA:MAX:0.5:1:600 RRA:MAX:0.5:6:700 RRA:MAX:0.5:24:775 RRA:MAX:0.5:288:797
 rrdtool create precip.rrd --start 1254384000 DS:precip:GAUGE:600:-50:150 RRA:AVERAGE:0.5:1:600 RRA:AVERAGE:0.5:6:700 RRA:AVERAGE:0.5:24:775 RRA:AVERAGE:0.5:288:797 RRA:MIN:0.5:1:600 RRA:MIN:0.5:6:700 RRA:MIN:0.5:24:775 RRA:MIN:0.5:288:797 RRA:MAX:0.5:1:600 RRA:MAX:0.5:6:700 RRA:MAX:0.5:24:775 RRA:MAX:0.5:288:797
 rrdtool create israd.rrd --start 1254384000 DS:israd:GAUGE:600:-50:150 RRA:AVERAGE:0.5:1:600 RRA:AVERAGE:0.5:6:700 RRA:AVERAGE:0.5:24:775 RRA:AVERAGE:0.5:288:797 RRA:MIN:0.5:1:600 RRA:MIN:0.5:6:700 RRA:MIN:0.5:24:775 RRA:MIN:0.5:288:797 RRA:MAX:0.5:1:600 RRA:MAX:0.5:6:700 RRA:MAX:0.5:24:775 RRA:MAX:0.5:288:797

Looks maybe good (run.py now runs with no errors..) So I replaced run_mjh.py in the crontab (with run.py). Now I'll futz with the images, then try to figure out what Nick did w/ precip to generate a second Campbell Data Table (and if/how I should plot that data). Then wind direction..

Hmm. no data plotting yet.. is it impatience? or time to hack more python?

In the meantime..

on nsrl1: wget -r -q --no-parent http://uashome.alaska.edu/~NKORZEN/Eagle%20Crest%20Cam/ (into ~seamonster/eaglecrest_images -- wget flag to force output directory for crontab?) and then ls -lrt uashome.alask... | grep JPG | tail -1 (to ln -s w/ latest.jpg) --directory-prefix=prefix and --continue is good also...

 rm -rf rh.rrd netrad.rrd ws.rrd precip.rrd srad.rrd
 date -d "20101120" +%s
 rrdtool create netrad.rrd --start 1254384000 DS:netrad:GAUGE:600:-50:150 RRA:AVERAGE:0.5:1:600 RRA:AVERAGE:0.5:6:700 RRA:AVERAGE:0.5:24:775 RRA:AVERAGE:0.5:288:797 RRA:MIN:0.5:1:600 RRA:MIN:0.5:6:700 RRA:MIN:0.5:24:775 RRA:MIN:0.5:288:797 RRA:MAX:0.5:1:600 RRA:MAX:0.5:6:700 RRA:MAX:0.5:24:775 RRA:MAX:0.5:288:797
 rrdtool create ws.rrd --start 1254384000 DS:ws:GAUGE:600:-50:150 RRA:AVERAGE:0.5:1:600 RRA:AVERAGE:0.5:6:700 RRA:AVERAGE:0.5:24:775 RRA:AVERAGE:0.5:288:797 RRA:MIN:0.5:1:600 RRA:MIN:0.5:6:700 RRA:MIN:0.5:24:775 RRA:MIN:0.5:288:797 RRA:MAX:0.5:1:600 RRA:MAX:0.5:6:700 RRA:MAX:0.5:24:775 RRA:MAX:0.5:288:797
 rrdtool create precip.rrd --start 1254384000 DS:precip:GAUGE:600:-50:150 RRA:AVERAGE:0.5:1:600 RRA:AVERAGE:0.5:6:700 RRA:AVERAGE:0.5:24:775 RRA:AVERAGE:0.5:288:797 RRA:MIN:0.5:1:600 RRA:MIN:0.5:6:700 RRA:MIN:0.5:24:775 RRA:MIN:0.5:288:797 RRA:MAX:0.5:1:600 RRA:MAX:0.5:6:700 RRA:MAX:0.5:24:775 RRA:MAX:0.5:288:797
 rrdtool create israd.rrd --start 1254384000 DS:israd:GAUGE:600:-50:150 RRA:AVERAGE:0.5:1:600 RRA:AVERAGE:0.5:6:700 RRA:AVERAGE:0.5:24:775 RRA:AVERAGE:0.5:288:797 RRA:MIN:0.5:1:600 RRA:MIN:0.5:6:700 RRA:MIN:0.5:24:775 RRA:MIN:0.5:288:797 RRA:MAX:0.5:1:600 RRA:MAX:0.5:6:700 RRA:MAX:0.5:24:775 RRA:MAX:0.5:288:797
 rrdtool create rh.rrd --start 1254384000 DS:rh:GAUGE:600:-50:150 RRA:AVERAGE:0.5:1:600 RRA:AVERAGE:0.5:6:700 RRA:AVERAGE:0.5:24:775 RRA:AVERAGE:0.5:288:797 RRA:MIN:0.5:1:600 RRA:MIN:0.5:6:700 RRA:MIN:0.5:24:775 RRA:MIN:0.5:288:797 RRA:MAX:0.5:1:600 RRA:MAX:0.5:6:700 RRA:MAX:0.5:24:775 RRA:MAX:0.5:288:797
 seamonster@dev:~/eaglecrest_rrd$ rm data/data.raw; rm data/data.backup; cp ../EaglecrestSnowSite.txt data/data.raw ; touch data/data.backup
 seamonster@dev:~/eaglecrest_rrd$ python reinit_rrd.py
 582  rm data/data.raw; rm data/data.backup; cp ../EaglecrestSnowSite.txt data/data.raw ; touch data/data.backup
 583  python reinit_rrd.py 
 584  rrdtool dump rrd/rh.rrd | less

Heavner 20:08, 2 December 2010 (PST) Ug. Broken it all (temp and snow depth as well!)

507  mv rrd rrd.bk2
 508  mkdir rrd
 509  rm data/data.raw; rm data/data.backup; cp EaglecrestSnowSite.txt data/data.raw
 510  cp ../EaglecrestSnowSite.txt data/data.raw
 511  touch data/data.backup
 512  ./mjh_reinitialize_eaglecrest_rrd.py

Heavner 20:36, 2 December 2010 (PST) OK, I think I've recovered it all..

538  rm -f data/data.raw; rm -f data/data.backup; cp ../EaglecrestSnowSite.txt data/data.raw
 539  rm -rf rrd
 540  mkdir rrd
 541  touch data/data.backup
 542  ./mjh_reinitialize_eaglecrest_rrd_all.py 
 543  python run.py 

Now to add the image to the web page.. Editing nav.inc:

 seamonster@dev:/var/www/smvaio/eaglecrest/includes$ cp nav.inc nav_orig.inc

AS A FINAL LAST thing, don't forget to

 rm data/data.raw; ln -s /home/seamonster/EaglecrestSnowSite.txt data.raw

otherwise, the data won't update!!