ReFRACtor
observation_id.cc
Go to the documentation of this file.
1 #include "observation_id.h"
2 
3 using namespace FullPhysics;
4 using namespace blitz;
5 
6 template<class T>
7 ObservationId<T>::ObservationId(const boost::shared_ptr<HdfFile>& input, const std::string& dataset_name, const T& identifier)
8 {
9  Array<T, 1> file_ids = input->read_field<T, 1>(dataset_name);
10 
11  data_index_ = -1;
12  bool found = false;
13  for (int idx = 0; !found && idx < file_ids.rows(); idx++) {
14  if(file_ids(idx) == identifier) {
15  data_index_ = idx;
16  found = true;
17  }
18  }
19 
20  if(!found) {
21  Exception err;
22  err << "The identifier " << identifier << " was not found in dataset: " << dataset_name << " in file: " << input->file_name();
23  throw err;
24  }
25 }
26 
28 template class FullPhysics::ObservationId<int>;
Defines a simple mechanism by where a specific dataset from a HDF file is read along with some sort o...
This is the base of the exception hierarchy for Full Physics code.
Definition: fp_exception.h:16
ObservationId(const boost::shared_ptr< HdfFile > &input, const std::string &dataset_name, const T &identifier)
Apply value function to a blitz array.
Contains classes to abstract away details in various Spurr Radiative Transfer software.
Definition: doxygen_python.h:1

Copyright © 2017, California Institute of Technology.
ALL RIGHTS RESERVED.
U.S. Government Sponsorship acknowledged.
Generated Fri Aug 24 2018 15:44:08