StellarCartography / pydis

DEPRECATED: Check out PyKOSMOS!
https://github.com/jradavenport/pykosmos
MIT License
43 stars 27 forks source link

real-time reduction #15

Open jradavenport opened 9 years ago

jradavenport commented 9 years ago

write a version of autoreduce that does the cal's, and then waits and reduces data in real time as it comes down from the telescope

jradavenport commented 9 years ago

After talking with @kolbylyn, realized we need to put in a bit of extra caution because files come in slowly from TUI and may be incomplete when PyDIS tries to read them.

I tested this w/ astropy.io.fits.open(), and if you give it an incomplete file it returns an IOError. Thus we need to include a Try-Except test, something like this:

while ...
# look for new files, if found, then do this
try:
    hdulist = fits.open('new_img.fits')
except IOError:
    print('nope')
jradavenport commented 9 years ago

Some thoughts on watching a folder for new files: http://stackoverflow.com/questions/3411020/python-checking-if-new-file-is-in-folder

and reading them in with os vs subprocess: http://stackoverflow.com/questions/3791465/python-os-system-for-command-line-call-linux-not-returning-what-it-should