From stefan.schwarzburg at googlemail.com Thu Jul 3 10:51:59 2008 From: stefan.schwarzburg at googlemail.com (Stefan Schwarzburg) Date: Thu, 3 Jul 2008 16:51:59 +0200 Subject: [AstroPy] pywcs problem Message-ID: Hi, I have a problem with pywcs. I tried to get a feeling for the library by playing around with it. At the end of the email, there is my modified "test", which is taken from here "http://stsdas.stsci.edu/astrolib/pywcs-1.0a1-4.3_api/" Now when I let this test run, I get the following output: >-------------------USING TEST HEADER------------------- > > > > > > > > > >[[ 99.322 36.3123]] To me this seems rather strange, since in the testheader, there is this part here: CRPIX1 = 151.0 / Reference pixel on axis 1 CRPIX2 = 151.0 / Reference pixel on axis 2 CRVAL1 = 279.322 / Value at ref. pixel on axis 1 CRVAL2 = -7.3123 / Value at ref. pixel on axis 2 and my test uses [150,150] as test pixel position. Should I not get something like:~ [[279, -7]] ? I hope someone can help me here. Thanks, Stefan #!/usr/bin/env python import numpy import pywcs import pyfits import sys print "-------------------USING TEST HEADER-------------------" h = """ SIMPLE = T / file does conform to FITS standard BITPIX = -32 / number of bits per data pixel NAXIS = 2 / number of data axes NAXIS1 = 301 / length of data axis 1 NAXIS2 = 301 / length of data axis 2 EXTEND = T / FITS dataset may contain extensions COMMENT FITS (Flexible Image Transport System) format is defined in 'Astronomy COMMENT and Astrophysics', volume 376, page 359; bibcode: 2001A&A...376..359H CTYPE1 = 'RA---CAR' / Type of co-ordinate on axis 1 CTYPE2 = 'DEC--CAR' / Type of co-ordinate on axis 2 CRPIX1 = 151.0 / Reference pixel on axis 1 CRPIX2 = 151.0 / Reference pixel on axis 2 CRVAL1 = 279.322 / Value at ref. pixel on axis 1 CRVAL2 = -7.3123 / Value at ref. pixel on axis 2 CDELT1 = -0.02 / Pixel size on axis 1 CDELT2 = 0.02 / Pixel size on axis 2 MJD-OBS = 51544.4992571308 / Modified Julian Date of observation DATE-OBS= '2000-01-01T11:58:55.816'/ Date of observation RADESYS = 'FK5 ' / Reference frame for RA/DEC values EQUINOX = 2000.0 / [yr] Epoch of reference equinox OBJECT = 'SOMETHING' BUNIT = 'Count ' BSCALE = 1.0 BZERO = 0.0 """ wcs = pywcs.WCS(h) # Print out the "name" of the WCS, as defined in the FITS header print wcs.name # Some interesting pixel coordinates pixcrd = numpy.array([[150,150]], numpy.double) # Convert pixel coordinates to world coordinates world = wcs.pixel2world(pixcrd) print world -------------- next part -------------- An HTML attachment was scrubbed... URL: From lee.j.joon at gmail.com Thu Jul 3 13:39:58 2008 From: lee.j.joon at gmail.com (Jae-Joon Lee) Date: Thu, 3 Jul 2008 13:39:58 -0400 Subject: [AstroPy] pywcs problem In-Reply-To: References: Message-ID: <6e8d907b0807031039n3b6e01dawe0138a58b67a69c2@mail.gmail.com> Hi Stefan, I guess you're providing a wrong input for pywcs.WCS, i.e., "h" contains invalid FITS header. As far as I remember (but you'd better double check), a line in FITS header should be 80-char-long without "\n". You may use the following code to convert your string to valid FITS header. h = "".join([s + " " * (80-len(s)) for s in h.split("\n")]) With this change, I get [[ 279.322 -7.3123]] as expected. I hope this solves your problem. Regards, -JJ On Thu, Jul 3, 2008 at 10:51 AM, Stefan Schwarzburg wrote: > Hi, > I have a problem with pywcs. I tried to get a feeling for the library by > playing around with it. > At the end of the email, there is my modified "test", which is taken from > here "http://stsdas.stsci.edu/astrolib/pywcs-1.0a1-4.3_api/" > > Now when I let this test run, I get the following output: >>-------------------USING TEST HEADER------------------- >> >> >> >> >> >> >> >> >> >>[[ 99.322 36.3123]] > > To me this seems rather strange, since in the testheader, there is this part > here: > CRPIX1 = 151.0 / Reference pixel on axis 1 > CRPIX2 = 151.0 / Reference pixel on axis 2 > CRVAL1 = 279.322 / Value at ref. pixel on axis 1 > CRVAL2 = -7.3123 / Value at ref. pixel on axis 2 > > and my test uses [150,150] as test pixel position. > Should I not get something like:~ [[279, -7]] ? > > I hope someone can help me here. > > Thanks, > Stefan > > > > #!/usr/bin/env python > import numpy > import pywcs > import pyfits > import sys > > print "-------------------USING TEST HEADER-------------------" > h = """ > SIMPLE = T / file does conform to FITS standard > BITPIX = -32 / number of bits per data pixel > NAXIS = 2 / number of data axes > NAXIS1 = 301 / length of data axis 1 > NAXIS2 = 301 / length of data axis 2 > EXTEND = T / FITS dataset may contain extensions > COMMENT FITS (Flexible Image Transport System) format is defined in > 'Astronomy > COMMENT and Astrophysics', volume 376, page 359; bibcode: > 2001A&A...376..359H > CTYPE1 = 'RA---CAR' / Type of co-ordinate on axis 1 > CTYPE2 = 'DEC--CAR' / Type of co-ordinate on axis 2 > CRPIX1 = 151.0 / Reference pixel on axis 1 > CRPIX2 = 151.0 / Reference pixel on axis 2 > CRVAL1 = 279.322 / Value at ref. pixel on axis 1 > CRVAL2 = -7.3123 / Value at ref. pixel on axis 2 > CDELT1 = -0.02 / Pixel size on axis 1 > CDELT2 = 0.02 / Pixel size on axis 2 > MJD-OBS = 51544.4992571308 / Modified Julian Date of observation > DATE-OBS= '2000-01-01T11:58:55.816'/ Date of observation > RADESYS = 'FK5 ' / Reference frame for RA/DEC values > EQUINOX = 2000.0 / [yr] Epoch of reference equinox > OBJECT = 'SOMETHING' > BUNIT = 'Count ' > BSCALE = 1.0 > BZERO = 0.0 > """ > > wcs = pywcs.WCS(h) > > # Print out the "name" of the WCS, as defined in the FITS header > print wcs.name > > # Some interesting pixel coordinates > pixcrd = numpy.array([[150,150]], numpy.double) > > # Convert pixel coordinates to world coordinates > world = wcs.pixel2world(pixcrd) > print world > > > _______________________________________________ > AstroPy mailing list > AstroPy at scipy.org > http://lists.astropy.scipy.org/mailman/listinfo/astropy > > From jh at physics.ucf.edu Thu Jul 3 17:59:08 2008 From: jh at physics.ucf.edu (Joe Harrington) Date: Thu, 03 Jul 2008 17:59:08 -0400 Subject: [AstroPy] Summer Doc Marathon status report and request for more writers Message-ID: This is an interim status report on the Summer Documentation Marathon. It is also an invitation and plea for all experienced users to participate! I am cross-posting in an effort to get broader participation. Please hold any discussion on the scipy-dev mailing list. As you know, our immediate goal is to produce first-draft docstrings for the user-visible parts of Numpy in time for a release before Fall classes (about 1 August). The short version is: We are really moving along! But, we need *your* help to make it in time for August. Here's the scoop: 1. We have all our infrastructure, standards, and procedure in place: We have a wiki that makes editing the docs easy and even fun. It communicates directly with the numpy sources. We have PDF and HTML reference guides being generated essentially automatically: http://sd-2116.dedibox.fr/pydocweb http://mentat.za.net/numpy/refguide/NumPy.pdf http://mentat.za.net/numpy/refguide/ The wiki front page contains or points to all you need to get started. The wiki lets you pull down a docstring with a few mouse clicks, edit on your machine, upload it, and see how it will look in its HTML version right away. You can also read everyone else's docstrings, comment on them, see the status of the project, and so on. The formatted versions necessarily lag the docstrings on the wiki because they are made whenever the docstrings are checked into the sources. 2. We have documented about 1/4 of numpy in a fairly professional way, comparable to the reference pages of the major commercial packages. The doc wiki is probably the next place to go if your question isn't answered by the docstring in the current version's help(), since you can look at the new docstrings we've generated, and they're *good*! 3. But, we're only 1/4 of the way there, we're halfway through the summer, and some of the initial enthusiasm is waning. The following page tells the tale: http://sd-2116.dedibox.fr/pydocweb/stats/ As you can see (you did click, right? please click...), there are 2323 numpy objects with docstrings. Of these, 1464 we deemed "unimportant" (for now). These are generally items not seen by regular users. This left 859 objects to document in this first pass. We've done 24% of them at this writing. Now, 24% is really exciting, and I'd like to take a moment to say a public "Hooray!" for the team (no particular order): St?fan van der Walt Pauli Virtanen Robert Hetland Gael Varoquaux Scott Sinclair Alan Jackson Tim Cera Johann Cohen-Tanugi David Huard Keith Goodman Together these ten have written around 7500 words of documentation on the community's behalf, mainly as volunteers. HOWEVER, we can all do the math. We've spent one of our two months. We are 1/4 of the way there. Progress is slowing, and even if it didn't, we wouldn't make it in time. This is not a sprint, it's a MARATHON. WE NEED YOUR HELP! And we need it now. Are you excited by the idea of having documentation for numpy by the Fall release? Of having docs that answer your questions, that have *good* examples, that really save you time? If so, then please invest just a fraction of the time that documentation will save you in the next year alone by signing up on the wiki and writing some. If each experienced user wrote just a few pages, we'd be done! If you don't think you know enough to write, then do some reviewing. Are the docs readable? Do you understand the examples? Each docstring on the wiki has an easy comment box waiting for your thoughts. You will have a reference guide in the next release of numpy! I hope you will help make it a complete one. Sign up on the doc wiki today: http://sd-2116.dedibox.fr/pydocweb/ Thanks, --jh-- and the SciPy Doc Team Prof. Joseph Harrington Department of Physics MAP 414 4000 Central Florida Blvd. University of Central Florida Orlando, FL 32816-2385 (407) 823-3416 voice (407) 823-5112 fax (407) 823-2325 physics office jh at physics.ucf.edu From perry at stsci.edu Mon Jul 7 14:20:54 2008 From: perry at stsci.edu (Perry Greenfield) Date: Mon, 7 Jul 2008 14:20:54 -0400 Subject: [AstroPy] SciPy 2008 conference Message-ID: <319FF11F-67E4-4E7C-BB46-9703AEB4FAE1@stsci.edu> I'd like to note that the next Scipy conference (August 19-24) will have a number of astronomy-related talks (one session's worth) as well as a tutorial on astronomical data analysis, besides a number of other introductory tutorials on using Python for scientific computing. http://conference.scipy.org/ (Early registration ends July 11)