Ocean Color Forum - Not logged in
Is there any way of resampling L2 images into a predefined grid (XY extents, cellsize, equidistant spacing) in command mode?
If yes, what are the methods available? I'm looking for a method which does not change the original values (something like the nearest neighbour).
Reading your post I'm not exactly sure what you're looking for. I'm not a "resampling" expert, but 3 options come to mind:
1) You could use the SeaDAS mapimg
command to transform your L2 data to an array of any size you like and use a projection that gives you equidistant spacing. There will be no gaps or interpolation between pixels because the projection code will just repeat pixel values to fill the resultant image.
2) You could use the SeaDAS l2bin
command, setting the resolution to 0.5, 1, 2, 4, 9, or 36 kilometer resolution. Here the resultant image could have missing pixels due to unfilled bins, or some pixels could be the average of multiple pixels that all fell within the same bin.
3) You could do a straight resampling of the data using a preexisting IDL function (I'm not sure the one you're looking for exists, but maybe read the help for procedures like triangulate
, etc.), or write your own code, or I seem to remember Matlab having a good resampling function.
I know this may not help much but if you can explain exactly what you're trying to do maybe someone can give more help.
Your post is very helpfull, at least it gives me an idea of where to start.
More specifically, I'm looking for a function that resamples the daily MODIS (or whatever) images, which have different pixel resolutions and grid sizes (differente day by day) to a fixed grid with a predefined resolution, extent and grid size (rows\cols). My preference is a function which does not average values (i.e. keeps the original values) and if an output pixel has no correspondence than it is not filled (NaN or -1).
About Matlab, i use a function user developed which does not come in the ML package using the nearest neighbour method and which has some limitations.
Thanks and Regards,
It sounds like the GUI map projection function / mapimg command
might be perfect for you. You can simply map project each satellite pass using the same output options to create images with matching lat/lon extents, resolution, etc.
The mapimg projection function would probably solve my problem. I am trying to resample a daily MODIS AQUA image to a predefined grid with [36 44 ; -12 -6.500002] coordinate boundaries, with an equal spacing of 0.00833330 degrees and size [661 961].
The problem is that grid is not equally spaced and the output min and max coordinates do not match exactly my predefined grid boundaries. For the 1st part, the isotropic option does not solve the problem as the boundaries drive further away from the ones predefined. For the 2nd part, can it be related to projection parameters?
I used the Widget all the time and tested only in one file.
I have another question, what is the interpolation method? Does it fill the blanks, does it average a few pixels that match a specific output pixel?
Uses linear interpolation to fill blanks and do average.