Here's what I've done that's got me to the point of totally confused: Start with A2016316180000.L1A_LAC -> modis_GEO.py -> modis_L1A_extract.py (24 to 26 Lat, -83 to -80 Lon) -> modis_L1B.py -> l2gen with all defaults except resolution=250. Note this extraction is very near the scan edge to highlight my problems. Also, I'm showing reprojections at 250m resolution, even though I recognize that even Rrs(645) does not have that fine resolution near the scan edge. The same effects are seen for HKM resolution projections, they're just not as obvious...
Anyway, I can mosaic this file to the default projection (with the specified bounds above and 0.0022727 pixel resolution [approx 250m] - see attached .xml), and output Rrs(645) to .png [mosaic_nearest.png]. If I retry this after changing the resampling method in the .xml to either 'Bicubic' or 'Bilinear', I get the exact same image [mosaic_bilinear.png; mosaic_bicubic.png]. I don't see how this is possible, unless the bilinear / bicubic methods are parameterized such that they do not "find" any neighbors for interpolation around each pixel in the output grid. Or perhaps under certain conditions that resampling option is ignored?
Interestingly, I tried the same thing with Reproject (using the GUI, in case my mosaic .xml was messing things up). The Nearest reproject [reproj_nearest.png] looked almost exactly the same as the Nearest mosaic, with just a few speckles filled. The Bilinear and Bicubic options in reproject produced exactly the same values as the nearest for water pixels, but the land and cloud NaNs were dilated a bit [reproj_bilinear.png, reproj_bicubic.png].
Also, per other forum posts, I reran the Nearest reproject after attaching the GEO coding [reproj_nearest_geocode_attached.png]. Here, I can see some changes in the data as well as the masking.
On top of all of this, I've tried several other softwares to reproject these data (using just the latitude, longitude, and Rrs_645 datasets in the L2) to a cylindrical equidistant projection using nearest neighbor and always get the same answer, which is quite different from everything above [pyresample.png]. Note that there are many apparent errors, primarily around the land/cloud edges. To validate that this method was actually nearest neighbor resampling, I tried was physically calculating the nearest neighbor from the lat/lon for each grid point in the output array, and I get the same answer as pyresample.
So, my questions are: What are the (likely fixed) input parameters for the Nearest, Bilinear, and Bicubic methods (i.e., radius of influence, number of neighbors to consider for Bilinear and Bicubic, etc)? Why do these look the same regardless of the selected sampling method (or essentially the same, for reproject)? Most importantly, what latitude and longitude grids are used in mosaic/reproject, since it does not appear to be the latitude and longitude datasets in the L2?
Any documentation / help on this would be greatly appreciated. Thanks in advance.
-brianattachment 1







