File:Ccsm4 july temperature south and middle europe lgm 1.svg
![File:Ccsm4 july temperature south and middle europe lgm 1.svg](https://upload.wikimedia.org/wikipedia/commons/thumb/2/2e/Ccsm4_july_temperature_south_and_middle_europe_lgm_1.svg/704px-Ccsm4_july_temperature_south_and_middle_europe_lgm_1.svg.png?20190901144559)
Original file (SVG file, nominally 1,236 × 1,052 pixels, file size: 7.12 MB)
Captions
Captions
Summary
[edit]DescriptionCcsm4 july temperature south and middle europe lgm 1.svg |
English: Avearege temperature of July in C, Iast Glacial maximum, CCM4. |
Date | |
Source | Own work |
Author | Merikanto |
![]() | This SVG image contains embedded raster graphics.[1] Such images are liable to produce inferior results when scaled to different sizes (as well as possibly being very inefficient in file size). If appropriate to do so, they should be replaced with images created using vector graphics. Note: This template is only supposed to be used if the SVG file mixes vector and raster graphics. If the SVG file only contains raster graphics {{FakeSVG}} is supposed to be used. See also {{TopoSVG}}. | ![]() |
This plot is based on WorldClim 1,4 CCSM4 LGM downscaled 2.5 min data
Hijmans, R.J., S.E. Cameron, J.L. Parra, P.G. Jones and A. Jarvis, 2005. Very high resolution interpolated climate surfaces for global land areas. International Journal of Climatology 25: 1965-1978.
WorldClim 1.4 LGM CCSM4 month
7 data is averaged from tn and tx vairables and divided by 10 with QGIS raster calculator.
Data is cropped with R script. Visualization is produced with Anaconda Python, Matplotlib sctipt.
R script to cut raster
library(raster)
outname1<-"lgmcc_europe_tk7.nc"
r1<-raster("D:/datavarasto/cclgmtk7.nc")
plot(r1)
- mosaik1 <- merge(r1,r2,r3,r4)
mosaik1<-r1
- france
- ext1 <- extent(-4,8, 39, 51)
- dordogne
- ext1 <- extent(-2,4,42 , 48)
- europe
ext1 <- extent(-15,40,30 , 70)
kropped1<-crop(mosaik1, ext1)
plot(kropped1)
crs(kropped1) <- "+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0"
writeRaster(kropped1, filename=outname1, format="CDF", overwrite=TRUE)
Anaconda Python code to visualize raster image to .svg
- netcdf plotting program
- lat, lon, zvar!
- -*- coding: utf-8 -*-
from mpl_toolkits.basemap import Basemap, cm
import matplotlib.pyplot as plt
from netCDF4 import Dataset as open_ncfile
import numpy as np
- preprocess with GMT 5.4
- gmt grdcut tk7_gauss1.nc -Gwest_europe_tk7.nc -R-10/50/30/60
- netcdf infile name, variable names
- lon, lat, z vars
infilename='lgmcc_europe_tk7.nc'
zvarlabel='GDAL.Band.Number.1'
latvarlabel='latitude'
lonvarlabel='longitude'
- labels
legtitle="T July avg.°C (LGM, CCSM4)"
plottitle="Temperature of July (Last Glacial Maximum, WorldClim 1.4 CCSM4 )"
- output
outimage="out.svg"
outpdf="out.pdf"
- cmap
kolormap='jet'
- kolormap='Spectral_r'
- kolormap='gist_rainbow_r'
- kolormap='rainbow'
- cmap min, max
zeta=-15
zetb=25
lona=-15
lonb=40
lata=30
latb=70
latdx=5
londy=5
deltazc=1.5
deltazd=5
dpi = 70
- -- open netcdf file
nc = open_ncfile(infilename)
var = nc.variables[zvarlabel][:,:]
var2=np.flipud(var)
lat = nc.variables[latvarlabel][:]
lon = nc.variables[lonvarlabel][:]
- -- create figure and axes instances
fig = plt.figure(figsize=(1100/dpi, 1100/dpi), dpi=dpi)
ax = fig.add_axes([0.1,0.1,0.8,0.9])
- map = Basemap(projection='cyl',llcrnrlat=lata,urcrnrlat= latb,\
- resolution='h', llcrnrlon=lona,urcrnrlon=lonb)
map = Basemap(projection='cyl',llcrnrlat=lata,urcrnrlat= latb,\
resolution='h', llcrnrlon=lona,urcrnrlon=lonb)
map.drawcoastlines(color='darkblue')
map.drawrivers(color='blue')
- map.drawstates()
- map.drawcountries()
- kolorado=('black','black','black','black','black','black','black','black','black','black','black','black','black','black','black','black')
kolorado=( (0.0, 0.0, 0.5),(0.0, 0.0, 0.5),(0.0, 0.0, 0.5),(0.0, 0.0, 0.5), (0.0, 0.0, 0.5),(0.0, 0.0, 0.5),(0.0, 0.0, 0.5),(0.0, 0.0, 0.5))
map.drawparallels(np.arange(lata, latb,latdx),labels=[1,0,0,0],fontsize=20)
map.drawmeridians(np.arange(lona,lonb,londy),labels=[0,0,0,1],fontsize=20)
x, y = map(*np.meshgrid(lon,lat))
clevs = np.arange(zeta,zetb,deltazc)
dlevs = np.arange(zeta,zetb,deltazd)
- xx, yy = np.meshgrid(lon, lat)
- map.pcolormesh(xx, yy, var)
maplot1=map.imshow(var2, cmap=kolormap, vmin=zeta, vmax=zetb)
plt.rc('lines', linewidth=0.5, color='#000000')
cnplot = map.contour(x,y,var,dlevs,colors=kolorado)
- cnplot = map.contour(x,y,var,dlevs,colors='k')
cbar = map.colorbar(maplot1,location='bottom',pad="10%", label='T avg July oC')
cbar.set_label(legtitle, fontsize=20)
cbar.ax.tick_params(labelsize=16)
plt.clabel(cnplot, fmt='%.0f',fontsize=15, inline=1)
plt.title(plottitle, fontsize=24)
- plt.show()
plt.savefig(outimage, bbox_inches='tight', dpi=dpi)
plt.savefig(outpdf, bbox_inches='tight', dpi=dpi)
OLD SLOW AND CLUMSY CODE
- -*- coding: utf-8 -*-
from mpl_toolkits.basemap import Basemap, cm
import matplotlib.pyplot as plt
from netCDF4 import Dataset as open_ncfile
import numpy as np
- preprocess with GMT 5.4
- gmt grdcut tk7_gauss1.nc -Gwest_europe_tk7.nc -R-10/50/30/60
zvarlabel='z'
latvarlabel='lat'
lonvarlabel='lon'
lona=-10
lonb=50
lata=30
latb=60
latdx=5
londy=5
zeta=-25
zetb=25
deltazc=0.5
deltazd=5
legtitle="oC"
plottitle="T July, LGM (CCSM4)"
dpi = 100
outimage="out.png"
- -- open netcdf file
nc = open_ncfile('west_europe_tk7.nc')
var = nc.variables[zvarlabel][:,:]
lat = nc.variables[latvarlabel][:]
lon = nc.variables[lonvarlabel][:]
- -- create figure and axes instances
fig = plt.figure(figsize=(1100/dpi, 1100/dpi), dpi=dpi)
ax = fig.add_axes([0.1,0.1,0.8,0.9])
map = Basemap(projection='cyl',llcrnrlat=lata,urcrnrlat= latb,\
resolution='h', llcrnrlon=lona,urcrnrlon=lonb)
map.drawcoastlines()
map.drawrivers()
- map.drawstates()
- map.drawcountries()
kolorado=('r', 'r', 'r', 'r','r','r','r', 'r', 'r', 'r', 'r','r','r','r' )
map.drawparallels(np.arange(lata, latb,latdx),labels=[1,0,0,0],fontsize=10)
map.drawmeridians(np.arange(lona,lonb,londy),labels=[0,0,0,1],fontsize=10)
x, y = map(*np.meshgrid(lon,lat))
clevs = np.arange(zeta,zetb,deltazc)
dlevs = np.arange(zeta,zetb,deltazd)
cnplot = map.contourf(x,y,var,clevs,antialiased=True,cmap=plt.cm.jet)
- cnplot = map.contour(x,y,var,clevs,cmap=plt.cm.jet)
cbar = map.colorbar(cnplot,location='bottom',pad="10%")
cbar.set_label(legtitle)
cnplot = map.contour(x,y,var,dlevs,colors=kolorado,)
plt.clabel(cnplot, fmt='%.0f',fontsize=12, inline=1)
plt.title(plottitle)
- plt.show()
plt.savefig("out.png", bbox_inches='tight', dpi=dpi)
plt.savefig("out.pdf", bbox_inches='tight', dpi=dpi )
bash
- gmt grdcut tk7_gauss1.nc -Gwest_europe_tk7.nc -R-10/50/30/60
python2 hevi1.py
pdf2svg out.pdf out.svg
inkscape -z -e out.png -w 1024 -h 512 out2.svg
svgo out.svg
bash gauss
ingrid1="../ccsm/data/cclgmtk7.nc"
ingrid2="../ccsm/data/cclgmtk1.nc"
ingrid3="../ccsm/data/cclgmbi1.nc"
outgridbase1="tk7_gauss1"
outgridbase2="tk1_gauss1"
outgridbase3="ta_gauss1"
saga_cmd grid_filter 1 -INPUT $ingrid3 -RESULT $outgridbase3 -SIGMA 6 -RADIUS 6
gdal_translate -of GMT $outgridbase3".sdat" temp.nc
gdal_calc.py -A temp.nc --outfile="temp2.tif" --calc="(A/10)"
gdal_translate -of netCDF temp2.tif $outgridbase3".nc"
exit
saga_cmd grid_filter 1 -INPUT $ingrid1 -RESULT $outgridbase1 -SIGMA 6 -RADIUS 6
gdal_translate -of GMT $outgridbase1".sdat" temp.nc
gdal_calc.py -A temp.nc --outfile="temp2.tif" --calc="(A)"
gdal_translate -of netCDF temp2.tif $outgridbase1".nc"
saga_cmd grid_filter 1 -INPUT $ingrid2 -RESULT $outgridbase2 -SIGMA 6 -RADIUS 6
gdal_translate -of GMT $outgridbase2".sdat" temp.nc
gdal_calc.py -A temp.nc --outfile="temp2.tif" --calc="(A)"
gdal_translate -of netCDF temp2.tif $outgridbase2".nc"
bash obtain data
- get LGM climate data geotiff
mkdir data
cd data
wget http://biogeo.ucdavis.edu/data/climate/cmip5/lgm/cclgmtn_2-5m.zip
wget http://biogeo.ucdavis.edu/data/climate/cmip5/lgm/cclgmtx_2-5m.zip
wget http://biogeo.ucdavis.edu/data/climate/cmip5/lgm/cclgmpr_2-5m.zip
wget http://biogeo.ucdavis.edu/data/climate/cmip5/lgm/cclgmbi_2-5m.zip
unzip cclgmtn_2-5m.zip
unzip cclgmtx_2-5m.zip
unzip cclgmpr_2-5m.zip
unzip cclgmbi_2-5m.zip
rm *.zip
cd ..
mkdir plot
mkdir teksti
- init mapping utilzzz
sudo apt install gdal-bin python-gdal nco cdo ctioga2 libnetcdf libnetcdf-dev -y
- sumenna.bash
- sudo apt install saga
gcc -o ncblit1 ncblit1.c -lm -lnetcdf
gcc -o ncprobe1 ncprobe1.c -lm -lnetcdf
bahs to prepare data
sorckanta1="cclgmtn"
sorckanta2="cclgmtx"
sorckanta3="cclgmpr"
sorckanta4="cclgmtk"
psorckanta1="cclgmbi"
cd data
for i in {1..12..1}
do
sorcnimi1=$sorckanta1$i.tif
sorcnimi2=$sorckanta2$i.tif
sorcnimi3=$sorckanta3$i.tif
sorcnimi4=$sorckanta4$i.tif
nesorcnimi1=$sorckanta1$i.nc
nesorcnimi2=$sorckanta2$i.nc
nesorcnimi3=$sorckanta3$i.nc
nesorcnimi4=$sorckanta4$i.nc
gdal_calc.py -A $sorcnimi1 -B $sorcnimi2 --outfile=$sorcnimi4 --calc="(A+B)/20"
gdal_translate -ot Float32 -of netCDF $sorcnimi1 $nesorcnimi1
gdal_translate -ot Float32 -of netCDF $sorcnimi2 $nesorcnimi2
gdal_translate -ot Float32 -of netCDF $sorcnimi3 $nesorcnimi3
gdal_translate -ot Float32 -of netCDF $sorcnimi4 $nesorcnimi4
done
for i in {1..15..1}
do
psorcnimi1=$psorckanta1$i.tif
pesorcnimi1=$psorckanta1$i.nc
gdal_calc.py -A $psorcnimi1 --outfile=temp.tif --calc="A"
gdal_translate -ot Float32 -of netCDF temp.tif $pesorcnimi1
done
cd ..
Licensing
[edit]
I, the copyright holder of this work, hereby publish it under the following license:
![w:en:Creative Commons](https://upload.wikimedia.org/wikipedia/commons/thumb/7/79/CC_some_rights_reserved.svg/90px-CC_some_rights_reserved.svg.png)
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.
https://creativecommons.org/licenses/by-sa/4.0CC BY-SA 4.0 Creative Commons Attribution-Share Alike 4.0 truetrue
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 14:45, 1 September 2019 | ![]() | 1,236 × 1,052 (7.12 MB) | Merikanto (talk | contribs) | Correction of text label |
14:34, 1 September 2019 | ![]() | 1,236 × 1,052 (7.12 MB) | Merikanto (talk | contribs) | Faster code | |
16:11, 6 December 2018 | ![]() | 911 × 566 (5.67 MB) | Merikanto (talk | contribs) | User created page with UploadWizard |
You cannot overwrite this file.
File usage on Commons
There are no pages that use this file.
Metadata
This file contains additional information such as Exif metadata which may have been added by the digital camera, scanner, or software program used to create or digitize it. If the file has been modified from its original state, some details such as the timestamp may not fully reflect those of the original file. The timestamp is only as accurate as the clock in the camera, and it may be completely wrong.
Width | 989.186786pt |
---|---|
Height | 841.506071pt |