@@ -915,7 +915,7 @@ def readWeatherFile(self, weatherFile=None, starttime=None,
915915 source : str
916916 To help identify different types of .csv files. If None, it assumes
917917 it is a TMY3-style formated data. Current options: 'TMY3',
918- 'solargis', 'EPW', 'SAM'
918+ 'solargis', 'EPW', 'SAM', 'PSM3'
919919 coerce_year : int
920920 Year to coerce weather data to in YYYY format, ie 2021.
921921 If more than one year of data in the weather file, year is NOT coerced.
@@ -968,7 +968,7 @@ def readWeatherFile(self, weatherFile=None, starttime=None,
968968 label = 'right'
969969 metdata , metadata = self ._readTMY (weatherFile , label = label , coerce_year = coerce_year )
970970
971- if source .lower () == 'sam' :
971+ if source .lower () in [ 'sam' , 'psm3' ] :
972972 if label is None :
973973 label = 'left'
974974 metdata , metadata = self ._readSAM (weatherFile )
@@ -1390,14 +1390,12 @@ def _convertTMYdate(data, meta):
13901390
13911391 def _readSAM (self , SAMfile = None ):
13921392 '''
1393- use pvlib to read in a tmy3 file.
1394- Note: pvlib 0.7 does not currently support sub-hourly files. Until
1395- then, use _readTMYdate() to create the index
1393+ Read an NSRDB PSM3 weather file (formatted as SAM CSV).
13961394
13971395 Parameters
13981396 ------------
13991397 tmyfile : str
1400- Filename of tmy3 to be read with pvlib.tmy.readtmy3
1398+ Filename of PSM3 to be read with pvlib.iotools.read_psm3
14011399
14021400 Returns
14031401 -------
@@ -1408,7 +1406,7 @@ def _readSAM(self, SAMfile=None):
14081406 # Will only work with latest PVLIB Release once htey accept my push..
14091407 # Note Oct. 10
14101408 # import pvlib
1411- #(tmydata, metadata) = pvlib.iotools.tmy. read_psm3(filename=SAMfile,
1409+ #(tmydata, metadata) = pvlib.iotools.read_psm3(filename=SAMfile,
14121410 # map_variables=True)
14131411 with open (SAMfile ) as myfile :
14141412 head = next (myfile )#
0 commit comments