<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Time zones
🌐!
This is a demo of some convenience methods for manipulating timezones with the Observer class. The two methods are
Step1:  Convert that astropy.time.Time back to a localized datetime, arriving back at the original datetime (only this one is localized)
Step2:  Let's say the Subaru observer is remotely observing from the East Coast. Let's convert their local time (Eastern) to an astropy time. Since this datetime is localized, datetime_to_astropy_time will use the datetime's timezone (rather than assuming self.timezone)
Step3:  Warning
How you construct your localized timezone is important! Don't initialize datetimes with
the tzinfo kwarg. Here's an example of when it doesn't work. These two times should be equal, but are not. See pytz documentation for discussion.
<ASSISTANT_TASK:>
Python Code:
from __future__ import (absolute_import, division, print_function,
                        unicode_literals)
from astropy.time import Time
import astropy.units as u
from astropy.coordinates import EarthLocation
import pytz
import datetime
from astroplan import Observer
# Set up an observer at ~Subaru
location = EarthLocation.from_geodetic(-155.4*u.deg, 19.8*u.deg)
obs = Observer(location=location, timezone=pytz.timezone('US/Hawaii'))
# Pick a local (Hawaii) time to observe: midnight
local_naive_datetime = datetime.datetime(2015, 7, 14, 0)
# What is the astropy.time.Time equivalent for this datetime?
astropy_time = obs.datetime_to_astropy_time(local_naive_datetime)
print('astropy.time.Time (UTC):', astropy_time)
Explanation: Time zones
🌐!
This is a demo of some convenience methods for manipulating timezones with the Observer class. The two methods are: 
self.datetime_to_astropy_time(datetime) which converts a naive or timezone-aware datetime to an astropy.time.Time object. 
If the input datetime is naive, it assumes that the implied timezone is the one saved in the instance of Observer (in self.timezone).
self.astropy_time_to_datetime(astropy_time) which converts an astropy.time.Time object into a localized datetime, in the timezone saved in the instance of Observer (in self.timezone).
End of explanation
localized_datetime = obs.astropy_time_to_datetime(astropy_time)
print('datetime:', localized_datetime)
print('new datetime equivalent to original naive datetime?:', 
      local_naive_datetime == localized_datetime.replace(tzinfo=None))
Explanation: Convert that astropy.time.Time back to a localized datetime, arriving back at the original datetime (only this one is localized):
End of explanation
east_coast_datetime = pytz.timezone('US/Eastern').localize(datetime.datetime(2015, 7, 14, 6))
east_coast_astropy_time = obs.datetime_to_astropy_time(east_coast_datetime)
print('Convert local East Coast time to UTC:', east_coast_astropy_time)
print('Equivalent to original astropy time?:', east_coast_astropy_time == astropy_time)
Explanation: Let's say the Subaru observer is remotely observing from the East Coast. Let's convert their local time (Eastern) to an astropy time. Since this datetime is localized, datetime_to_astropy_time will use the datetime's timezone (rather than assuming self.timezone):
End of explanation
tzinfo_kwarg = datetime.datetime(2015, 7, 14, 6, tzinfo=pytz.timezone('US/Eastern'))
localized = pytz.timezone('US/Eastern').localize(datetime.datetime(2015, 7, 14, 6))
print('with tz assigned in kwarg:', tzinfo_kwarg)
print('with localization by tz.localize(dt):', localized)
Explanation: Warning
How you construct your localized timezone is important! Don't initialize datetimes with
the tzinfo kwarg. Here's an example of when it doesn't work. These two times should be equal, but are not. See pytz documentation for discussion.
End of explanation
<END_TASK>