Closed DaniJonesOcean closed 3 years ago
The reversal is correct (although the names are confusing - maybe we should rename source_grid in get_fill_mask!) This call to interp_reg is interpolating the cavity mask from the MITgcm grid to the SOSE grid, using np.ceil to include any points which are "partial" cavities. In other words, it's a rare case where we're interpolating from the model back to the SOSE grid (usually it's the other direction), but interp_reg still works fine for this.
Okay, that makes sense, thanks. : )
I'll close this for now, but we could make a different issue for renaming at some point.
Hi @knaughten. This is more of a question than an issue. I'm confused about the order of a couple of the arguments to
interp_reg
. My question may very well end up being a basic python one, but I'd still like to understand. I'll step through what I noticed below:First, we call the
sose_ics
function:This function calls
get_fill_mask
:This function calls
interp_reg
, using this call ifmissing_cavities==True
:Check out the definition of
interp_reg
, which hassource_grid
as a first argument.I'm confused as to why the arguments in the definition are
source_grid, target_grid
, while the arguments in the function call aremodel_grid, source_grid
.I know that python has keyword arguments as well, but don't you have to call them with a keyword and an equals sign? As far as I understand,
source_grid
andtarget_grid
are positional arguments, but they seem to be reversed between the function call and the function definition. Thanks in advance for any clarification you can provide!