File:Les eyzies lgm.png

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

Les_eyzies_lgm.png(500 × 480 pixels, file size: 10 KB, MIME type: image/png)

Captions

Captions

Add a one-line explanation of what this file represents

Summary

[edit]
Description
English: Climate diagram of Les Eyzies, France, at Last Ice age coldest period. This climate diagram presents temperature, precipittation on Les Eyzies, Dordogne, Near Vezere river Aquitania, France, ca. 21000 calendar years (cal.21 ka BP) ago. during Last Glacial Maximum LGM.
Date
Source Own work
Author Merikanto

This image is produced from CCSM4 Last Glacial Maximum data on WorldClim 1.4 home page.

http://www.worldclim.org/paleo-climate1 archive copy at the Wayback Machine

With special R scripts was taken seacimen from location ca. 01E, 45N.

data is processed with gdal_translate, and with some R scripts to form

1 0 87
2 0 90
3 4 92
4 6 89
5 9 87
6 12 71
7 12 48
8 12 66
9 10 68
10 7 82
11 3 97
12 0 103


Plotting was done with gnuplot, using this script

bash script

    1. Rscript a4e.r --args paikat.txt

modeli="./malli5.plg"

  1. !/bin/bash

file="./sitez.txt" while IFS=: read -r f1 f2 f3 f4 f5 f6 do

   #    printf '<%s> <%s> <%s> <%s> <%s>\n' "$f1" "$f2" "$f3" "$f4" "$f5" 
    nimi=$f2
    kaption=$f1
    paikka=$kaption
     data=$f3
     output=$f4
    echo $output    

faili=$data

  1. tkeski=$(awk '{s+=$2}END{print s/12}' $faili)

tkeski=$(awk '{s+=$2}END{print (int((s*10)/12))/10 }' $faili) tminimi=$( awk '{if(min>$2){min=$2;line=$2}}END{print line}' $faili) tmaksimi=$( awk '{if(max<$2){max=$2;line=$2}}END{print line}' $faili) tsadem=$(awk '{s+=$3}END{print s}' $faili)

echo $tkeski echo $tsadem echo $tminimi echo $tmaksimi


  1. gnuplot -e "datafile='${data}'; paikka='${paikka}';outputname='${output}'" $modeli
  2. gnuplot -e "datafile='${data}'; paikka='${paikka}';outputname='${output};avgtemp='${tkeski};totalprecip='${tsadem};mintemp='${tminimi};maxtemp='${tmaksimi};'" $modeli
  3. gnuplot -e "datafile='${data}'; paikka='${paikka}';outputname='${output} ';avgtemp='${tkeski} '; " $modeli

gnuplot -e "datafile='${data}'; paikka='${paikka}';outputname='${output} ';avgtemp='${tkeski} ';mintemp='${tminimi} ';maxtemp='${tmaksimi} ';totalprecip='${tsadem} ';" $modeli


done <"$file"


Gnuplot script

  1. gnuplot ilmastokaavio
  2. gnuplot climate diagram test script
    1. draw month, precipitation and rainfall
  1. run from command line
    1. tex. gnuplot -e
    2. output=test1.png
  2. data=foo.data
  1. gnuplot -e "datafile='${data}'; paikka='${paikka}';outputname='${output};avgtemp='${tkeski};totalprecip='${tsadem};mintemp='${tminimi};maxtemp='${tmaksimi};'" $modeli

set xrange [1:12] set yrange [-10:20] set y2range [0:200]

set key font ",16" set tics font ", 16" set title font ", 16"

  1. set terminal svg size 400 600 enhanced font 'Verdana,10'

set terminal png size 500 1200 enhanced font 'Verdana,10'

set output outputname

  1. paikka2=paikka"LGM"

set title paikka font ",20"

    1. set label 1 font ",14" "at LGM" at 5,15
  1. set title paikka2 font ",20"

set xtics 0,2,12 nomirror tc rgb '#000000' set xlabel 'Months' font ",14" tc rgb '#003f00'

set ytics 5 nomirror tc rgb '#ff0000' set ylabel 'Temperature (°C)' font ",14" tc rgb '#3f0000'

set y2tics 20 nomirror tc rgb '#0000ff' set y2label 'Precipitation mm' font ",14" tc rgb '#00003f'

set boxwidth 0.9 set style fill solid 1.00 set style line 1 lc rgb 'blue' set style line 2 lc rgb 'red'

    1. koe

koe=datafile

set label 1 "koe" at 1,1

set table 'temp.dat' plot datafile using 1:2 smooth cspline unset table min_y = GPVAL_DATA_Y_MIN max_y = GPVAL_DATA_Y_MAX

  1. mean_y

yposi=19 ydelta=1.5 ydelta1=ydelta ydelta2=ydelta*2 ydelta3=ydelta*3

set label 2 font ",13" gprintf("Tavg= %3.1f °C", avgtemp) at 2,yposi set label 3 font ",13" gprintf("Precipa= %3.0f mm", totalprecip) at 2,yposi-ydelta1 set label 4 font ",13" gprintf("Tmin= %3.1f °C", mintemp) at 2, yposi-ydelta2 set label 5 font ",13" gprintf("Tmax= %3.1f °C", maxtemp) at 2,yposi-ydelta3

    1. origo
  1. plot datafile using 1:3 notitle with boxes lc rgb '#0000ff' axes x1y2, datafile using 1:2 notitle with lines lc rgb '#ff0000' linewidth 5
    1. koe

plot datafile using 1:3 notitle with boxes lc rgb '#0000ff' axes x1y2, 'temp.dat' using 1:2 notitle with lines lc rgb '#ff0000' linewidth 5


R script produce the table was

  1. install.packages("raster")

library(ncdf4) library(fields) library(sp) # classes for spatial data library(raster) library(rasterVis) # raster visualisation


sitezfile<-"./sitez.txt" piirroshak<-"./plot/" tekstihak<-"./teksti/" ohakemisto<-"./teksti/" tnimi<-"./paikat.txt" modeli<-"malli4.plg" sname1 <- "./data/ccsm4_europe_lgm_tk.nc" sname2 <- "./data/ccsm4_europe_lgm_pr.nc"


lgm_nayte<-function ( slongitude, slatitude, nimi) {

    1. lgm data specimen, worldclim ccsm4 360 shifted data

paluu=0

oname<-paste(ohakemisto,nimi,"_lgm.txt", sep="")

ncfilee1 <- nc_open(sname1) ncfilee2 <- nc_open(sname2)

longitude <- ncvar_get(ncfilee1,"lon") latitude <- ncvar_get(ncfilee1,"lat")

tas<-ncvar_get(ncfilee1,"temperature")
pr<-ncvar_get(ncfilee2,"precipitation")

latlen=length(latitude) lonlen=length(longitude)

  1. print(paste(latlen," ",lonlen))

latdex=0 londex=0

for (n in 1:latlen) {

  1. oletus nouseva
  if (latitude[n]>slatitude) 
  {
    latdex=n
    break
  }

}


for (n in 1:lonlen) {

  1. oletus nouseva
  if (longitude[n]>slongitude) 
  {
    londex=n
    break
  }

}


print(paste(latdex," ",londex))

  1. longitude

print (oname)

sink(oname)

for(n in 1:12) 

{

  lugu=tas[londex,latdex,n]
 lugu2=pr[londex,latdex,n]
 paska=paste(n, lugu[1],lugu2[1])
 #print(paska)
 cat (sprintf(" %i %i %i\n",n, lugu,lugu2))

}

sink()

paluu=0

return(paluu) }


tiedkas<-function(tanimi, siirros) {

 kentat <- read.csv(file=tanimi, header=FALSE, sep=",")
 kaptionat<-kentat[,1]
 longit<-kentat[,3]
 latit<-kentat[,2]
 kaptionit<-gsub(" ", " ", kaptionat)
 tokat<-gsub(" ", "_", kaptionit)
nimet<-tolower(tokat)
 pitu<-length(kaptionit)

for (n in 1:pitu ) {

 kaption<-kaptionit[n]
 nimi<-nimet[n]
 longi<-longit[n]
 lati<-latit[n]


longib=longi

 if (siirros==360) 
{
  if(longi<0)
 {
     longib<-longi+360
}

}


print("UUSLONG>")
print(longib)
  1. kaption
  2. nimi, longi, lati


piha<<-piirroshak[1] teha<<-tekstihak[1]

  1. print(runkku)

piirrosnimi=paste(piha,"lgm_",nimi, "_diagram_en.svg", sep="") tekstinimi=paste(teha, nimi,"_lgm.txt",sep="")

  1. print(runkku[1])
  2. print (kaption)
  3. print (longib)
  4. print (lati)
  5. print(piirrosnimi)
  6. print (tekstinimi)

print (nimi) print (longib) print (lati)

kippo=lgm_nayte(longib, lati, nimi)

  1. gnuplot -e "datafile='${data}'; paikka='${paikka}';outputname='${output}'" $modeli
  1. kommando="ls"
  2. system(kommando)

}

print (sitezfile)

sink(sitezfile)

for (n in 1:pitu ) {

 kaption<-kaptionit[n]
 nimi<-nimet[n]
 longi<-longit[n]
 lati<-latit[n]
 if (siirros==360) 
 {
    if(longi<0)
   {
     longib<-longi+360
   }
 }

piha<<-piirroshak[1] teha<<-tekstihak[1]

piirrosnimi=paste(piha,"lgm_",nimi, "_diagram_en.svg", sep="") tekstinimi=paste(teha, nimi,"_lgm.txt",sep="") jono=sprintf(" %s:%s:%s:%s:%s:%s:", kaption,nimi,tekstinimi,piirrosnimi, longib, lati)

 cat (sprintf("%s\n",jono))

}


sink()


paluu=0 return(paluu) }


    1. pääohjelma main
    1. esim. Rscript a4.r --args paikat.txt

args <- commandArgs(trailingOnly = TRUE)


  1. print(args[2])
  1. tnimi <- args[2]

tnimi

tiedkas(tnimi, 0)

  1. slongitude <- args[3]
  2. slatitude <- args[4]
  1. print (paste (nimi, " ",slongitude, " ", slatitude) )
  2. kippo=lgm_nayte(212.2, 64.85,"fairbanks")
  3. kippo=lgm_nayte(slongitude, slatitude,nimi)

Old gnuplot script was this

set xrange [1:12] set yrange [-20:20] set y2range [0:200]

set key font ",16" set tics font ", 16" set title font ", 16"

set terminal png size 400 600 enhanced font 'Verdana,10'

set output "output.png"

  1. set term postscript color size 3in, 3in
  2. set output "les_eyzies_lgm.ps"
  1. set terminal svg enhanced size 1200 800
  2. set output 'les_eyzies_lgm.svg'

set title "Les Eyzies, LGM" font ",20"

set xtics 12 nomirror tc rgb '#000000' set xlabel 'month' font ",14" tc rgb '#003f00'

set ytics 10 nomirror tc rgb '#ff0000' set ylabel 'temperature' font ",14" tc rgb '#3f0000'

set y2tics 20 nomirror tc rgb '#0000ff' set y2label 'precipitation' font ",14" tc rgb '#00003f'

set boxwidth 0.9 set style fill solid 1.00 set style line 1 lc rgb 'blue' set style line 2 lc rgb 'red'

plot "wezere.txt" using 1:3 notitle with boxes lc rgb '#0000ff' axes x1y2, "wezere.txt" using 1:2 notitle with lines lc rgb '#ff0000' linewidth 5

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.

File history

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

Date/TimeThumbnailDimensionsUserComment
current09:42, 12 August 2016Thumbnail for version as of 09:42, 12 August 2016500 × 480 (10 KB)Merikanto (talk | contribs)PNG edition.
09:29, 12 August 2016Thumbnail for version as of 09:29, 12 August 2016400 × 600 (24 KB)Merikanto (talk | contribs)Spline curve, annual precipitation, max min average temperatures.
08:21, 27 July 2016Thumbnail for version as of 08:21, 27 July 2016400 × 480 (7 KB)Merikanto (talk | contribs)User created page with UploadWizard

There are no pages that use this file.

File usage on other wikis

The following other wikis use this file:

Metadata