source: trunk/inv_mask.pro

Last change on this file was 48, checked in by pinsard, 10 years ago

fix thanks to coding rules

File size: 857 bytes
Line 
1;+
2; NAME: inv_mask.pro
3;
4; PURPOSE: Puts 0 where mask is equal to 1 and vice versa
5;
6; CATEGORY: Function
7;
8; CALLING SEQUENCE: inv_mask, mask
9;
10; INPUTS:
11;          mask : mask field composed of 0 and 1 values
12;
13; KEYWORD PARAMETERS: None
14;
15; OUTPUTS:
16;          mask : mask field composed of 0 and 1 values
17;                 inverted
18;
19; COMMON BLOCKS: None
20;
21; SIDE EFFECTS:
22;
23; RESTRICTIONS:
24;
25; EXAMPLE:
26;
27; MODIFICATION HISTORY: 11/99 A. Jouzeau
28;
29;-
30;------------------------------------------------------------
31;------------------------------------------------------------
32;------------------------------------------------------------
33FUNCTION inv_mask, mask
34printf, 40, ''
35printf, 40, 'Entering inv_mask'
36z = mask
37stop
38zero = where(mask EQ 0)
39one = where(mask EQ 1)
40z[zero] = 1
41z[one] = 0
42printf, 40, ''
43printf, 40, 'Inversion done'
44return, z
45END
Note: See TracBrowser for help on using the repository browser.