<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html><body style='font-size: 10pt; font-family: "Book Antiqua",Palatino,serif'>
<p><span class="st"> Would be great to have the 'object visibility' in local time.  This issue was also flagged  by someone in the discussion group on <span class="st">astroplan<em>. </em>I hope they  fix it soon. <em> <br /></em></span></span></p>
<p><span class="st"><span class="st">Regards,</span></span></p>
<p><span class="st"><span class="st">Ravinder</span></span></p>
<p>On 2016-11-08 03:09, Matthew Craig wrote:</p>
<blockquote type="cite" style="padding-left:5px; border-left:#1010ff 2px solid; margin-left:5px"><!-- html ignored --><!-- head ignored --><!-- meta ignored -->Hi,
<div> </div>
<div>IIRC, astropy times do not support timezones in a very direct way [1]. Both start_time and end_time from the example will be interpreted as times in UTC, and the time arguments to functions in astroplan are in UTC, not local time, even if you specify the time zone when you create the Observer object. The documentation for target_is_up say that the time is passed directly to the astropy Time class which, in the cases in the sample code, will assume UTC.</div>
<div> </div>
<div>It looks like if you want to get local times you could use the astropy_time_to_datetime method of Observer.</div>
<div> </div>
<div>I'm using astropy in an undergraduate observing class this semester and have been reminding them (repeatedly) that they need to do local to UTC conversions themselves and then feed the UTC times into astropy/astroplan. That is a little inconvenient, but seemed less error-prone than explaining how to use pytz or create a TimezoneInfo object (their python background is typically limited).</div>
<div> </div>
<div>[1]: <a href="http://docs.astropy.org/en/latest/time/index.html#timezones">http://docs.astropy.org/en/latest/time/index.html#timezones</a></div>
<div><br />
<div>
<div style="color: #000000; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="color: #000000; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="color: #000000; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Matt Craig</div>
<div style="color: #000000; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br /> schedule:  <a href="http://physics.mnstate.edu/craig">http://physics.mnstate.edu/craig</a><br /> ——
<div>Professor<br /> Department of Physics and Astronomy </div>
<div>Minnesota State University Moorhead<br /> 1104 7th Ave S, Moorhead MN 56563<br /><br /> office: Hagen 307F<br /> phone: (218) 477-2439<br /> fax: (218) 477-2290</div>
</div>
</div>
</div>
</div>
<br />
<div>
<blockquote type="cite" style="padding-left:5px; border-left:#1010ff 2px solid; margin-left:5px">
<div>On Nov 7, 2016, at 2:57 PM, Eric L. N. Jensen <<a href="mailto:ejensen1@swarthmore.edu">ejensen1@swarthmore.edu</a>> wrote:</div>
<br class="Apple-interchange-newline" />
<div>
<div>Good catch, Gautham. <br /><br /> And more generally to that point, Steven, I'd suggest getting in the habit of *always* specifying the timezone for any times you use in your code (e.g. in any call to 'Time'), even if you're using UTC, just to be more clear to yourself and to anyone reading your code what timezone you're working with.  In the example you gave, when you're specifying the start and end times it would still be good to explicitly specify the timezone there as well. <br /><br /> Eric<br /><br /><br />
<blockquote type="cite" style="padding-left:5px; border-left:#1010ff 2px solid; margin-left:5px">On Nov 7, 2016, at 3:53 PM, Gautham Narayan <<a href="mailto:gnarayan@noao.edu">gnarayan@noao.edu</a>> wrote:<br /><br /><br /> Specify the time as well as the date. 2016-11-11 is being parsed at 2016-11-11 00:00:00 UTC, at which point it's only 5pm here in AZ, so it's not yet civil twilight at Kitt Peak.<br /><br /> print(<a href="http://astroplan.is">astroplan.is</a>_observable(constraint, kpno, target[:1], times=[Time('2016-11-11 12:15:00')]))<br /> # prints True<br /><br /></blockquote>
<br /> _______________________________________________<br /> AstroPy mailing list<br /><a href="mailto:AstroPy@scipy.org">AstroPy@scipy.org</a><br /> https://mail.scipy.org/mailman/listinfo/astropy</div>
</div>
</blockquote>
</div>
</div>
<!-- html ignored --><br />
<pre>_______________________________________________
AstroPy mailing list
<a href="mailto:AstroPy@scipy.org">AstroPy@scipy.org</a>
<a href="https://mail.scipy.org/mailman/listinfo/astropy">https://mail.scipy.org/mailman/listinfo/astropy</a>
</pre>
</blockquote>
<p> </p>
<div>
<pre>-- <br />Best Regards
Dr Ravinder Banyal
Indian Institute of Astrophysics
Koramangala 2nd Block
Bangalore 560034
Phone: 08025530672</pre>
</div>
</body></html>