3 views (last 30 days)

Show older comments

Walter Roberson
on 14 Aug 2021

If the additional data represents reading being taken at higher resolution, rather than extra readings that can be discarded, then you have three choices:

- You can regrid. That could be by using griddata() or it could be by using interp2();
- You can try to find a function that explains all of the readings. I do not mean a piecewise continuous function; I do not mean fitting a model to the data. I mean a theoretical function based upon external parameters. For example, if you could find that the readings were explained by distance from the Sun and axel tilt and latitude and longitude and a single number representing the intensity of solar flares -- mathematical formulas in which the satellite readings just confirm the formulas. You would never be able to come up with such a thing if the satellite images are rainfall readings for example. Formula in hand, you would discard the readings in the files and just apply the formula at the sets of locations, no regridding needed because the information in the files would be ignored except perhaps datetime.
- You can find all of the positions that match exactly in all of the files (to within round-off error), and use only those, and set the rest of the positions to NaN. For example if one of the files had 1, 3/2, 2, 5/2, 3, and the other had 1, 4/3, 5/3, 2, 7/3, 8/3, 3, then you would see the matching 1, 2, 3 and populate there, and set everything else to nan. No regridding, no interpolation. And if one of the datasets happens to be locations 1:1:10 and the other one happens to be 1.001:1:10.001 then you just throw away all of that data because nothing matches.

In practice, regridding is likely to be your only viable strategy.

Remember, you can find all of the unique locations over all of the files, and take all of those together and regrid to that union of all of the locations: when you do that, then every exact data is used (and each dataset gets extended extrapolation to the additional points not explicitly recorded for it.) regridding does not have to mean that you discard data or merge several pieces of data together. However... this approach is likely to end up with irregularly spaced locations, and that makes statistical area calculations difficult...

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!