Hello everyone. I made a subset from the SLC data of Sentinel 1 and found that directly reading the. img file in MATLAB is different from converting this subset into a geotiff file (simply use Export-GeoTIFF). I want to know why? Here are the MATLAB code, original files, and results:
MATLAB code for .img data:
‘’’
f = ‘D:\Destkop\SLC_SDV\test\subset_0_of_subset_9_of_S1A_IW2_SLC__1SDV_20151125T233123_20151125T233136_008768_00C7F0_D298.data’;
Column =279;
Row = 191;
path=strcat(f,‘\i_IW2_VH.img’);
fid=fopen(path,‘rb’);
VH_real=fread(fid,[Column,Row],‘int16’);
VH_real=VH_real.';
fclose(fid);
path=strcat(f,‘\q_IW2_VH.img’);
fid=fopen(path,‘rb’);
VH_imag=fread(fid,[Column,Row], ‘int16’);
VH_imag=VH_imag.';
fclose(fid);
VHtest=VH_real+1i.*VH_imag;
path=strcat(f,‘\i_IW2_VV.img’);
fid=fopen(path,‘rb’);
VV_real=fread(fid,[Column,Row],‘int16’);VV_real=VV_real.';
fclose(fid);
path=strcat(f,‘\q_IW2_VV.img’);
fid=fopen(path,‘rb’);
VV_imag=fread(fid,[Column,Row],‘int16’);VV_imag=VV_imag.';
fclose(fid);
VVtest=VV_real+1i.*VV_imag;
figure(1); imshow(abs(VHtest),[]);title(‘106E-IW2-VH’);
figure(2); imshow(abs(VVtest),[]);title(‘106E-IW2-VV’);
‘’’
MATLAB code for .tif data:
‘’’
folder_path = ‘D:\Destkop\SLC_SDV\test\subset_0_of_subset_9_of_S1A_IW2_SLC__1SDV_20151125T233123_20151125T233136_008768_00C7F0_D298.tif’;
img=imread(folder_path);
vh_img = img(:,:,1:2);
VHtest=vh_img(:,:,1) + 1i*vh_img(:,:,2);
vv_img = img(:,:,3:4);
VVtest=vv_img(:,:,1) + 1i*vv_img(:,:,2);
figure(1); imshow(abs(VHtest),[]);title(‘VH’);
figure(2); imshow(abs(VVtest),[]);title(‘VV’);
‘’’
here are the results for .img:
here are the results for .tif:
here are the code and files.
data -.zip (1.5 MB)
The values of. tif and. img do not appear to be ordinary mappings in MATLAB. Because I found that only part of the data I thought of as Linear map law met.