Animation weather system (gif)

Animation of weather system landfalling in North America. The Great Basin watershed is highlighted in brownish color.


(requires a light background because of transparency)

code excerpt : (it’s not super clean … but hey, we all learn !)

projection="-JL-120/35/30/40/${width}"
area="-R-170/-70/8/52"

for inc in loop
do
gmt grdimage $area $projection @earth_relief_03m -Crelief.cpt -I+d -P  $open  >  $psFile
gmt pscoast -R -J  -Di -Wthinnest -Sdeepskyblue -t25                   $add   >> $psFile
gmt psxy -R -J -Wthinner $Gbasin -L -G$myred -t25                     $add   >> $psFile
gmt grdcontour -R -J -W -C+1 -Ndetect.cpt -A- $NetCDFvar[$inc]   $add   >> $psFile
gmt psbasemap -R -J -Bx20g10 -By10g10  -B+t"${title}"              $close >> $psFile

gmt psconvert $psFile -A -Tf

done

convert -delay 33 -loop 0 -dispose previous -density 200x200 $(ls -v *pdf) animation_${line2print}.gif
3 Likes

Looks great :slight_smile:

Would be great if you could convert this to a modern mode script run by gmt movie instead!

Now that you mention it … I have a couple question about that modern mode. I’ll open a new thread right away.

edit : by the way @pwessel : Bercovici says hi ! :slight_smile:

2 Likes

I completely forgot to follow up on that !
Since I’ve made a couple of animations made from a composite analysis of many such weather systems (atmospheric rivers).

Using -JG for integrated vapor transport :

Global view of the composite over the Pacific ocean. The Inter-Tropical Convergence Zone (ITCZ) can clearly be seen, as well as the mid/high latitude of water content build up

Using -JL for integrated water volume :

Same idea, with a Lambert conic projection and a different dataset. The colormap is “logarithmic”. I also added winds anomalies at 350hPa (high atmosphere)

(Code excerpt)

pre.sh

gmt begin
gmt math -o0 -T0/\${tmax}/1 T = index.txt
gmt makecpt -Ccork -T\${lim1}/\${lim2} -H  > color.cpt
gmt end

main.sh

gmt begin
gmt grdimage ${region} ${projection} -Ccolor.cpt $NCfile"?ivt[${MOVIE_COL0}]" -B+t"${titre}" -Yc1c
gmt end

post.sh

gmt begin 
gmt coast ${region} ${projection} -Dc -Wthin -Yc1c
gmt plot -Wthinner ${Gbasin} -L -G${myred} -t25
gmt colorbar -Ccolor.cpt ${clr_style} ${clr_text}
gmt end
gmt movie main.sh -Sbpre.sh -Sfpost.sh -N${tmpdir} -C20cx20cx120 -Tindex.txt -Iinclude.sh -Pb -D11 -Fmp4 -M97

Hope this help :slight_smile: