Correct way to chain sellonlatbox and setcalendar using apply
Added by hy song over 3 years ago
Hello,
I am new to using cdo, and here's a question that's been bothering me for a long time.
The apply operator can runs operators on each input file, and I want to use sellonlatbox and setcalendar in apply and finally merge them.
I have tried this cdo -f nc4 -z zip_1 -cat -apply,"-setcalendar,standard -sellonlatbox,70,140,15,55" [ file1.nc file2.nc ] file3.nc
but I got this error: Operator >-setcalendar< not found.
and I tried another method cdo -f nc4 -z zip_1 -cat -apply,"setcalendar,standard sellonlatbox,70,140,15,55" [ file1.nc file2.nc ] file3.nc
and got another error: setcalendar (Abort): Too many arguments! Need 1 found 5
So what is the correct way, thank you for your help!
Replies (7)
RE: Correct way to chain sellonlatbox and setcalendar using apply - Added by Karin Meier-Fleischer over 3 years ago
Hi Hy Song,
which version of CDO are you using? I am not able to reproduce the problem.
-Karin
RE: Correct way to chain sellonlatbox and setcalendar using apply - Added by hy song over 3 years ago
Hi, thank you for your response.
My version is 1.9.9rc1. And I've attached a screenshot of the error that occurred.
RE: Correct way to chain sellonlatbox and setcalendar using apply - Added by Ralf Mueller over 3 years ago
you might try -apply,"-setcalendar,standard -sellonlatbox,70,140,15,55"
The minus in front of the operator name is needed to distinguish them from the parameters
RE: Correct way to chain sellonlatbox and setcalendar using apply - Added by hy song over 3 years ago
Thanks to you I know the right way, however as the screenshot, neither method works. So I don't understand what's wrong with it
RE: Correct way to chain sellonlatbox and setcalendar using apply - Added by Ralf Mueller over 3 years ago
My dummy test call is
cdo -f nc4 -z zip_3 -cat -apply,"-setcalendar,standard -sellonlatbox,70,140,15,55" [ -topo -topo -topo ] o.ncbecause I don't have access to your input. It works with 1.9.10 and 1.9.9. Can you give that call a try with your version?
or can you change your CDO installation to 1.9.10 or 1.9.9?
RE: Correct way to chain sellonlatbox and setcalendar using apply - Added by hy song over 3 years ago
Thank you , I have solved this problem, it was caused by using wsl and wsl2 does not create this problem.
RE: Correct way to chain sellonlatbox and setcalendar using apply - Added by Karin Meier-Fleischer over 3 years ago
Good to hear that it is a wsl (Windows subsystem linux) problem and not CDO