ers sar raw data extraction and image formation -凯发k8网页登录
this example shows the steps to extract the european remote sensing (ers) synthetic aperture radar (sar) system parameters, unfocused raw data and form a focused image from raw data using range migration image formation algorithm.
ers dataset is nasa’s provision of the european space agency’s ers satellites (ers-1 and ers-2) sar data. as part of the earth observation heritage data program (ltdp ), the ers missions provide scientists with historically accurate and easily accessible information to help further understand the dynamics of our planet. ers dataset contains raw unfocused data along with system parameters file which can be used to generate focused image of the scene.
to illustrate this workflow, ers dataset published by the nasa's alaska satellite facility (asf) [1] is used. the dataset is available for download . our goal is to develop a model to generate a focused image from the raw data.
download dataset
this example uses ers dataset containing committee on earth observation satellites (ceos) standard files namely: leader file (.ldr), level zero frame data file (.raw), volume descriptor file (.vol), processing information file (.pi), metadata file (.meta) and null file (.nul). the ceos leader file contains relevant metadata information to be able to process the sar data (.raw) it accompanies. level zero frame data file (.raw) contains binary sar signal data collected after processing the analog sar signal. the volume descriptor is part of the ceos frame distribution, containing a short summary about the processing. the processing information file provides information on the ceos conversion describing the data set itself as well as its location on the system. the metadata file is an ascii file that contains most of the metadata needed for using the asf software tools. the null volume directory file is part of the ceos frame distribution. it is used to terminate a logical data volume.
download the dataset from the given url using the helperdownloadersdata
helper function. the size of dataset is 134 mb. ersdata.zip
contains three files namely: leader file, raw file, and license file.
outputfolder = pwd; dataurl = ['https://ssd.mathworks.com/supportfiles/radar/data/' ... 'ersdata.zip']; helperdownloadersdata(outputfolder,dataurl);
depending on your internet connection, the download process can take some time. the code suspends matlab® execution until the download process is complete. alternatively, you can download the data set to your local disk using your web browser and extract the file. if you do so, change the outputfolder
variable in the code to the location of the downloaded file.
parameter extraction
sar image formation involves extracting the parameters from the parameter file (e2_84699_std_l0_f299.000.ldr) given with raw data file. the parameter file contains satellite and scene specific data which is required to form the image. several parameters like pulse repetition frequency, wavelength, sampling rate, pulsewidth of the chirp signal, range gate delay and velocity of the sensor are extracted from the parameter file according to their specific addresses given in the description of the parameter file. other parameters like effective velocity, minimum distance, chirp bandwidth and chirp frequency are estimated using the data extracted from the parameter file.
in this example, system parameters are extracted using the helper function ersparameterextractor
which takes e2_84699_std_l0_f299.000.ldr as an input file.
c = physconst('lightspeed'); % speed of light % extract ers system parameters [fs,fc,prf,tau,bw,v,ro,fd] = ersparameterextractor('e2_84699_std_l0_f299.000.ldr');
raw data extraction
raw data is extracted from the data file (e2_84699_std_l0_f299.000.raw) having a total of 28652 lines and 11644 bytes per line. in each line, header consists of 412 bytes and remaining 11232 bytes (5616 complex) of data for each echo. for the ers radar, the synthetic aperture is 1296 points long. therefore, the helper function ersdataextractor
reads 2048 rows since it is a power of 2. using 80% beamwidth the helper function calculates valid azimuthal points and takes overlapping patches.
in this example, unfocused raw data is extracted using the helper function which takes e2_84699_std_l0_f299.000.raw as an input file along with system parameters.
% extract raw data rawdata = ersdataextractor('e2_84699_std_l0_f299.000.raw',fs,fc,prf,tau,v,ro,fd).';
sar image formation
the next step is to generate single-look complex (slc) image using the extracted system parameters and unfocused raw data. for the ers-radar, a linear frequency modulated chirp is emitted by the radar. the phased.linearfmwaveform
system object creates a linear fm pulse waveform using the extracted system parameters. squint angle is calculated using doppler frequency which is close to zero for the ers system. range migration image formation algorithm is a frequency domain algorithm also known as wavenumber domain processing method. use rangemigrationlfm
function to focus the raw data to slc image.
sar slc image is characterized by speckle which can be modeled as a multiplicative noise, resulting in salt and pepper appearance of sar image.
% create lfm waveform waveform = phased.linearfmwaveform('samplerate',fs,'prf',prf,'pulsewidth',tau,'sweepbandwidth',bw,'sweepinterval','symmetric'); sqang = asind((c*fd)/(2*fc*v)); % squint angle % range migration algorithm slcimg = rangemigrationlfm(rawdata,waveform,fc,v,ro,'squintangle',sqang); % display image figure(1) imagesc(log(abs(slcimg))) axis image colormap('gray') title('slc image') ylabel('range bin') xlabel('azimuth bin')
multi-look processing
the effect of speckle is reduced by performing multi-look processing by making a trade-off for image resolution. either in range or azimuth direction or in both the directions, subsequent lines are averaged to get a better image with reduced speckle. the multi-looking can be performed either in range or azimuth or both the direction.
the helper function multilookprocessing
performs averaging in range and azimuth direction with number of looks 4 and 20 respectively.
mlimg = multilookprocessing(abs(slcimg),4,20); % display image figure(2) imagesc(log(abs(mlimg(1:end-500,:)))) axis image colormap('gray') title('multi-look image') ylabel('range bin') xlabel('azimuth bin')
summary
this example shows how to extract the system parameters such as pulse repetition frequency, wavelength, sampling rate, pulsewidth of the chirp signal, range gate delay, velocity of the sensor and raw data. then the range migration image formation algorithm is used to focus the raw data. finally, the multi-look processing is applied to remove the multiplicative noise.
helper functions
ersparameterextractor
function [fs,fc,prf,tau,bw,veff,ro,fdop] = ersparameterextractor(file) % open the parameter file to extract required parameters fid = fopen(file,'r'); % radar wavelength (satellite specific) status = fseek(fid,720 500,'bof'); lambda = str2double(fread(fid,[1 16],'*char')); % wavelength (m) % pulse repetition frequency (satellite specific) status = fseek(fid,720 934,'bof')|status; prf = str2double(fread(fid,[1 16],'*char')); % prf (hz) % range sampling rate (satellite specific) status = fseek(fid,720 710,'bof')|status; fs =str2double(fread(fid,[1 16],'*char'))*1e 06; % sampling rate (hz) % range pulse length (satellite specific) status = fseek(fid,720 742,'bof')|status; tau = str2double(fread(fid,[1 16],'*char'))*1e-06; % pulse width (sec) % range gate delay to first range cell status = fseek(fid,720 1766,'bof')|status; rangegatedelay = str2double(fread(fid,[1 16],'*char'))*1e-03; % range gate delay (sec) % velocity x status = fseek(fid,720 1886 452,'bof')|status; xvelocity = str2double(fread(fid,[1 22],'*char')); % xvelocity (m/sec) % velocity y status = fseek(fid,720 1886 474,'bof')|status; yvelocity = str2double(fread(fid,[1 22],'*char')); % yvelocity (m/sec) % velocity z status = fseek(fid,720 1886 496,'bof')|status; zvelocity = str2double(fread(fid,[1 22],'*char')); % zvelocity (m/sec) fclose(fid); % checking for any file error if(status==1) fs = nan; fc = nan; prf = nan; tau = nan; bw = nan; veff = nan; ro = nan; fdop = nan; return; end % values specific to ers satellites slope = 4.19e 11; % slope of the transmitted chirp (hz/s) h = 790000; % platform altitude above ground (m) fdop = -1.349748e 02; % doppler frequency (hz) % additional parameters re = 6378144 ; % earth radius (m) % min distance ro = time2range(rangegatedelay); % min distance (m) % effective velocity v = sqrt(xvelocity^2 yvelocity^2 zvelocity^2); veff = v*sqrt(re/(re h)); % effective velocity (m/sec) % chirp frequency fc = wavelen2freq(lambda); % chirp frequency (hz) % chirp bandwidth bw = slope*tau; % chirp bandwidth (hz) end
ersdataextractor
function rawdata = ersdataextractor(datafile,fs,fc,prf,tau,v,ro,doppler) c = physconst('lightspeed'); % speed of light % values specific to data file totlines = 28652; % total number of lines numlines = 2048; % number of lines numbytes = 11644; % number of bytes of data numhdr = 412; % header size nvalid = (numbytes-numhdr)/2 - round(tau*fs); % valid range samples % antenna length specific to ers l = 10; % calculate valid azimuth points range = ro (0:nvalid-1) * (c/(2*fs)); % computes range perpendicular to azimuth direction rdc = range/sqrt(1-(c*doppler/(fc*(2*v))^2)); % squinted range azbeamwidth = rdc * (c/(fc*l)) * 0.8; % use only 80% aztau = azbeamwidth / v; % azimuth pulse length nptsaz = ceil(aztau(end) * prf); % use the far range value validazpts = numlines - nptsaz ; % valid azimuth points % start extracting fid = fopen(datafile,'r'); status = fseek(fid,numbytes,'bof'); % skipping first line numpatch = floor(totlines/validazpts); % number of patches if(status==-1) rawdata = nan; return; end rawdata=zeros(numpatch*validazpts,nvalid); % patch data extraction starts for patchi = 1:numpatch fseek(fid,11644,'cof'); data = fread(fid,[numbytes,numlines],'uint8')'; % reading raw data file % interpret as complex values and remove mean data = complex(data(:,numhdr 1:2:end),data(:,numhdr 2:2:end)); data = data - mean(data(:)); rawdata((1:validazpts) ((patchi-1)*validazpts),:) = data(1:validazpts,1:nvalid); fseek(fid,numbytes numbytes*validazpts*patchi,'bof'); end fclose(fid); end
multilookprocessing
function image = multilookprocessing(slcimg,sx,sy) [nx,ny] = size(slcimg); nfx = floor(nx/sx); nfy = floor(ny/sy); image = (zeros(nfx,nfy)); for i=1:nfx for j = 1:nfy fimg=0; for ix = 1:sx for jy = 1:sy fimg = fimg slcimg(((i-1)*sx) ix,((j-1)*sy) jy); end end image(i,j) = fimg/(sx*sy); end end end
helperdownloadersdata
function helperdownloadersdata(outputfolder,dataurl) % download the data set from the given url to the output folder. radardatazipfile = fullfile(outputfolder,'ersdata.zip'); if ~exist(radardatazipfile,'file') disp('downloading ers data (134 mib)...'); websave(radardatazipfile,dataurl); unzip(radardatazipfile,outputfolder); end end
references
[1] dataset: ers-2, esa 2011. retrieved from 10 november 2021.