Changeset 502


Ignore:
Timestamp:
10/11/16 20:40:46 (8 years ago)
Author:
smasson
Message:

bugfix in extrapolate for 1d array andwhen using smwin

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SRC/Interpolation/extrapolate.pro

    r495 r502  
    7171; check the number of iteration used in the extrapolation. 
    7272  szin = size(zinput) 
     73  IF szin[0] EQ 1 THEN BEGIN 
     74    zinput = reform(zinput, szin[1], 1) 
     75    maskinput = reform(maskinput, szin[1], 1) 
     76    szin = size(zinput) 
     77    fillxdir = 1 
     78  ENDIF 
     79   
    7380  IF szin[0] NE 2 THEN return, -1. ELSE szin = szin[1:2] 
    7481  nx = szin[0] 
    7582  ny = szin[1] 
    7683  IF n_elements(nb_iteration) EQ 0 THEN nb_iteration = max(szin) 
     84  IF n_elements(smwin) EQ 0 THEN smwin = 0 
     85  smwin = smwin < min(szin) 
     86  IF n_elements(nsmooth) EQ 0 THEN nsmooth = 25 
     87  IF smwin GT 1 AND nsmooth NE 0 THEN nb_iteration = max(szin) 
    7788  IF nb_iteration EQ 0 THEN return, zinput 
    7889; take care of the boundary conditions... 
     
    231242; smooth the filled values 
    232243;--------------------------------------------------------------- 
    233   IF n_elements(smwin) EQ 0 THEN smwin = 0 
    234   IF smwin EQ 0 OR smwin EQ 1 THEN return, z 
    235   IF n_elements(nsmooth) EQ 0 THEN nsmooth = 25 
    236   IF nsmooth EQ 0 THEN return, z 
     244  IF smwin LE 1 OR nsmooth EQ 0 THEN return, z 
    237245 
    238246; add extra bands to avoid edge errors... 
Note: See TracChangeset for help on using the changeset viewer.