-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
regridding netcdf file using ClimateOperators and specified grid #5
Comments
Hi Dan,
The best place to start with debugging is actually using CDO directly from the command line – once you’ve got the command up and running, then try implementing it in R – the ClimateOperators package is really only a wrapper for command line CDO anyway, so they should be the same.
The CDO manual is also pretty useful for getting these commands to work – here is the example from remapcon:
***@***.***
“n32” in this case should be replaced with the text file that you mentioned that specifies the grid.
Hope that helps.
Mark
From: Dan Crear ***@***.***>
Sent: tirsdag den 19. marts 2024 16.22
To: markpayneatwork/ClimateOperators ***@***.***>
Cc: Subscribed ***@***.***>
Subject: [markpayneatwork/ClimateOperators] regridding netcdf file using ClimateOperators and specified grid (Issue #5)
Hi,
I'm excited to use your package! I've been getting more familiar with cdo and the formatting specifically through Climate Unboxed youtube tutorials<https://www.youtube.com/watch?v=79o6DXr_3zM>. However, I'm trying to translate it to R and am having a tough time and was hoping you could help.
I'm on a Linux Virtual Machine with cdo installed as well as the package ClimateOperators. I wanted to regrid a 4 dimensional netcdf file to a coarser resolution using 1st order conservative mapping. Right now the dimensions are 961 lon x 961 lat x 32 depths x 31 days (basically 1/12 degree). I would like to reduce it to 321 lon x 321 lat x 32 depths x 31 days (basically 0.25 degree). I tried to use another netcdf file which has the dimensions 321 lon x 321 lat x 31 days and I received the error "CDO command failed. Status code 1." The code I used is below, where examp.nc is the netcdf file I want the spatial resolution to match. I' m not sure why I'm receiving the error. Maybe it is because one grid has 4 dimensions and the other has 3 dimensions?
cdo("remapcon,examp.nc","t.nc","out.nc")
I'm also trying to use the specified grid approach explained in the youtube tutorial above. I created .txt file with the required information but I don't understand how to specify the .txt file that has the new grid information in the R code. Any help would be greatly appreciated!
Thanks!
Dan
—
Reply to this email directly, view it on GitHub<#5>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABGCO4B5GFOXSW4VBKWP4S3YZBJX7AVCNFSM6AAAAABE5ZDVACVHI2DSMVQWIX3LMV43ASLTON2WKOZSGE4TKMRXGA4DANQ>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.******@***.***>>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I'm excited to use your package! I've been getting more familiar with cdo and the formatting specifically through Climate Unboxed youtube tutorials. However, I'm trying to translate it to R and am having a tough time and was hoping you could help.
I'm on a Linux Virtual Machine with cdo installed as well as the package ClimateOperators. I wanted to regrid a 4 dimensional netcdf file to a coarser resolution using 1st order conservative mapping. Right now the dimensions are 961 lon x 961 lat x 32 depths x 31 days (basically 1/12 degree). I would like to reduce it to 321 lon x 321 lat x 32 depths x 31 days (basically 0.25 degree). I tried to use another netcdf file which has the dimensions 321 lon x 321 lat x 31 days and I received the error "CDO command failed. Status code 1." The code I used is below, where examp.nc is the netcdf file I want the spatial resolution to match. I' m not sure why I'm receiving the error. Maybe it is because one grid has 4 dimensions and the other has 3 dimensions?
cdo("remapcon,examp.nc","t.nc","out.nc")
I'm also trying to use the specified grid approach explained in the youtube tutorial above. I created .txt file with the required information but I don't understand how to specify the .txt file that has the new grid information in the R code. Any help would be greatly appreciated!
Thanks!
Dan
The text was updated successfully, but these errors were encountered: