# HG changeset patch # User climate # Date 1657357321 0 # Node ID abdc27e01dca52bb79048aa20b8809c2409da91d # Parent c6f2435d680b61272a0dbe230753df21df1d257d planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/climate-stripes commit e4c144851549600ffde5bcf875304d5edd98e2b1 diff -r c6f2435d680b -r abdc27e01dca climate-stripes.xml --- a/climate-stripes.xml Tue Apr 14 15:08:10 2020 -0400 +++ b/climate-stripes.xml Sat Jul 09 09:02:01 2022 +0000 @@ -1,9 +1,16 @@ - + from timeseries + + topic_3855 + topic_3318 + + + operation_0337 + python - matplotlib - pandas + matplotlib + pandas @@ -28,6 +38,7 @@
+ @@ -127,6 +138,7 @@ + diff -r c6f2435d680b -r abdc27e01dca climate_stripes.py --- a/climate_stripes.py Tue Apr 14 15:08:10 2020 -0400 +++ b/climate_stripes.py Sat Jul 09 09:02:01 2022 +0000 @@ -72,7 +72,10 @@ self.plot_format = plot_format.replace('X', '%') def read_data(self): - self.data = pd.read_csv(self.input, sep='\t') + if self.xname is not None: + self.data = pd.read_csv(self.input, sep='\t', index_col=self.xname, infer_datetime_format=True) + else: + self.data = pd.read_csv(self.input, sep='\t') def create_stripes(self): data = np.zeros((2, self.data[self.valname].shape[0]), dtype='float') @@ -86,16 +89,11 @@ vmax=self.data[self.valname].quantile(q=0.99)) if self.title: plt.title(self.title) - if self.xname: + if self.xname is not None: nrange = self.data.index.values - n = int(np.floor((nrange.max() - nrange.min())/int(self.nxsplit))) - date_list = self.data[self.xname].loc[::n].apply( - lambda x: pd.to_datetime(str(x), - format=self.format)) + date_list = pd.to_datetime(nrange[::int(self.nxsplit)], format=self.format) date_list = [i.strftime(self.plot_format) for i in date_list] - nval = int(self.data[self.xname].loc[::n].shape[0]) - ax.xaxis.set_major_locator(plt.MaxNLocator(nval)) - ax.xaxis.set_ticklabels(date_list) + ax.set_xticks(np.arange(0, len(nrange), int(self.nxsplit)), date_list) ax.xaxis.set_tick_params(rotation=45) else: ax.set_xticks([]) diff -r c6f2435d680b -r abdc27e01dca test-data/T2Mstripes_with_axis.png Binary file test-data/T2Mstripes_with_axis.png has changed