Data Access Library (DAL)
|
00001 /* Copyright 2011-2012 ASTRON, Netherlands Institute for Radio Astronomy 00002 * This file is part of the Data Access Library (DAL). 00003 * 00004 * This library is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU Lesser General Public 00006 * License as published by the Free Software Foundation; either 00007 * version 3 of the License, or (at your option) any later version. 00008 * 00009 * This library is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 * Lesser General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Lesser General Public 00015 * License along with this library. If not, see <http://www.gnu.org/licenses/>. 00016 */ 00017 #ifndef DAL_CLA_FILE_H 00018 #define DAL_CLA_FILE_H 00019 00020 #include <cstddef> 00021 #include <sys/time.h> 00022 00023 #include <string> 00024 #include <vector> 00025 #include <hdf5.h> 00026 #include "../hdf5/types/versiontype.h" 00027 #include "../hdf5/File.h" 00028 00029 namespace dal { 00030 00034 class CLA_File: public File { 00035 public: 00036 CLA_File(); 00037 CLA_File( const std::string &filename, FileMode mode = READ ); 00038 00039 virtual ~CLA_File(); 00040 00041 virtual void open( const std::string &filename, FileMode mode = READ ); 00042 virtual void close(); 00043 00044 Attribute<std::string> fileName(); 00045 Attribute<std::string> fileDate(); 00046 Attribute<std::string> fileType(); 00047 00048 Attribute<std::string> telescope(); 00049 00050 Attribute<std::string> projectID(); 00051 Attribute<std::string> projectTitle(); 00052 Attribute<std::string> projectPI(); 00053 Attribute<std::string> projectCOI(); 00054 Attribute<std::string> projectContact(); 00055 00056 Attribute<std::string> observationID(); 00057 00058 Attribute<std::string> observationStartUTC(); 00059 Attribute<double> observationStartMJD(); 00060 00061 Attribute<std::string> observationEndUTC(); 00062 Attribute<double> observationEndMJD(); 00063 00064 Attribute<unsigned> observationNofStations(); 00065 Attribute< std::vector<std::string> > observationStationsList(); 00066 00067 Attribute<double> observationFrequencyMax(); 00068 Attribute<double> observationFrequencyMin(); 00069 Attribute<double> observationFrequencyCenter(); 00070 Attribute<std::string> observationFrequencyUnit(); 00071 00072 Attribute<unsigned> observationNofBitsPerSample(); 00073 Attribute<double> clockFrequency(); 00074 Attribute<std::string> clockFrequencyUnit(); 00075 Attribute<std::string> antennaSet(); 00076 Attribute<std::string> filterSelection(); 00077 Attribute< std::vector<std::string> > targets(); 00078 00079 Attribute<std::string> systemVersion(); 00080 Attribute<std::string> pipelineName(); 00081 Attribute<std::string> pipelineVersion(); 00082 Attribute<std::string> docName(); 00083 Attribute<VersionType> docVersion(); 00084 Attribute<std::string> notes(); 00085 00086 protected: 00087 std::string getFileModDate( const std::string& filename ) const; 00088 std::string formatFilenameTimestamp( const struct timeval& tv, const char* output_format, 00089 const char* output_format_secs, size_t output_size ) const; 00090 00091 private: 00092 void openFile( const std::string &filename, FileMode mode ); 00093 void initFileNodes(); 00094 }; 00095 00096 } 00097 00098 #endif 00099