Borrar filtros
Borrar filtros

Im having a ASCAT satellite data and i need to regrid 500m resolution data to 2.225 km .

12 visualizaciones (últimos 30 días)
Since the satellite data are available in different resolutions and projections, all the data were resampled to 2.225-km spatial resolution and in the BYU projection for comparative analysis. please provide a code for this regridding.

Respuestas (1)

Keerthi Reddy
Keerthi Reddy el 30 de Jun. de 2023
Hi Amrutha, here is a sample code which you may use, but please, make sure to add necessary changes wherever required.
% Load the satellite data
% Assuming you have a variable named 'satelliteData' containing the original data
% Define the desired resolution and projection
targetResolution = 2.225; % in kilometers
targetProjection = 'BYU'; % replace with the desired projection name
% Define the grid for the target resolution
targetGridSize = 1 / targetResolution; % grid size in degrees
targetLatitudes = -90:targetGridSize:90;
targetLongitudes = -180:targetGridSize:180;
% Create a meshgrid for the target grid
[lonTarget, latTarget] = meshgrid(targetLongitudes, targetLatitudes);
% Resample the satellite data to the target grid
regriddedData = interp2(lonOriginal, latOriginal, satelliteData, lonTarget, latTarget, 'linear');
% Plot the regridded data
imagesc(targetLongitudes, targetLatitudes, regriddedData);
colorbar;
title('Regridded Satellite Data');
xlabel('Longitude');
ylabel('Latitude');
The variables latOriginal and lonOriginal contain the original longitude and latitude values of the satellite data. Also to mention, the above code uses bilinear interpolation, you can feel free to use any kind of interpolation method that suits your data.
I hope this helps.
  1 comentario
amrutha anna
amrutha anna el 5 de Jul. de 2023
as im using this codes, it is showing error as unrecognised function lonOrginial. so i modified the code as given below
% Load the satellite data
% Assuming you have a variable named 'satelliteData' containing the original data
% Define the original grid size (in meters)
originalGridSize = 500;
% Define the desired resolution and projection
targetResolution = 2.225; % in kilometers
targetProjection = 'BYU'; % replace with the desired projection name
% Define the grid for the target resolution
targetGridSize = 1 / targetResolution; % grid size in degrees
targetLatitudes = -90:targetGridSize:90;
targetLongitudes = -180:targetGridSize:180;
% Create a meshgrid for the target grid
[lonTarget, latTarget] = meshgrid(targetLongitudes, targetLatitudes);
% Define the original grid for the satellite data
originalLatitudes = -90:originalGridSize/1000:90;
originalLongitudes = -180:originalGridSize/1000:180;
[lonOriginal, latOriginal] = meshgrid(originalLongitudes, originalLatitudes);
% Resample the satellite data to the target grid
regriddedData = interp2(lonOriginal, latOriginal, satelliteData, lonTarget, latTarget, 'linear');
% Plot the regridded data
imagesc(targetLongitudes, targetLatitudes, regriddedData);
colorbar;
title('Regridded Satellite Data');
still, it is showing error as error using griddedinterpolant Sample value must be of type double or single
please provide a solution for this.

Iniciar sesión para comentar.

Categorías

Más información sobre Scenario Generation and Visualization en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by