/** @class CalcRefracHigh.cpp @author Brian Magill @datecreated 08/11/2008 $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: Calculates Refraction angle from solar extent and sink rate. Uses the solar extent tau later in the calculations instead of a recursive relationship using the refraction angle at time minus tau in the past. */ //---------------------------------------------------------------------- // #include #include #include #include "CalcRefracHigh.h" #include "VectorLinInterp.hpp" #include "Vec2Val.hpp" using namespace std; valarray CalcRefracHigh::get_refraction(const valarray &inTime, const valarray &inShinkage) const { assert(inTime.size() == inShinkage.size()); vector time = Val2Vec (inTime); vector solarShinkage = Val2Vec (inShinkage); vector timePrime; vector shrinkPrime; unsigned long i; VectorLinInterp linInterp; valarray rho(time.size() ); for(i = 0; i < time.size(); i++) { timePrime.push_back(tauPtr->operator( )(time[i]) + time[i]); } shrinkPrime = linInterp.Interpol(solarShinkage, time, timePrime); for(i = 0; i < solarShinkage.size(); i++) { rho[i] = solarShinkage[i]*shrinkPrime[i]/(shrinkPrime[i] - solarShinkage[i]); } return rho; }