##// END OF EJS Templates
Adds unit test with data holes
Alexandre Leroux -
r981:5d2dc7c46000
parent child
Show More
@@ -0,0 +1,62
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 : 180
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] : 14234.4,18737.3
39 # PARAMETER_TABLE_MAX_VALUES[0] : 18737.3,23254.9
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 : 2011-12-10T12:10:00.000
48 # INTERVAL_STOP : 2011-12-10T12:40:00.000
49 #
50 # ------
51 # DATA :
52 # ------
53 # DATA_COLUMNS : AMDA_TIME, tha_ion_sp[0], tha_ion_sp[1]
54 #
55 2011-12-10T12:10:54.000 2577578.000 2336016.000
56 2011-12-10T12:17:23.000 2314121.500 1712093.125
57 2011-12-10T12:23:51.000 2063608.750 1614491.625
58 2011-12-10T12:30:19.000 2234525.500 1764516.500
59 2011-12-10T12:35:04.000 1670215.250 1688078.500
60 2011-12-10T12:36:41.000 1689243.250 1743183.500
61 2011-12-10T12:38:18.000 1654617.125 1733603.250
62 2011-12-10T12:39:55.000 1504983.750 1708356.500 No newline at end of file
@@ -397,6 +397,61 void TestAmdaResultParser::testReadSpectrogramTxt_data()
397 << QStringLiteral("spectro/ValidSpectrogramFillValues.txt")
397 << QStringLiteral("spectro/ValidSpectrogramFillValues.txt")
398 << nanValuesResult; // Fill values are replaced by NaN values in the data series
398 << nanValuesResult; // Fill values are replaced by NaN values in the data series
399
399
400 QTest::newRow("Valid file (containing data holes, resolution = 3 minutes)")
401 << QStringLiteral("spectro/ValidSpectrogramDataHoles.txt")
402 << ExpectedResults<SpectrogramSeries>{}
403 .setParsingOK(true)
404 .setXAxisUnit(Unit{"t", true})
405 .setXAxisData({dateTime(2011, 12, 10, 12, 10, 54), //
406 dateTime(2011, 12, 10, 12, 13, 54), // Data hole
407 dateTime(2011, 12, 10, 12, 16, 54), // Data hole
408 dateTime(2011, 12, 10, 12, 17, 23), //
409 dateTime(2011, 12, 10, 12, 20, 23), // Data hole
410 dateTime(2011, 12, 10, 12, 23, 23), // Data hole
411 dateTime(2011, 12, 10, 12, 23, 51), //
412 dateTime(2011, 12, 10, 12, 26, 51), // Data hole
413 dateTime(2011, 12, 10, 12, 29, 51), // Data hole
414 dateTime(2011, 12, 10, 12, 30, 19), //
415 dateTime(2011, 12, 10, 12, 33, 19), // Data hole
416 dateTime(2011, 12, 10, 12, 35, 04), //
417 dateTime(2011, 12, 10, 12, 36, 41), //
418 dateTime(2011, 12, 10, 12, 38, 18), //
419 dateTime(2011, 12, 10, 12, 39, 55)})
420 .setYAxisEnabled(true)
421 .setYAxisUnit(Unit{"eV"})
422 .setYAxisData({16485.85, 20996.1}) // middle of the intervals of each band
423 .setValuesUnit(Unit{"eV/(cm^2-s-sr-eV)"})
424 .setValuesData(QVector<QVector<double> >{{2577578.000, //
425 nan, // Data hole
426 nan, // Data hole
427 2314121.500, //
428 nan, // Data hole
429 nan, // Data hole
430 2063608.750, //
431 nan, // Data hole
432 nan, // Data hole
433 2234525.500, //
434 nan, // Data hole
435 1670215.250, //
436 1689243.250, //
437 1654617.125, //
438 1504983.750},
439 {2336016.000, //
440 nan, // Data hole
441 nan, // Data hole
442 1712093.125, //
443 nan, // Data hole
444 nan, // Data hole
445 1614491.625, //
446 nan, // Data hole
447 nan, // Data hole
448 1764516.500, //
449 nan, // Data hole
450 1688078.500, //
451 1743183.500, //
452 1733603.250, //
453 1708356.500}});
454
400 // Invalid files
455 // Invalid files
401 QTest::newRow("Invalid file (inconsistent bands)")
456 QTest::newRow("Invalid file (inconsistent bands)")
402 << QStringLiteral("spectro/InvalidSpectrogramWrongBands.txt")
457 << QStringLiteral("spectro/InvalidSpectrogramWrongBands.txt")
General Comments 0
You need to be logged in to leave comments. Login now