rinex_obs_test.cpp

Go to the documentation of this file.
00001 #pragma ident "$Id: rinex_obs_test.cpp 1895 2009-05-12 19:34:29Z afarris $"
00002 
00003 //============================================================================
00004 //
00005 //  This file is part of GPSTk, the GPS Toolkit.
00006 //
00007 //  The GPSTk is free software; you can redistribute it and/or modify
00008 //  it under the terms of the GNU Lesser General Public License as published
00009 //  by the Free Software Foundation; either version 2.1 of the License, or
00010 //  any later version.
00011 //
00012 //  The GPSTk is distributed in the hope that it will be useful,
00013 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 //  GNU Lesser General Public License for more details.
00016 //
00017 //  You should have received a copy of the GNU Lesser General Public
00018 //  License along with GPSTk; if not, write to the Free Software Foundation,
00019 //  Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020 //
00021 //  Copyright 2006, The University of Texas at Austin
00022 //
00023 //============================================================================
00024 
00030 #include "RinexObsBase.hpp"
00031 #include "RinexObsData.hpp"
00032 #include "RinexObsHeader.hpp"
00033 #include "RinexObsStream.hpp"
00034 
00035 using namespace std;
00036 
00038 main(int argc, char *argv[])
00039 {
00040    if (argc<2)
00041    {
00042       cout << "Gimme a rinex obs to chew on!  Exiting." << endl;
00043       exit(-1);
00044    }
00045 
00046    try
00047    {
00048       cout << "Reading " << argv[1] << "." << endl;
00049 
00050       gpstk::RinexObsStream roffs(argv[1]);
00051       roffs.exceptions(ios::failbit);
00052       gpstk::RinexObsHeader roh;
00053       gpstk::RinexObsData roe;
00054       
00055       roffs >> roh;
00056       roh.dump(cout);
00057 
00058       while (roffs >> roe)
00059       {}
00060 
00061       cout << "Read " << roffs.recordNumber << " epochs.  Done."  << endl;
00062       exit(0);
00063    }
00064    catch(gpstk::FFStreamError& e)
00065    {
00066       cout << e;
00067       exit(1);
00068    }
00069    catch(gpstk::Exception& e)
00070    {
00071       cout << e;
00072       exit(1);
00073    }
00074    catch (...)
00075    {
00076       cout << "unknown error.  Done." << endl;
00077       exit(1);
00078    }
00079 
00080    exit(0);
00081 } // main()

Generated on Wed May 23 03:31:01 2012 for GPS ToolKit Software Library by  doxygen 1.3.9.1