I am trying to find the solar zenith angle for data sets throughout the United States. The issue I am having is that my data set timestamp does not give me the time zone it is located in. Here is an example below:
Blodgett_lat = 38.89525
Blodgett_lon = -120.63275
Blodgett_elev = 1280.0 # meters
Blodgett_timestamp = '2001-01-01 00:28:48' # Blodgett_raw.index[0]
from pysolar.solar import *
solar_zenith_angle = get_altitude(Blodgett_lat,Blodgett_lon,Blodgett_timestamp,elevation=Blodgett_elev)
-53.09626336
I know that the issue is pysolar is assuming GMT time instead of PST. I try to get around with this issue by telling the pandas timestamp index that the tz_localize is the 'US/Pacific' timezone, but it gives me the error below:
Blodgett_raw.index.tz_localize('US/Pacific')
NonExistentTimeError: 2001-01-01 00:28:48
How can I be able to fix this problem? Any help would be much appreciated!