Annual Leaf Cycle

Our Beautiful Living and Breathing Planet

The map is fixed per this article.

# Zoe Phin, 2021/02/13
# File:
# To Run: source; require; download; fix; animate

require() { sudo apt-get install -y netpbm imagemagick; }

download() {
    list=$(wget -qO- '' | grep '"viewDataset' | cut -f2 -d "'" | tr '\n' ' ')	
    let n=1
    for si in $list; do 
        N=$(printf "%02d" $n)
        wget -O lai$N.jpg "$si&cs=rgb&format=JPEG&width=750&height=375"
        sleep 1
        let n++

fix() { 
    for jpg in `ls -1 lai*.jpg`; do
        echo -e 'P3\n750 375\n255\n' > $pnm
        jpegtopnm $jpg | pnmtoplainpnm | sed 's/  /\n/g' | awk '{printf "%03d %03d %03d ", $1, $2, $3}' | fold -w9000 > .tmp

        cut -c1-300 .tmp > .right
        cut -c300-  .tmp > .left
        paste -d '' .left .right >> $pnm

        pnmtopng $pnm > $jpg
    rm -f *.pnm

animate() { convert -delay 25 -loop 0 lai*.jpg animlai.gif; }

Happy Valentines Day!

❤ -Zoe

Published by Zoe Phin

4 thoughts on “Annual Leaf Cycle

    1. This is just a pretty picture. 2016 Leaf Area Index played in a loop, so people can see a typical annual birth and death. Change over time is next. You’re interrsted in knowing pressure by latitude? I can do that. -Z

      Liked by 1 person

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: