PlantCam file ordening script

I recently got a copy of the data as retrieved by my PlantCam installed in Yangambi, DR Congo. Before processing could proceed I had to rename all files from the standard Wingscapes PlantCam format to a format compatible with the PhenoCam GUI.

I wrote a little script in bash that does just this job. If run within a directory of PlantCam images it will use the exif data to create the appropriate filenames and file structures as required by the Phenocam GUI. You find the code below. The code depends on the CLI exif program and takes one parameter, mainly the site name.

#!/bin/bash

# convert wingscape PlantCam files
# and moves the files into the desired file structure
# for easy processing with the PhenoCam GUI or toolkit
#
# NOTE: requires a running version of linux/Mac or cygwin
# with exif installed.
#
# written by Koen Hufkens, 24/08/2013

# get a list of all wingscape files
files=ls *.JPG

sitename=$1 for i in$files;
do
# extract date and time from exif data
date=exif $i | grep "Date and Time" | head -n 1 | cut -d'|' -f2 | cut -d' ' -f1 | sed 's/:/_/g' time=exif$i | grep "Date and Time" | head -n 1 | cut -d'|' -f2 | cut -d' ' -f2 | sed 's/://g'

# construct the final filename and rename (with copy not move)
tmp=echo "$sitename$date $time.jpg" filename=echo$tmp | sed 's/ /_/g'

cp $i$filename

done

# sort files into the correct data structure (a folder for each month)

years=ls *.jpg | cut -d'_' -f2 | uniq
months=ls *.jpg | cut -d'_' -f3 | uniq

for i in $years; do echo$i

# if the year directory does not exist, create it
if [ ! -d "./$i" ]; then mkdir ./$i
fi

for j in $months; do # if the month directory does not exits, create it if [ ! -d "./$j" ]; then
mkdir ./$i/$j
fi

#files_to_move=ls *_${i}_${j}_*.jpg
mv *_${i}_${j}_*.jpg ./$i/$j

done
done

Cellulose, finally!

Two days ago I finalized the cellulose extraction by homogenization of the sample material. These samples were put into a drying oven overnight. The result is a paper like material as seen in the picture. Next up is packing the samples in tin cups for 13C analysis.

Autonomous flight p2.

To the right, the flight plan of my latest UAV flight. I programmed the UAV to fly in a pattern across the local field where I fly. A manual take-off used, then switching to waypoint (auto) mode. The UAV returned to launch nicely, hovering at 15m until manual take over and landing.

I couldn’t properly attach my normal point and shoot for photos or video during the flight so I’m looking into buying a GoPro like camera for this purpose.

Autonomous flight p1.

Here is a small map of a waypoint mission I flew two days ago. Although giving control to the autopilot does give you some sweaty palms the ardupilot performed wonderfully. I’m rather sad I neglected my work on the UAV so long. Part of it was having limited access to a nice and safe area to fly over. I’m now closer to a tram stop that takes me out of town so flying is more convenient and less of a hassle. More experimenting, especially with flying gridded layouts will follow.

Loitering away

[caption id=”” align=”alignright” width=”350”] arducopter, old config.. updated pictures will follow[/caption]

I got my arducopter up and running the past week. I updated to the latest firmware (3.0.1). Previously I had to fight wires to calibrate the multicopter during the compass calibration dance. But I found out that you can do most of the setup of the arducopter over the XBee telemetry, so I don’t get tangled anymore. Having calibrated my compass properly and compensating for compass drift due to motor and ESC interference (compassmot values down to 5%!) I get really good GPS hold / loiter performance. During rather windy conditions my multicopter wouldn’t drift outside a 2x2m box. During calm wind conditions this was a square meter box at most. Rather impressive performance for a budget quadcopter. Next up, flying some way point missions.