I used the toolbox to calculate the daily minmum temperature, see the following code. Then I calculated the average of every 8 days, there are 46 maps in a year.

But there are some errors in some data. Please see the following map. The same problem occurs in other years.  

.

import cdstoolbox as ct
@ct.application(title='Download data 2018 of air max temperature')
@ct.output.download()
def download_application():
count=1
for yr in ['2001']:
count_month=1;
for mn in ['01', '02', '03',
'04', '05', '06',
'07', '08', '09',
'10', '11', '12'
]:
if count_month == 1:
ddz=['01', '02', '03','04', '05', '06','07', '08', '09','10','11',
'12','13','14','15','16','17','18','19','20','21','22','23',
'24','25','26','27','28','29','30','31']
if count_month==2:
ddz=['01', '02', '03','04', '05', '06','07', '08', '09','10','11',
'12','13','14','15','16','17','18','19','20','21','22','23',
'24','25','26','27','28']
if count_month==3:
ddz=['01', '02', '03','04', '05', '06','07', '08', '09','10','11',
'12','13','14','15','16','17','18','19','20','21','22','23',
'24','25','26','27','28','29','30','31']
if count_month==4:
ddz=['01', '02', '03','04', '05', '06','07', '08', '09','10','11',
'12','13','14','15','16','17','18','19','20','21','22','23',
'24','25','26','27','28','29','30']
if count_month==5:
ddz=['01', '02', '03','04', '05', '06','07', '08', '09','10','11',
'12','13','14','15','16','17','18','19','20','21','22','23',
'24','25','26','27','28','29','30','31']
if count_month==6:
ddz=['01', '02', '03','04', '05', '06','07', '08', '09','10','11',
'12','13','14','15','16','17','18','19','20','21','22','23',
'24','25','26','27','28','29','30']
if count_month==7:
ddz=['01', '02', '03','04', '05', '06','07', '08', '09','10','11',
'12','13','14','15','16','17','18','19','20','21','22','23',
'24','25','26','27','28','29','30','31']
if count_month==8:
ddz=['01', '02', '03','04', '05', '06','07', '08', '09','10','11',
'12','13','14','15','16','17','18','19','20','21','22','23',
'24','25','26','27','28','29','30','31']
if count_month==9:
ddz=['01', '02', '03','04', '05', '06','07', '08', '09','10','11',
'12','13','14','15','16','17','18','19','20','21','22','23',
'24','25','26','27','28','29','30']
if count_month==10:
ddz=['01', '02', '03','04', '05', '06','07', '08', '09','10','11',
'12','13','14','15','16','17','18','19','20','21','22','23',
'24','25','26','27','28','29','30','31']
if count_month==11:
ddz=['01', '02', '03','04', '05', '06','07', '08', '09','10','11',
'12','13','14','15','16','17','18','19','20','21','22','23',
'24','25','26','27','28','29','30']
if count_month==12:
ddz=['01', '02', '03','04', '05', '06','07', '08', '09','10','11',
'12','13','14','15','16','17','18','19','20','21','22','23',
'24','25','26','27','28','29','30','31']

for dd in ddz:
data = ct.catalogue.retrieve(
'reanalysis-era5-land',
{'variable': '2m_temperature',
'year': yr,
'month': mn,
'day': dd,
'time': [
'00:00', '01:00', '02:00',
'03:00', '04:00', '05:00',
'06:00', '07:00', '08:00',
'09:00', '10:00', '11:00',
'12:00', '13:00', '14:00',
'15:00', '16:00', '17:00',
'18:00', '19:00', '20:00',
'21:00', '22:00', '23:00',
],
'area':[90,-180,-60,180]
}
)
day_mean=ct.climate.daily_min(data,keep_attrs=True)
if count == 1:
day_mean_all=day_mean
else:
day_mean_all=ct.cube.concat([day_mean_all, day_mean], dim='time')

count = count + 1

count_month=count_month+1
return day_mean_all

2 Comments

  1. Hi Lichang,

    I ran your workflow and calculated the monthly daily mean for Jan 2001 - the results look ok to me - see attached image. Maybe there was an issue during data transfer/processing?

    Thanks,

    Kevin

    1. Hi Kevin. The first picture expresses the average from the 9th to the 16th day of 2001, not the average for January. I calculated the average of every 8 days, and then expressed it with 1-46.  Then

      I check each daily data between the 9th and the 16th day of 2001, and found an error occurred in the Julian day 11 in 2011. In this process, I did not process any data, but only presented the data。