Category : Uncategorized

My personal research for NightCafe and Disco Diffusion painting generation. Just for my personal reference. This post will be continuously updated. Landscape snow scene by Vincent Salvas-Savard,Katarina Persson,Jan Degas,Michal Kváč,Andres Munar,zhang gan,Goedele Godfroid,Au Au,Jay Versluis,malo chen 3D Artist,Mike Reid MaxQ3D,llya Landshut 3D Artist cityscape by sathish kumar,Logan Feliciano,Matt Birks,Guillem H. Pongiluppi,Liya Bohnat,Michal Kváč,Christian Hecker,Daniel Lieske,Jason ..

Read more

Add multiple variables with the same dimension to an existing nc file. Read the target nc file and include the new variables into the file and save to the new file. Sample code import xarray as xr #read nc file fn1 = ‘Annual_average_temperature.nc’ TxTn90p10p=xr.open_dataset(fn1) #add new variables TxTn90p10p[‘TX90p’]=xr.DataArray(TX90p.astype(np.float32), coords=TxTn90p10p.coords, dims=TxTn90p10p.t2m.dims, attrs=TxTn90p10p.attrs) TxTn90p10p[‘TX10p’]=xr.DataArray(TX10p.astype(np.float32), coords=TxTn90p10p.coords, dims=TxTn90p10p.t2m.dims, attrs=TxTn90p10p.attrs) ..

Read more

from scipy.ndimage.filters import gaussian_filter lats = tp.coords[‘latitude’][:] lons = tp.coords[‘longitude’][:] ct_x=[-79.617,-75.717,-86.917,-93.783] ct_y=[43.667,45.383,49.767,51.067] ct_n=[‘Toronto’,’Ottawa’,’Geraldton’,’Red Lake’] projection = ccrs.PlateCarree() provinc_bodr = cartopy.feature.NaturalEarthFeature(category=’cultural’, name=’admin_1_states_provinces_lines’, scale=’50m’, facecolor=’none’, edgecolor=’k’) axes_class = (GeoAxes, dict(map_projection=projection)) # lons, lats = np.meshgrid(lons, lats) title_text=[“season=DJF(m/s)”, “season=MAM(m/s)”, “season=JJA(m/s)”, “season=SON(m/s)”] fig = plt.figure(figsize=(15,15)) axgr = AxesGrid(fig, 111, axes_class=axes_class, nrows_ncols=(1, 1), axes_pad=0.6, cbar_location=’right’, cbar_mode=’single’, cbar_pad=0.2, cbar_size=’2%’, label_mode=”) # ..

Read more

This code is an example for calculating time difference in different units. It is a part of my one program. import pandas as pd DateOct02_2020=date(2020,10,2) # … data=pd.read_csv(file) data[‘Date’]=pd.to_datetime(data.Date) L=data.shape[0] for i in range(L): date1=data.loc[i,’Date’].date() ddt=DateOct02_2020-date1 print(int(ddt.total_seconds())) # in seconds print(int(ddt.total_seconds()/60)) # in minutes print(int(ddt.total_seconds()/60/60)) # in hours print(int(ddt.total_seconds()/60/60/24))..

Read more