File:Fast rotating desert planet like earth annual temperature 1 1 1 1.png
Original file (1,132 × 616 pixels, file size: 234 KB, MIME type: image/png)
Captions
Summary
[edit]DescriptionFast rotating desert planet like earth annual temperature 1 1 1 1.png |
English: Fast rotating desert planet like Earth annual temperature degrees Celsius. |
Date | |
Source | Own work |
Author | Merikanto |
Python3 visualizing code
- python3 exoplasim netcf data visualize
- 30.10.2023 v 0000.0000
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
import netCDF4
from netCDF4 import Dataset
from matplotlib.pylab import *
import numpy as np
from scipy import interpolate
from scipy.interpolate import griddata
def savenetcdf_single_frommem(outfilename1, outvarname1, xoutvalue1,xoutlats1,xoutlons1):
nlat1=len(xoutlats1)
nlon1=len(xoutlons1)
#indata_set1=indata1
print(outfilename1)
ncout1 = netCDF4.Dataset(outfilename1, 'w', format='NETCDF4')
outlat1 = ncout1.createDimension('lat', nlat1)
outlon1 = ncout1.createDimension('lon', nlon1)
outlats1 = ncout1.createVariable('lat', 'f4', ('lat',))
outlons1 = ncout1.createVariable('lon', 'f4', ('lon',))
outvalue1 = ncout1.createVariable(outvarname1, 'f4', ('lat', 'lon',))
outvalue1.units = 'Unknown'
outlats1[:] = xoutlats1
outlons1[:] = xoutlons1
outvalue1[:, :] =xoutvalue1[:]
ncout1.close()
return 0
def loadnetcdf_single_tomem(infilename1, invarname1):
global cache_lons1
global cache_lats1
print(infilename1)
inc1 = netCDF4.Dataset(infilename1)
inlatname1="lat"
inlonname1="lon"
inlats1=inc1[inlatname1][:]
inlons1=inc1[inlonname1][:]
cache_lons1=inlons1
cache_lats1=inlats1
indata1_set1 = inc1[invarname1][:]
dim1=indata1_set1.shape
nlat1=dim1[0]
nlon1=dim1[1]
inc1.close()
return (indata1_set1)
num1=1
kk1=1
vari1="tas"
- fintemp1 = "./earth_fastrot_ocean.nc"
fintemp1 = "./earth_fastrot_desert.nc"
- fintemp1 = "./planet_run/MOST.0000"+str(num1)+".nc"
- fintemp1="fields_biogem_2d.nc"
print(num1, kk1)
print(fintemp1)
ncinu1 = Dataset(fintemp1, "r+", format = "NETCDF4")
print(ncinu1)
- quit(-1)
- navalue=9.969209968386869e+36
lon0 = ncinu1.variables['lon']
lat0 = ncinu1.variables['lat']
kindex1=kk1-1
- tsa00 = ncinu1.variables['tsa'][kindex1]-273.15
- tsa00 = ncinu1.variables[vari1][kindex1]
Kelvin=273.15
tsa00=np.mean(ncinu1.variables[vari1], axis=0)-Kelvin
- mask00=ncinu1.variables['lsm']
- print(mask00)
print(np.shape(tsa00))
- quit(-1)
- print(tsa00)
- quit(-1)
- print(type(lon1))
lon1=np.array(lon0)
lat1=np.array(lat0)
- print(lon1)
tsa=np.array(tsa00)
- mask1=np.array(mask00)
- print(mask1)
- quit(-1)
avgtemp1=np.mean(tsa)
print("Tavg: ",avgtemp1)
- quit(-1)
newx=36
newy=36
X = np.arange(-180, 180, 360/newx)
Y = np.arange(-90, 90, 180/newy)
oname1="atm_temp.nc"
ovar1="Band1"
- savenetcdf_single_frommem(oname1, ovar1, tsa,Y, X)
kmap2 = plt.cm.get_cmap('RdBu_r')
kmap1=plt.get_cmap('YlGnBu')
mint1=round(np.min(tsa),1)
maxt1=round(np.max(tsa),1)
title1="Fast rotating desert planet like Earth"
title2="Temperature deg C: min "+str(mint1)+" max "+str(maxt1)
plt.suptitle(title1, fontsize=22)
plt.title(title2, fontsize=18)
plt.xlabel("Longitude", fontsize=18)
plt.xticks(fontsize=18)
plt.ylabel("Latitude", fontsize=18)
plt.yticks(fontsize=18)
- contourrange1=[-50,-30,-20,-10,0,10,20,30,40,50]
contourrange1=[-250,-200,-150,-120,-100,-80,-70,-60,-50,-45,-40,-35,-30,-25,-20,-15,-10,-5,0,5,10,15,20,25,30,35,40,45,50,60,70,80,100,120,150,200,300,400,500]
from skimage.transform import resize
tsa2 = resize(tsa, (tsa.shape[0] *3, tsa.shape[1]*2),anti_aliasing=True)
plt.imshow( tsa2, origin="upper",extent=(-180,180,-90,90), cmap=plt.cm.coolwarm, vmin=-80, vmax=80, interpolation="bicubic" )
cs = plt.contour(tsa2, origin="upper", alpha=0.5, extent=(-180,180,-90,90), inline=True, colors=['#3f0000'],levels=contourrange1)
plt.clabel(cs, fontsize=20, inline=1,fmt = '%3.0f', colors=['#3f0000'])
plt.grid(alpha=0.3, linestyle="--")
plt.show()
Exoplasim source code
import numpy as np
import math
import exoplasim as exo
numyears=40
fluksi=1361.5
planet = exo.Model(workdir="planet_run",modelname="Planet",ncpus=4,resolution="T21",outputtype=".nc")
planet.configure(flux=fluksi, eccentricity=0.,obliquity=0.,fixedorbit=True,synchronous=False,rotationperiod=1,
aquaplanet=False,desertplanet=True,timestep=30.0,snapshots=None,physicsfilter="gp|exp|sp")
planet.exportcfg()
print("Running, takes very long time ...")
planet.run(years=numyears,crashifbroken=True)
print(".")
Licensing
[edit]- 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/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 11:34, 30 October 2023 | 1,132 × 616 (234 KB) | Merikanto (talk | contribs) | Uploaded own work 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.
Software used | |
---|---|
Horizontal resolution | 39.37 dpc |
Vertical resolution | 39.37 dpc |