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

Home » Public Forums » archive » Re: Conversion floating point to byte or integer
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Conversion floating point to byte or integer [message #56292] Thu, 11 October 2007 18:44 Go to previous message
beardown911 is currently offline  beardown911
Messages: 21
Registered: March 2007
Junior Member
On Oct 11, 4:04 pm, "M. Katz" <MKatz...@yahoo.com> wrote:
> You have to guard against byte values going below zero.
> Here is what I would recommend.
> 1) Immediately convert the raw data into float, before any processing.
> 2) Subtract the background array but "crop" any negative values at
> zero.
> image1 = (raw_data - background ) > 0.
> 3) Then apply your calibration
> image2 = image1 * calibration
> If instead you have to divide by the calibration array, watch out
> for zeros.
> image2 = image1 / (calibration > 1.) might be a format you should
> consider.
> (The 1. here is just an example. It depends on your actual data.)
>
> Of course be careful about spikes or zeros in the calibration
> file or background file. Those can cause problems.
>
> MKatz

Thanks a lot.

Kim
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Minor IDL code changes cause large slowdowns elsewhere in code
Next Topic: Re: Problem while deleting shape file

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

Current Time: Wed Oct 08 15:34:25 PDT 2025

Total time taken to generate the page: 0.00351 seconds