# Retrieve average for selected days and hours

**URL:** <https://forum.ecmwf.int/t/retrieve-average-for-selected-days-and-hours/1773>\
**Category:** Other - Software and tools\
**Tags:** c3s, toolbox\
**Created:** [1 April 2022 09:47 UTC](https://forum.ecmwf.int/t/retrieve-average-for-selected-days-and-hours/1773 "2022-04-01T09:47:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniele\_Francario](https://forum.ecmwf.int/letter_avatar_proxy/v4/letter/d/41988e/32.png) [@Daniele\_Francario](https://forum.ecmwf.int/u/Daniele_Francario)\
**Post date:** [1 April 2022 09:47 UTC](https://forum.ecmwf.int/t/retrieve-average-for-selected-days-and-hours/1773/1 "2022-04-01T09:47:01Z")

</div>

For my thesis, I need to get the average of ERA5 land values at 15.00 and 16:00 for specific days in each month. To clarify, I've been trying the following:

import cdstoolbox as ct

@ct.application(title='Download data')  
 @ct.output.download()  
 @ct.output.download()  
 @ct.output.download()  
 def download\_application():  
 &nbsp; &nbsp; data1, data2, data3 = ct.catalogue.retrieve(  
 &nbsp; &nbsp; &nbsp; &nbsp; 'reanalysis-era5-land',  
 &nbsp; &nbsp; &nbsp; &nbsp; {  
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'variable': [  
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; '10m\_u\_component\_of\_wind', '10m\_v\_component\_of\_wind', '2m\_temperature',  
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ],  
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'year': '2019',  
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'month': '03',  
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'day': [  
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; '05', '12', '19',  
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; '23', '24', '27',  
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; '28',  
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ],  
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'time': [  
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; '15.00',16:00',  
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ],  
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'area': [  
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 41, -80.5, 34,  
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -74,  
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ],  
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'grid':['0.008333333', '0.00833333']  
 &nbsp; &nbsp; &nbsp; &nbsp; }  
 &nbsp; &nbsp; )

&nbsp; &nbsp;temperature\_mean = ct.cube.resample(data3, freq='day', dim='time', how='mean')

&nbsp; &nbsp;uwind\_mean = ct.cube.resample(data2, freq='day', dim='time', how='mean')

&nbsp; &nbsp;vwind\_mean = ct.cube.resample(data1, freq='day', dim='time', how='mean')  
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;  
 &nbsp; return temperature\_mean, uwind\_mean, vwind\_mean

With the goal of obtaining 7 two-dimensional arrays (one per day) for each variable, where each pixel contains the average of the estimates at 15.00 and 16.00.  
 But when I then try to visualize the output in Snap or Spyder, it makes almost no sense - there are 24 timesteps, of which 7(located in a seemigly random way along the list) seem to contain just the estimate made at 15.00.  
 Any suggestion on how to solve this matter would be dearly appreciated.
