/** @file ApplyDrift.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 */ #include #include "ApplyDrift.h" #include "SOFIE_namespace.h" using namespace std; ChannelSignals ApplyDrift::operator()(std::valarray const &time, ChannelSignals const &in, DriftParam const ¶m) const { int gasId = in.getID(); std::valarray strong = in.getSignal(SOFIE::Strong); std::valarray weak = in.getSignal(SOFIE::Weak); std::valarray diff = in.getSignal(SOFIE::Diff); double strong_atten = in.getAttenuation(SOFIE::Strong); double weak_atten = in.getAttenuation(SOFIE::Weak); double Ka = param.getSlope(SOFIE::Strong); double t_0 = param.getTimeRef(); double v_0 = param.getSigRef(SOFIE::Strong); strong = strong*(1. + Ka*(time - t_0)); Ka = param.getSlope(SOFIE::Weak); v_0 = param.getSigRef(SOFIE::Weak); weak = weak*(1. + Ka*(time - t_0)); Ka = param.getSlope(SOFIE::Diff); v_0 = param.getSigRef(SOFIE::Diff); diff = diff - Ka*(time - t_0); return ChannelSignals(gasId, strong_atten, weak_atten, strong, weak, diff); }