@@ -25,41 +25,42 @@ def test_get_nasa_power(data_index, ghi_series):
2525 longitude = 7.64 ,
2626 start = data_index [0 ],
2727 end = data_index [- 1 ],
28- parameters = ['ALLSKY_SFC_SW_DWN' ],
2928 map_variables = False )
3029 # Check that metadata is correct
3130 assert meta ['latitude' ] == 44.76
3231 assert meta ['longitude' ] == 7.64
3332 assert meta ['altitude' ] == 705.88
34- assert meta ['header' ]['start' ] == '20250202'
35- assert meta ['header' ]['end' ] == '20250202'
36- assert meta ['header' ]['time_standard' ] == 'UTC'
37- assert meta ['header' ]['title' ] == 'NASA/POWER Source Native Resolution Hourly Data' # noqa: E501
38- assert meta ['header' ]['sources' ][0 ] == 'SYN1DEG'
39- # Check that columns are parsed correctly
40- assert 'ALLSKY_SFC_SW_DWN' in data .columns
33+ assert meta ['start' ] == '20250202'
34+ assert meta ['end' ] == '20250202'
35+ assert meta ['time_standard' ] == 'UTC'
36+ assert meta ['title' ] == 'NASA/POWER Source Native Resolution Hourly Data'
4137 # Assert that the index is parsed correctly
4238 pd .testing .assert_index_equal (data .index , data_index )
4339 # Test one column
4440 pd .testing .assert_series_equal (data ['ALLSKY_SFC_SW_DWN' ], ghi_series ,
4541 check_freq = False , check_names = False )
4642
4743
44+ def test_get_nasa_power_pvlib_params_naming (data_index , ghi_series ):
45+ data , meta = pvlib .iotools .get_nasa_power (latitude = 44.76 ,
46+ longitude = 7.64 ,
47+ start = data_index [0 ],
48+ end = data_index [- 1 ],
49+ parameters = ['ghi' ])
50+ # Assert that the index is parsed correctly
51+ pd .testing .assert_index_equal (data .index , data_index )
52+ # Test one column
53+ pd .testing .assert_series_equal (data ['ghi' ], ghi_series ,
54+ check_freq = False )
55+
56+
4857def test_get_nasa_power_map_variables (data_index ):
4958 # Check that variables are mapped by default to pvlib names
5059 data , meta = pvlib .iotools .get_nasa_power (latitude = 44.76 ,
5160 longitude = 7.64 ,
5261 start = data_index [0 ],
53- end = data_index [- 1 ],
54- parameters = ['ALLSKY_SFC_SW_DWN' ,
55- 'ALLSKY_SFC_SW_DIFF' ,
56- 'ALLSKY_SFC_SW_DNI' ,
57- 'CLRSKY_SFC_SW_DWN' ,
58- 'T2M' , 'WS2M' ,
59- 'WS10M'
60- ])
61- mapped_column_names = ['ghi' , 'dni' , 'dhi' , 'temp_air_2m' , 'wind_speed_2m' ,
62- 'wind_speed_10m' , 'ghi_clear' ]
62+ end = data_index [- 1 ])
63+ mapped_column_names = ['ghi' , 'dni' , 'dhi' , 'temp_air' , 'wind_speed' ]
6364 for c in mapped_column_names :
6465 assert c in data .columns
6566 assert meta ['latitude' ] == 44.76
0 commit comments