def timeseries(self): statistic = self.request.session['map_'].get( 'dropdown_0', {'value': 'mean'})['value'] timeseries = GroundwaterTimeSeries() timeseries.queries = { "name": self.request.GET.get("groundwater_type", "GWmMSL") } timeseries.bbox(*self.coordinates, statistic=statistic, **self.time_window) return timeseries.ts_to_dict( start_date=jsdt.datestring_to_js(self.request.session['map_']['datepicker'][ 'start']), end_date=jsdt.datestring_to_js(self.request.session['map_'][ 'datepicker']['end']), date_time='str' )
def timeseries_(self): gw_type, statistic = [ x.strip(' ') for x in self.request.session['map_'].get( 'dropdown_0', {'value': 'GWmBGS | mean'})['value'].split('|') ] timeseries = GroundwaterTimeSeries(use_header=self.logged_in) timeseries.queries = {"name": gw_type} south_west, north_east = self.coordinates timeseries.bbox(south_west=south_west, north_east=north_east, organisation=self.selected_organisation_id, statistic=statistic, **self.time_window) result = timeseries.ts_to_dict( start_date=jsdt.datestring_to_js( self.request.session['map_']['datepicker']['start']), end_date=jsdt.datestring_to_js( self.request.session['map_']['datepicker']['end']), date_time='str') return result
def timeseries_(self): gw_type, statistic = [ x.strip(' ') for x in self.request.session['map_'].get( 'dropdown_0', {'value': 'GWmBGS | mean'})['value'].split('|') ] timeseries = GroundwaterTimeSeries(use_header=self.logged_in) timeseries.queries = { "name": gw_type } south_west, north_east = self.coordinates timeseries.bbox(south_west=south_west, north_east=north_east, organisation=self.selected_organisation_id, statistic=statistic, **self.time_window) result = timeseries.ts_to_dict( start_date=jsdt.datestring_to_js(self.request.session['map_'][ 'datepicker']['start']), end_date=jsdt.datestring_to_js(self.request.session['map_'][ 'datepicker']['end']), date_time='str' ) return result