1 | /* ************************************************************************** * |
---|
2 | * Copyright © IPSL/LSCE, XMLIOServer, Avril 2010 - Octobre 2011 * |
---|
3 | * ************************************************************************** */ |
---|
4 | |
---|
5 | #ifndef __INETCDF4_ADV_HPP__ |
---|
6 | #define __INETCDF4_ADV_HPP__ |
---|
7 | |
---|
8 | /** |
---|
9 | * \file inetcdf4_adv.hpp |
---|
10 | * \brief Lecture des fichiers de données au format netCDF-4, fonctionnalités avancées (entête). |
---|
11 | * \author Hervé Ozdoba |
---|
12 | * \version 0.4 |
---|
13 | * \date 15 Juin 2011 |
---|
14 | */ |
---|
15 | |
---|
16 | #ifndef __XIOS_NO_EXTERN |
---|
17 | |
---|
18 | // C++ standard headers |
---|
19 | # include <set> |
---|
20 | # include <algorithm> |
---|
21 | |
---|
22 | #endif // __XIOS_NO_EXTERN |
---|
23 | |
---|
24 | // XMLIOServer headers |
---|
25 | #include "inetcdf4.hpp" |
---|
26 | |
---|
27 | // ////////////////////////////// Déclarations ///////////////////////////// // |
---|
28 | |
---|
29 | namespace xmlioserver |
---|
30 | { |
---|
31 | namespace io |
---|
32 | { |
---|
33 | class CINetCDF4Adv : public CINetCDF4 |
---|
34 | { |
---|
35 | typedef CINetCDF4 SuperClass; /*!< Redéfinition de CINetCDF4. */ |
---|
36 | |
---|
37 | public : // Constructeurs |
---|
38 | |
---|
39 | //! \brief Constructeur simple. |
---|
40 | CINetCDF4Adv(void); // NIY |
---|
41 | |
---|
42 | /*! |
---|
43 | * \brief Constructeur à partir d'un nom de fichier au format netCDF4. |
---|
44 | * \param _filename : un nom de fichier au format netCDF4. |
---|
45 | */ |
---|
46 | explicit CINetCDF4Adv(const std::string & _filename); |
---|
47 | |
---|
48 | /*! |
---|
49 | * \brief Constructeur par copie . |
---|
50 | * \param _inetcdf4 : référence de l'objet à copier. |
---|
51 | */ |
---|
52 | CINetCDF4Adv(const CINetCDF4Adv & _inetcdfadv);// NIY |
---|
53 | |
---|
54 | /*! |
---|
55 | * \brief Constructeur par copie. |
---|
56 | * \param _inetcdf4_ptr : le pointeur sur l'objet à copier. |
---|
57 | */ |
---|
58 | CINetCDF4Adv(const CINetCDF4Adv * const _inetcdfadv); // NIY |
---|
59 | |
---|
60 | public : // Destructeur |
---|
61 | |
---|
62 | //! \brief Destructeur de l'objet (le fichier est clos lors de son appel). |
---|
63 | virtual ~CINetCDF4Adv(void); |
---|
64 | |
---|
65 | public : // Divers accesseurs |
---|
66 | |
---|
67 | std::string getLonCoordName (const std::string & _varname); |
---|
68 | std::string getLatCoordName (const std::string & _varname); |
---|
69 | std::string getVertCoordName(const std::string & _varname); |
---|
70 | |
---|
71 | std::set<std::string> getCoordVariables(void); |
---|
72 | std::set<std::string> getBoundVariables(void); |
---|
73 | |
---|
74 | std::string getCoordinatesId(const std::string & _varname); |
---|
75 | std::string getBoundsId (const std::string & _varname); |
---|
76 | |
---|
77 | template <class DataType> |
---|
78 | void getMissingValue(DataType & _value, const std::string & _varname); |
---|
79 | |
---|
80 | std::vector<std::string> getCoordinatesIdList(const std::string & _varname); |
---|
81 | |
---|
82 | std::vector<std::string> getDataVariables(bool _is3D = true, |
---|
83 | bool _isRecti = true, |
---|
84 | bool _isCurvi = true, |
---|
85 | bool _isUnstr = true, |
---|
86 | bool _isCellData = true, |
---|
87 | bool _isTemporal = true); |
---|
88 | |
---|
89 | |
---|
90 | std::size_t getNbVertex(const std::string & _varname); |
---|
91 | |
---|
92 | public : // Divers mutateurs |
---|
93 | |
---|
94 | template <class DataType, std::size_t ndim> |
---|
95 | bool replaceMissingValue(const std::string & _varname, |
---|
96 | boost::multi_array<DataType, ndim> & _data, |
---|
97 | const DataType & newValue); |
---|
98 | |
---|
99 | public : // Divers méthodes de tests |
---|
100 | |
---|
101 | bool hasAttribute(const std::string & name, |
---|
102 | const std::string * const _varname = NULL); |
---|
103 | |
---|
104 | bool hasVariable (const std::string & _varname); |
---|
105 | bool hasMissingValue(const std::string & _varname); |
---|
106 | bool hasCoordinates (const std::string & _varname); |
---|
107 | bool hasBounds (const std::string & _varname); |
---|
108 | |
---|
109 | bool hasTemporalDim(void); |
---|
110 | |
---|
111 | bool isBound (const std::string & _varname); |
---|
112 | bool isCoordinate (const std::string & _varname); |
---|
113 | bool isRectilinear (const std::string & _varname); |
---|
114 | bool isCurvilinear (const std::string & _varname); |
---|
115 | bool isUnknown (const std::string & _varname); |
---|
116 | bool isUnstructured(const std::string & _varname); |
---|
117 | bool isTemporal (const std::string & _varname); |
---|
118 | bool is3Dim (const std::string & _varname); |
---|
119 | bool isCellGrid (const std::string & _varname); |
---|
120 | |
---|
121 | }; // class CINetCDF4Adv |
---|
122 | } // namespace io |
---|
123 | } // namespace xmlioserver |
---|
124 | |
---|
125 | #endif // __INETCDF4_ADV_HPP__ |
---|
126 | |
---|