getmaskarray is the proper way to do it.
PEP8
Improving window_mean_2D, now wmean_2D.
Updating import for the new structure.