Hi
Not an issue, rather a discussion.
-
Why is it better to have ~1k lines of code (co2_interpolation.py) to finally call scipy.interpolate.griddata instead of an one(ish)-liner cdo remap* or such?
If both methods yield (very) similar results - which is what I would expect if griddata's method = 'linear' and cdo's remapbil is used:
|
co2_interpolated = griddata( |
|
co2_points, |
|
co2_values, |
|
icmgg_points, |
|
method='linear' |
- then I would prefer the (much) shorter method?
-
Does it make a lot of sense that the interpolated field is a combination of two interpolation methods - linear and nearest neighbor, if the linear interpolation result includes NaNs?:
|
if np.isnan(co2_interpolated).any(): |
|
nan_mask = np.isnan(co2_interpolated) |
|
co2_interpolated[nan_mask] = griddata( |
|
co2_points, |
|
co2_values, |
|
icmgg_points[nan_mask], |
|
method='nearest' |
Thanks!
Hi
Not an issue, rather a discussion.
Why is it better to have ~1k lines of code (co2_interpolation.py) to finally call
scipy.interpolate.griddatainstead of an one(ish)-linercdo remap*or such?If both methods yield (very) similar results - which is what I would expect if
griddata'smethod = 'linear'andcdo'sremapbilis used:ocp-tool/ocp_tool/co2_interpolation.py
Lines 297 to 301 in af5b552
- then I would prefer the (much) shorter method?
Does it make a lot of sense that the interpolated field is a combination of two interpolation methods - linear and nearest neighbor, if the linear interpolation result includes NaNs?:
ocp-tool/ocp_tool/co2_interpolation.py
Lines 305 to 311 in af5b552
Thanks!