Closed mlandriau closed 7 years ago
bytes vs. unicode in python 3 is such a pain.
Ideally the caching and I/O should be implemented such that the object returned from getCalAll is identical regardless of whether it was created on-the-fly or read from a cache. i.e. please fix it within getCalAll
so that other code doesn't have to know whether it was from a cache or not.
Let's drop the string entirely from the ephemerides file, since it doesn't really belong there, and compute it on the fly from day
with:
'{y:04d}{m:02d}{d:02d}'.format(y=day.year, m=day.month, d=day.day)
I will make this change on my branch unless someone objects.
This was fixed in #30
When created, the 'dirname' part of the calendar is of type 'S8' if computed, but 'U8' if read from file. This causes en error in the line 281 of afternoonplan.py:
filename = 'obsplan' + day_stats['dirName'].decode('ascii') + '.fits'
When read from file, the line should not have the .decode('ascii') .