/** @file ConvertAlt2Time @author Brian Magill @creation date 8/23/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 Finds the time corresponding to a given altitude */ #include #include "ConvertAlt2Time.h" #include "VectorLinInterp.hpp" using namespace std; double ConvertAlt2Time::operator()(double alt) const { VectorLinInterp interp; vector time = param.getTimes(); vector altitude = param.getAltitudes(); vector viewAng = param.getViewAngle(); vector lockdown = param.getElevLockDown(); vector solExt = param.getSolarExtent(); vector adjAngle; for(unsigned long i = 0; i < viewAng.size(); i++) adjAngle.push_back(viewAng[i] - solExt[i]/2. + lockdown[i]); double theta = interp.Interpol(adjAngle, altitude, alt); return interp.Interpol(time, viewAng, theta); }