0

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!

Jason
  • 181
  • 2
  • 14
  • 1
    Running your code results in the error `NameError: name 'Blodgett_raw' is not defined` — to make it able for readers to reproduce your problem, you will want to edit the question and add in the code that creates that object as well. – Brandon Rhodes Oct 14 '16 at 10:10

1 Answers1

0

Not an answer but a suggestion.

You could file an issue or ask the developers about this.

For instance I just found this but I'm not sure if this is your problem.

Check it out anyway.

Douglas G. Allen
  • 2,203
  • 21
  • 20