Re: Radar dB values [message #29327] |
Thu, 14 February 2002 08:40  |
Pavel A. Romashkin
Messages: 531 Registered: November 2000
|
Senior Member |
|
|
Pretty close, but for the result to be integer, all components of an
expression need to be integer. If any one is "higher", the entire result
is promoted.
So that
help, 10*alog10(45)
<Expression> Float = 16.5321
because ALOG returns floating point value no matter what you pass in.
Cheers,
Pavel
Vincent Schut wrote:
>
> Usually when you get an output of only 0's and 1's, there is a integer
> somewhere in your calculation where it should have been floating point.
> Check your formulas and variables; if any of them in your calculation is
> integer, the result will be integer too...
> I assume you use something like db=10*alog10(rawvalue)? Try putting a
> point zero behind the '10', which makes it a floating point constant
> instead of a integer: db=10.0 * alog10(rawvalue)
>
> Cheers,
> Vincent.
|
|
|
|
Re: Radar dB values [message #29391 is a reply to message #29327] |
Mon, 18 February 2002 00:25  |
Vincent Schut
Messages: 8 Registered: February 2002
|
Junior Member |
|
|
Right :-)
So the problem should be that somewhere in the beginning of the
calculations, one of the var's or expressions might be integer, which
maybe does not prevent the result from being float, but does result in
a, in the end, rounded result: float(0) or float(1). Or, indeed,
somewhere in a expression all the elements are int.
OK, it's a bit hard to explain on a new monday morning just after 9 o
clock. But just 0's and 1's however rang the integer bell somewhere in
my head, kind of reflex maybe...
Thanks for the correction. Only just started with IDL programming :)
Cheers,
Vincent.
Pavel A. Romashkin wrote:
> Pretty close, but for the result to be integer, all components of an
> expression need to be integer. If any one is "higher", the entire result
> is promoted.
> So that
>
> help, 10*alog10(45)
> <Expression> Float = 16.5321
>
> because ALOG returns floating point value no matter what you pass in.
> Cheers,
> Pavel
>
> Vincent Schut wrote:
>
>> Usually when you get an output of only 0's and 1's, there is a integer
>> somewhere in your calculation where it should have been floating point.
>> Check your formulas and variables; if any of them in your calculation is
>> integer, the result will be integer too...
>> I assume you use something like db=10*alog10(rawvalue)? Try putting a
>> point zero behind the '10', which makes it a floating point constant
>> instead of a integer: db=10.0 * alog10(rawvalue)
>>
>> Cheers,
>> Vincent.
>>
|
|
|