Commit 91128aaeba9a20b949d436be5528e3cc31b11198
1 parent
a1184f24
Exists in
master
and in
68 other branches
kernel arguments ok
Showing
10 changed files
with
98 additions
and
28 deletions
Show diff stats
src/TimeTableCatalog/InternalXMLData.cc
... | ... | @@ -14,6 +14,12 @@ const std::string InternalXMLData::SEPARATOR = ","; |
14 | 14 | |
15 | 15 | const std::string InternalXMLData::ELEM_NAME = "name"; |
16 | 16 | const std::string InternalXMLData::ELEM_CREATED = "created"; |
17 | + | |
18 | +const std::string InternalXMLData::ELEM_MODIFIED = "modified"; | |
19 | +const std::string InternalXMLData::SURVEY_START_DATE = "surveyStart"; | |
20 | +const std::string InternalXMLData::SURVEY_STOP_DATE = "surveyStop"; | |
21 | +const std::string InternalXMLData::ELEM_CONTACT = "contact"; | |
22 | + | |
17 | 23 | const std::string InternalXMLData::ELEM_DESCRIPTION = "description"; |
18 | 24 | const std::string InternalXMLData::ELEM_HISTORY = "history"; |
19 | 25 | const std::string InternalXMLData::ELEM_PARAMETERS = "parameters"; | ... | ... |
src/TimeTableCatalog/InternalXMLData.hh
... | ... | @@ -20,6 +20,12 @@ public: |
20 | 20 | static const std::string XML_TIMETABLE_TAG; |
21 | 21 | static const std::string ELEM_NAME; |
22 | 22 | static const std::string ELEM_CREATED; |
23 | + static const std::string ELEM_MODIFIED; | |
24 | + // survey start and stop date | |
25 | + static const std::string SURVEY_START_DATE; | |
26 | + static const std::string SURVEY_STOP_DATE; | |
27 | + | |
28 | + static const std::string ELEM_CONTACT; | |
23 | 29 | static const std::string ELEM_DESCRIPTION; |
24 | 30 | static const std::string ELEM_HISTORY; |
25 | 31 | static const std::string ELEM_PARAMETERS; | ... | ... |
src/TimeTableCatalog/InternalXMLReader.cc
... | ... | @@ -22,6 +22,11 @@ |
22 | 22 | <timetable> |
23 | 23 | <name>FTE_c3</name> |
24 | 24 | <created>2013-07-14T09:09:32</created> |
25 | + <modified>2013-07-14T09:09:32</modified> | |
26 | + <modified>2013-07-14T09:09:32</modified> | |
27 | + <surveyStart>2013-07-14T09:09:32</surveyStart> | |
28 | + <surveyStop>2013-07-14T09:09:32</surveyStop> | |
29 | + <contact>tototiti<contact> | |
25 | 30 | <description>Uploaded Time Table |
26 | 31 | Time Table generated by AMDA @ CDPP;Description: FTE list from Cluster 3 data. From \"A new multivariate time series data analysis technique: Automated detection of flux transfer events using Cluster data\" by Karimabadi et al., JOURNAL OF GEOPHYSICAL RESEARCH, VOL. 114, A06216, doi:10.1029/2009JA014202, 2009 http://www.agu.org/journals/ja/ja0906/2009JA014202/The list is available as Auxiliary material \"Data Set S3\"Transformation into AMDA Time Table by V. Genot, CESR, Toulouse, France 29/06/2009 : - millisec have been omitted - the original event corresponds to the StartTime of the Time Table - if StopTime-StartTime = 1 sec then the event is a magnetosheath FTE - if StopTime-StartTime = 2 sec then the event is a magnetospheric FTE;Source: Upload Time Table;Creation Date : 2009-07-01 17:16:46 shared by Vincent Genot on 2009-11-24 18:52:50;</description> |
27 | 32 | <history>created from another TT</history> |
... | ... | @@ -31,7 +36,6 @@ |
31 | 36 | <stop>2001-02-02T16:27:13</stop> |
32 | 37 | </intervals> |
33 | 38 | */ |
34 | - | |
35 | 39 | namespace TimeTableCatalog { |
36 | 40 | |
37 | 41 | const std::string InternalXMLReader::FORMAT = "Internal"; |
... | ... | @@ -111,7 +115,15 @@ void InternalXMLReader::processNode(TimeTable& pTT, xmlTextReaderPtr reader, int |
111 | 115 | pTT._creationDate = readISOTime(tagValue); |
112 | 116 | } else if (_tmpCurrentTag == InternalXMLData::ELEM_NB_INTERVALS) { |
113 | 117 | // NOP, dont care about interval number |
114 | - } else { | |
118 | + } else if( _tmpCurrentTag == InternalXMLData::ELEM_MODIFIED) { | |
119 | + pTT._modificationDate = readISOTime(tagValue); | |
120 | + }else if( _tmpCurrentTag == InternalXMLData::SURVEY_START_DATE) { | |
121 | + pTT._listStartDate = readISOTime(tagValue); | |
122 | + }else if( _tmpCurrentTag == InternalXMLData::SURVEY_STOP_DATE) { | |
123 | + pTT._listStopDate = readISOTime(tagValue); | |
124 | + }else if( _tmpCurrentTag == InternalXMLData::ELEM_CONTACT) { | |
125 | + pTT._contact = readISOTime(tagValue); | |
126 | + }else{ | |
115 | 127 | // read intervals |
116 | 128 | if (_tmpCurrentTag == InternalXMLData::ELEM_START) { |
117 | 129 | _tmpIntervalstartdate = readISOTime(tagValue); | ... | ... |
src/TimeTableCatalog/InternalXMLWriter.cc
... | ... | @@ -33,6 +33,11 @@ InternalXMLWriter::~InternalXMLWriter() { |
33 | 33 | <timetable> |
34 | 34 | <name>FTE_c3</name> |
35 | 35 | <created>2013-07-14T09:09:32</created> |
36 | + <modified>2013-07-14T09:09:32</modified> | |
37 | + <modified>2013-07-14T09:09:32</modified> | |
38 | + <surveyStart>2013-07-14T09:09:32</surveyStart> | |
39 | + <surveyStop>2013-07-14T09:09:32</surveyStop> | |
40 | + <contact>tototiti<contact> | |
36 | 41 | <description>Uploaded Time Table |
37 | 42 | Time Table generated by AMDA @ CDPP;Description: FTE list from Cluster 3 data. From \"A new multivariate time series data analysis technique: Automated detection of flux transfer events using Cluster data\" by Karimabadi et al., JOURNAL OF GEOPHYSICAL RESEARCH, VOL. 114, A06216, doi:10.1029/2009JA014202, 2009 http://www.agu.org/journals/ja/ja0906/2009JA014202/The list is available as Auxiliary material \"Data Set S3\"Transformation into AMDA Time Table by V. Genot, CESR, Toulouse, France 29/06/2009 : - millisec have been omitted - the original event corresponds to the StartTime of the Time Table - if StopTime-StartTime = 1 sec then the event is a magnetosheath FTE - if StopTime-StartTime = 2 sec then the event is a magnetospheric FTE;Source: Upload Time Table;Creation Date : 2009-07-01 17:16:46 shared by Vincent Genot on 2009-11-24 18:52:50;</description> |
38 | 43 | <history>created from another TT</history> |
... | ... | @@ -89,6 +94,22 @@ void InternalXMLWriter::writeMetadata(const TimeTable& pTT, |
89 | 94 | std::ostringstream os; |
90 | 95 | writeISOTime(pTT._creationDate, pTT._timeFormat, os); |
91 | 96 | writeElement(pTT, pWriter, InternalXMLData::ELEM_CREATED, os.str()); |
97 | + os.str(""); | |
98 | + | |
99 | + writeISOTime(pTT._modificationDate, pTT._timeFormat, os); | |
100 | + writeElement(pTT, pWriter, InternalXMLData::ELEM_MODIFIED, os.str()); | |
101 | + os.str(""); | |
102 | + | |
103 | + writeISOTime(pTT._listStartDate, pTT._timeFormat, os); | |
104 | + writeElement(pTT, pWriter, InternalXMLData::SURVEY_START_DATE, os.str()); | |
105 | + os.str(""); | |
106 | + | |
107 | + writeISOTime(pTT._listStopDate, pTT._timeFormat, os); | |
108 | + writeElement(pTT, pWriter, InternalXMLData::SURVEY_STOP_DATE, os.str()); | |
109 | + os.str(""); | |
110 | + | |
111 | + writeElement(pTT, pWriter, InternalXMLData::ELEM_CONTACT, pTT._name); | |
112 | + | |
92 | 113 | // -- write description tag |
93 | 114 | if (!pTT._description.empty()) { |
94 | 115 | std::string description = pTT._description.at(0); | ... | ... |
src/TimeTableCatalog/SpaceData.cc
... | ... | @@ -17,7 +17,7 @@ namespace TimeTableCatalog { |
17 | 17 | const std::string SpaceData::LIST_ID_KEYWORD = "ListID:"; |
18 | 18 | const std::string SpaceData::CREATION_DATE_KEYWORD = "CreationDate:"; |
19 | 19 | const std::string SpaceData::MODIFY_DATE_KEYWORD = "ModifyDate:"; |
20 | - const std::string SpaceData::FIELD_NAMES_KEYWORD = " FieldNames:"; | |
20 | + const std::string SpaceData::FIELD_NAMES_KEYWORD = "FieldNames:"; | |
21 | 21 | const std::string SpaceData::FIELD_UNIT_KEYWORD = "FieldUnits:"; |
22 | 22 | const std::string SpaceData::FIELD_TYPES_KEYWORD = "FieldTypes:"; |
23 | 23 | const std::string SpaceData::FIELD_NULLS_KEYWORD = "FieldNulls:"; | ... | ... |
src/TimeTableCatalog/SpaceReader.cc
... | ... | @@ -194,9 +194,6 @@ void SpaceReader::addDescription(const std::string & pline, TimeTable& ptt) { |
194 | 194 | ptt._description.push_back(value); |
195 | 195 | } |
196 | 196 | |
197 | -void SpaceReader::addParameter(const std::string & pline, TimeTable& ptt) { | |
198 | -} | |
199 | - | |
200 | 197 | ParameterDescription::ParameterType SpaceReader::getTypeFromString(std::string type) { |
201 | 198 | boost::algorithm::trim(type); |
202 | 199 | boost::algorithm::to_lower(type); | ... | ... |
src/TimeTableCatalog/SpaceReader.hh
... | ... | @@ -69,11 +69,6 @@ private: |
69 | 69 | */ |
70 | 70 | void addDescription(const std::string & pline, TimeTable& ptt); |
71 | 71 | |
72 | - /** | |
73 | - * Adds a parameter description to a time table. | |
74 | - */ | |
75 | - void addParameter(const std::string & pline, TimeTable& ptt); | |
76 | - | |
77 | 72 | int timeSize; |
78 | 73 | }; |
79 | 74 | ... | ... |
src/TimeTableCatalog/SpaceWriter.cc
... | ... | @@ -64,11 +64,11 @@ const std::string SpaceWriter::getExtension() const { |
64 | 64 | void SpaceWriter::writeMetaData(const TimeTable& pTT, |
65 | 65 | std::ostream& pOut) { |
66 | 66 | // write version |
67 | - pOut << "# " <<SpaceData::EVENT_TABLE_VERSION_KEYWORD << " " <<SpaceData::EVENT_TABLE_VERSION_DEFAULT << std::endl; | |
67 | + pOut << "# " <<SpaceData::EVENT_TABLE_VERSION_KEYWORD << " " << pTT._eventTableVersion << std::endl; | |
68 | 68 | // -- write ListTitle |
69 | 69 | pOut << "# " << SpaceData::LIST_TITLE_KEYWORD<< " " << pTT._name << std::endl; |
70 | 70 | // -- write ListID |
71 | - pOut << "# " << SpaceData::LIST_ID_KEYWORD<< " " <<SpaceData::LIST_ID_DEFAULT<< std::endl; | |
71 | + pOut << "# " << SpaceData::LIST_ID_KEYWORD<< " " << pTT._listID << std::endl; | |
72 | 72 | |
73 | 73 | // -- write creation date |
74 | 74 | pOut << "# " << SpaceData::CREATION_DATE_KEYWORD << " "; |
... | ... | @@ -77,33 +77,39 @@ void SpaceWriter::writeMetaData(const TimeTable& pTT, |
77 | 77 | |
78 | 78 | // -- write modify date |
79 | 79 | pOut << "# " << SpaceData::MODIFY_DATE_KEYWORD << " "; |
80 | - writeISOTime(pTT._creationDate, pTT._timeFormat, pOut); | |
80 | + if(pTT._modificationDate == 0){ | |
81 | + pOut <<"0001-01-01T00:00:00:00.000Z"; | |
82 | + }else{ | |
83 | + writeISOTime(pTT._modificationDate, pTT._timeFormat, pOut); | |
84 | + } | |
81 | 85 | pOut << std::endl; |
82 | 86 | |
83 | 87 | ParameterDescriptionList pdl = pTT.getParameterDescritptions(); |
84 | 88 | // FieldNames |
85 | - pOut << "# " << SpaceData::FIELD_NAMES_KEYWORD << " "; | |
89 | + pOut << "# " << SpaceData::FIELD_NAMES_KEYWORD << " "<< "t_begin" <<" "<< "t_end"<<" "; | |
86 | 90 | for (auto parameterDescription : pdl) { |
87 | 91 | pOut << parameterDescription.getId() << " "; |
88 | 92 | } |
89 | 93 | pOut <<std::endl; |
90 | 94 | |
91 | 95 | // FieldUnits |
92 | - pOut << "# " << SpaceData::FIELD_UNIT_KEYWORD << " "; | |
96 | + pOut << "# " << SpaceData::FIELD_UNIT_KEYWORD << " "<< "DateTime" <<" "<< "DateTime"<<" "; | |
97 | + std::string unit; | |
93 | 98 | for (auto parameterDescription : pdl) { |
94 | - pOut << parameterDescription.getUnit() << " "; | |
99 | + unit = parameterDescription.getUnit().empty() ? "None" : parameterDescription.getUnit(); | |
100 | + pOut << unit << " "; | |
95 | 101 | } |
96 | 102 | pOut <<std::endl; |
97 | 103 | |
98 | 104 | // FieldTypes |
99 | - pOut << "# " << SpaceData::FIELD_TYPES_KEYWORD << " "; | |
105 | + pOut << "# " << SpaceData::FIELD_TYPES_KEYWORD << " "<< "char" <<" "<< "char"<<" "; | |
100 | 106 | for (auto parameterDescription : pdl) { |
101 | 107 | pOut << getTypeAsString(parameterDescription.getType()) << " "; |
102 | 108 | } |
103 | 109 | pOut <<std::endl; |
104 | 110 | |
105 | 111 | // # FieldNulls |
106 | - pOut << "# " << SpaceData::FIELD_NULLS_KEYWORD << " "; | |
112 | + pOut << "# " << SpaceData::FIELD_NULLS_KEYWORD << " "<< " "<< "0001-01-01T00:00:00:00.000Z" <<" "<< "0001-01-01T00:00:00:00.000Z"<<" ";; | |
107 | 113 | for (auto parameterDescription : pdl) { |
108 | 114 | pOut << parameterDescription.getNull() << " "; |
109 | 115 | } |
... | ... | @@ -111,12 +117,20 @@ void SpaceWriter::writeMetaData(const TimeTable& pTT, |
111 | 117 | |
112 | 118 | //ListStartDate |
113 | 119 | pOut << "# " << SpaceData::LIST_START_DATE_KEYWORD << " "; |
114 | - writeISOTime(pTT._listStartDate, pTT._timeFormat, pOut); | |
120 | + if(pTT._listStartDate == 0){ | |
121 | + pOut <<"0001-01-01T00:00:00:00.000Z"; | |
122 | + }else{ | |
123 | + writeISOTime(pTT._listStartDate, pTT._timeFormat, pOut); | |
124 | + } | |
115 | 125 | pOut << std::endl; |
116 | 126 | |
117 | 127 | //ListStopDate |
118 | 128 | pOut << "# " << SpaceData::LIST_STOP_DATE_KEYWORD << " "; |
119 | - writeISOTime(pTT._listStopDate, pTT._timeFormat, pOut); | |
129 | + if(pTT._listStopDate == 0){ | |
130 | + pOut <<"0001-01-01T00:00:00:00.000Z"; | |
131 | + }else{ | |
132 | + writeISOTime(pTT._listStopDate, pTT._timeFormat, pOut); | |
133 | + } | |
120 | 134 | pOut << std::endl; |
121 | 135 | |
122 | 136 | // Contact: |
... | ... | @@ -134,9 +148,11 @@ void SpaceWriter::writeMetaData(const TimeTable& pTT, |
134 | 148 | pOut << pTT._history << std::endl; |
135 | 149 | |
136 | 150 | // repeat variable names |
151 | + pOut << "# " << "t_begin" <<" "<< "t_end"<<" "; | |
137 | 152 | for (auto parameterDescription : pdl) { |
138 | 153 | pOut << parameterDescription.getId() << " "; |
139 | 154 | } |
155 | + pOut << std::endl; | |
140 | 156 | } |
141 | 157 | |
142 | 158 | void SpaceWriter::writeIntervals(const TimeTable& pTT, std::ostream& pOut) { | ... | ... |
src/TimeTableCatalog/TimeTable.cc
... | ... | @@ -16,6 +16,7 @@ |
16 | 16 | #include <stdio.h> |
17 | 17 | #include <curl/curl.h> |
18 | 18 | #include <curl/easy.h> |
19 | +#include "SpaceData.hh" | |
19 | 20 | |
20 | 21 | namespace TimeTableCatalog { |
21 | 22 | |
... | ... | @@ -23,18 +24,18 @@ log4cxx::LoggerPtr TimeTable::_logger( |
23 | 24 | log4cxx::Logger::getLogger("AMDA-Kernel.TimeTable")); |
24 | 25 | |
25 | 26 | TimeTable::TimeTable() : |
26 | - _creationDate(0), _timeFormat(TimeTable::TIME_FORMAT::UNKNOWN), _extTimeFormat(AMDA::OutputFormatTime::FORMAT_OUTPUT_TIME_ISO), | |
27 | - _listStartDate(0), _listStopDate(0), _contact("None"), _contactID("None"){ | |
27 | + _creationDate(0), _timeFormat(TimeTable::TIME_FORMAT::UNKNOWN), _extTimeFormat(AMDA::OutputFormatTime::FORMAT_OUTPUT_TIME_ISO), _modificationDate(0), | |
28 | + _listStartDate(0), _listStopDate(0), _contact("None"), _contactID("None"),_eventTableVersion(SpaceData::EVENT_TABLE_VERSION_DEFAULT), _listID(SpaceData::LIST_ID_DEFAULT){ | |
28 | 29 | } |
29 | 30 | |
30 | 31 | TimeTable::TimeTable(TIME_FORMAT pFormat) : |
31 | - _creationDate(0), _timeFormat(pFormat), _extTimeFormat(AMDA::OutputFormatTime::FORMAT_OUTPUT_TIME_ISO), | |
32 | - _listStartDate(0), _listStopDate(0), _contact("None"), _contactID("None") { | |
32 | + _creationDate(0), _timeFormat(pFormat), _extTimeFormat(AMDA::OutputFormatTime::FORMAT_OUTPUT_TIME_ISO), _modificationDate(0), | |
33 | + _listStartDate(0), _listStopDate(0), _contact("None"), _contactID("None"),_eventTableVersion(SpaceData::EVENT_TABLE_VERSION_DEFAULT), _listID(SpaceData::LIST_ID_DEFAULT) { | |
33 | 34 | } |
34 | 35 | |
35 | 36 | TimeTable::TimeTable(AMDA::OutputFormatTime pFormat) : |
36 | - _creationDate(0), _timeFormat(TimeTable::TIME_FORMAT::UNKNOWN), _extTimeFormat(pFormat), | |
37 | - _listStartDate(0), _listStopDate(0), _contact("None"), _contactID("None") { | |
37 | + _creationDate(0), _timeFormat(TimeTable::TIME_FORMAT::UNKNOWN), _extTimeFormat(pFormat),_modificationDate(0), | |
38 | + _listStartDate(0), _listStopDate(0), _contact("None"), _contactID("None"),_eventTableVersion(SpaceData::EVENT_TABLE_VERSION_DEFAULT), _listID(SpaceData::LIST_ID_DEFAULT) { | |
38 | 39 | } |
39 | 40 | |
40 | 41 | TimeTable::~TimeTable() { | ... | ... |
src/TimeTableCatalog/TimeTable.hh
... | ... | @@ -20,6 +20,7 @@ |
20 | 20 | #include "log4cxx/logger.h" |
21 | 21 | |
22 | 22 | |
23 | + | |
23 | 24 | namespace TimeTableCatalog { |
24 | 25 | |
25 | 26 | /** |
... | ... | @@ -166,12 +167,17 @@ public: |
166 | 167 | * TT creation date and interval dates ISO format (with or without msk) |
167 | 168 | */ |
168 | 169 | TIME_FORMAT _timeFormat; |
169 | - | |
170 | + | |
170 | 171 | /** |
171 | 172 | * TT creation date and interval dates extented format |
172 | 173 | */ |
173 | 174 | AMDA::OutputFormatTime _extTimeFormat; |
174 | 175 | |
176 | + /** | |
177 | + * TT modification date. | |
178 | + */ | |
179 | + double _modificationDate; | |
180 | + | |
175 | 181 | /** |
176 | 182 | * ListStartDate => start date of the survey |
177 | 183 | */ |
... | ... | @@ -191,6 +197,16 @@ public: |
191 | 197 | * contactID spase contact id |
192 | 198 | */ |
193 | 199 | std::string _contactID; |
200 | + | |
201 | + /** | |
202 | + * EventTableVersion version of the format | |
203 | + */ | |
204 | + std::string _eventTableVersion; | |
205 | + | |
206 | + /** | |
207 | + * listID : spase id of the ccatalog if existe | |
208 | + */ | |
209 | + std::string _listID; | |
194 | 210 | |
195 | 211 | protected: |
196 | 212 | ... | ... |