From andrew at physics.uwa.edu.au Thu Feb 24 04:25:38 2000 From: andrew at physics.uwa.edu.au (Andrew Williams) Date: Thu, 24 Feb 2000 17:25:38 +0800 Subject: Astro-Py list Message-ID: <200002240926.RAA31633@galaxy.calm.wa.gov.au> This list has been quiet since I joined - is there actually anyone out there? I'm at Perth Observatory in Western Australia, using Python for data reduction scripts, and to control an Apogee AP7 camera, through pipes to a low-level driver ('Ariel') written by staff at Ohio State University. The only code likely to be useful elsewhere is a FITS file class that reads and parses header cards into a dictionary, so you can do stuff like: import fits f=fits.FITSfile('/path/test.fits','h') et=float(f.headers['EXPTIME']) print 'Exptime=',et,' and comment was:',f.comments['EXPTIME'] print 'All history cards for ',f.filename,':' print f.comments['HISTORY'] Not fancy - no error checking yet to see if the file actually _is_ in FITS format, for example - but it's only 50 lines of python. So far it only handles 'h' mode, to parse headers and leave the file closed. I was planning to add 'r' and 'w' as for normal file classes when I need to actually get at the data. I also don't want to spend too much time duplicating something that's already been written. The code is at: http://www.physics.uwa.edu.au/~andrew/ 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 From S.J.Quinney at durham.ac.uk Thu Feb 24 05:22:41 2000 From: S.J.Quinney at durham.ac.uk (Stephen) Date: Thu, 24 Feb 2000 10:22:41 +0000 (GMT) Subject: Astro-Py list In-Reply-To: <200002240926.RAA31633@galaxy.calm.wa.gov.au> Message-ID: On Thu, 24 Feb 2000, Andrew Williams wrote: > >This list has been quiet since I joined - is there actually anyone out >there? I've been wondering the same thing, i wasn't really sure if the list was just for announcements or whether i could ask questions or post about stuff myself. > >I'm at Perth Observatory in Western Australia, using Python for data >reduction scripts, and to control an Apogee AP7 camera, through pipes >to a low-level driver ('Ariel') written by staff at Ohio State >University. The only code likely to be useful elsewhere is a FITS file >class that reads and parses header cards into a dictionary, so you can >do stuff like: I would actually be very interested in python code for telescope control. I am involved in an undergraduate lab in Durham University, we have three Meade telescopes with various sbig (st6/st7) cameras attached. We are currently running everything from Windows but are looking to convert to Linux. Currently the idea is to use xephem for telescope control, but we have various other equipment for which software doesn't exist. I am currently writing control software for an electronic focusser. I will then be looking into CCD control stuff, including grabbing the frames, temperature control, etc.. Any pointers to python code or information on how to write such software would be very welcome. Stephen From msdemlei at head-cfa.harvard.edu Thu Feb 24 09:21:39 2000 From: msdemlei at head-cfa.harvard.edu (Markus Demleitner) Date: Thu, 24 Feb 2000 09:21:39 -0500 (EST) Subject: Astro-Py list In-Reply-To: <200002240926.RAA31633@galaxy.calm.wa.gov.au> Message-ID: On 24-Feb-00 Andrew Williams wrote: > > This list has been quiet since I joined - is there actually anyone > out > there? > Yes, another one -- I'm here at the ADS, and we use python mostly for not exactly astronomy-related stuff, including identifying and isolating references or abstracts from our scans, resolving references, maintaining our synonym file etc. pp. As I said, mostly stuff that's more bibliographic in orientation, but hey, we're the *astro*physics data system :-) Markus ---------------------------------- mdemleitner at head-cfa.harvard.edu finger me as msdemlei at tucana.harvard.edu From ndevilla at eso.org Thu Feb 24 09:28:41 2000 From: ndevilla at eso.org (Nicolas Devillard) Date: Thu, 24 Feb 2000 15:28:41 +0100 (MET) Subject: Fast FITS queries in Python Message-ID: Yet another module to help making keyword queries in FITS headers, either in C or Python. 'qfits' is an ANSI C module that offers very fast keyword queries in FITS headers, through the use of the mmap() system call on Unix. 'qfits' is written in portable ANSI C and should compile on any Unix system that offers the mmap() call, i.e. any modern Unix :-). 'qfits' has been extracted from the eclipse library to build a stand-alone module, to make it accessible from Python. A wrapper module called 'qfits_wrap.c' has been generated using SWIG, making qfits.so a callable shared object from the Python interpreter. If you have SWIG, you can straightaway build a callable module for Perl or Tcl (see http://www.swig.org). A wrapper class called 'Qfits.py' is then offered on top of the shared object, to make the queries more Python-like. Here is an example of an interactive session using Qfits: >>> from Qfits import * >>> q = Qfits('vltframe.fits') >>> q.get('naxis') '2' >>> q.get('MJD-OBS') '51275.33002418' >>> q.get('DET.DIT') '20.0' >>> q.get('HIERARCH ESO DPR CATG') "'SCIENCE '" >>> q.get('dpr.catg', pretty=1) 'SCIENCE' >>> q.get('simple', 'naxis', 'naxis1', 'naxis2', 'bscale', 'bzero') ('T', '2', '1024', '1024', None, None) 'qfits' is a good solution if you only want to retrieve known keywords from a FITS header in a Python script, and you want to do it fast, without need for a complete FITS library with bells and whistles (the distribution tar file for 'qfits' is 12 kbytes). 'qfits' can be downloaded from the (bottom of the) following page: http://www.eso.org/~ndevilla/saft/ -- Nicolas From bridgman at wyeth.gsfc.nasa.gov Thu Feb 24 09:40:03 2000 From: bridgman at wyeth.gsfc.nasa.gov (Tom Bridgman) Date: Thu, 24 Feb 2000 09:40:03 -0500 Subject: Fast FITS queries in Python References: Message-ID: <38B542C3.4DA194DC@wyeth.gsfc.nasa.gov> There is also Paul Barrett's PyFITS routine which for some lame reason I don't seem to have a link to on the AstroPy home page. :^) Paul, if you're around, could you send an updated link? I've successfully FITSified OSSE timing data files (with IDL on a VAX) and then extracted both header & binary table data using PyFITS. I actually had this working on a Macintosh. Perhaps I should post/repost some of this. Actually, perhaps I should update the AstroPy page. While I'm at it, suggestions for other additions? Tom Nicolas Devillard wrote: > > Yet another module to help making keyword queries in FITS headers, either > in C or Python. > > 'qfits' is an ANSI C module that offers very fast keyword queries in > FITS headers, through the use of the mmap() system call on Unix. 'qfits' > is written in portable ANSI C and should compile on any Unix system that > offers the mmap() call, i.e. any modern Unix :-). > > 'qfits' has been extracted from the eclipse library to build a stand-alone > module, to make it accessible from Python. A wrapper module called > 'qfits_wrap.c' has been generated using SWIG, making qfits.so a callable > shared object from the Python interpreter. If you have SWIG, you can > straightaway build a callable module for Perl or Tcl (see > http://www.swig.org). > > A wrapper class called 'Qfits.py' is then offered on top of the shared > object, to make the queries more Python-like. Here is an example of an > interactive session using Qfits: > > >>> from Qfits import * > >>> q = Qfits('vltframe.fits') > >>> q.get('naxis') > '2' > >>> q.get('MJD-OBS') > '51275.33002418' > >>> q.get('DET.DIT') > '20.0' > >>> q.get('HIERARCH ESO DPR CATG') > "'SCIENCE '" > >>> q.get('dpr.catg', pretty=1) > 'SCIENCE' > >>> q.get('simple', 'naxis', 'naxis1', 'naxis2', 'bscale', 'bzero') > ('T', '2', '1024', '1024', None, None) > > 'qfits' is a good solution if you only want to retrieve known keywords > from a FITS header in a Python script, and you want to do it fast, without > need for a complete FITS library with bells and whistles (the distribution > tar file for 'qfits' is 12 kbytes). > > 'qfits' can be downloaded from the (bottom of the) following page: > http://www.eso.org/~ndevilla/saft/ > > -- > Nicolas -- Dr. William T."Tom" Bridgman Scientific Visualization Studio Raytheon ITSS NASA/Goddard Space Flight Center Email: bridgman at wyeth.gsfc.nasa.gov Code 935 Phone: 301-286-1346 Greenbelt, MD 20771 FAX: TBD http://svs.gsfc.nasa.gov/ From Barrett at stsci.edu Thu Feb 24 09:45:59 2000 From: Barrett at stsci.edu (Paul Barrett) Date: Thu, 24 Feb 2000 09:45:59 -0500 (EST) Subject: [AstroPy] Astro-Py list In-Reply-To: <200002240926.RAA31633@galaxy.calm.wa.gov.au> References: <200002240926.RAA31633@galaxy.calm.wa.gov.au> Message-ID: <14517.16791.321482.788636@nem-srvr.stsci.edu> Andrew Williams writes: > > This list has been quiet since I joined - is there actually anyone out > there? Yes, we're out here, but we must all be very busy. I know I am. I'm the maintainer of this list and have been meaning to post some news, just to get the list going again. Looks like you beat me to it. > The code is at: http://www.physics.uwa.edu.au/~andrew/ There are two other FITS modules out there that you may want to take a look at. There is my PyFITS (version 0.30) and Norbert's wrappers around the cfitsio library. PyFITS reads most FITS files reasonably well at this point, but more work needs to be done to handle ASCII and binary tables and to write files easily. I'd appreciate more astronomers using and commenting on this package. Other news is that a group of us at STScI are considering a re-write of Numeric to make it more efficient and to handle large arrays more transparently (using mmap). You might want to check the Numeric mailing list at SourceForge for recent posting about this. Any opinions or support on this topic would be welcome. Cheers, Paul -- Dr. Paul Barrett Space Telescope Science Institute Phone: 410-516-6714 ESS/DPT FAX: 410-516-8615 Baltimore, MD 21218 _____________________________________________________ AstroPy mailing list - astropy at stsci.edu http://lheawww.gsfc.nasa.gov/~bridgman/AstroPy/ From Barrett at stsci.edu Thu Feb 24 09:55:36 2000 From: Barrett at stsci.edu (Paul Barrett) Date: Thu, 24 Feb 2000 09:55:36 -0500 (EST) Subject: [AstroPy] Re: Astro-Py list In-Reply-To: References: <200002240926.RAA31633@galaxy.calm.wa.gov.au> Message-ID: <14517.17462.6669.924173@nem-srvr.stsci.edu> Stephen writes: > On Thu, 24 Feb 2000, Andrew Williams wrote: > > > >This list has been quiet since I joined - is there actually anyone out > >there? > > I've been wondering the same thing, i wasn't really sure if the list was > just for announcements or whether i could ask questions or post about > stuff myself. This list is for any discussion associated with Python in astronomy, e.g. FITS modules, Numeric enhancements, statistics packages, telescope control software, etc. > I would actually be very interested in python code for telescope control. > I am involved in an undergraduate lab in Durham University, we have three > Meade telescopes with various sbig (st6/st7) cameras attached. We are > currently running everything from Windows but are looking to convert to > Linux. Currently the idea is to use xephem for telescope control, but we > have various other equipment for which software doesn't exist. I am > currently writing control software for an electronic focusser. I will then > be looking into CCD control stuff, including grabbing the frames, > temperature control, etc.. Any pointers to python code or information on > how to write such software would be very welcome. In my earlier days I wrote a data acquisition program for the Univ of Cape Town photo-polarimeter. It ran on 286-class computers under DOS. Since discovering Python, I thought it would be an interesting project to rewrite it using Python with C-extensions for controlling the hardware. Python would give the developer a capability similar to Forth, in that you could control the hardware (eg, a stepping motor) interactively at the command line for testing purposes. I think it shouldn't be too difficult and would be a valuable asset to create a library of C-extension modules for hardware control: everything else such as data reduction and graphics can be done in Python. Let me know if I can be of any help. Cheers, Paul -- Dr. Paul Barrett Space Telescope Science Institute Phone: 410-516-6714 DESD/DPT FAX: 410-516-8615 Baltimore, MD 21218 _____________________________________________________ AstroPy mailing list - astropy at stsci.edu http://lheawww.gsfc.nasa.gov/~bridgman/AstroPy/ From bridgman at wyeth.gsfc.nasa.gov Thu Feb 24 09:57:03 2000 From: bridgman at wyeth.gsfc.nasa.gov (Tom Bridgman) Date: Thu, 24 Feb 2000 09:57:03 -0500 Subject: [AstroPy] Astro-Py list References: <200002240926.RAA31633@galaxy.calm.wa.gov.au> <14517.16791.321482.788636@nem-srvr.stsci.edu> Message-ID: <38B546BF.E4E77850@wyeth.gsfc.nasa.gov> I think I encountered an array limit of ~32,000 elements which was a real surprise when I tried to generate a power spectrum from my timing data. Is there really a 16/15-bit index limit and will that be raised? Tom Paul Barrett wrote: > > Other news is that a group of us at STScI are considering a re-write > of Numeric to make it more efficient and to handle large arrays more > transparently (using mmap). You might want to check the Numeric > mailing list at SourceForge for recent posting about this. Any > opinions or support on this topic would be welcome. > -- Dr. William T."Tom" Bridgman Scientific Visualization Studio Raytheon ITSS NASA/Goddard Space Flight Center Email: bridgman at wyeth.gsfc.nasa.gov Code 935 Phone: 301-286-1346 Greenbelt, MD 20771 FAX: TBD http://svs.gsfc.nasa.gov/ _____________________________________________________ AstroPy mailing list - astropy at stsci.edu http://lheawww.gsfc.nasa.gov/~bridgman/AstroPy/ From A.Vick at roe.ac.uk Thu Feb 24 10:14:26 2000 From: A.Vick at roe.ac.uk (Andrew Vick) Date: Thu, 24 Feb 2000 15:14:26 -0000 (GMT) Subject: Astro-Py list In-Reply-To: <200002240926.RAA31633@galaxy.calm.wa.gov.au> Message-ID: >This list has been quiet since I joined - is there actually anyone out >there? Yes, the list traffic has never been that heavy. For the record I work at the UK-ATC (that was the Royal Observatory Edinburgh) on an AO project called NAOMI. Python has been used in the control system, for data analysis, as part of the messaging system and for all sorts of assorted tasks. There appears to be several types of FIT's modules available for python, and I know that one of my old colleagues at Durham wrap'd cfitsio and the starlink NDF libraries at one time. I will try and sort out the code for this and a few other things and get them on the net somewhere, but since we are approaching instrument commissioning it make take some time.... At one time I did start to make a module for the base routines in Nicholas's eclipse library (see 'Fast FITS queries in Python'), but it's only 20% completed. So little time, so many project managers ;-) Andy Vick ---------------------------------------------------------------------------- http://www.roe.ac.uk/atc/projects/naomi Andrew J. A. Vick Email: A.Vick at roe.ac.uk, No solicitations UK ATC, See http://www.roe.ac.uk/ajvwww/spamoff.htm Royal Observatory Edinburgh, Blackford Hill, Edinburgh, EH9 3HJ, UK. Tel: +44-131-668-8100 From ndevilla at eso.org Thu Feb 24 10:32:25 2000 From: ndevilla at eso.org (Nicolas Devillard) Date: Thu, 24 Feb 2000 16:32:25 +0100 (MET) Subject: Astro-Py list In-Reply-To: Message-ID: Hello Andrew: > At one time I did start to make a module for the base routines in > Nicholas's eclipse library (see 'Fast FITS queries in Python'), but > it's only 20% completed. So little time, so many project managers ;-) One word about eclipse and Python: eclipse is about to be completely Python-ized to offer a Python programming interface to its C library. Once this is achieved, it should help us build the automatic data reduction tools we need for some of the VLT instruments in a pretty short development time. For the moment, the base C code in eclipse is under heavy rain: we modify it almost every day to suit our needs, it is definitely not recommended to base any high-level code upon this for the moment. As soon as we have Python-ized the lot, the low-level stuff may still change at high rate, but the Python interfaces should at least remain stable. Our aim is not to build an IRAF-like interactive facility for data reduction (e.g. there is no display facility of any kind). The aim is to have a fast and robust image processing library in C, programmed at a higher level in Python for fast algorithm and code development, ease of use, maintenance and portability reasons. ... and also because we love Python. :-) Stay tuned! -- Nicolas From wtbridgman at Radix.Net Sat Feb 26 18:18:38 2000 From: wtbridgman at Radix.Net (W.T. Bridgman) Date: Sat, 26 Feb 2000 18:18:38 -0500 Subject: [AstroPy] Updates to AstroPy page Message-ID: I've installed a number of updates to the Astronomical Python home page at http://lheawww.gsfc.nasa.gov/~bridgman/AstroPy/. I've added links to pages of support modules mentioned in recent posts. Please contact me with any corrections/additions. I've also re-installed the link to the cross-platform support matrix which somehow became disconnected. The server at ra.stsci.edu seems to be down. Thanks, Tom _____________________________________________________ AstroPy mailing list - astropy at stsci.edu http://lheawww.gsfc.nasa.gov/~bridgman/AstroPy/