Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
kuchaale authored May 12, 2022
1 parent 1ecf1df commit 390b626
Show file tree
Hide file tree
Showing 27 changed files with 92,754 additions and 0 deletions.
2,646 changes: 2,646 additions & 0 deletions code/EPFD_lagA_again.ipynb

Large diffs are not rendered by default.

3,570 changes: 3,570 additions & 0 deletions code/EPFD_vs_OGWD_correlation.ipynb

Large diffs are not rendered by default.

2,745 changes: 2,745 additions & 0 deletions code/GRL_reproduce_Fig1_Himalayas_lagA.ipynb

Large diffs are not rendered by default.

780 changes: 780 additions & 0 deletions code/NAM_CMAM_variance.ipynb

Large diffs are not rendered by default.

5,601 changes: 5,601 additions & 0 deletions code/NAM_lagA.ipynb

Large diffs are not rendered by default.

3,632 changes: 3,632 additions & 0 deletions code/OGWD+refr_index_himalayas_composite_lagA.ipynb

Large diffs are not rendered by default.

3,406 changes: 3,406 additions & 0 deletions code/OGWD_himalayas_composite_lagA.ipynb

Large diffs are not rendered by default.

2,784 changes: 2,784 additions & 0 deletions code/OGWD_trendanalysis_CCMI-SD.ipynb

Large diffs are not rendered by default.

843 changes: 843 additions & 0 deletions code/Plumb_flux_analysis_Himalayas.ipynb

Large diffs are not rendered by default.

15,764 changes: 15,764 additions & 0 deletions code/VMFC_ERA5_composite.ipynb

Large diffs are not rendered by default.

Large diffs are not rendered by default.

3,034 changes: 3,034 additions & 0 deletions code/chap3_vykreslovani_dizertace_new-DJFonly-tropo-strato-meso.ipynb

Large diffs are not rendered by default.

5,530 changes: 5,530 additions & 0 deletions code/effective_diffusivity_HI_composite-pv-xcontour.ipynb

Large diffs are not rendered by default.

1,104 changes: 1,104 additions & 0 deletions code/geoapps_vs_xcontour.ipynb

Large diffs are not rendered by default.

4,587 changes: 4,587 additions & 0 deletions code/influx_figure_using_composites.ipynb

Large diffs are not rendered by default.

6,661 changes: 6,661 additions & 0 deletions code/interpeak_times_analysis.ipynb

Large diffs are not rendered by default.

4,828 changes: 4,828 additions & 0 deletions code/moment_calculation_distribution_in_CMAM30-sd_composites.ipynb

Large diffs are not rendered by default.

57 changes: 57 additions & 0 deletions code/moments_fast_example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
from netCDF4 import Dataset
import matplotlib.pyplot as plt
import numpy as np
import vor_fast
import vor_fast_setup
import xarray as xr
import sys

#input variables
plot = False
save2netcdf = True
resolution = 'full'

# Read in NetCDF file with geopotential height values
print('opening')
ncin = xr.open_dataset('zg_daily_CMAM_CMAM30-SD_r1i1p1_19790101-20101231_10hPa.nc')
gph = ncin.zg.values
lons = ncin.lon.values
lats = ncin.lat.values
days = ncin.time.values#[:100]
ncin.close()

# Set up cartesian mapping xypoints and restrict to NH
gph_nh, lats_nh, xypoints = vor_fast_setup.setup(gph,lats,lons,'NH')



# Calculate diagnostics for each day
print('Calculating for resolution: '+resolution)
for iday, day in enumerate(days):
if iday % 1000 == 0:
print('Calculating moments for day '+str(iday), day)
moments = vor_fast.calc_moments(gph_nh[iday,:,:],lats_nh,lons,xypoints,
hemisphere='NH',field_type='GPH',
edge=3.02e4,resolution=resolution)
if iday == 0:
ds = xr.Dataset(moments, coords={'time': [day]})
else:
temp = xr.Dataset(moments, coords={'time': [day]})
ds = xr.concat([ds,temp], dim='time')


if save2netcdf:
print('saving')
ds.to_netcdf('moment_calculation_w_obj-area_CMAM.nc')

# Plot timeseries
if plot:
print('plotting')
fig, axes = plt.subplots(nrows=2)
ds['aspect_ratio'].plot(ax = axes[0])
ds['aspect_ratio'].where(ds.aspect_ratio >= 2.4).plot(ax = axes[0], color= 'red')
ds['centroid_latitude'].plot(ax = axes[1])
ds['centroid_latitude'].where(ds.centroid_latitude < 66).plot(ax = axes[1])
plt.tight_layout()
plt.savefig('ar_centroid_full.pdf', bbox_inches = 'tight')

191 changes: 191 additions & 0 deletions code/predictability_wavenumbers.ipynb

Large diffs are not rendered by default.

37 changes: 37 additions & 0 deletions code/refraction_index_calc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import xarray as xr
import glob
from aostools.climate import ComputeRefractiveIndex


cesta = '/mnt/4data/CMAM/0A.daily/'
ta_list = sorted(glob.glob(cesta+'ta/ta_6hrPlev_CMAM_CMAM30-SD_r1i1p1_*-*18.nc'))
ua_list = sorted(glob.glob(cesta+'ua/ua_6hrPlev_CMAM_CMAM30-SD_r1i1p1_*-*18.nc'))
Earth_radius = 6.378e+6

for i,(ta_file, ua_file) in enumerate(zip(ta_list[:], ua_list[:])):
print(ta_file, ua_file)
suffix = ta_file[len(cesta)+5:]
print(suffix)
ds_ta = xr.open_dataset(ta_file)
ds_ua = xr.open_dataset(ua_file)

if i==0:
lat = ds_ta.lat.values
pres = ds_ta.plev.values/100.

uz = ds_ua.ua.mean(['lon'])#
Tz = ds_ta.ta.mean(['lon'])

n_k_ls = []
for k in range(1,4):
n_k = ComputeRefractiveIndex(lat,pres,uz,Tz,k)
n_k_ls.append(n_k)

n_k_xa = xr.concat(n_k_ls, dim='wavenumber')
n_k_xa['wavenumber'] = range(1,4)

n_k_xa.name = 'refr_index'
outfile = '{0}refr_index/refr_index{1}'.format(cesta, suffix)
print(outfile)
n_k_xa.to_netcdf(outfile)

Loading

0 comments on commit 390b626

Please sign in to comment.