#ifndef MSIS_MIX_RATIOS_2008_08_06 #define MSIS_MIX_RATIOS_2008_08_06 /** @file MSISXRatio @author Brian Magill @creationdate 8/6/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 Converts MSIS densities to volume mixing ratios */ //#include #include #include "MSISGases.h" class MSISXRatio { private: float O_density; float O2_density; float N2_density; float total; bool hasData; public: MSISXRatio():O_density(0.), O2_density(0.0), N2_density(0.), total(.0), hasData(false) {} MSISXRatio(std::vector densities) { O_density = densities.at(MSIS::O); O2_density = densities.at(MSIS::O2); N2_density = densities.at(MSIS::N2); total = densities.at(MSIS::He) + O_density + O2_density + N2_density + densities.at(MSIS::AR) + densities.at(MSIS::H) + densities.at(MSIS::N); } MSISXRatio(MSISXRatio const &rhs):O_density(rhs.O_density), O2_density(rhs.O2_density), N2_density(rhs.N2_density), total(rhs.total), hasData(rhs.hasData) {} MSISXRatio& operator = (MSISXRatio const &rhs) { if (&rhs == this) return *this; O_density = rhs.O_density; O2_density = rhs.O2_density; N2_density = rhs.N2_density; total = rhs.total; hasData = rhs.hasData; return *this; } ~MSISXRatio() {} bool HasData() {return hasData;} float getO_xratio() {return O_density/total;} float getO2_xratio() {return O2_density/total;} float getN2_xratio() {return N2_density/total;} }; #endif