From andrew at physics.uwa.edu.au Fri Feb 2 06:41:45 2001 From: andrew at physics.uwa.edu.au (Andrew Williams) Date: Fri, 02 Feb 2001 19:41:45 +0800 Subject: [AstroPy] Updated FITS image library in (pure) Python Message-ID: <200102021143.TAA11971@solar.calm.wa.gov.au> Something to relieve the silence on this mailing list... I've put a new version of my Python FITS image library up at http://www.physics.uwa.edu.au/~andrew The new version includes support for reading and writing the data section of FITS images, instead of just the header cards, provided the Numeric Python high-speed array package is available. (If not, the library can be used in stand-alone mode to handle just the header cards, as before). It's in pure Python, so all you need is a basic Python installation (1.5.2 and up), plus NumPy if you want to deal with image data. This makes it trivial to us, and much more portable, although I've only tested it under Linux. Currently, the only documentation is in the form of source code comments and function docstrings. Typical use could be: ---------------------------------------------------------------------- import fits f=fits.FITS('/path/test.fits','r') et=float(f.headers['EXPTIME']) print 'Exptime=',et,' and comment was:',f.comments['EXPTIME'] print 'History of ', f.filename,':', f.comments['HISTORY'] print 'Comments:', f.comments['COMMENT'] print "Value at 256,256 was: ",f.data[255,255] #python arrays start at 0 f.data[255,255]=2000 print "But now = 2000" g=fits.FITS('/path/test2.fits','r') f.data=(f.data-g.data)*1000 f.save("/tmp/outfile.fits",fits.Float32) #Save as 32-bit float: BITPIX=-32 ---------------------------------------------------------------------- The FITS class also defines methods for preprocessing (bias, dark, and flat) the image, but are tailored for our observing setup and FITS header structure. They may or may not be useful for anyone else, but should provide a starting point for reduction code. While probably not as fast as dedicated C or FORTRAN, the speed is pretty good (I highly recommend NumPy), and negligible in comparison with the image readout time, so for basic pre-processing, it's fine. A function 'median' is also included that takes a list of FITS objects and returns the median image. Be warned, it's very memory hungry, as it loads the whole of every image to do the median. There _are_ ways I could speed this up and reduce the memory overhead by an order of magnitude or so, but it's a low-priority job. I've also put up 'improc.py', which has some more FITS image handler functions, and xpa.py which communicates with SAOtng or SAOds9 FITS image viewer, using the X Public Access mechanism (for displaying images and defining or reading image regions) This code is part of the user-interface to the CCD camera (an Apogee AP7 camera lent by Ohio State University) at Perth Observatory on our 24" automated telescope. It's really just a collection of libraries defining functions like 'exptime', inside the Python interactive interpeter. You can script the CCD and telescope operation in Python as you use it - a throwback to the old days of FORTH in astronomy... Please let me know if anyone uses (or especially, extends) any of this code. Andrew Williams -- Dr Andrew Williams andrew at physics.uwa.edu.au Perth Observatory, andrew at ucc.gu.uwa.edu.au Walnut rd, Bickley, Western Australia. andrewW at cyllene.uwa.edu.au _____________________________________________________ AstroPy mailing list - astropy at stsci.edu http://lheawww.gsfc.nasa.gov/~bridgman/AstroPy/ From wtbridgman at Radix.Net Sun Feb 4 19:08:16 2001 From: wtbridgman at Radix.Net (W.T. Bridgman) Date: Sun, 4 Feb 2001 19:08:16 -0500 Subject: [AstroPy] February 2001 - AstroPy Monthly Notice Message-ID: This is a monthly notice sent by the managers of the AstroPy Mailing List reminding you that your list subscription is still operational. The AstroPy web page is located at http://lheawww.gsfc.nasa.gov/~bridgman/AstroPy/ If you are interested in having any astronomical Python-related announcements, etc. included in this monthly reminder, please contact the list administrators: Tom Bridgman (bridgman at wyeth.gsfc.nasa.gov) or Paul Barrett (barrett at stsci.edu). _____________________________________________________ AstroPy mailing list - astropy at stsci.edu http://lheawww.gsfc.nasa.gov/~bridgman/AstroPy/ From ptak at cmu.edu Mon Feb 5 14:48:31 2001 From: ptak at cmu.edu (Andrew Ptak) Date: Mon, 5 Feb 2001 14:48:31 -0500 (EST) Subject: [AstroPy] new python astro cgibin program Message-ID: Hello everyone, Here's something for you to play with: http://xassist.phys.cmu.edu/xassist/qlook This program runs mostly in python and downloads ROSAT X-ray images for a given source and computes count rates, fluxes, etc. for the source closest to the expected position for the target, and then also estimates the Chandra ACIS count rates based on these fluxes. If more than one data sets are found then a long-term light curve is produced using biggles (c.f., biggles.sourceforge.net). In the near future other X-ray data will be available for this type of analysis. For bright sources that would show up in catalogs anyway the main advantage is just convenience for seeing the image rather than just getting a count rate and getting the Chandra count rate for proposal work. For fainter sources this handles upper-limits and detections in a Poisson-correct way. Of course, any comments are welcome. Cheers, Andy Ptak _____________________________________________________ AstroPy mailing list - astropy at stsci.edu http://lheawww.gsfc.nasa.gov/~bridgman/AstroPy/ From Barrett at stsci.edu Fri Feb 16 17:35:13 2001 From: Barrett at stsci.edu (Paul Barrett) Date: Fri, 16 Feb 2001 17:35:13 -0500 (EST) Subject: [AstroPy] PEP 209: Multi-Dimensional Arrays submitted. Message-ID: <14989.43433.340787.107124@nem-srvr.stsci.edu> The Python Enhancement Proposal (PEP) 209: Multi-Dimensional Arrays has been submitted for comment to python.sourceforge.net. Some comments have already been made, so please review the numpy-discussion list before commenting, so as not to re-hash previous arguments. Also, there will be a Numeric BoF at the 9th International Python Conference (Python 9) for those planning to attend. Cheers, Paul -- Dr. Paul Barrett Space Telescope Science Institute Phone: 410-338-4475 ESS/Science Software Group FAX: 410-338-4767 Baltimore, MD 21218 _____________________________________________________ AstroPy mailing list - astropy at stsci.edu http://lheawww.gsfc.nasa.gov/~bridgman/AstroPy/