EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  <20212022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  <20212022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: NDPluginProcess Background subtraction UInt wrap around
From: Mark Rivers via Tech-talk <tech-talk at aps.anl.gov>
To: 'Laurenz Rettig' <rettig at fhi-berlin.mpg.de>
Cc: "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Tue, 16 Mar 2021 22:36:20 +0000
> I'm having some trouble with the background subtraction in the NDPluginProcess and UInt16 data type. 
> Whenever the values would turn negative due to the background subtraction, the UInt16 wraps around and produces values close to 65536. 
> What is the best way to avoid this this?

That depends on what you want to get from the output. 

If you want to preserve the negative values then you could set the output data type to Int32.  That will make the output arrays larger, but it will preserve UInt16 values up to 65535 as well as handle negative numbers.

If you are OK with clipping negative numbers to 0 then you could do what Hugo suggested and clip the low value to 0.  Then the output arrays can be left as UInt16 data type.

Mark


-----Original Message-----
From: Tech-talk <tech-talk-bounces at aps.anl.gov> On Behalf Of Laurenz Rettig via Tech-talk
Sent: Tuesday, March 16, 2021 5:19 PM
To: tech-talk at aps.anl.gov
Subject: NDPluginProcess Background subtraction UInt wrap around

Hi,

I'm having some trouble with the background subtraction in the NDPluginProcess and UInt16 data type. Whenever the values would turn negative due to the background subtraction, the UInt16 wraps around and produces values close to 65536. What is the best way to avoid this this?

Thanks, Laurenz

--
Dr. Laurenz Rettig
Fritz Haber Institute of the Max Planck Society Department of Physical Chemistry Dynamics of Correlated Materials Faradayweg 4-6
14195 Berlin, Germany

phone: +49-(0)30-8413 5225
email: rettig at fhi-berlin.mpg.de



Replies:
RE: NDPluginProcess Background subtraction UInt wrap around Mark Rivers via Tech-talk
References:
NDPluginProcess Background subtraction UInt wrap around Laurenz Rettig via Tech-talk

Navigate by Date:
Prev: Re: NDPluginProcess Background subtraction UInt wrap around Hugo Slepicka via Tech-talk
Next: RE: NDPluginProcess Background subtraction UInt wrap around Mark Rivers via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  <20212022  2023  2024 
Navigate by Thread:
Prev: Re: NDPluginProcess Background subtraction UInt wrap around Hugo Slepicka via Tech-talk
Next: RE: NDPluginProcess Background subtraction UInt wrap around Mark Rivers via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  <20212022  2023  2024 
ANJ, 16 Mar 2021 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·