comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Is there a better way?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Is there a better way? [message #9170] Tue, 10 June 1997 00:00
Kelly Dean is currently offline  Kelly Dean
Messages: 92
Registered: March 1997
Member
Is there a better way to locate a value in a table (or array)? I would
like to come in with an array of radaince values and convert them to
temperatures. The method below only takes the one number (rad) then
search for the best match in the table (or array).

If you can thing of a better method, send me a note.

Kelly Dean
dean@cira.colostate.edu

=================================================
FUNCTION IS_THERE_A_BETTER_WAY, rad

WVTEMParr = FINDGEN(200) + 170.

WVRADarr = FLTarr(200)
WVRADarr(0:9) = [ 0.015, 0.016, 0.018, 0.019, 0.020, 0.022,
0.024, 0.025, 0.027, 0.029 ]
WVRADarr(10:19) = [ 0.031, 0.034, 0.036, 0.039, 0.041, 0.044,
0.047, 0.050, 0.053, 0.057 ]
WVRADarr(20:29) = [ 0.061, 0.064, 0.069, 0.073, 0.077, 0.082,
0.087, 0.092, 0.098, 0.104 ]
WVRADarr(30:39) = [ 0.110, 0.116, 0.122, 0.129, 0.137, 0.144,
0.152, 0.160, 0.169, 0.178 ]
WVRADarr(40:49) = [ 0.187, 0.197, 0.207, 0.218, 0.229, 0.241,
0.253, 0.265, 0.278, 0.292 ]
WVRADarr(50:59) = [ 0.306, 0.320, 0.335, 0.351, 0.367, 0.384,
0.401, 0.420, 0.438, 0.458 ]
WVRADarr(60:69) = [ 0.478, 0.499, 0.520, 0.542, 0.565, 0.589,
0.614, 0.639, 0.665, 0.692 ]
WVRADarr(70:79) = [ 0.720, 0.749, 0.779, 0.809, 0.841, 0.873,
0.907, 0.941, 0.977, 1.013 ]
WVRADarr(80:89) = [ 1.051, 1.090, 1.129, 1.170, 1.212, 1.256,
1.300, 1.346, 1.393, 1.441 ]
WVRADarr(90:99) = [ 1.490, 1.541, 1.593, 1.647, 1.701, 1.758,
1.815, 1.874, 1.935, 1.997 ]
WVRADarr(100:109) = [ 2.060, 2.125, 2.192, 2.260, 2.330, 2.401,
2.474, 2.549, 2.626, 2.704 ]
WVRADarr(110:119) = [ 2.784, 2.866, 2.949, 3.034, 3.122, 3.211,
3.302, 3.395, 3.490, 3.586 ]
WVRADarr(120:129) = [ 3.685, 3.786, 3.889, 3.994, 4.101, 4.210,
4.322, 4.435, 4.551, 4.669 ]
WVRADarr(130:139) = [ 4.790, 4.912, 5.037, 5.164, 5.294, 5.426,
5.560, 5.697, 5.836, 5.978 ]
WVRADarr(140:149) = [ 6.122, 6.269, 6.418, 6.570, 6.724, 6.881,
7.041, 7.203, 7.369, 7.536 ]
WVRADarr(150:159) = [ 7.707, 7.880, 8.057, 8.236, 8.418, 8.602,
8.790, 8.981, 9.174, 9.371 ]
WVRADarr(160:169) = [ 9.570, 9.773, 9.978, 10.187, 10.399, 10.614,
10.832, 11.053, 11.277, 11.505 ]
WVRADarr(170:179) = [11.736, 11.970, 12.207, 12.448, 12.692, 12.939,
13.190, 13.444, 13.701, 13.962 ]
WVRADarr(180:189) = [14.226, 14.494, 14.766, 15.040, 15.319, 15.601,
15.886, 16.176, 16.468, 16.765 ]
WVRADarr(190:199) = [17.065, 17.369, 17.676, 17.988, 18.303, 18.622,
18.944, 19.271, 19.601, 19.935 ]

FOR i = 0 ,198 DO BEGIN
IF ( rad GT WVRADarr(i) AND rad LE WVRADarr(i+1) ) THEN BEGIN
TempK = WVTEMParr(i)
ENDIF
ENDFOR

RETURN, TempK
END
[Message index]
 
Read Message
Previous Topic: Outputting to E-sized Postscript files?
Next Topic: Call_external

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 05:58:36 PDT 2025

Total time taken to generate the page: 0.24386 seconds