@@ -12,7 +12,7 @@ def test_energy_flux_output():
12
12
13
13
assert round (outputEnergyFlux [0 ],7 ) == round (0.00012419 ,7 )
14
14
15
- def test_timestamp_flux_output ():
15
+ def test_timestamp_flux_output_no_tzinfo ():
16
16
17
17
datetimeToUse = dt .datetime (
18
18
year = 2001 ,
@@ -25,6 +25,29 @@ def test_timestamp_flux_output():
25
25
26
26
outputtedSpectralDataFrame = CosRayModifiedISO .getSpectrumUsingTimestamp (datetimeToUse ,atomicNumber = 1 )
27
27
28
+ assert round (outputtedSpectralDataFrame ["Energy (MeV/n)" ].iloc [0 ],5 ) == round (11.294627 ,5 )
29
+ assert round (outputtedSpectralDataFrame ["Energy (MeV/n)" ].iloc [4 ],5 ) == round (28.370820 ,5 )
30
+ assert round (outputtedSpectralDataFrame ["Rigidity (GV/n)" ].iloc [0 ],5 ) == round (0.146022 ,5 )
31
+ assert round (outputtedSpectralDataFrame ["Rigidity (GV/n)" ].iloc [4 ],5 ) == round (0.232474 ,5 )
32
+ assert round (outputtedSpectralDataFrame ["d_Flux / d_E (cm-2 s-1 sr-1 (MeV/n)-1)" ].iloc [0 ],10 ) == round (2.290835e-07 ,10 )
33
+ assert round (outputtedSpectralDataFrame ["d_Flux / d_E (cm-2 s-1 sr-1 (MeV/n)-1)" ].iloc [4 ],10 ) == round (1.546788e-06 ,10 )
34
+ assert round (outputtedSpectralDataFrame ["d_Flux / d_R (cm-2 s-1 sr-1 (GV/n)-1)" ].iloc [0 ],8 ) == round (3.522790e-05 ,8 )
35
+ assert round (outputtedSpectralDataFrame ["d_Flux / d_R (cm-2 s-1 sr-1 (GV/n)-1)" ].iloc [4 ],8 ) == round (3.719962e-04 ,8 )
36
+
37
+ def test_timestamp_flux_output ():
38
+
39
+ datetimeToUse = dt .datetime (
40
+ year = 2001 ,
41
+ month = 10 ,
42
+ day = 27 ,
43
+ hour = 0 ,
44
+ minute = 10 ,
45
+ second = 35 ,
46
+ tzinfo = dt .timezone .utc
47
+ )
48
+
49
+ outputtedSpectralDataFrame = CosRayModifiedISO .getSpectrumUsingTimestamp (datetimeToUse ,atomicNumber = 1 )
50
+
28
51
assert round (outputtedSpectralDataFrame ["Energy (MeV/n)" ].iloc [0 ],5 ) == round (11.294627 ,5 )
29
52
assert round (outputtedSpectralDataFrame ["Energy (MeV/n)" ].iloc [4 ],5 ) == round (28.370820 ,5 )
30
53
assert round (outputtedSpectralDataFrame ["Rigidity (GV/n)" ].iloc [0 ],5 ) == round (0.146022 ,5 )
0 commit comments