Last change
on this file since 232 was
231,
checked in by pinsard, 17 years ago
|
improvements/corrections of some *.pro headers
|
-
Property svn:eol-style set to
native
-
Property svn:keywords set to
Id
|
File size:
1.1 KB
|
Line | |
---|
1 | ;+ |
---|
2 | ; |
---|
3 | ; @file_comments |
---|
4 | ; We want, from a 3d matrix, to extract a 2d (x,y) array whose each element |
---|
5 | ; has been extract from a level specified by the 2d level array (typically, |
---|
6 | ; we want to obtain the salinity along an isopycn we have repered by its level). |
---|
7 | ; level2index is a function who give, in function of level, a 2d indexes array |
---|
8 | ; which will allow to extract the 2d array from the 3d array... |
---|
9 | ; |
---|
10 | ; @categories |
---|
11 | ; Without loop |
---|
12 | ; |
---|
13 | ; @param LEVEL {in}{required}{type=2d array} |
---|
14 | ; A 2d level array |
---|
15 | ; |
---|
16 | ; @returns |
---|
17 | ; a 2d indexes array |
---|
18 | ; |
---|
19 | ; @history |
---|
20 | ; Sebastien Masson (smasson\@lodyc.jussieu.fr) |
---|
21 | ; 24/11/1999 |
---|
22 | ; |
---|
23 | ; @version |
---|
24 | ; $Id$ |
---|
25 | ; |
---|
26 | ;- |
---|
27 | ; |
---|
28 | FUNCTION level2index, level |
---|
29 | ; An element of 3d array (whose the two first dimensions are nx and ny) whose |
---|
30 | ; coordinates are i, j and k have for index in the same 3d array i + j*nx + k*(nx*ny) |
---|
31 | ; level given, for each point of level, we know i, j et k, |
---|
32 | ; so we can calculate the index |
---|
33 | ; |
---|
34 | compile_opt idl2, strictarrsubs |
---|
35 | ; |
---|
36 | taille = size(level) |
---|
37 | nx = taille[1] |
---|
38 | ny = taille[2] |
---|
39 | ; array k*(nx*ny) |
---|
40 | tabknxny = (nx*ny)*long(level) |
---|
41 | ; |
---|
42 | ; |
---|
43 | return, lindgen(nx, ny)+tabknxny |
---|
44 | end |
---|
Note: See
TracBrowser
for help on using the repository browser.