/** @class InterpDetTem.cpp @author Brian Magill @datecreated 4/12/2006 $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 a time correction to a detector signal Applies a time correction to a time offset to a signal and then interpolates the signal back to the original time. */ //---------------------------------------------------------------------- // #include #include #include "InterpDetTem.h" #include "ValInterp.h" using namespace std; InterpDetTem& InterpDetTem::operator = (InterpDetTem const& rhs ) { if (&rhs == this) return *this; detectorTime.resize(rhs.detectorTime.size()); detectorTime = rhs.detectorTime; return *this; } void InterpDetTem::interpolate(EventVarVect &inTemp, valarray const &hskpTime, EventVarVect &outTemp) { const unsigned long MIN_SIG_SIZE = 3; unsigned long i; EventVar out_temp(detectorTime.size()); outTemp.clear(); for(i = 0; i < inTemp.size(); i++) { if(inTemp[i].size() != hskpTime.size()) throw runtime_error("InterpDetTem:temperature array size differs from housekeeping's time's"); if(inTemp[i].size() < MIN_SIG_SIZE) throw runtime_error("InterpDetTem:too few data points in housekeeping data!"); out_temp = VInterpol(inTemp[i], hskpTime, detectorTime); outTemp.addEventVar(out_temp); } }