1 | ;------------------------------------------------------------ |
---|
2 | ;------------------------------------------------------------ |
---|
3 | ;------------------------------------------------------------ |
---|
4 | ;+ |
---|
5 | ; |
---|
6 | ; @file_comments |
---|
7 | ; Allows to pass from a 2d depth sill array to a 3d array of mask |
---|
8 | ; with one of levels above the sill depth and 0s below. |
---|
9 | ; |
---|
10 | ; @categories |
---|
11 | ; Without loop |
---|
12 | ; |
---|
13 | ; @param TAB {type=3d array} |
---|
14 | ; 2d sill depth array (or a structure respecting litchamp critrions) |
---|
15 | ; |
---|
16 | ; @keyword _EXTRA |
---|
17 | ; used to pass your keywords |
---|
18 | ; |
---|
19 | ; @returns |
---|
20 | ; It is a 3d array containing the mas associated to the 2d sill depth array |
---|
21 | ; |
---|
22 | ; @uses |
---|
23 | ; common.pro |
---|
24 | ; |
---|
25 | ; @history |
---|
26 | ; Sebastien Masson (smasson\@lodyc.jussieu.fr) |
---|
27 | ; 17/6/1999 |
---|
28 | ; |
---|
29 | ; @version |
---|
30 | ; $Id$ |
---|
31 | ; |
---|
32 | ;- |
---|
33 | ;------------------------------------------------------------ |
---|
34 | ;------------------------------------------------------------ |
---|
35 | ;------------------------------------------------------------ |
---|
36 | FUNCTION depth2mask, tab, _extra = ex |
---|
37 | ;------------------------------------------------------------ |
---|
38 | ; |
---|
39 | compile_opt idl2, strictarrsubs |
---|
40 | ; |
---|
41 | tempsun = systime(1) ; For key_performance |
---|
42 | @common |
---|
43 | ;------------------------------------------------------------ |
---|
44 | ; We transform the 2d deth value in a 2d array of levels corresponding to depthes |
---|
45 | ;------------------------------------------------------------ |
---|
46 | niveaux = depth2level(tab, _extra = ex) |
---|
47 | IF niveaux[0] EQ -1 THEN return, -1 |
---|
48 | ;------------------------------------------------------------ |
---|
49 | ; We transform the 2d array in a 3d array of mask |
---|
50 | ;------------------------------------------------------------ |
---|
51 | mask = level2mask(niveaux) |
---|
52 | ;------------------------------------------------------------ |
---|
53 | if keyword_set(key_performance) NE 0 THEN print, 'temps depth2mask', systime(1)-tempsun |
---|
54 | return, mask |
---|
55 | end |
---|