From 3c5591dc48446f75a1b9dead4c36c1fc26281f64 Mon Sep 17 00:00:00 2001 From: Sven Kiefer Date: Mon, 23 Oct 2023 09:59:22 +0200 Subject: [PATCH] small clean up --- gcm_toolkit/utils/interface.py | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/gcm_toolkit/utils/interface.py b/gcm_toolkit/utils/interface.py index 6b4f2ed..6cd13c3 100644 --- a/gcm_toolkit/utils/interface.py +++ b/gcm_toolkit/utils/interface.py @@ -238,17 +238,17 @@ def _set_data_common(self, time, tag=None, regrid_lowres=False, dsi = self.tools.get_one_model(tag).sel(time=time) if terminator_avg: - # To perform a proper avareging over the terminator region, the data is + # To perform a proper avareging over the terminator region, the data is # sampled and regridded. - + # set latitude step size and latitude centers d_lat = 180 / lat_points c_lat = np.linspace(-90+d_lat/2, 90-d_lat/2, lat_points) - + # read out values from x array to normal array input coords = np.meshgrid(dsi[c['lon']], dsi[c['lat']]) coords = np.asarray([coords[0].flatten(), coords[1].flatten()]) - + # read out data that needs to be avaraged data = [] names = [] @@ -274,14 +274,14 @@ def _set_data_common(self, time, tag=None, regrid_lowres=False, }, attrs=dsi.attrs ) - + # loop over both limbs seperatly tmp = np.zeros((lat_points, 2, data_nr)) for i, limb in enumerate([-90., 90.]): # loop over each latitude point for j, lp in enumerate(c_lat): tmp[j, i, :] = self._terminator_slice_interpolator( - coords, data, lp - d_lat/2, lp + d_lat/2, + coords, data, lp - d_lat/2, lp + d_lat/2, lon_resolution, limb) # reshape output data and add it to the new dataset @@ -405,13 +405,6 @@ def _terminator_slice_interpolator(self, coord, data, lat_min, lat_max, opening_ grid_y, grid_x = np.meshgrid(np.linspace(lmin, lmax, 100), np.linspace(-oa, oa, 100)) - # # debuging plotting routines - # import matplotlib.pyplot as plt - # plt.figure() - # plt.plot(grid_x, grid_y, 'k.') - # plt.plot(np.asarray(d_gri)[:, 0], np.asarray(d_gri)[:, 1], 'r.') - # plt.show() - # interpolate data to new grid out = np.zeros((len(data[:, 0]),)) for d in range(len(d_res[0])):