/** @file RemoveNonLin.cpp @author Brian Magill @creation date 1/1/2007 $Date:$ $Revision:$ @copyright (©) Copyright 2006 by GATS Inc. 11864 Canon Blvd., Suite 101, Newport News, VA 23606 All Rights Reserved. No part of this software or publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise without the prior written permission of GATS Inc. @brief Applies the drift signal correction for a given channel Corrects multiplicative drift to first order Note: Since the drift effects have been found to be un the detectors and optics, the difference drift correction is based entirely on the drift corrections for the strong and weak signals. To avoid loss of precision, the corrections are left in their factored form. For this reason, the drift correction needs to be done first. @brief Remove nonlinearity from a detector signal */ #include "RemoveNonLin.h" using namespace std; std::valarray RemoveNonLin::operator()(double gain, std::valarray const &inSig) const { valarray outSig(inSig.size()); outSig = inSig / (1.0 - nonlin_coef * inSig * cal_gain / gain); return outSig; }