Code Monkey home page Code Monkey logo

Comments (2)

jradavenport avatar jradavenport commented on September 6, 2024

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')

from pydis.

jradavenport avatar jradavenport commented on September 6, 2024

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

from pydis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.