##// END OF EJS Templates
Adds valid test cases on bands
Alexandre Leroux -
r971:0739f6ecd269
parent child
Show More
@@ -0,0 +1,59
1 # -----------
2 # AMDA INFO :
3 # -----------
4 # AMDA_ABOUT : Created by CDPP/AMDA(c)
5 # AMDA_VERSION : 3.5.0
6 # AMDA_ACKNOWLEDGEMENT : CDPP/AMDA Team
7 #
8 # --------------
9 # REQUEST INFO :
10 # --------------
11 # REQUEST_STRUCTURE : one-file-per-parameter-per-interval
12 # REQUEST_TIME_FORMAT : ISO 8601
13 # REQUEST_OUTPUT_PARAMS : tha_ion_sp
14 #
15 # -----------------
16 # BASE PARAMETERS :
17 # -----------------
18 #
19 # MISSION_ID : NONE
20 #
21 # INSTRUMENT_ID : NONE
22 #
23 # DATASET_ID : tha-esa-l2i
24 # DATASET_NAME : ion full mode
25 # DATASET_SOURCE : CDPP/DDServer
26 # DATASET_GLOBAL_START : 2007-03-07T18:53:59.134
27 # DATASET_GLOBAL_STOP : 2017-11-04T18:35:25.907
28 # DATASET_MIN_SAMPLING : 96
29 # DATASET_MAX_SAMPLING : 385
30 #
31 # PARAMETER_ID : tha_ion_sp
32 # PARAMETER_NAME : tha_ion_sp
33 # PARAMETER_SHORT_NAME : spectra
34 # PARAMETER_UNITS : eV/(cm^2-s-sr-eV)
35 # PARAMETER_TENSOR_ORDER : 0
36 # PARAMETER_TABLE[0] : energy
37 # PARAMETER_TABLE_UNITS[0] : eV
38 # PARAMETER_TABLE_MIN_VALUES[0] : 5.00000,6.50000,8.70000
39 # PARAMETER_TABLE_MAX_VALUES[0] : 6.50000,8.70000,11.4000
40 # PARAMETER_FILL_VALUE : nan
41 # PARAMETER_UCD : phys.flux.density;phys.energy;phys.atmol.ionStage
42 #
43 #
44 # ---------------
45 # INTERVAL INFO :
46 # ---------------
47 # INTERVAL_START : 2012-11-06T09:13:31.000
48 # INTERVAL_STOP : 2012-11-06T09:21:00.000
49 #
50 # ------
51 # DATA :
52 # ------
53 # DATA_COLUMNS : AMDA_TIME, tha_ion_sp[0], tha_ion_sp[1], tha_ion_sp[2]
54 #
55 2012-11-06T09:14:35.000 16313.780 15405.838 8946.475
56 2012-11-06T09:16:10.000 12631.465 11957.925 18133.158
57 2012-11-06T09:17:45.000 8223.368 15026.249 10875.621
58 2012-11-06T09:19:20.000 27595.301 25617.533 24051.619
59 2012-11-06T09:20:55.000 12820.613 11179.109 19283.221 No newline at end of file
@@ -0,0 +1,59
1 # -----------
2 # AMDA INFO :
3 # -----------
4 # AMDA_ABOUT : Created by CDPP/AMDA(c)
5 # AMDA_VERSION : 3.5.0
6 # AMDA_ACKNOWLEDGEMENT : CDPP/AMDA Team
7 #
8 # --------------
9 # REQUEST INFO :
10 # --------------
11 # REQUEST_STRUCTURE : one-file-per-parameter-per-interval
12 # REQUEST_TIME_FORMAT : ISO 8601
13 # REQUEST_OUTPUT_PARAMS : tha_ion_sp
14 #
15 # -----------------
16 # BASE PARAMETERS :
17 # -----------------
18 #
19 # MISSION_ID : NONE
20 #
21 # INSTRUMENT_ID : NONE
22 #
23 # DATASET_ID : tha-esa-l2i
24 # DATASET_NAME : ion full mode
25 # DATASET_SOURCE : CDPP/DDServer
26 # DATASET_GLOBAL_START : 2007-03-07T18:53:59.134
27 # DATASET_GLOBAL_STOP : 2017-11-04T18:35:25.907
28 # DATASET_MIN_SAMPLING : 96
29 # DATASET_MAX_SAMPLING : 385
30 #
31 # PARAMETER_ID : tha_ion_sp
32 # PARAMETER_NAME : tha_ion_sp
33 # PARAMETER_SHORT_NAME : spectra
34 # PARAMETER_UNITS : eV/(cm^2-s-sr-eV)
35 # PARAMETER_TENSOR_ORDER : 0
36 # PARAMETER_TABLE[0] : energy
37 # PARAMETER_TABLE_UNITS[0] : eV
38 # PARAMETER_TABLE_MIN_VALUES[0] : 5.00000,6.50000,8.70000,11.4000
39 # PARAMETER_TABLE_MAX_VALUES[0] : 6.50000,8.70000,11.4000,14.6000
40 # PARAMETER_FILL_VALUE : nan
41 # PARAMETER_UCD : phys.flux.density;phys.energy;phys.atmol.ionStage
42 #
43 #
44 # ---------------
45 # INTERVAL INFO :
46 # ---------------
47 # INTERVAL_START : 2012-11-06T09:13:31.000
48 # INTERVAL_STOP : 2012-11-06T09:21:00.000
49 #
50 # ------
51 # DATA :
52 # ------
53 # DATA_COLUMNS : AMDA_TIME, tha_ion_sp[0], tha_ion_sp[1], tha_ion_sp[2], tha_ion_sp[3]
54 #
55 2012-11-06T09:14:35.000 16313.780 15405.838 8946.475 20907.664
56 2012-11-06T09:16:10.000 12631.465 11957.925 18133.158 32076.725
57 2012-11-06T09:17:45.000 8223.368 15026.249 10875.621 13008.381
58 2012-11-06T09:19:20.000 27595.301 25617.533 24051.619 13142.759
59 2012-11-06T09:20:55.000 12820.613 11179.109 19283.221 23226.998 No newline at end of file
@@ -0,0 +1,59
1 # -----------
2 # AMDA INFO :
3 # -----------
4 # AMDA_ABOUT : Created by CDPP/AMDA(c)
5 # AMDA_VERSION : 3.5.0
6 # AMDA_ACKNOWLEDGEMENT : CDPP/AMDA Team
7 #
8 # --------------
9 # REQUEST INFO :
10 # --------------
11 # REQUEST_STRUCTURE : one-file-per-parameter-per-interval
12 # REQUEST_TIME_FORMAT : ISO 8601
13 # REQUEST_OUTPUT_PARAMS : tha_ion_sp
14 #
15 # -----------------
16 # BASE PARAMETERS :
17 # -----------------
18 #
19 # MISSION_ID : NONE
20 #
21 # INSTRUMENT_ID : NONE
22 #
23 # DATASET_ID : tha-esa-l2i
24 # DATASET_NAME : ion full mode
25 # DATASET_SOURCE : CDPP/DDServer
26 # DATASET_GLOBAL_START : 2007-03-07T18:53:59.134
27 # DATASET_GLOBAL_STOP : 2017-11-04T18:35:25.907
28 # DATASET_MIN_SAMPLING : 96
29 # DATASET_MAX_SAMPLING : 385
30 #
31 # PARAMETER_ID : tha_ion_sp
32 # PARAMETER_NAME : tha_ion_sp
33 # PARAMETER_SHORT_NAME : spectra
34 # PARAMETER_UNITS : eV/(cm^2-s-sr-eV)
35 # PARAMETER_TENSOR_ORDER : 0
36 # PARAMETER_TABLE[0] : energy
37 # PARAMETER_TABLE_UNITS[0] : eV
38 # PARAMETER_TABLE_MIN_VALUES[0] : 8.70000,6.50000,11.4000,5.00000
39 # PARAMETER_TABLE_MAX_VALUES[0] : 11.4000,8.70000,14.6000,6.50000
40 # PARAMETER_FILL_VALUE : nan
41 # PARAMETER_UCD : phys.flux.density;phys.energy;phys.atmol.ionStage
42 #
43 #
44 # ---------------
45 # INTERVAL INFO :
46 # ---------------
47 # INTERVAL_START : 2012-11-06T09:13:31.000
48 # INTERVAL_STOP : 2012-11-06T09:21:00.000
49 #
50 # ------
51 # DATA :
52 # ------
53 # DATA_COLUMNS : AMDA_TIME, tha_ion_sp[0], tha_ion_sp[1], tha_ion_sp[2], tha_ion_sp[3]
54 #
55 2012-11-06T09:14:35.000 8946.475 15405.838 20907.664 16313.780
56 2012-11-06T09:16:10.000 18133.158 11957.925 32076.725 12631.465
57 2012-11-06T09:17:45.000 10875.621 15026.249 13008.381 8223.368
58 2012-11-06T09:19:20.000 24051.619 25617.533 13142.759 27595.301
59 2012-11-06T09:20:55.000 19283.221 11179.109 23226.998 12820.613 No newline at end of file
@@ -331,6 +331,47 void TestAmdaResultParser::testReadSpectrogramTxt_data()
331 // Test cases //
331 // Test cases //
332 // ////////// //
332 // ////////// //
333
333
334 // Valid files
335 QTest::newRow("Valid file (three bands)")
336 << QStringLiteral("spectro/ValidSpectrogram1.txt")
337 << ExpectedResults<SpectrogramSeries>{}
338 .setParsingOK(true)
339 .setXAxisUnit(Unit{"t", true})
340 .setXAxisData({dateTime(2012, 11, 6, 9, 14, 35), dateTime(2012, 11, 6, 9, 16, 10),
341 dateTime(2012, 11, 6, 9, 17, 45), dateTime(2012, 11, 6, 9, 19, 20),
342 dateTime(2012, 11, 6, 9, 20, 55)})
343 .setYAxisEnabled(true)
344 .setYAxisUnit(Unit{"eV"})
345 .setYAxisData({5.75, 7.6, 10.05}) // middle of the intervals of each band
346 .setValuesUnit(Unit{"eV/(cm^2-s-sr-eV)"})
347 .setValuesData(QVector<QVector<double> >{
348 {16313.780, 12631.465, 8223.368, 27595.301, 12820.613},
349 {15405.838, 11957.925, 15026.249, 25617.533, 11179.109},
350 {8946.475, 18133.158, 10875.621, 24051.619, 19283.221}});
351
352 auto fourBandsResult
353 = ExpectedResults<SpectrogramSeries>{}
354 .setParsingOK(true)
355 .setXAxisUnit(Unit{"t", true})
356 .setXAxisData({dateTime(2012, 11, 6, 9, 14, 35), dateTime(2012, 11, 6, 9, 16, 10),
357 dateTime(2012, 11, 6, 9, 17, 45), dateTime(2012, 11, 6, 9, 19, 20),
358 dateTime(2012, 11, 6, 9, 20, 55)})
359 .setYAxisEnabled(true)
360 .setYAxisUnit(Unit{"eV"})
361 .setYAxisData({5.75, 7.6, 10.05, 13.}) // middle of the intervals of each band
362 .setValuesUnit(Unit{"eV/(cm^2-s-sr-eV)"})
363 .setValuesData(QVector<QVector<double> >{
364 {16313.780, 12631.465, 8223.368, 27595.301, 12820.613},
365 {15405.838, 11957.925, 15026.249, 25617.533, 11179.109},
366 {8946.475, 18133.158, 10875.621, 24051.619, 19283.221},
367 {20907.664, 32076.725, 13008.381, 13142.759, 23226.998}});
368
369 QTest::newRow("Valid file (four bands)")
370 << QStringLiteral("spectro/ValidSpectrogram2.txt") << fourBandsResult;
371 QTest::newRow("Valid file (four unsorted bands)")
372 << QStringLiteral("spectro/ValidSpectrogram3.txt")
373 << fourBandsResult; // Bands and values are sorted
374
334 }
375 }
335
376
336 void TestAmdaResultParser::testReadSpectrogramTxt()
377 void TestAmdaResultParser::testReadSpectrogramTxt()
General Comments 0
You need to be logged in to leave comments. Login now