/** @file MSISGases @author Brian Magill @creationdate 8/14/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 temperature in the thermosphere */ #include "MSISGases.h" #include "msis2000.h" #include using namespace std; /// /// Calculate temperature for a given altitude and time /// vector MSISGases::operator() (float altitude, float time) { int density_size = 9; float density[density_size]; // gas densities returned by MSIS model float outTemp[2]; // temperature returned by MSIS model vector ap = solarFlux.getAP(time); float flux10_7 = solarFlux.getFlux10_7(); float flux_90 = solarFlux.getFlux90(); float lat = ephemeris.getLat(altitude); float lon = ephemeris.getLon(altitude); vector switches(25, 1.0); vector densityOut; long mass = 48; //return the densities for all Gases in the MSIS model other than anomalous O float stl; // switches[9] = -1.0; // Daily Ap (-1 History). Not sure if this actually does anything tselec_(&switches[1]); stl = time/3600 + lon/15; if (gtd7_(&idate, &time, &altitude, &lat, &lon, &stl, &flux_90, &flux10_7, &ap[0], &mass, density, outTemp) ) { cerr << "Problem calculating MSIS value" << endl; } densityOut = vector(&density[0], &density[0] + density_size*sizeof(float) ); return densityOut; }