A complicate problem for building a map [message #36690] |
Wed, 15 October 2003 10:51  |
ftls1
Messages: 4 Registered: October 2003
|
Junior Member |
|
|
I met a problem of map building as below,
I have two 2-D tables of RT(nw,nt), RW(nw,nt), nw and nt are
constants,
both RT and RW range from -1 to +1, the value of nw, even though it is
'integer',actually means wind speed from
-50 m/s to 50 m/s and the nt means temperature from 0 to 300 K.
Now I want to get a table with x and y axis of RT and RW respectively.
The purpose to build such a table is that if there is an arbitrary
pair
of RW and RT value, I can look it in the table and find the
appropriate
wind and temperature.
I've been thinking on this topic for a couple of weeks without any
idea, in C
language there is a concept of 'Group', but IDL does not.
|
|
|
Re: A complicate problem for building a map [message #36728 is a reply to message #36690] |
Tue, 21 October 2003 15:02  |
ftls1
Messages: 4 Registered: October 2003
|
Junior Member |
|
|
yeah, actually I used the same method as urs, but there was some other
more complicate problems to be sovled. I think it is time to conclude
this discussion here.
Thank you all so much for ideas and what you all have posted!
ftls1@uaf.edu (ftls1@uaf.edu) wrote in message news:<44042ede.0310201352.2e27a979@posting.google.com>...
> yes, I used 'where' function and intersected the two sets to find
> temperature and wind.
>
> the problem is whether this retrieval method was converging? is the
> point the nearst one with least RMS?
>
>
> Olaf Stetzer <olaf.stetzer@imk.fzk.de> wrote in message news:<bn0hn1$fnt$1@news.rz.uni-karlsruhe.de>...
>> ftls1@uaf.edu schrieb:
>>> I met a problem of map building as below,
>>> I have two 2-D tables of RT(nw,nt), RW(nw,nt), nw and nt are
>>> constants,
>>> both RT and RW range from -1 to +1, the value of nw, even though it is
>>> 'integer',actually means wind speed from
>>> -50 m/s to 50 m/s and the nt means temperature from 0 to 300 K.
>>> Now I want to get a table with x and y axis of RT and RW respectively.
>>> The purpose to build such a table is that if there is an arbitrary
>>> pair
>>> of RW and RT value, I can look it in the table and find the
>>> appropriate
>>> wind and temperature.
>>> I've been thinking on this topic for a couple of weeks without any
>>> idea, in C
>>> language there is a concept of 'Group', but IDL does not.
>>
>> I am not sure if I understood you correctly but maybe you can use
>> the where() function to find your information. You want the "cordinates"
>> where:
>> wind = 50 m/s and T= 250 K ?
>>
>> wind_temp_indices=where(RT eq 250 and RW eq 50) ; or use the "coded"
>> ; values for 250 K and 50 m/s instead
|
|
|
Re: A complicate problem for building a map [message #36733 is a reply to message #36690] |
Tue, 21 October 2003 00:33  |
Olaf Stetzer
Messages: 39 Registered: September 2001
|
Member |
|
|
ftls1@uaf.edu schrieb:
> yes, I used 'where' function and intersected the two sets to find
> temperature and wind.
>
> the problem is whether this retrieval method was converging? is the
> point the nearst one with least RMS?
The where function does only logical comparisons, which means you only
get a result if the data contains exactly the values you are looking
for. If you are looking for nearest values you have to calcualte them on
your own, something like:
RT_dev=abs(RT-250) ; nearest values to 250 K
RW_dev=abs(RW-50) ; nearest values to 50 m/s
RTW_dev=RT_dev*RW_dev ; or use smth. like sqrt(RT_dev^2 + RW_dev^2)
; depending on your needs. Then:
wind_temp_indices= where (RTW_dev eq min(RTW_dev))
Olaf
|
|
|
Re: A complicate problem for building a map [message #36735 is a reply to message #36690] |
Mon, 20 October 2003 15:49  |
condor
Messages: 35 Registered: January 2002
|
Member |
|
|
ftls1@uaf.edu (ftls1@uaf.edu) wrote in message news:<44042ede.0310182223.d736129@posting.google.com>...
>>> I've been thinking on this topic for a couple of weeks without any
>>> idea, in C language there is a concept of 'Group', but IDL does not.
>>
>> Unfortunately my understanding of C is on the basic side, and I don't
>> think I have ever heard of a "group" in C, so I don't know what
>> functionality you are looking for. Can you describe what that is
>> supposed to do and maybe someone could tell you how to emulate this in
>> IDL.
>
> sorry, made a typo. what I said is 'Record' in Pascal Language.
Well, it's been a couple years for me since I last looked at Pascal,
but IDL certainly has a record mechanism (I think they're called
"struct"). Here's a couple trivial examples:
;; create a template:
IDL> record = {name: "" , age: 0}
IDL> help,record,/struct
** Structure <81bfda4>, 2 tags, length=16, data length=14, refs=1:
NAME STRING ''
AGE INT 0
;; create an array that holds a hundred of those:
IDL> a = replicate(record,100)
IDL> a[0].name ='fred'
IDL> a[1].name ='bob'
;; they can also be used in the usual array ways:
IDL> a[0:1].age = [35,36]
IDL> print,a[0]
{ fred 35}
IDL> print,a[1]
{ bob 36}
The tags in a struct can also be arrays, if desired, which are indexed
in the obvious way. I.e.
a[0].array[5] is the fifth element of the tag with the
name "array" in the zeroth record, while
a[5].array[0] is the zeroth element of that array in the fifth record.
|
|
|
Re: A complicate problem for building a map [message #36736 is a reply to message #36690] |
Mon, 20 October 2003 14:52  |
ftls1
Messages: 4 Registered: October 2003
|
Junior Member |
|
|
yes, I used 'where' function and intersected the two sets to find
temperature and wind.
the problem is whether this retrieval method was converging? is the
point the nearst one with least RMS?
Olaf Stetzer <olaf.stetzer@imk.fzk.de> wrote in message news:<bn0hn1$fnt$1@news.rz.uni-karlsruhe.de>...
> ftls1@uaf.edu schrieb:
>> I met a problem of map building as below,
>> I have two 2-D tables of RT(nw,nt), RW(nw,nt), nw and nt are
>> constants,
>> both RT and RW range from -1 to +1, the value of nw, even though it is
>> 'integer',actually means wind speed from
>> -50 m/s to 50 m/s and the nt means temperature from 0 to 300 K.
>> Now I want to get a table with x and y axis of RT and RW respectively.
>> The purpose to build such a table is that if there is an arbitrary
>> pair
>> of RW and RT value, I can look it in the table and find the
>> appropriate
>> wind and temperature.
>> I've been thinking on this topic for a couple of weeks without any
>> idea, in C
>> language there is a concept of 'Group', but IDL does not.
>
> I am not sure if I understood you correctly but maybe you can use
> the where() function to find your information. You want the "cordinates"
> where:
> wind = 50 m/s and T= 250 K ?
>
> wind_temp_indices=where(RT eq 250 and RW eq 50) ; or use the "coded"
> ; values for 250 K and 50 m/s instead
|
|
|
Re: A complicate problem for building a map [message #36738 is a reply to message #36690] |
Mon, 20 October 2003 04:42  |
Olaf Stetzer
Messages: 39 Registered: September 2001
|
Member |
|
|
ftls1@uaf.edu schrieb:
> I met a problem of map building as below,
> I have two 2-D tables of RT(nw,nt), RW(nw,nt), nw and nt are
> constants,
> both RT and RW range from -1 to +1, the value of nw, even though it is
> 'integer',actually means wind speed from
> -50 m/s to 50 m/s and the nt means temperature from 0 to 300 K.
> Now I want to get a table with x and y axis of RT and RW respectively.
> The purpose to build such a table is that if there is an arbitrary
> pair
> of RW and RT value, I can look it in the table and find the
> appropriate
> wind and temperature.
> I've been thinking on this topic for a couple of weeks without any
> idea, in C
> language there is a concept of 'Group', but IDL does not.
I am not sure if I understood you correctly but maybe you can use
the where() function to find your information. You want the "cordinates"
where:
wind = 50 m/s and T= 250 K ?
wind_temp_indices=where(RT eq 250 and RW eq 50) ; or use the "coded"
; values for 250 K and 50 m/s instead
|
|
|
Re: A complicate problem for building a map [message #36742 is a reply to message #36690] |
Sat, 18 October 2003 23:23  |
ftls1
Messages: 4 Registered: October 2003
|
Junior Member |
|
|
condor@biosys.net (Big Bird) wrote in message news:<df160b8f.0310161536.3cf83a8a@posting.google.com>...
> ftls1@uaf.edu (ftls1@uaf.edu) wrote in message news:<44042ede.0310150951.71dad28a@posting.google.com>...
>> I met a problem of map building as below,
>> I have two 2-D tables of RT(nw,nt), RW(nw,nt), nw and nt are
>> constants,
>
> i.e. not variables. OK.
>
> Are RT and RW unique? I.e. can there be values in these tables that
> appear more than once.
>
> E.g. is it possible that RT[3,5] = RT[10,15]
yes,some points have the same value in RT and RW respectively.
>
>> both RT and RW range from -1 to +1,
>
> What is the meaning of these numbers? In particular: what is the
> granularity? Are we talking three possible values (-1,0,1) or many
> many values?
many values.
>
>> the value of nw, even though it is
>> 'integer',actually means wind speed from
>> -50 m/s to 50 m/s and the nt means temperature from 0 to 300 K.
>
> Speaking only for myself, at this point you're confusing me. Are they
> constant or are they variable? When you say "0 to 300K" then you seem
> to imply that there's more than one possibility
>
e.g. RT[n,k]= #, where # is the value for RT, n and k are variables
for wind speed and temperature functions respectively.
in another word, the # is RT's value is under a secific wind speed
and temperatue condition.
>> Now I want to get a table with x and y axis of RT and RW respectively.
>> The purpose to build such a table is that if there is an arbitrary
>> pair of RW and RT value, I can look it in the table and find the
>> appropriate wind and temperature.
>
> But what would be the "appropriate" wind and temperature?
>
> Obviously you can create an array where RT and RW are the
> (appropriately scaled) indices. Call it "A". Then you could do
> something like
>
> A[(RT+1)/n,(RW+1)/n]
>
> but from the given information it is not clear what should be written
> in this array at that location. If various different values of nw and
> nt can produce the same RT and/or RW values, which of them are the
> "appropriate" ones to store at that location?
>
>> I've been thinking on this topic for a couple of weeks without any
>> idea, in C language there is a concept of 'Group', but IDL does not.
>
> Unfortunately my understanding of C is on the basic side, and I don't
> think I have ever heard of a "group" in C, so I don't know what
> functionality you are looking for. Can you describe what that is
> supposed to do and maybe someone could tell you how to emulate this in
> IDL.
sorry, made a typo. what I said is 'Record' in Pascal Language.
|
|
|
Re: A complicate problem for building a map [message #36768 is a reply to message #36690] |
Thu, 16 October 2003 16:36  |
condor
Messages: 35 Registered: January 2002
|
Member |
|
|
ftls1@uaf.edu (ftls1@uaf.edu) wrote in message news:<44042ede.0310150951.71dad28a@posting.google.com>...
> I met a problem of map building as below,
> I have two 2-D tables of RT(nw,nt), RW(nw,nt), nw and nt are
> constants,
i.e. not variables. OK.
Are RT and RW unique? I.e. can there be values in these tables that
appear more than once.
E.g. is it possible that RT[3,5] = RT[10,15]
> both RT and RW range from -1 to +1,
What is the meaning of these numbers? In particular: what is the
granularity? Are we talking three possible values (-1,0,1) or many
many values?
> the value of nw, even though it is
> 'integer',actually means wind speed from
> -50 m/s to 50 m/s and the nt means temperature from 0 to 300 K.
Speaking only for myself, at this point you're confusing me. Are they
constant or are they variable? When you say "0 to 300K" then you seem
to imply that there's more than one possibility
> Now I want to get a table with x and y axis of RT and RW respectively.
> The purpose to build such a table is that if there is an arbitrary
> pair of RW and RT value, I can look it in the table and find the
> appropriate wind and temperature.
But what would be the "appropriate" wind and temperature?
Obviously you can create an array where RT and RW are the
(appropriately scaled) indices. Call it "A". Then you could do
something like
A[(RT+1)/n,(RW+1)/n]
but from the given information it is not clear what should be written
in this array at that location. If various different values of nw and
nt can produce the same RT and/or RW values, which of them are the
"appropriate" ones to store at that location?
> I've been thinking on this topic for a couple of weeks without any
> idea, in C language there is a concept of 'Group', but IDL does not.
Unfortunately my understanding of C is on the basic side, and I don't
think I have ever heard of a "group" in C, so I don't know what
functionality you are looking for. Can you describe what that is
supposed to do and maybe someone could tell you how to emulate this in
IDL.
|
|
|