Project

General

Profile

Issue using setgrid/setgrid type

Added by Kushank Bajaj over 6 years ago

I'm facing an issue trying to setgrid details in the file named: maharashtra.nc
It's a .nc file I created from a shape file by converting it to raster on ArcGIS. I want to use it to mask out some of my climate data from sf_gws_inv.nc file.

Could anyone please suggest the issue. I've attached the files here.
Thanks in advance.

-KB


Replies (5)

RE: Issue using setgrid/setgrid type - Added by Ralf Mueller over 6 years ago

your mask is on a projection, that is not supported by CDO, e.g. the coordinates units are in "meter".

I see no way of handling it correctly in CDO, sorry

cheers
ralf

RE: Issue using setgrid/setgrid type - Added by Kushank Bajaj over 6 years ago

Hey Ralf,
Thanks for your reply. Could you suggest any other way to go about it?

Thanks.

RE: Issue using setgrid/setgrid type - Added by Ralf Mueller over 6 years ago

try to put the mask on a regular (in degrees) grid with another tool - I have no idea which one, sorry

best,
ralf

RE: Issue using setgrid/setgrid type - Added by Kushank Bajaj over 6 years ago

Thanks for your response Ralf,

I managed to set the coordinate system in degrees. But now I'm struggling masking the sf_ind_gws.nc using the masking file. I've attached the two files here within.
Could you please suggest how to go about it. I did try to use a shell script using cdo commands but wasn't successful.

Thank you so much!
-KB

RE: Issue using setgrid/setgrid type - Added by Ralf Mueller over 6 years ago

You have to bring the mask grid to the data grid and set the mask value to 1

cdo -setvals,0,1 -remapcon,sf_ind_gws.nc maha_mask.nc maha_mask_AT_sfGrid.nc 

now you can multiply the data and the mask to cut out the region if interest

cdo mul sf_ind_gws.nc maha_mask_AT_sfGrid.nc maskedSF.nc 

thats it --

cheers
ralf

    (1-5/5)