File:Fairbanks lgm climate diagram.svg

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Original file (SVG file, nominally 1,080 × 720 pixels, file size: 47 KB)

Captions

Captions

Add a one-line explanation of what this file represents

Summary

[edit]
Description
English: Climate diagram of Fairbanks, Alaska during Last Glacial Maximum. Monthly average tempereture in centigrader C, rainfall in millimeters mm. Situation during last ice age coldest period, the Last Glacial Maximum (LGM), ca. 21000 calendar years ago, according of CCSM4 paleoclimate simulation.
Date
Source Own work
Author Merikanto

Basic data for this image is generated with various script with various programs and scripts from Worlrdlmin 1,4 LGM CCSM4 simulation data.

http://www.worldclim.org/paleo-climate1 archive copy at the Wayback Machine Downscaled Paleoclimate data - WorldClim 1.4 downscaled paleo climate, ittem Last Glacial Maximum, CCSM4 ...

Result is text file like this

[1]

Tho plot was get with this python matlplotlib program.

    1. drawing climate diagram in python 3
    2. version 2.1
    3. 11.9.2020

import matplotlib.pyplot as plt import numpy as np import pandas as pd from scipy import interpolate


pohjanimi="fairbanks" captioni="Fairbanks. LGM" maxrainfall=120 mintemperature=-30 maxtemperature=20

datafilename=pohjanimi+".csv" savename=pohjanimi+"_climate_diagram.svg"

figsizex=12 figsizey=8


x = [] y = [] y2= []


dfin0=pd.read_csv(datafilename, sep=";") lst1 = ['Month','T','P']

dfin1 = dfin0[dfin0.columns.intersection(lst1)]

x=dfin1['Month'] y=dfin1['T'] y2=dfin1['P']

yearprecip=0 yeartemp=0

for n in range(0, 12): yearprecip=yearprecip+y2[n] yeartemp=yeartemp+y[n] print (n,y[n],y2[n])


size1=22 size2=26 size3=30

yeartemp=round((yeartemp/12.0),1) mintemp=min(y) maxtemp=max(y) yearprecip=round(yearprecip,0) maxprecip=max(y2) minprecip=min(y2)

print(yearprecip) print(minprecip) print(maxprecip)

print(yeartemp) print(mintemp) print(maxtemp)


ymax1=int((maxprecip+60)/20)*20 ymax2=int((maxtemp+15)/5)*5 ymin2=int((mintemp-10)/5)*5

x_sm = np.array(x) y_sm = np.array(y) x_smooth = np.linspace(x_sm.min(), x_sm.max(), 200) funk1 = interpolate.interp1d(x, y, kind="cubic") y_smooth = funk1(x_smooth)

fig, ax1 = plt.subplots()

plt.rcParams["figure.figsize"] = (12,16)

ax1.axis((1,12,0,ymax1))

ax1.bar(x, y2, color='#0000ff', label="Precip. mm", width=0.9, align="center")

ax1.set_ylabel('Precipitation mm', color='#00007f', fontsize=size2)

for tl in ax1.get_yticklabels():

tl.set_color('b')
tl.set_fontsize(size1)

ax2 = ax1.twinx() ax2.set_ylabel('Temperature °C', color='#7f0000', fontsize=size2)

ax2.axis((1,12,ymin2, ymax2))

  1. ax2.plot(x,y, label='Temperature °C',color="#ff0000", linewidth=7)

ax2.plot(x_smooth,y_smooth, label='Temperature °C',color="red", linewidth=10)


for t2 in ax2.get_yticklabels():

t2.set_color('r')
t2.set_fontsize(size1)

ax1.set_xlabel('Month', color="darkgreen", fontsize=size2)

for tix in ax1.get_xticklabels():

tix.set_color("Black")
tix.set_fontsize(size1)

ax1.set_title(captioni, fontsize=size3)

ax2.text(1, ymax2-4, " P annual "+str(int(yearprecip))+ " mm", color="#00007f", fontsize=size1) ax2.text(1, ymax2-8, " T year "+str(yeartemp) + " °C", color="#7f0000",fontsize=size1) ax2.text(1, ymax2-12, " T max "+str(maxtemp)+ " °C", color="#7f0000", fontsize=size1) ax2.text(1, ymax2-16, " T min "+str(mintemp) + " °C", color="#7f0000",fontsize=size1)

fig = plt.gcf() fig.set_size_inches(figsizex, figsizey, forward=True)


plt.plot()


plt.savefig(savename, format="svg", dpi = 100)

plt.show()


Licensing

[edit]
I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
  1. Month;T;P 1;-28;12 2;-26;10 3;-21;6 4;-9;3 5;-1;8 6;7;18 7;11;22 8;9;23 9;2;16 10;-11;13 11;-22;12 12;-28;13

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current13:17, 11 September 2020Thumbnail for version as of 13:17, 11 September 20201,080 × 720 (47 KB)Merikanto (talk | contribs)Uodate on layout
17:02, 11 August 2016Thumbnail for version as of 17:02, 11 August 20163,150 × 4,050 (54 KB)Merikanto (talk | contribs)User created page with UploadWizard

The following page uses this file:

Metadata