Load(): Option to apply mask before interpolating
As discussed in issue #48 (closed):
@eexarchou said:
Thank you Nico for finding this problem.
Indeed if there lonlat data, there should be one common grid. However, sometimes it is important that the mask is applied before regridding ("cdo remapcon …") because in ocean data, there are zeros or other values over land points, that should not be taken into account during interpolation. This is not the case for atmospheric data. I am not sure now how this can be implemented, but I think it is important for points near the cost.
Cheers Eleftheria
@cprodhomme said:
Hi,
You are right Eleftheria that the mask should be use before the interpolation (normally for tos, the file itself is masked so it won't generate any issue). However, it we want to apply the mask before the interpolation, it will be needed to specify the mask of the observation always in the Load function, which will break the backward compatibility of Load.... It we decide that we want to go for this major change, it would be a good opportunity to improve in general the mask handling of load (check if the size is compatible, use directly the name of the file, or even automatic mask selection?) This should be discuss I think in an s2dverification meeting, no?
Regards.
Chloé
@vguemas said:
I agree that it would be a very interesting enhancement to apply the mask before interpolation rather than after interpolation as it is done currently. The current Load assumes that the initial data are already land/sea masked and the application of an additional mask is rather thought to discard additional values that are not of interest for a specific analysis. However, there might be several application where this assumption does not hold: interpolation of winds over ocean without being poluted by land winds ... etc
I don't see clearly though why there would be automatically a backward compatibility break if modifying the Load behaviour : there could be an additional option to apply the mask before interpolation. I think in any case you need to apply the mask again after interpolation because the input mask defined on various grids would not necessarily give the same output masks even though they intend to define the same geographical boundaries initially. I mean for a same given resolution, there exists different land/sea masks depending on the dataset considered even though there is only one geographical location of the continents.
That'd be nice to have a check of the size compatibility, the direct use of the path/name of the mask. However, I am not sure an automatic selection of the mask is suitable since there might be other applications of masking than the classical land/sea mask.