Commit 75e21a6241d6e65fb771637e8d3a51a23665508c
1 parent
f3236ab4
Exists in
master
made consistent with JPBLib
Showing
1 changed file
with
13 additions
and
8 deletions
Show diff stats
src/idl_extern/JPBLib_for_Dustemwrap/Image_Processing/enlarge.pro
1 | -FUNCTION enlarge,ind,Npix,sx,sy,remove_seed=remove_seed | |
1 | +FUNCTION enlarge,ind,Npix,sx,sy,remove_seed=remove_seed,remove_these=remove_these,count=count | |
2 | 2 | |
3 | 3 | ;+ |
4 | 4 | ; NAME: |
... | ... | @@ -10,10 +10,11 @@ FUNCTION enlarge,ind,Npix,sx,sy,remove_seed=remove_seed |
10 | 10 | ; the area selected is enlarged by neighbor pixels |
11 | 11 | ; INPUTS: |
12 | 12 | ; ind = index of the region |
13 | -; Npix = number of pixels to extend | |
14 | -; sx, sy = size of the array in x and y | |
13 | +; Npix = number of pixels to extend | |
14 | +; sx, sy = size of the array in x and y | |
15 | 15 | ; OPTIONAL INPUT: |
16 | -; | |
16 | +; remove_seed = if set, the initial indices are not included in the output | |
17 | +; remove_these = if set, this is a map sx,sy which values not at 0 will be removed in the output | |
17 | 18 | ; OUTPUTS: |
18 | 19 | ; modified index |
19 | 20 | ; SUBROUTINE AND PROCEDURE USED |
... | ... | @@ -27,7 +28,7 @@ FUNCTION enlarge,ind,Npix,sx,sy,remove_seed=remove_seed |
27 | 28 | |
28 | 29 | |
29 | 30 | if n_params() eq 0 then begin |
30 | - print,'Calling sequence: ind2=enlarge(ind,Npix,sx,sy)' | |
31 | + print,'Calling sequence: ind2=enlarge(ind,Npix,sx,sy[,/remove_seed][remove_these=])' | |
31 | 32 | goto,sortie |
32 | 33 | endif |
33 | 34 | |
... | ... | @@ -89,12 +90,16 @@ ENDIF ELSE BEGIN |
89 | 90 | ENDELSE |
90 | 91 | |
91 | 92 | IF keyword_set(remove_seed) THEN BEGIN |
92 | - work(ind)=0 | |
93 | + work[ind]=0 | |
94 | +ENDIF | |
95 | +IF keyword_set(remove_these) THEN BEGIN | |
96 | + ind_remove=where(remove_these NE 0,count_remove) | |
97 | + IF count_remove NE 0 THEN work[ind_remove]=0 | |
93 | 98 | ENDIF |
94 | 99 | |
95 | -indout=where(work EQ 1) | |
100 | +indout=where(work EQ 1,count) | |
96 | 101 | |
97 | -return,indout | |
102 | +RETURN,indout | |
98 | 103 | |
99 | 104 | sortie: |
100 | 105 | ... | ... |