/** @class Create_ZPT.cpp @author Brian Magill @creationdate 8/18/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 the ZPT profile */ #include "Create_ZPT.h" #include "F77Functions.h" //for hydro //#include "Atmos.h" //#include #include using namespace std; Create_ZPT::Create_ZPT(ZT_Profile & Tprof, PressProfile & pressProf, EphemData const & ephemstd) { // ephemeris = ephemstd; float z=0.0; std::vector za,pa,ta; while (z <= pressProf.MaxAlt() ) { za.push_back(z); pa.push_back(pressProf(z) ); ta.push_back( Tprof(z) ) ; z += 2.0; } while (z <= 150.5 ) { za.push_back(z); pa.push_back( -10.0 ); ta.push_back( Tprof(z) ) ; z += 2.0; } int nl = (int)za.size() ; int isl = 1; // do a quick reverse since everything is top down for hydro std::reverse(za.begin(), za.end() ); std::reverse(ta.begin(), ta.end() ); std::reverse(pa.begin(), pa.end() ); std::vector::iterator res = std::find_if( pa.begin(), pa.end(), std::bind2nd(std::greater(),0.0) ); int iptie = (int)std::distance(pa.begin(), res )+1 ; int iel = iptie-1; //std::cout << pa[iptie-1] << " " << pa[iptie] << " " << pa[iel] << std::endl; exit(23); float re = 6371. ; // Re is the radius of the earth This is not used by hydro but it is // an argument float xlat = ephemstd.getLat( pressProf.MaxAlt() ); ::hydro_( &nl, &isl, &iel, &iptie, &re, &xlat, &za[0], &pa[0], &ta[0] ); altitude = std::vector(za.begin(),za.end() ); pressure = std::vector(pa.begin(), pa.end() ); temperature= std::vector(ta.begin(),ta.end() ); }