Skip to content

Commit

Permalink
Merge pull request #34 from E3SM-Project/hsianghelee/boolean_array_fix
Browse files Browse the repository at this point in the history
fix xarray boolean array issue when using where function
  • Loading branch information
hsiangheleellnl authored Sep 6, 2023
2 parents 6728253 + f62dd0b commit 1f49c38
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions chemdyg/templates/chemdyg_TOZ_eq_plot.bash
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ lat2 = refer['lat']
rearth = 6.37122e6
AREA_in = refer['area'] * rearth * rearth
TOZ_sel = file_in['TCO'].where((lat < -60), drop=True)+file_in['SCO'].where((lat < -60), drop=True)
TOZ_sel = file_in['TCO'].where((lat.compute() < -60), drop=True)+file_in['SCO'].where((lat.compute() < -60), drop=True)
AREA_sel = AREA_in.where((lat2 < -60), drop=True)
AREA_64S = AREA_in.where((lat2 < -64), drop=True).sum()
AREA_64S = np.array(AREA_64S)
Expand Down Expand Up @@ -160,7 +160,7 @@ for i in range(startindex,endindex):
fig = plt.figure(figsize=(10,5))
plt.plot(time_range[startindex:endindex],O3_64S)
plt.title('Total column ozone conc. with equivalent latitude (64S)')
plt.xlabel('Time')
plt.xlabel('Time (start in year 2000)')
plt.ylabel('O3 conc. (DU)',fontsize='large')
pylab.savefig(pathout+'TOZ_PDF_timeseries.png', dpi=300)
Expand Down
6 changes: 3 additions & 3 deletions chemdyg/templates/chemdyg_temperature_eq_plot.bash
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ lat2 = refer['lat']
rearth = 6.37122e6
AREA_in = refer['area'] * rearth * rearth
TOZ_h = file_in['T'][:,13].where((lat < -55), drop=True)
TOZ_m = file_in['T'][:,21].where((lat < -55), drop=True)
TOZ_l = file_in['T'][:,29].where((lat < -55), drop=True)
TOZ_h = file_in['T'][:,13].where((lat.compute() < -55), drop=True)
TOZ_m = file_in['T'][:,21].where((lat.compute() < -55), drop=True)
TOZ_l = file_in['T'][:,29].where((lat.compute() < -55), drop=True)
AREA_sel = AREA_in.where((lat2 < -55), drop=True)
TOZ_h_sel = TOZ_h.sel(time=TOZ_h.time.dt.month.isin([6,7,8,9,10,11,12]))
TOZ_m_sel = TOZ_m.sel(time=TOZ_m.time.dt.month.isin([6,7,8,9,10,11,12]))
Expand Down

0 comments on commit 1f49c38

Please sign in to comment.