# Graphical T.O.A Insolation

In a previous post, I presented a program for generating global insolation data. In this post I kick it up a notch and do the same thing using higher resolution graphics. It turned out making a graphical version was quite easy thanks to gnuplot.

To get gnuplot on a Debian Linux-based system (I use Linux Lite), type command:

``> sudo apt install gnuplot``

After installation, copy the following code to a new text file (I called it gtoa.sh):

``````#!/usr/bin/bash
# Zoe Phin, 2019/11/04

DAY=`printf "%03d" \$1`

(echo "set term png size 740,460
set title 'Day \${DAY} : W/mÂ˛'; unset key
set xtics out 3;  set mxtics 3
set ytics out 15; set mytics 3
set palette defined (0 0 0 0, 1 0 0 1, 2 0.58 0 0.83, 3 1 0 0, 4 1 0.65 0, 5 1 1 0, 6 1 1 1)
plot '-' using 1:2:3 with dots palette"

awk -v day=\$1 '
function asin(x)  { return atan2(x, sqrt(1-x*x)) }
function rad(x)   { return x*PI/180 }
function abs(x)   { if (x<0) x=-1*x; return x }
BEGIN { day--
PI = atan2(0,-1)
TSI = 1361; YEAR = 365.2422; TILT = 23.45; ECC = 0.017
VEQ = 79.915; PHA = 2.013 # Vernal Equinox & Perihelion Adjustment
for (lat = -90; lat <= 90; lat += 0.5) {
for (min = -720; min <= 720; min += 2) {
dm = day + min/1440
ORB = 1-ECC*cos(2*PI*(dm-PHA)/YEAR)
INS = (sin(LAT)*sin(DEC)+cos(LAT)*cos(DEC)*cos(LON))
if (INS<0) { INS = 0 } else { INS = TSI/ORB*INS }
printf "%f %f %f\n", (min+720)/60, lat, INS
}
}
}') | gnuplot > Day\${DAY}.png``````

Now make the program executable:

``> chmod +x gtoa.sh``

The program takes one argument: day of the year. To generate a plot for the 123rd day of the year:

``> ./gtoa.sh 123``

A file called Day123.png will be generated in the same directory as your program. It will look like this:

I automated the generation of every day of the year ( ask me how đź™‚ ) and created an animated gif:

I reduced the color depth, otherwise the gif becomes 33MB. Now it’s 6MB.

Enjoy. – Zoe

https://phzoe.com

## 2 thoughts on “Graphical T.O.A Insolation”

1. bentstrut says:

Zoe.. take a look at DR Gary Novak’s site at nov83.com…He is presenting a case that no molecule or atom anywhere will absorb and retain EMR. It all gets passed on in a max time on .5 pico seconds. ilegtina non carborundum…Jeff O

Liked by 1 person

1. Thank you.
Yes, it’s not possible to retain Radiation. The word’s etymology is: to *emit* rays.