First day of year, first day of month
Added by Pallav Kumar Shrestha over 2 years ago
Hi Uwe
It seems a direct CDO operator for selecting the first day of year or first day of month doesn't exist atm.
I have indirect solutions at hand e.g. selecting each month from the daily time series, then selecting first time step of each, then merging them.
For instance, I want to compare the volume of liquid in a container of first day of each year against the yearsum of fluxes in and out of the container, as a water balance check per year.
I feel this is a rather common analysis and would make sense to have a supporting CDO operator. I hope this can make it to your to-do list, as many of us prefer to stay with CDO's fantastic 1 liners rather going for loops or moving to other generic platforms
I look forward to your thoughts UWE.
Pallav
UFZ - Leipzig
PS> I can not stress this enough - thanks to you and your team for maintaining the CDO project!!
Replies (2)
RE: First day of year, first day of month - Added by Uwe Schulzweida over 2 years ago
Hi Pallov,
With the select operator you can select any months and days with the parameters month and day. To select the first day of a year, use:
cdo select,day=1,month=1 infile outfileThe dom parameter selects the day of the month with one parameter:
cdo select,dom=1jan infile outfileIs this sufficient for your application?
Cheers,
Uwe
RE: First day of year, first day of month - Added by Pallav Kumar Shrestha over 2 years ago
Hi Uwe
Yes. This is perfect for my usage.
1st day of year, of whole time series:(like you mentioned)
cdo select,day=1,month=1 infile outfile
1st day of each month, of whole time series:
cdo select,day=1,month=1/12 infile outfile
Thanks for making me realise the super useful select function Uwe.
Cheers
Pallav