dbekaert / StaMPS

Stanford Method for Persistent Scatterers
http://homepages.see.leeds.ac.uk/~earahoo/stamps/
GNU General Public License v3.0
236 stars 120 forks source link

Error in processing using SLCs from ISCE2 #27

Closed bjmarfito closed 3 years ago

bjmarfito commented 3 years ago

I encountered an error after I ran stamps.m using the coregistered SLCs using ISCE.

STAMPS: ########################################
STAMPS: ####### StaMPS/MTI Version 4.0b6 #######
STAMPS: #######  Beta version, Jun 2018  #######
STAMPS: ########################################

STAMPS: Will process current directory only

STAMPS: ########################################
STAMPS: ################ Step 1 ################
STAMPS: ########################################
STAMPS: Directory is PATCH_1

Found inc angle file, will load the data 
Loading data into matlab...
SETPARM: heading = -11.1257
SETPARM: lambda = 0.055466
Unable to perform assignment because the left and
right sides have a different number of elements.

Error in ps_load_initial_isce (line 126)
        caldate(i)=bb;

Error in stamps (line 281)
                    ps_load_initial_isce(data_inc)
S-Nari commented 3 years ago

I encountered completely the same error when I used ISCE2 stack of ALOS stripmap. I have partially modified the script "ps_load_initial_isce.m" as below, and it works well; (I modified the Line 116-126 in the original script.)

if exist(calname,'file')
    [calfile,calconst]=textread(calname,'%s%f');
    caldate=zeros(length(calfile),1);
    for i = 1 : length(calfile)
        aa=strread(calfile{i},'%s','delimiter','/');
        % my modification start (originally, try & catch)
        bb=str2num(aa{end}(1:8));
        if isempty(bb)
            bb=str2num(aa{end-1}(1:8));
            if isempty(bb)
                strcmpi(aa{end-1},'reference');
                bb=str2num(aa{end-2}(end-7:end));
            end            
        end
        % my modification end 
        caldate(i)=bb;
    end
    not_master_ix=caldate~=master_day_yyyymmdd;
    caldate=caldate(not_master_ix);
    calconst=calconst(not_master_ix);
    [Y,I]=sort(caldate);
    calconst=calconst(I);
else
    calconst=ones(n_ifg-1,1);
end
bjmarfito commented 3 years ago

Thank you @S-Nari. I've also done the same modification on the code and it worked properly.

I recommend that you submit a pull request regarding the modification you've made on the code.

hariiirs commented 3 years ago

Thank you @bjmarfito and @S-Nari. I am also using ISCE processor for StaMPS procesisng and fot the exactly same error. Then I have also done the same modification in ps_load_initial_isce.m and it worked properly for stamps(1,1) step. When I ran stamps(2,2) then it showing this error -

Screenshot from 2021-10-07 12-46-37

Kindly help me in this step.

Thanks Hari Shankar

bjmarfito commented 3 years ago

@hariiirs, the developer of StAMPS has not maintained this repository since late 2019. For now, you may use the forked version of StAMPS which I edited to incorporate the new terminologies in ISCE2 such as reference and secondary. I've also included the corrections made by @S-Nari on the forked version.

Here is the link: https://github.com/bjmarfito/StaMPS

S-Nari commented 3 years ago

Hi @hariiirs.

Do you have Signal Processing Toolbox ? It seems that Signal Processing Toolbox is not installed in your machine. The function 'gausswin' belongs to Signal Processing Toolbox (http://matlab.izmiran.ru/help/toolbox/signal/gausswin.html).

bjmarfito commented 3 years ago

@S-Nari, you're correct. I am closing this issue since this has been solved already.

hariiirs commented 3 years ago

Hi @bjmarfito. Thak you very much for your help. Now I will try your corrected version.

@S-Nari. Yes signal processing toolbox is already installed in matlab. I have installed the following toolboxes

1) Image processing Toolbox 2) Signal Processing Toolbox 3) Statictics and Machine Learning Toolbox 4) Optimization 5) Maping Toolbox 6) Curve Fitting

hariiirs commented 3 years ago

Hi All

I re-installed matlab with all above tollboxes. Now its working fine.

One more thing whic I experienced is with Ubuntu 20.04 users. If anybody using Ubuntu 20.04 or above OR upgrading Ubuntu from Ubuntu 18.04 to Ubuntu 20.04, then you just have to change the return type from 'int' to 'void' for cshortswap, shortswap, cfloatswap, floatswap, and longswap functions in these three files (Calamp.c, selpsc_patch.c, and selsbc_patch.c) which are available under StaMPS/src folder. In C and C++ it is forbidden to not explicitly return something in a function whose return type is not void.

For information to all concern.