/** @class CalcRefraction.cpp @author Brian Magill @datecreated 05/04/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: Calculates Refraction angle from solar extent and sink rate. Time is assumed to be a montonically increasing sequence. For the case of sunrise events, the time needs to be transformed by t_f = t_max - t_i, where t_max = max(t_i). The inverse then needs to be applied to the time afterwards. */ //---------------------------------------------------------------------- // #include #include #include "CalcRefraction.h" #include "RhoFunction.h" using namespace std; valarray CalcRefraction::get_refraction(const valarray &time, const valarray &solarShinkage) const { valarray rho(time.size() ); RhoFunction rhoFunct(tauPtr); assert(time.size() == solarShinkage.size()); // find refraction angle for(unsigned long j = 0; j < time.size(); j++) { rho[j] = solarShinkage[j] + rhoFunct.Calculate(time[j]); rhoFunct.addData(time[j], rho[j]); } return rho; }