1515 '100' : 'ghi' ,
1616 '201' : 'dni' ,
1717 '300' : 'dhi' ,
18- '920' : 'wind_dir ' ,
18+ '920' : 'wind_direction ' ,
1919 '921' : 'wind_speed' ,
2020 '930' : 'temp_air' ,
2121 '931' : 'temp_dew' ,
2424}
2525
2626
27- def read_srml (filename ):
27+ def read_srml (filename , map_variables = True ):
2828 """
2929 Read University of Oregon SRML 1min .tsv file into pandas dataframe. The
3030 SRML is described in [1]_.
@@ -33,13 +33,14 @@ def read_srml(filename):
3333 ----------
3434 filename: str
3535 filepath or url to read for the tsv file.
36+ map_variables: bool, default: True
37+ When true, renames columns of the DataFrame to pvlib variable names
38+ where applicable. See variable :const:`VARIABLE_MAP`.
3639
3740 Returns
3841 -------
3942 data: Dataframe
40- A dataframe with datetime index and all of the variables listed
41- in the `VARIABLE_MAP` dict inside of the map_columns function,
42- along with their associated quality control flags.
43+ A dataframe with datetime index
4344
4445 Notes
4546 -----
@@ -64,7 +65,8 @@ def read_srml(filename):
6465 # Drop day of year and time columns
6566 data = data [data .columns [2 :]]
6667
67- data = data .rename (columns = map_columns )
68+ if map_variables :
69+ data = data .rename (columns = map_columns )
6870
6971 # Quality flag columns are all labeled 0 in the original data. They
7072 # appear immediately after their associated variable and are suffixed
@@ -166,7 +168,8 @@ def format_index(df):
166168 return df
167169
168170
169- def read_srml_month_from_solardat (station , year , month , filetype = 'PO' ):
171+ def read_srml_month_from_solardat (station , year , month , filetype = 'PO' ,
172+ map_variables = True ):
170173 """Request a month of SRML data from solardat and read it into
171174 a Dataframe. The SRML is described in [1]_.
172175
@@ -180,6 +183,9 @@ def read_srml_month_from_solardat(station, year, month, filetype='PO'):
180183 Month to request data for.
181184 filetype: string
182185 SRML file type to gather. See notes for explanation.
186+ map_variables: bool, default: True
187+ When true, renames columns of the DataFrame to pvlib variable names
188+ where applicable. See variable :const:`VARIABLE_MAP`.
183189
184190 Returns
185191 -------
@@ -214,5 +220,5 @@ def read_srml_month_from_solardat(station, year, month, filetype='PO'):
214220 year = year % 100 ,
215221 month = month )
216222 url = "http://solardat.uoregon.edu/download/Archive/"
217- data = read_srml (url + file_name )
223+ data = read_srml (url + file_name , map_variables = map_variables )
218224 return data
0 commit comments