IODA Bundle
GsiSatBiasReader.h
Go to the documentation of this file.
1 /*
2  * (C) Copyright 2021 UCAR
3  *
4  * This software is licensed under the terms of the Apache Licence Version 2.0
5  * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
6  */
7 
8 #pragma once
9 
10 #include <string>
11 #include <vector>
12 #include <fstream>
13 
14 #include <Eigen/Dense>
15 
16 /// Number of predictors in GSI satbias file
17 constexpr size_t gsi_npredictors = 12;
18 
19 /// Finds all sensors in the file (returned in \p sensors) and number of channels
20 /// for all the sensors (returned in \p nchannels)
21 void findSensorsChannels(const std::string & filename, std::vector<std::string> & sensors,
22  std::vector<int> & nchannels);
23 
24 /// Read bias coefficients from the GSI bias coefficients file (satbias_in)
25 /// \param filename file with bias coefficients (GSI style)
26 /// \param sensor instrument+satellite that is to be read from the file
27 /// \param(out) channels channels for \p sensor
28 /// \param(out) coeffs bias coefficients
29 void readObsBiasCoefficients(const std::string & filename, const std::string & sensor,
30  std::vector<int> & channels, Eigen::ArrayXXf & coeffs);
31 
32 /// Read bias coefficients errors from the GSI file (satbias_pc)
33 /// \param filename file with bias coefficients (GSI style)
34 /// \param sensor instrument+satellite that is to be read from the file
35 /// \param(out) channels channels for \p sensor
36 /// \param(out) errs bias coefficients error variances
37 /// \param(out) nobs number of observations
38 void readObsBiasCoeffErrors(const std::string & filename, const std::string & sensor,
39  std::vector<int> & channels, Eigen::ArrayXXf & errs,
40  Eigen::ArrayXf & nobs);
41 
void readObsBiasCoefficients(const std::string &filename, const std::string &sensor, std::vector< int > &channels, Eigen::ArrayXXf &coeffs)
constexpr size_t gsi_npredictors
Number of predictors in GSI satbias file.
void findSensorsChannels(const std::string &filename, std::vector< std::string > &sensors, std::vector< int > &nchannels)
void readObsBiasCoeffErrors(const std::string &filename, const std::string &sensor, std::vector< int > &channels, Eigen::ArrayXXf &errs, Eigen::ArrayXf &nobs)