File:CCSM3 19000BP JulyT 1.svg

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

Original file(SVG file, nominally 1,650 × 1,275 pixels, file size: 1.12 MB)

Captions

Captions

July Temperature, Europe, 19000 years ago

Summary

[edit]
Description
English: July temperature on Europe, 19000 years ago.
Date
Source Own work
Author Merikanto

This image is based on "Trace21ka CCSM3" simulation data. Data is dowscaled with delta method with "GLAC 1D" and "ETOPO1" datasets. Assumed temperature lapse rate +5 C/1000 m.

Finally it is visualized with NASA Panoply program.

Python source code.

    1. python 3.7 trace21ka temperature downscaler
    2. needs trace21ka TS file(s), Glac1D "HDC" file
    3. end cropped etopo1 for europe lonlat (-15,30) - (40, 70)

import matplotlib.pyplot as plt import numpy as np import scipy

import xarray as xr

import skimage from skimage import data from skimage import io from skimage import filters from skimage import color from skimage.transform import rescale, resize, downscale_local_mean

    1. location in Trace21ka CCSM3 TS file

tslok1=7

    1. location in GLAC 1D file
    2. defa

orolok1=71

    1. sea level change *-1 eq 120 means 120 meters below current

sealev=120

    1. 1 pix accuracy

skale1=1

    1. temperature lapse rate 5 C/ km

lapserate1=-0.005

  1. limits of accureta map

lat1=30 lat2=70 lon1=-15 lon2=40

dataDIR = './predata/TOPicemsk.GLACD26kN9894GE90227A6005GGrBgic.nc' eurodir = './predata/etopo1_europe0.nc' tsdatadir = './predata2/trace*.nc'

outdir1 = './oroout.nc' outtempo1='./outtempo1.nc'

DTS = xr.open_mfdataset(tsdatadir)

  1. print (DTS)

rtemp0=DTS.TS[tslok1]-273.15 rtemp1=np.flipud(rtemp0) rtemp2=np.roll(rtemp1, 48, axis=1)

  1. plt.imshow(rtemp2)
  1. plt.show()

DS = xr.open_dataset(dataDIR)

  1. print (DS)

roro0=DS.HDC[orolok1] roro1=np.flipud(roro0) roro2=np.roll(roro1, 180, axis=1)

    1. 360x180 grid

indx1=lon1+180 indx2=lon2+180 indy1=180-(lat1*2) indy2=180-(lat2*2)

roro3=roro2[indy2:indy1,indx1:indx2]

roro3 *= (roro3>1)

print(indx1,indx2) print (indy1, indy2)

  1. roro3=roro2[0:90,180:270]
  1. roro3=roro2[00:90,180:270]
  1. plt.imshow(roro3)
  1. plt.show()

DSE = xr.open_dataset(eurodir)

  1. print (DSE)

euro0=DSE.Elev

  1. euro1=np.flipud(euro0)

elon=DSE.lon elat=DSE.lat

euro0=euro0+sealev euro0 *= (euro0>1)

ork1 = resize(euro0, (roro3.shape[0], roro3.shape[1] ),

                      anti_aliasing=True, order=1)

ork2 = resize(ork1, (euro0.shape[0], euro0.shape[1] ), anti_aliasing=True, order=1)

ork3 = resize(roro3, (euro0.shape[0], euro0.shape[1] ), anti_aliasing=True, order=1)

  1. rim22=scipy.ndimage.zoom(rim21,(imgw2, imgh2), order=1)
  1. omg3=resize(omg2, img2.shape,anti_aliasing=True ,order=1)

dorka=euro0-ork2 outi1=ork3+dorka

  1. outi2=np.flipud(outi1)
  1. plt.imshow(ork2)

plt.imshow(outi1)

  1. plt.imshow(roro3)

eurout = xr.Dataset(

       data_vars={'Elev': (('lat', 'lon'), outi1) },
       coords={'lat': elat, 'lon': elon})
  1. plt.imshow(euro0)
  1. plt.show()

eurout.to_netcdf(outdir1)

    1. io.imsave("outoro.tif", outi1)
  1. io.imsave("outtemp.tif", rtemp1)
  1. img1 = io.imread('./outtemp.tif')
  1. img200 = io.imread('./outoro.tif')

img1=rtemp1 img200=outi1

img201 = resize(img200, (img200.shape[0]/skale1, img200.shape[1]/skale1 ),

                      anti_aliasing=True, order=1)

img2 = resize(img201, (img200.shape[0], img200.shape[1] ),

                      anti_aliasing=True, order=1)

imgw1=img1.shape[1] imgh1=img1.shape[0] imgw2=img2.shape[1] imgh2=img2.shape[0]

print(imgw1, imgh1) print(imgw2, imgh2)

  1. ix1=0
  2. ix2=360
  3. iy1=-90
  4. iy2=90

ix1=-180 ix2=180 iy1=90 iy2=-90

dx1=(ix2-ix1)/imgw1 dy1=(iy2-iy1)/imgh1 dy2=(iy2-iy1)/(imgh1*2)

lon1=-15 lon2=40 lat1=70 lat2=30

indx1=int((lon1-ix1)/dx1) indx2=int((lon2-ix1)/dx1) indy1=int((lat1-iy1)/dy1) indy2=int((lat2-iy1)/dy1)

wi1=abs(indx2-indx1) hi1=abs(indy2-indy1)

  1. print(indy1)

omg1=np.roll(img1, 45, axis=1)

print(indx1,indx2) print(indy1,indy2)

omg2=omg1[indy1:indy2,indx1:indx2]

  1. omg2=omg1[0:48,0:48]
  2. omg2=omg1[0:24,44:58]
  3. omg2=omg1[10:32,44:58]
    1. lat, lon


rim21 = resize(img2, (img1.shape[0], img1.shape[1] ),

                      anti_aliasing=True, order=1)

rim22 = resize(rim21, (img2.shape[0], img2.shape[1] ),

                      anti_aliasing=True, order=1)
  1. rim22=imresize(rim21, img2.shape, interp='bilinear')
  1. rim22=scipy.ndimage.zoom(rim21,(imgw2, imgh2), order=1)

omg3=resize(omg2, img2.shape,anti_aliasing=True ,order=1)

rim23=(img2-rim22)

outi1=omg3+(rim23*lapserate1) outi2=np.flipud(outi1)

imgw3=outi2.shape[1] imgh3=outi2.shape[0]

print(imgw3, imgh3)

levels1 = [-25,-20,-15,-10,-5,0,5,10,15,20,25,30,35]

  1. levels1 = [-15,-10,-5,0,5,10,15,20,25]
  2. levels1 = [-10,-5,0,5,10,15,20]

ox1 = np.linspace(0,1, imgw3) oy1 = np.linspace(0,1, imgh3)

odx1=(lon2-lon1)/imgw3 ody1=(lat2-lat1)/imgh3

olonas1 = np.linspace(lon1,lon2,imgw3) olatas1 = np.linspace(lat1,lat2, imgh3)

  1. print ("olatas")
  2. print (odx1)
  3. print (len(olatas1))
  4. print (olatas1)
  1. image_resized = resize(image, (image.shape[0] / 4, image.shape[1] / 4), anti_aliasing=True)
  2. mi3 = downscale_local_mean(img1, (4, 4))
  1. plt.imshow(img1, cmap='viridis')
  2. plt.imshow(rim23, cmap='rainbow')
  3. plt.imshow(omg2, cmap='rainbow')
  1. plt.imshow(outi1,extent=[lon1, lon2, lat1, lat2], cmap='rainbow')
  1. plt.contour(ox1,oy1,outi2,5, colors='blue');
  1. plt.contour(outi1,5, levels=levels1,alpha=.5, colors='blue');
  2. plt.contourf(outi1,5, levels=levels1,alpha=.5, colors='rainbow');

cf = plt.contourf(ox1,oy1, outi2, levels=levels1)

  1. cn= plt.contour(outi2,5, levels=levels1,alpha=.5, colors='k', linestyle='-');

plt.contour(cf, colors='k')

  1. plt.show()
  1. type(img1)

eurout = xr.Dataset(

       data_vars={'TT': (('lat', 'lon'), outi1) },
       coords={'lat': olatas1, 'lon': olonas1})
       
       

eurout.to_netcdf(outtempo1)

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
current18:44, 8 September 2019Thumbnail for version as of 18:44, 8 September 20191,650 × 1,275 (1.12 MB)Merikanto (talk | contribs)User created page with UploadWizard

There are no pages that use this file.

Metadata