From jean-baptiste.marquette at iap.fr Fri Jul 1 01:45:40 2016 From: jean-baptiste.marquette at iap.fr (Jean-Baptiste Marquette) Date: Fri, 1 Jul 2016 07:45:40 +0200 Subject: [AstroPy] ICRF2 & astropy.coordinates: a question In-Reply-To: <30237B5B-12EA-490F-B9B0-B327D1DB54EF@iap.fr> References: <30237B5B-12EA-490F-B9B0-B327D1DB54EF@iap.fr> Message-ID: Hi astropy gurus, The ICRS Frame is built from the International Celestial Reference Frame (ICRF). But the 2nd realization of that Reference Frame (ICRF2) is available since the publication of Fey et al. 2015, see http://iopscience.iop.org/article/10.1088/0004-6256/150/2/58/meta Then, the question: is that ICRF2 Frame already included in astropy.coordinates Frame definitions? That could be useful for some VLBI people. Cheers, JB -------------- next part -------------- An HTML attachment was scrubbed... URL: From derek at astro.physik.uni-goettingen.de Sat Jul 2 14:58:00 2016 From: derek at astro.physik.uni-goettingen.de (Derek Homeier) Date: Sat, 2 Jul 2016 20:58:00 +0200 Subject: [AstroPy] Fortran-style and large exponents in ascii.io (PR 3655) Message-ID: Hi, first, this is an invitation to review the pull request for Fortran-style exponent character support https://github.com/astropy/astropy/pull/3655 which has been dormant for a fairly long time because of some test crashes on travis. I?ve noticed far too late that long exponents (> 3 digits) already were flagged as a known cause of segfaults on travis, and therefore have now isolated the corresponding tests and marked them xfail. Second, in the comments on that PR some existing inconsistencies between the handling of ?illegal? exponents had been discussed; see my last comment for a kind of summary. Summary of the summary, strings with exponents exceeding float64 range are e.g. read in as inf and 0.0 in plain Python [float('1.423e388?)], while the ascii.io standard has generally asked to return such entries as string fields. Numpy OTOH can parse such numbers as extended precision if specifically asked: np.float128('1.423e388')*10 1.423e+389 So I?d also like to poll if there is general interest in having ascii.io be able to handle such numbers as well (set by an option, if necessary), which might then include four-digit exponents. Cheers, Derek From jzuhone at gmail.com Thu Jul 7 18:47:12 2016 From: jzuhone at gmail.com (John Zuhone) Date: Thu, 7 Jul 2016 18:47:12 -0400 Subject: [AstroPy] Question about multiple WCS in FITS file Message-ID: Hello, I have created some FITS image files with multiple WCS systems in them, using the format of appending letters to the keywords like so (here is the output of fitsdump on the header): # HDU 4 in fiducial_1to3_b1_hdf5_plt_cnt_0000_proj_z.fits: XTENSION= 'IMAGE ' / Image extension BITPIX = -64 / array data type NAXIS = 2 / number of array dimensions NAXIS1 = 2048 NAXIS2 = 2048 PCOUNT = 0 / number of parameters GCOUNT = 1 / number of groups EXTNAME = 'KT ' / extension name BTYPE = 'kT ' BUNIT = 'keV ' WCSAXES = 2 CRPIX1 = 1024.5 CRPIX2 = 1024.5 CDELT1 = 6.96261175585938 CDELT2 = 6.96261175585938 CUNIT1 = 'kpc ' CUNIT2 = 'kpc ' CTYPE1 = 'LINEAR ' CTYPE2 = 'LINEAR ' CRVAL1 = 0.0 CRVAL2 = 0.0 LATPOLE = 90.0 WCSNAME = 'yt ' WCSAXESA= 2 CRPIX1A = 1024.5 CRPIX2A = 1024.5 CDELT1A = -0.00200479940122947 CDELT2A = 0.00200479940122947 CUNIT1A = 'deg ' CUNIT2A = 'deg ' CTYPE1A = 'RA---TAN' CTYPE2A = 'DEC--TAN' CRVAL1A = 30.0 CRVAL2A = 45.0 LONPOLEA= 180.0 LATPOLEA= 45.0 WCSNAMEA= 'celestial' RADESYSA= 'ICRS ' TIME = 0.0 So far, so good. However, if I try to access these keywords in Python, I cannot get at them: In [7]: im.header Out[7]: XTENSION= 'IMAGE ' / Image extension BITPIX = -64 / array data type NAXIS = 2 / number of array dimensions NAXIS1 = 2048 NAXIS2 = 2048 PCOUNT = 0 / number of parameters GCOUNT = 1 / number of groups EXTNAME = 'KT ' / extension name BTYPE = 'kT ' BUNIT = 'keV ' WCSAXES = 2 CRPIX1 = 1024.5 CRPIX2 = 1024.5 CDELT1 = 6.9626117558594 CDELT2 = 6.9626117558594 CUNIT1 = 'kpc ' CUNIT2 = 'kpc ' CTYPE1 = 'LINEAR ' CTYPE2 = 'LINEAR ' CRVAL1 = 0.0 CRVAL2 = 0.0 LATPOLE = 90.0 WCSNAME = 'yt ' Querying for them in dict-like fashion doesn?t work either. What am I missing that would allow AstroPy to see these? Best, John Z -------------- next part -------------- An HTML attachment was scrubbed... URL: From evert.rol at gmail.com Thu Jul 7 20:31:56 2016 From: evert.rol at gmail.com (Evert Rol) Date: Fri, 8 Jul 2016 10:31:56 +1000 Subject: [AstroPy] Question about multiple WCS in FITS file In-Reply-To: References: Message-ID: <2357E885-FFEE-43F0-A8C0-C34BE5069D67@gmail.com> Hi John, Any chance you could make your FITS file, and the few lines of you use to read it, available somewhere for testing? Evert > Hello, > > I have created some FITS image files with multiple WCS systems in them, using the format of appending letters to the keywords like so (here is the output of fitsdump on the header): > > # HDU 4 in fiducial_1to3_b1_hdf5_plt_cnt_0000_proj_z.fits: > XTENSION= 'IMAGE ' / Image extension > BITPIX = -64 / array data type > NAXIS = 2 / number of array dimensions > NAXIS1 = 2048 > NAXIS2 = 2048 > PCOUNT = 0 / number of parameters > GCOUNT = 1 / number of groups > EXTNAME = 'KT ' / extension name > BTYPE = 'kT ' > BUNIT = 'keV ' > WCSAXES = 2 > CRPIX1 = 1024.5 > CRPIX2 = 1024.5 > CDELT1 = 6.96261175585938 > CDELT2 = 6.96261175585938 > CUNIT1 = 'kpc ' > CUNIT2 = 'kpc ' > CTYPE1 = 'LINEAR ' > CTYPE2 = 'LINEAR ' > CRVAL1 = 0.0 > CRVAL2 = 0.0 > LATPOLE = 90.0 > WCSNAME = 'yt ' > WCSAXESA= 2 > CRPIX1A = 1024.5 > CRPIX2A = 1024.5 > CDELT1A = -0.00200479940122947 > CDELT2A = 0.00200479940122947 > CUNIT1A = 'deg ' > CUNIT2A = 'deg ' > CTYPE1A = 'RA---TAN' > CTYPE2A = 'DEC--TAN' > CRVAL1A = 30.0 > CRVAL2A = 45.0 > LONPOLEA= 180.0 > LATPOLEA= 45.0 > WCSNAMEA= 'celestial' > RADESYSA= 'ICRS ' > TIME = 0.0 > > So far, so good. However, if I try to access these keywords in Python, I cannot get at them: > > In [7]: im.header > Out[7]: > XTENSION= 'IMAGE ' / Image extension > BITPIX = -64 / array data type > NAXIS = 2 / number of array dimensions > NAXIS1 = 2048 > NAXIS2 = 2048 > PCOUNT = 0 / number of parameters > GCOUNT = 1 / number of groups > EXTNAME = 'KT ' / extension name > BTYPE = 'kT ' > BUNIT = 'keV ' > WCSAXES = 2 > CRPIX1 = 1024.5 > CRPIX2 = 1024.5 > CDELT1 = 6.9626117558594 > CDELT2 = 6.9626117558594 > CUNIT1 = 'kpc ' > CUNIT2 = 'kpc ' > CTYPE1 = 'LINEAR ' > CTYPE2 = 'LINEAR ' > CRVAL1 = 0.0 > CRVAL2 = 0.0 > LATPOLE = 90.0 > WCSNAME = 'yt ' > > Querying for them in dict-like fashion doesn?t work either. What am I missing that would allow AstroPy to see these? > > Best, > > John Z > _______________________________________________ > AstroPy mailing list > AstroPy at scipy.org > https://mail.scipy.org/mailman/listinfo/astropy From jzuhone at gmail.com Thu Jul 7 21:22:38 2016 From: jzuhone at gmail.com (John ZuHone) Date: Thu, 7 Jul 2016 21:22:38 -0400 Subject: [AstroPy] Question about multiple WCS in FITS file In-Reply-To: <2357E885-FFEE-43F0-A8C0-C34BE5069D67@gmail.com> References: <2357E885-FFEE-43F0-A8C0-C34BE5069D67@gmail.com> Message-ID: <1CFA9E26-3F92-492D-AEDB-360471639A78@gmail.com> Hi Evert, Your question got me thinking and now I realize I was doing something completely silly on my end. This is totally a bug on my side, so we can call this closed. Thanks, John Z > On Jul 7, 2016, at 8:31 PM, Evert Rol wrote: > > Hi John, > > Any chance you could make your FITS file, and the few lines of you use to read it, available somewhere for testing? > > Evert > > >> Hello, >> >> I have created some FITS image files with multiple WCS systems in them, using the format of appending letters to the keywords like so (here is the output of fitsdump on the header): >> >> # HDU 4 in fiducial_1to3_b1_hdf5_plt_cnt_0000_proj_z.fits: >> XTENSION= 'IMAGE ' / Image extension >> BITPIX = -64 / array data type >> NAXIS = 2 / number of array dimensions >> NAXIS1 = 2048 >> NAXIS2 = 2048 >> PCOUNT = 0 / number of parameters >> GCOUNT = 1 / number of groups >> EXTNAME = 'KT ' / extension name >> BTYPE = 'kT ' >> BUNIT = 'keV ' >> WCSAXES = 2 >> CRPIX1 = 1024.5 >> CRPIX2 = 1024.5 >> CDELT1 = 6.96261175585938 >> CDELT2 = 6.96261175585938 >> CUNIT1 = 'kpc ' >> CUNIT2 = 'kpc ' >> CTYPE1 = 'LINEAR ' >> CTYPE2 = 'LINEAR ' >> CRVAL1 = 0.0 >> CRVAL2 = 0.0 >> LATPOLE = 90.0 >> WCSNAME = 'yt ' >> WCSAXESA= 2 >> CRPIX1A = 1024.5 >> CRPIX2A = 1024.5 >> CDELT1A = -0.00200479940122947 >> CDELT2A = 0.00200479940122947 >> CUNIT1A = 'deg ' >> CUNIT2A = 'deg ' >> CTYPE1A = 'RA---TAN' >> CTYPE2A = 'DEC--TAN' >> CRVAL1A = 30.0 >> CRVAL2A = 45.0 >> LONPOLEA= 180.0 >> LATPOLEA= 45.0 >> WCSNAMEA= 'celestial' >> RADESYSA= 'ICRS ' >> TIME = 0.0 >> >> So far, so good. However, if I try to access these keywords in Python, I cannot get at them: >> >> In [7]: im.header >> Out[7]: >> XTENSION= 'IMAGE ' / Image extension >> BITPIX = -64 / array data type >> NAXIS = 2 / number of array dimensions >> NAXIS1 = 2048 >> NAXIS2 = 2048 >> PCOUNT = 0 / number of parameters >> GCOUNT = 1 / number of groups >> EXTNAME = 'KT ' / extension name >> BTYPE = 'kT ' >> BUNIT = 'keV ' >> WCSAXES = 2 >> CRPIX1 = 1024.5 >> CRPIX2 = 1024.5 >> CDELT1 = 6.9626117558594 >> CDELT2 = 6.9626117558594 >> CUNIT1 = 'kpc ' >> CUNIT2 = 'kpc ' >> CTYPE1 = 'LINEAR ' >> CTYPE2 = 'LINEAR ' >> CRVAL1 = 0.0 >> CRVAL2 = 0.0 >> LATPOLE = 90.0 >> WCSNAME = 'yt ' >> >> Querying for them in dict-like fashion doesn?t work either. What am I missing that would allow AstroPy to see these? >> >> Best, >> >> John Z >> _______________________________________________ >> AstroPy mailing list >> AstroPy at scipy.org >> https://mail.scipy.org/mailman/listinfo/astropy > > _______________________________________________ > AstroPy mailing list > AstroPy at scipy.org > https://mail.scipy.org/mailman/listinfo/astropy From mcraig at mnstate.edu Thu Jul 7 21:43:09 2016 From: mcraig at mnstate.edu (Matthew Craig) Date: Fri, 8 Jul 2016 01:43:09 +0000 Subject: [AstroPy] conda channels for astronomy software Message-ID: Hi, There are a couple of conda channels providing astronomy-related python packages, including one that is relatively new: astropy: This conda channel contains all of the astropy affiliated packages and their dependencies. This includes Windows versions for almost all of the packages. Astropy itself is provide by Continuum, the company that distributes conda. List of available packages: https://anaconda.org/astropy/packages OpenAstronomy: This includes all of the packages in the astropy channel and some packages that are not affiliated packages (e.g. healpy). List of available packages: https://anaconda.org/openastronomy/packages If you use anaconda you can add one or the other of these on a one-time basis with: conda install -c astropy some_package You can add them permanently with: conda config --add channels openastronomy If you develop an astronomy-related package and what it built, feel free to open a pull request at either: https://github.com/astropy/conda-channel-astropy (for astropy affiliated packages) or https://github.com/openastronomy/conda-channel (for any astro-related package). Adding a package already on PyPI typically entails very little work?just a few lines need to be added to a configuration file in the repository! Matt Craig schedule: http://physics.mnstate.edu/craig ?? Professor Department of Physics and Astronomy Minnesota State University Moorhead 1104 7th Ave S, Moorhead MN 56563 office: Hagen 307F phone: (218) 477-2439 fax: (218) 477-2290 -------------- next part -------------- An HTML attachment was scrubbed... URL: From peter at newton.cx Thu Jul 7 22:15:28 2016 From: peter at newton.cx (Peter Williams) Date: Thu, 07 Jul 2016 22:15:28 -0400 Subject: [AstroPy] conda channels for astronomy software In-Reply-To: References: Message-ID: <1467944128.4024.20.camel@newton.cx> For what it's worth, I'll mention that I've put up a number of astro- related Conda packages in my personal Anaconda channel, including DS9, IRAF, PyRAF, and CASA: https://anaconda.org/pkgw https://github.com/pkgw/conda-recipes/ Folks are certainly invited to use these packages as well. However, while I've been too stubborn to go to the work of integrating these into something like conda-forge yet, I really should. If anyone wants to build on the work I've done, or even just get on my case about integrating with conda-forge, they are most welcome.? Cheers, Peter --? Dr. Peter K. G. Williams ??http://newton.cx/~peter/ Harvard-Smithsonian Center for Astrophysics On Fri, 2016-07-08 at 01:43 +0000, Matthew Craig wrote: > Hi, > > > There?are a?couple of conda channels providing?astronomy-related > python?packages, including one that is relatively new: > > > astropy: This conda channel contains all > of?the?astropy?affiliated?packages?and their dependencies. This > includes?Windows?versions for almost all of?the?packages.?Astropy > itself is provide by Continuum,?the company that distributes conda. > List of?available?packages:?https://anaconda.org/astropy/packages > > > OpenAstronomy: This includes all of?the?packages in?the?astropy > channel?and some?packages that are not?affiliated?packages (e.g. > healpy). List of?available?packages:?https://anaconda.org/openastrono > my/packages > > > If?you use anaconda?you can add one or?the other of these on a one- > time basis?with: conda install -c astropy some_package > > > You can add them permanently?with: conda config --add channels > openastronomy? > > > If?you develop an?astronomy-related?package?and what it built, feel > free to open a pull request at either: > > > https://github.com/astropy/conda-channel-astropy ?(for astropy > affiliated?packages) > > > or > > > https://github.com/openastronomy/conda-channel (for any astro- > related?package). > > > Adding a?package already on PyPI typically entails very little > work?just a few lines need to be added to a configuration file in?the > repository! > > > Matt Craig > > schedule:??http://physics.mnstate.edu/craig > ?? > Professor > Department of Physics and Astronomy? > Minnesota State University Moorhead > 1104 7th Ave S, Moorhead MN 56563 > > office: Hagen 307F > phone: (218) 477-2439 > fax: (218) 477-2290 > > > > > > > _______________________________________________ > AstroPy mailing list > AstroPy at scipy.org > https://mail.scipy.org/mailman/listinfo/astropy -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcraig at mnstate.edu Fri Jul 8 00:01:28 2016 From: mcraig at mnstate.edu (Matthew Craig) Date: Fri, 8 Jul 2016 04:01:28 +0000 Subject: [AstroPy] conda channels for astronomy software In-Reply-To: <1467944128.4024.20.camel@newton.cx> References: <1467944128.4024.20.camel@newton.cx> Message-ID: <93CB916A-6F06-4A43-ACEA-39EBBFE60E28@mnstate.edu> Excellent! I?ll be in touch next work to see if we can consolidate some things. I think even once conda-forge is running flawlessly there will still be some value in having channels that provide related packages (though I?d love the building to happen on conda-forge when possible, eventually). Matt Craig schedule: http://physics.mnstate.edu/craig ?? Professor Department of Physics and Astronomy Minnesota State University Moorhead 1104 7th Ave S, Moorhead MN 56563 office: Hagen 307F phone: (218) 477-2439 fax: (218) 477-2290 On Jul 7, 2016, at 8:15 PM, Peter Williams > wrote: For what it's worth, I'll mention that I've put up a number of astro-related Conda packages in my personal Anaconda channel, including DS9, IRAF, PyRAF, and CASA: https://anaconda.org/pkgw https://github.com/pkgw/conda-recipes/ Folks are certainly invited to use these packages as well. However, while I've been too stubborn to go to the work of integrating these into something like conda-forge yet, I really should. If anyone wants to build on the work I've done, or even just get on my case about integrating with conda-forge, they are most welcome. Cheers, Peter -- Dr. Peter K. G. Williams ? http://newton.cx/~peter/ Harvard-Smithsonian Center for Astrophysics On Fri, 2016-07-08 at 01:43 +0000, Matthew Craig wrote: Hi, There are a couple of conda channels providing astronomy-related python packages, including one that is relatively new: astropy: This conda channel contains all of the astropy affiliated packages and their dependencies. This includes Windows versions for almost all of the packages. Astropy itself is provide by Continuum, the company that distributes conda. List of available packages: https://anaconda.org/astropy/packages OpenAstronomy: This includes all of the packages in the astropy channel and some packages that are not affiliated packages (e.g. healpy). List of available packages: https://anaconda.org/openastronomy/packages If you use anaconda you can add one or the other of these on a one-time basis with: conda install -c astropy some_package You can add them permanently with: conda config --add channels openastronomy If you develop an astronomy-related package and what it built, feel free to open a pull request at either: https://github.com/astropy/conda-channel-astropy (for astropy affiliated packages) or https://github.com/openastronomy/conda-channel (for any astro-related package). Adding a package already on PyPI typically entails very little work?just a few lines need to be added to a configuration file in the repository! Matt Craig schedule: http://physics.mnstate.edu/craig ?? Professor Department of Physics and Astronomy Minnesota State University Moorhead 1104 7th Ave S, Moorhead MN 56563 office: Hagen 307F phone: (218) 477-2439 fax: (218) 477-2290 _______________________________________________ AstroPy mailing list AstroPy at scipy.org https://mail.scipy.org/mailman/listinfo/astropy _______________________________________________ AstroPy mailing list AstroPy at scipy.org https://mail.scipy.org/mailman/listinfo/astropy -------------- next part -------------- An HTML attachment was scrubbed... URL: From dsyphers at ewu.edu Fri Jul 8 00:18:46 2016 From: dsyphers at ewu.edu (Syphers, David) Date: Fri, 8 Jul 2016 04:18:46 +0000 Subject: [AstroPy] conda channels for astronomy software In-Reply-To: <93CB916A-6F06-4A43-ACEA-39EBBFE60E28@mnstate.edu> References: <1467944128.4024.20.camel@newton.cx> <93CB916A-6F06-4A43-ACEA-39EBBFE60E28@mnstate.edu> Message-ID: <1B8E8C17-F21C-4D10-8222-C25169C38EA2@ewu.edu> There is also STScI's AstroConda, http://astroconda.readthedocs.io/en/latest/ , which replaces their Ureka distribution. But since they are going to drop IRAF/PyRAF support, it's nice to know those are available on other channels. -David On Jul 7, 2016, at 9:01 PM, Matthew Craig wrote: > Excellent! > > I?ll be in touch next work to see if we can consolidate some things. I think even once conda-forge is running flawlessly there will still be some value in having channels that provide related packages (though I?d love the building to happen on conda-forge when possible, eventually). > > Matt Craig > > schedule: http://physics.mnstate.edu/craig > ?? > Professor > Department of Physics and Astronomy > Minnesota State University Moorhead > 1104 7th Ave S, Moorhead MN 56563 > > office: Hagen 307F > phone: (218) 477-2439 > fax: (218) 477-2290 > >> On Jul 7, 2016, at 8:15 PM, Peter Williams wrote: >> >> For what it's worth, I'll mention that I've put up a number of astro-related Conda packages in my personal Anaconda channel, including DS9, IRAF, PyRAF, and CASA: >> >> https://anaconda.org/pkgw >> https://github.com/pkgw/conda-recipes/ >> >> Folks are certainly invited to use these packages as well. However, while I've been too stubborn to go to the work of integrating these into something like conda-forge yet, I really should. If anyone wants to build on the work I've done, or even just get on my case about integrating with conda-forge, they are most welcome. >> >> Cheers, >> >> Peter >> >> -- >> Dr. Peter K. G. Williams ? http://newton.cx/~peter/ >> Harvard-Smithsonian Center for Astrophysics >> >> On Fri, 2016-07-08 at 01:43 +0000, Matthew Craig wrote: >>> Hi, >>> >>> There are a couple of conda channels providing astronomy-related python packages, including one that is relatively new: >>> >>> astropy: This conda channel contains all of the astropy affiliated packages and their dependencies. This includes Windows versions for almost all of the packages. Astropy itself is provide by Continuum, the company that distributes conda. List of available packages: https://anaconda.org/astropy/packages >>> >>> OpenAstronomy: This includes all of the packages in the astropy channel and some packages that are not affiliated packages (e.g. healpy). List of available packages: https://anaconda.org/openastronomy/packages >>> >>> If you use anaconda you can add one or the other of these on a one-time basis with: conda install -c astropy some_package >>> >>> You can add them permanently with: conda config --add channels openastronomy >>> >>> If you develop an astronomy-related package and what it built, feel free to open a pull request at either: >>> >>> https://github.com/astropy/conda-channel-astropy (for astropy affiliated packages) >>> >>> or >>> >>> https://github.com/openastronomy/conda-channel (for any astro-related package). >>> >>> Adding a package already on PyPI typically entails very little work?just a few lines need to be added to a configuration file in the repository! >>> >>> Matt Craig >>> >>> schedule: http://physics.mnstate.edu/craig >>> ?? >>> Professor >>> Department of Physics and Astronomy >>> Minnesota State University Moorhead >>> 1104 7th Ave S, Moorhead MN 56563 >>> >>> office: Hagen 307F >>> phone: (218) 477-2439 >>> fax: (218) 477-2290 >>> >>> _______________________________________________ >>> AstroPy mailing list >>> >>> AstroPy at scipy.org >>> https://mail.scipy.org/mailman/listinfo/astropy >> >> _______________________________________________ >> AstroPy mailing list >> AstroPy at scipy.org >> https://mail.scipy.org/mailman/listinfo/astropy > > _______________________________________________ > AstroPy mailing list > AstroPy at scipy.org > https://mail.scipy.org/mailman/listinfo/astropy From klabrie at gemini.edu Fri Jul 8 15:05:01 2016 From: klabrie at gemini.edu (Kathleen Labrie) Date: Fri, 8 Jul 2016 09:05:01 -1000 Subject: [AstroPy] conda channels for astronomy software In-Reply-To: <1B8E8C17-F21C-4D10-8222-C25169C38EA2@ewu.edu> References: <1467944128.4024.20.camel@newton.cx> <93CB916A-6F06-4A43-ACEA-39EBBFE60E28@mnstate.edu> <1B8E8C17-F21C-4D10-8222-C25169C38EA2@ewu.edu> Message-ID: FYI, Gemini is working with STScI to get IRAF/PyRAF packaged into anaconda as well. I do not know which channel will be used, but this effort is part of the Ureka replacement. Contact James Turner at Gemini for details. Kathleen On Thu, Jul 7, 2016 at 6:18 PM, Syphers, David wrote: > There is also STScI's AstroConda, > http://astroconda.readthedocs.io/en/latest/ , which replaces their Ureka > distribution. But since they are going to drop IRAF/PyRAF support, it's > nice to know those are available on other channels. > > -David > > On Jul 7, 2016, at 9:01 PM, Matthew Craig wrote: > > > Excellent! > > > > I?ll be in touch next work to see if we can consolidate some things. I > think even once conda-forge is running flawlessly there will still be some > value in having channels that provide related packages (though I?d love the > building to happen on conda-forge when possible, eventually). > > > > Matt Craig > > > > schedule: http://physics.mnstate.edu/craig > > ?? > > Professor > > Department of Physics and Astronomy > > Minnesota State University Moorhead > > 1104 7th Ave S, Moorhead MN 56563 > > > > office: Hagen 307F > > phone: (218) 477-2439 > > fax: (218) 477-2290 > > > >> On Jul 7, 2016, at 8:15 PM, Peter Williams wrote: > >> > >> For what it's worth, I'll mention that I've put up a number of > astro-related Conda packages in my personal Anaconda channel, including > DS9, IRAF, PyRAF, and CASA: > >> > >> https://anaconda.org/pkgw > >> https://github.com/pkgw/conda-recipes/ > >> > >> Folks are certainly invited to use these packages as well. However, > while I've been too stubborn to go to the work of integrating these into > something like conda-forge yet, I really should. If anyone wants to build > on the work I've done, or even just get on my case about integrating with > conda-forge, they are most welcome. > >> > >> Cheers, > >> > >> Peter > >> > >> -- > >> Dr. Peter K. G. Williams ? http://newton.cx/~peter/ > >> Harvard-Smithsonian Center for Astrophysics > >> > >> On Fri, 2016-07-08 at 01:43 +0000, Matthew Craig wrote: > >>> Hi, > >>> > >>> There are a couple of conda channels providing astronomy-related > python packages, including one that is relatively new: > >>> > >>> astropy: This conda channel contains all of the astropy affiliated > packages and their dependencies. This includes Windows versions for almost > all of the packages. Astropy itself is provide by Continuum, the company > that distributes conda. List of available packages: > https://anaconda.org/astropy/packages > >>> > >>> OpenAstronomy: This includes all of the packages in the astropy > channel and some packages that are not affiliated packages (e.g. healpy). > List of available packages: https://anaconda.org/openastronomy/packages > >>> > >>> If you use anaconda you can add one or the other of these on a > one-time basis with: conda install -c astropy some_package > >>> > >>> You can add them permanently with: conda config --add channels > openastronomy > >>> > >>> If you develop an astronomy-related package and what it built, feel > free to open a pull request at either: > >>> > >>> https://github.com/astropy/conda-channel-astropy (for astropy > affiliated packages) > >>> > >>> or > >>> > >>> https://github.com/openastronomy/conda-channel (for any astro-related > package). > >>> > >>> Adding a package already on PyPI typically entails very little > work?just a few lines need to be added to a configuration file in the > repository! > >>> > >>> Matt Craig > >>> > >>> schedule: http://physics.mnstate.edu/craig > >>> ?? > >>> Professor > >>> Department of Physics and Astronomy > >>> Minnesota State University Moorhead > >>> 1104 7th Ave S, Moorhead MN 56563 > >>> > >>> office: Hagen 307F > >>> phone: (218) 477-2439 > >>> fax: (218) 477-2290 > >>> > >>> _______________________________________________ > >>> AstroPy mailing list > >>> > >>> AstroPy at scipy.org > >>> https://mail.scipy.org/mailman/listinfo/astropy > >> > >> _______________________________________________ > >> AstroPy mailing list > >> AstroPy at scipy.org > >> https://mail.scipy.org/mailman/listinfo/astropy > > > > _______________________________________________ > > AstroPy mailing list > > AstroPy at scipy.org > > https://mail.scipy.org/mailman/listinfo/astropy > > _______________________________________________ > AstroPy mailing list > AstroPy at scipy.org > https://mail.scipy.org/mailman/listinfo/astropy > -------------- next part -------------- An HTML attachment was scrubbed... URL: From derek at astro.physik.uni-goettingen.de Mon Jul 11 20:22:50 2016 From: derek at astro.physik.uni-goettingen.de (Derek Homeier) Date: Tue, 12 Jul 2016 02:22:50 +0200 Subject: [AstroPy] PR 3655 (Fortran-style and large exponents in ascii.io) Message-ID: <2A662C22-9D61-4B73-B90F-C942A71C0EB1@astro.physik.uni-goettingen.de> Hi, is there anyone else I should send this to regarding the PR? > first, this is an invitation to review the pull request for Fortran-style exponent character support > > https://github.com/astropy/astropy/pull/3655 > > which has been dormant for a fairly long time because of some test crashes on travis. > I?ve noticed far too late that long exponents (> 3 digits) already were flagged as a known > cause of segfaults on travis, and therefore have now isolated the corresponding tests > and marked them xfail. > Second, in the comments on that PR some existing inconsistencies between the handling > of ?illegal? exponents had been discussed; see my last comment for a kind of summary. > Summary of the summary, strings with exponents exceeding float64 range are e.g. read > in as inf and 0.0 in plain Python [float('1.423e388?)], while the ascii.io standard has generally > asked to return such entries as string fields. Numpy OTOH can parse such numbers as > extended precision if specifically asked: > > np.float128('1.423e388')*10 > 1.423e+389 > > So I?d also like to poll if there is general interest in having ascii.io be able to handle such > numbers as well (set by an option, if necessary), which might then include four-digit > exponents. > Thanks, Derek From evert.rol at gmail.com Mon Jul 11 20:36:22 2016 From: evert.rol at gmail.com (Evert Rol) Date: Tue, 12 Jul 2016 10:36:22 +1000 Subject: [AstroPy] PR 3655 (Fortran-style and large exponents in ascii.io) In-Reply-To: <2A662C22-9D61-4B73-B90F-C942A71C0EB1@astro.physik.uni-goettingen.de> References: <2A662C22-9D61-4B73-B90F-C942A71C0EB1@astro.physik.uni-goettingen.de> Message-ID: <37B3CF6D-2455-4D31-B987-4A796B34981B@gmail.com> > is there anyone else I should send this to regarding the PR? Probably not. There is the astropy developer mailing list, which is separate to this mailing list(*), but if you've updated the PR, the astropy maintainers should get informed automatically. Best I can advice, is to keep your PR up-to-date with the current master, verify all tests still pass on Github, and wait (or possibly ping people on GitHub through a comment). The PR will need someone to review it, and a knowledgeable reviewer may not have found time yet to do that. Evert (*) this mailing list is more for general help with Python in an astronomical context. Perhaps you had meant to send this email to the astropy developer mailing list the first time? >> first, this is an invitation to review the pull request for Fortran-style exponent character support >> >> https://github.com/astropy/astropy/pull/3655 >> >> which has been dormant for a fairly long time because of some test crashes on travis. >> I?ve noticed far too late that long exponents (> 3 digits) already were flagged as a known >> cause of segfaults on travis, and therefore have now isolated the corresponding tests >> and marked them xfail. >> Second, in the comments on that PR some existing inconsistencies between the handling >> of ?illegal? exponents had been discussed; see my last comment for a kind of summary. >> Summary of the summary, strings with exponents exceeding float64 range are e.g. read >> in as inf and 0.0 in plain Python [float('1.423e388?)], while the ascii.io standard has generally >> asked to return such entries as string fields. Numpy OTOH can parse such numbers as >> extended precision if specifically asked: >> >> np.float128('1.423e388')*10 >> 1.423e+389 >> >> So I?d also like to poll if there is general interest in having ascii.io be able to handle such >> numbers as well (set by an option, if necessary), which might then include four-digit >> exponents. >> > Thanks, > Derek > > _______________________________________________ > AstroPy mailing list > AstroPy at scipy.org > https://mail.scipy.org/mailman/listinfo/astropy From derek at astro.physik.uni-goettingen.de Mon Jul 11 20:54:03 2016 From: derek at astro.physik.uni-goettingen.de (Derek Homeier) Date: Tue, 12 Jul 2016 02:54:03 +0200 Subject: [AstroPy] PR 3655 (Fortran-style and large exponents in ascii.io) In-Reply-To: <37B3CF6D-2455-4D31-B987-4A796B34981B@gmail.com> References: <2A662C22-9D61-4B73-B90F-C942A71C0EB1@astro.physik.uni-goettingen.de> <37B3CF6D-2455-4D31-B987-4A796B34981B@gmail.com> Message-ID: <35D16723-409F-40BE-90A6-61A3B8109994@astro.physik.uni-goettingen.de> On 12 Jul 2016, at 2:36 am, Evert Rol wrote: > > Probably not. > There is the astropy developer mailing list, which is separate to this mailing list(*), but if you've updated the PR, the astropy maintainers should get informed automatically. > Best I can advice, is to keep your PR up-to-date with the current master, verify all tests still pass on Github, and wait (or possibly ping people on GitHub through a comment). > The PR will need someone to review it, and a knowledgeable reviewer may not have found time yet to do that. > Thanks, I had completely missed the -dev list as it is not on the Scipy archive! I commented on the changes made to pass all CI tests a few weeks ago, so I guess I?m just gonna give it a little more time. Cheers, Derek From wildi.markus at bluewin.ch Wed Jul 13 08:34:03 2016 From: wildi.markus at bluewin.ch (Markus Wildi) Date: Wed, 13 Jul 2016 14:34:03 +0200 Subject: [AstroPy] ICRS, CIRS, AltAz, difference 16 arcmin Message-ID: <5786353B.9090305@bluewin.ch> Hello I'm quite new to AstroPy and I'm using AstroPy 1.2.1, NumPy 1.11.1, Python 3.5 on Ubuntu 16.04. I wrote a script that calculates the AltAz() coordinates from SkyCoord(). To double check the result I calculated AltAz coordinates using a simple matrix transforming CIRS eq. coordinates to AltAz. I checked 1) the value of the sidereal time (good within less than 1 sec). 2) the matrix transformation using ha=dec=0. with no intermediate apparent place calculation. This yields Az=180 deg and the co-latitude of the observatory. While the Alt coordinates in this example are in good agreement the Az show a difference of 16 arcmin although I set the relevant parameters to 0. (should not influence Az anyway): ap_aa=astr_eq.transform_to(AltAz( obstime=dtm, location=obs, obswl=0.5*u.micron, pressure=0.*u.hPa, temperature= 0.*u.deg_C, relative_humidity=0.)) Using different ha values, e.g. ha=15 deg, Alt difference is about 3 arcmin. I can not explain this difference and since AstroPy has been existing for a long time I got the impression I missed something (in the documentation). I appreciate any help. Kind regards, Markus Wildi The script at the bottom produces the following (commented) output: obs lon: 7d34m59.88s obs lat: 47d47m27.96s obs co-lat: 42d12m32.04s sid : 2h03m23.7265s Apparent position for ha=dec=0., ra=Longitude(sid.radian-ha,u.radian): CIRS ra : 2h03m23.1977s # ok, sid CIRS dec: 0d04m22.9374s Transformation to AltAz from ICRS (astropy): AltAz az : 179d44m02.1999s AltAz alt: 42d16m53.7929s # see result rotmat Transformation to AltAz from CIRS (rotmat): rotmat az : 180d00m10.7215s rotmat alt: 42d16m54.9773s # see astropy Direct transformation of ha=dec=0. (no intermediate apparent place), seems to be ok: astrometic (ha=dec=0., cross check for rotmat) rotmat az : 180d00m00.0009s rotmat alt: 42d12m32.04s #!/usr/bin/env python import numpy as np from astropy import units as u from astropy.time import Time from astropy.coordinates import SkyCoord,EarthLocation from astropy.coordinates import AltAz,CIRS from astropy.coordinates import Angle,Longitude,Latitude import numpy as np from numpy import matrix def y_rot(rads=None): return np.matrix([ [ np.cos(rads), 0., np.sin(rads)], [ 0., 1., 0.], [-np.sin(rads), 0., np.cos(rads)]]) def __xyz(lat=None,lon=None): s=np.array([np.cos(lat)*np.cos(lon), np.cos(lat)*np.sin(lon), np.sin(lat)]).transpose() s.shape=(3,1) return s def EQtoAltAz(ra=None,dec=None,sid=None,lat=None): ha=sid.radian-ra mt=y_rot(lat-np.pi/2.) t = mt * __xyz(lat=dec,lon=-ha) tlat=np.arcsin(float(t[2])) tlon=-np.arctan2(float(t[1]),float(t[0])) return tlon,tlat obs=EarthLocation(lon=7.5833*u.deg,lat=+47.7911*u.deg,height=280.*u.m) print('obs lon: {}'.format(obs.longitude.to_string(unit=u.deg))) print('obs lat: {}'.format(obs.latitude.to_string(unit=u.deg))) cl=Latitude(np.pi/2. - obs.latitude.radian, u.radian) print('obs co-lat: {}'.format(cl.to_string(unit=u.deg))) dtm=Time('2015-06-30T07:00:56.05',format='isot', scale='utc',location=obs) sid=dtm.sidereal_time(kind='apparent') ha=dec=0. ra=Longitude(sid.radian-ha,u.radian) radec_str='{} {}'.format(ra.to_string(unit=u.hour),dec) astr_eq=SkyCoord(radec_str, unit=(u.hourangle,u.deg )) print('sid :{}'.format( Angle(sid.radian,u.radian).to_string(u.hour))) ap_eq=astr_eq.transform_to(CIRS(obstime=dtm)) print('CIRS ra : {}'.format(ap_eq.ra.to_string(unit=u.hour))) print('CIRS dec: {}'.format(ap_eq.dec.to_string(unit=u.deg))) ap_aa=astr_eq.transform_to(AltAz(obstime=dtm, location=obs, obswl=0.5*u.micron, pressure=0.*u.hPa, temperature= 0.*u.deg_C, relative_humidity=0.)) print('AltAz az : {}'.format(ap_aa.az.to_string(unit=u.deg))) print('AltAz alt: {}'.format(ap_aa.alt.to_string(unit=u.deg))) az,alt=EQtoAltAz(ra=ap_eq.ra.radian, dec=ap_eq.dec.radian, sid=sid, lat=obs.latitude.radian) aaz=Longitude(az+np.pi, u.radian) # North Az=0., E=np.pi/2. aalt=Latitude(alt, u.radian) print('rotmat az : {}'.format(aaz.to_string(unit=u.degree))) print('rotmat alt: {}'.format(aalt.to_string(unit=u.degree))) az,alt=EQtoAltAz(ra=astr_eq.ra.radian, dec=astr_eq.dec.radian, sid=sid, lat=obs.latitude.radian) aaz=Longitude(az+np.pi, u.radian) aalt=Latitude(alt, u.radian) print('astrometic (ha=dec=0., cross check for rotmat)') print('rotmat az : {}'.format(aaz.to_string(unit=u.degree))) print('rotmat alt: {}'.format(aalt.to_string(unit=u.degree))) From Elie.Bouffard at USherbrooke.ca Tue Jul 26 10:46:58 2016 From: Elie.Bouffard at USherbrooke.ca (=?iso-8859-1?Q?=C9lie_Bouffard?=) Date: Tue, 26 Jul 2016 14:46:58 +0000 Subject: [AstroPy] Lomb-Scargle power Message-ID: Hi everyone, I'm presently working with the Lomb-Scargle periodogram in Astropy. It is very good, but I have a question. From the power outputs, how can you compute the corresponding amplitude of the sinusoid corresponding to that frequency? I know that you can use the .model method, but I would like to know the exact relation between power and sinusoid amplitude, because I want to know the amplitude instead of the power. Thanks! -?lie -------------- next part -------------- An HTML attachment was scrubbed... URL: From parejkoj at uw.edu Wed Jul 27 05:00:59 2016 From: parejkoj at uw.edu (John K. Parejko) Date: Wed, 27 Jul 2016 02:00:59 -0700 Subject: [AstroPy] matplotlib histograms and astropy quantites Message-ID: I wonder if I'm misusing astropy quantities, or if there's a bug with how it interacts with matplotlib's pyplot.hist (and thus np.histogram). I've attached a minimal working example that represents a histogram I was attempting to create. If you try to make the plot range be a unit, plt.hist will fail. I would have thought that I could specify a range with units and get the plot axis to match the units I want to show the data with. Also, trying to draw a vertical line with axvline() on a Quantity fails, though I guess I shouldn't be surprised at that. But given the above, this was also surprising to me. I feel like there could be some more documentation about the interaction between astropy quantities and matplotlib? Am I missing something here? Thanks in advance, John import numpy as np from astropy import units as u import matplotlib.pyplot as plt range1 = (-3, 3) range2 = range1*u.arcsecond np.random.seed(100) data = np.random.normal(scale=3e-6, size=100)*u.radian plt.figure() # Not well centered and wrong X scale. plt.hist(data) # Works: I guess I shouldn't be surprised that I have to extract a value here. plt.axvline(x=data[0].value, color='red') plt.figure() # Wanted the range in arcseconds, so this isn't right! plt.hist(data, range=range1) # Dimensionalizing it seems to work correctly. plt.axvline(x=data[0]/u.arcsecond, color='red') plt.figure() # UnitsError: Can only apply 'less_equal' function to dimensionless quantities... plt.hist(data, range=range2) # UnitsError: Can only apply 'greater' function to dimensionless quantities... plt.axvline(x=data[0]) From d.f.evans at keele.ac.uk Wed Jul 27 05:15:18 2016 From: d.f.evans at keele.ac.uk (Daniel Evans) Date: Wed, 27 Jul 2016 10:15:18 +0100 Subject: [AstroPy] matplotlib histograms and astropy quantites In-Reply-To: References: Message-ID: John, My version of astropy is far too ancient to have this feature (I should bug my sysadmin!) so I can't test it myself, but does calling astropy.visualization.quantity_support() fix your errors? "Enable support for plotting astropy.units.Quantity instances in matplotlib." http://docs.astropy.org/en/stable/api/astropy.visualization.quantity_support.html#astropy.visualization.quantity_support Regards, Daniel On 27 July 2016 at 10:00, John K. Parejko wrote: > I wonder if I'm misusing astropy quantities, or if there's a bug with how > it interacts with matplotlib's pyplot.hist (and thus np.histogram). I've > attached a minimal working example that represents a histogram I was > attempting to create. If you try to make the plot range be a unit, plt.hist > will fail. I would have thought that I could specify a range with units and > get the plot axis to match the units I want to show the data with. > > Also, trying to draw a vertical line with axvline() on a Quantity fails, > though I guess I shouldn't be surprised at that. But given the above, this > was also surprising to me. > > I feel like there could be some more documentation about the interaction > between astropy quantities and matplotlib? > > Am I missing something here? > > Thanks in advance, > John > > > import numpy as np > from astropy import units as u > import matplotlib.pyplot as plt > > range1 = (-3, 3) > range2 = range1*u.arcsecond > np.random.seed(100) > data = np.random.normal(scale=3e-6, size=100)*u.radian > plt.figure() > # Not well centered and wrong X scale. > plt.hist(data) > # Works: I guess I shouldn't be surprised that I have to extract a value > here. > plt.axvline(x=data[0].value, color='red') > plt.figure() > # Wanted the range in arcseconds, so this isn't right! > plt.hist(data, range=range1) > # Dimensionalizing it seems to work correctly. > plt.axvline(x=data[0]/u.arcsecond, color='red') > plt.figure() > # UnitsError: Can only apply 'less_equal' function to dimensionless > quantities... > plt.hist(data, range=range2) > # UnitsError: Can only apply 'greater' function to dimensionless > quantities... > plt.axvline(x=data[0]) > > > > _______________________________________________ > AstroPy mailing list > AstroPy at scipy.org > https://mail.scipy.org/mailman/listinfo/astropy > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fb55 at nyu.edu Wed Jul 27 08:34:43 2016 From: fb55 at nyu.edu (federica) Date: Wed, 27 Jul 2016 08:34:43 -0400 Subject: [AstroPy] matplotlib histograms and astropy quantites In-Reply-To: References: Message-ID: This a numpy version compatibility issue with versions 1.9.x of numpy: https://github.com/numpy/numpy/issues/6469 and the motivation behind it is computational efficiency, but it is fixed in later numpy versions https://github.com/numpy/numpy/commit/34b582aadae8272e7b7209f7a05594e9258ba217 On Wed, Jul 27, 2016 at 5:15 AM, Daniel Evans wrote: > John, > > My version of astropy is far too ancient to have this feature (I should > bug my sysadmin!) so I can't test it myself, but does calling > astropy.visualization.quantity_support() fix your errors? > > "Enable support for plotting astropy.units.Quantity instances in > matplotlib." > > http://docs.astropy.org/en/stable/api/astropy.visualization.quantity_support.html#astropy.visualization.quantity_support > > Regards, > Daniel > > > On 27 July 2016 at 10:00, John K. Parejko wrote: > >> I wonder if I'm misusing astropy quantities, or if there's a bug with how >> it interacts with matplotlib's pyplot.hist (and thus np.histogram). I've >> attached a minimal working example that represents a histogram I was >> attempting to create. If you try to make the plot range be a unit, plt.hist >> will fail. I would have thought that I could specify a range with units and >> get the plot axis to match the units I want to show the data with. >> >> Also, trying to draw a vertical line with axvline() on a Quantity fails, >> though I guess I shouldn't be surprised at that. But given the above, this >> was also surprising to me. >> >> I feel like there could be some more documentation about the interaction >> between astropy quantities and matplotlib? >> >> Am I missing something here? >> >> Thanks in advance, >> John >> >> >> import numpy as np >> from astropy import units as u >> import matplotlib.pyplot as plt >> >> range1 = (-3, 3) >> range2 = range1*u.arcsecond >> np.random.seed(100) >> data = np.random.normal(scale=3e-6, size=100)*u.radian >> plt.figure() >> # Not well centered and wrong X scale. >> plt.hist(data) >> # Works: I guess I shouldn't be surprised that I have to extract a value >> here. >> plt.axvline(x=data[0].value, color='red') >> plt.figure() >> # Wanted the range in arcseconds, so this isn't right! >> plt.hist(data, range=range1) >> # Dimensionalizing it seems to work correctly. >> plt.axvline(x=data[0]/u.arcsecond, color='red') >> plt.figure() >> # UnitsError: Can only apply 'less_equal' function to dimensionless >> quantities... >> plt.hist(data, range=range2) >> # UnitsError: Can only apply 'greater' function to dimensionless >> quantities... >> plt.axvline(x=data[0]) >> >> >> >> _______________________________________________ >> AstroPy mailing list >> AstroPy at scipy.org >> https://mail.scipy.org/mailman/listinfo/astropy >> > > > _______________________________________________ > AstroPy mailing list > AstroPy at scipy.org > https://mail.scipy.org/mailman/listinfo/astropy > > -- _____________________________________________ dr. federica bianco NYU-Center for Cosmology & Particle Physics NYU-Center for Urban Science & Progress New York, NY http://cosmo.nyu.edu/~fb55/ ___________________________________________ //\\ //||\\ Please consider the environment before printing this e-mail email checking schedule: 9-5 on the hour. otherwise sporadically. -------------- next part -------------- An HTML attachment was scrubbed... URL: From parejkoj at uw.edu Wed Jul 27 18:42:08 2016 From: parejkoj at uw.edu (John K. Parejko) Date: Wed, 27 Jul 2016 15:42:08 -0700 Subject: [AstroPy] matplotlib histograms and astropy quantites In-Reply-To: References: Message-ID: <79DD5BBC-EEE0-4452-AFCA-A0D150395641@uw.edu> On 27Jul 2016, at 05:34, federica wrote: > This a numpy version compatibility issue with versions 1.9.x of numpy: > > https://github.com/numpy/numpy/issues/6469 This appears to be a different bug, and I'm on numpy 1.10.4. > On Wed, Jul 27, 2016 at 5:15 AM, Daniel Evans wrote: > > My version of astropy is far too ancient to have this feature (I should bug my sysadmin!) so I can't test it myself, but does calling astropy.visualization.quantity_support() fix your errors? Ah, thanks! It does get rid of the exception, and produce somewhat more helpful axis labels. I'll have to poke around some to fully understand how the units interact with the plot windows, but I think I'm good now. Thanks a bunch, John > On 27 July 2016 at 10:00, John K. Parejko wrote: > I wonder if I'm misusing astropy quantities, or if there's a bug with how it interacts with matplotlib's pyplot.hist (and thus np.histogram). I've attached a minimal working example that represents a histogram I was attempting to create. If you try to make the plot range be a unit, plt.hist will fail. I would have thought that I could specify a range with units and get the plot axis to match the units I want to show the data with. > > Also, trying to draw a vertical line with axvline() on a Quantity fails, though I guess I shouldn't be surprised at that. But given the above, this was also surprising to me. > > I feel like there could be some more documentation about the interaction between astropy quantities and matplotlib? > > Am I missing something here? > > Thanks in advance, > John > > > import numpy as np > from astropy import units as u > import matplotlib.pyplot as plt > > range1 = (-3, 3) > range2 = range1*u.arcsecond > np.random.seed(100) > data = np.random.normal(scale=3e-6, size=100)*u.radian > plt.figure() > # Not well centered and wrong X scale. > plt.hist(data) > # Works: I guess I shouldn't be surprised that I have to extract a value here. > plt.axvline(x=data[0].value, color='red') > plt.figure() > # Wanted the range in arcseconds, so this isn't right! > plt.hist(data, range=range1) > # Dimensionalizing it seems to work correctly. > plt.axvline(x=data[0]/u.arcsecond, color='red') > plt.figure() > # UnitsError: Can only apply 'less_equal' function to dimensionless quantities... > plt.hist(data, range=range2) > # UnitsError: Can only apply 'greater' function to dimensionless quantities... > plt.axvline(x=data[0]) > From parejkoj at uw.edu Wed Jul 27 19:45:50 2016 From: parejkoj at uw.edu (John K. Parejko) Date: Wed, 27 Jul 2016 16:45:50 -0700 Subject: [AstroPy] matplotlib histograms and astropy quantites In-Reply-To: <79DD5BBC-EEE0-4452-AFCA-A0D150395641@uw.edu> References: <79DD5BBC-EEE0-4452-AFCA-A0D150395641@uw.edu> Message-ID: On 27Jul 2016, at 15:42, John K. Parejko wrote: >> On Wed, Jul 27, 2016 at 5:15 AM, Daniel Evans wrote: >> >> My version of astropy is far too ancient to have this feature (I should bug my sysadmin!) so I can't test it myself, but does calling astropy.visualization.quantity_support() fix your errors? > > Ah, thanks! It does get rid of the exception, and produce somewhat more helpful axis labels. I'll have to poke around some to fully understand how the units interact with the plot windows, but I think I'm good now. Actually, I partially withdraw that statement. Turning on quantity_support makes plt.hist() behave better, but it doesn't help plt.axvline(). See the attached example. Have others used axvline() or axhline() with Quantities? Thanks again, John import numpy as np import astropy.visualization from astropy import units as u import matplotlib.pyplot as plt astropy.visualization.quantity_support() range1 = (-40, 40) range2 = range1*u.arcsecond np.random.seed(100) data = np.random.normal(scale=3e-3, size=100)*u.degree plt.figure() # UnitsError: Can only apply 'less_equal' function to dimensionless quantities... plt.hist(data.to(u.arcsecond), range=range2) # works plt.axvline(x=data[0].to(u.arcsecond).value, color='red', lw=2) # works plt.axvline(x=10, color='magenta', lw=2) # ValueError: setting an array element with a sequence. plt.axvline(x=data[1].to(u.arcsecond), color='cyan', lw=2) From ricky.egeland at gmail.com Thu Jul 28 17:18:08 2016 From: ricky.egeland at gmail.com (Ricky Egeland) Date: Thu, 28 Jul 2016 15:18:08 -0600 Subject: [AstroPy] Lomb-Scargle power In-Reply-To: References: Message-ID: <68F3F4D5-95D8-4E3D-BB2C-2F74EA776B4C@gmail.com> PSD := power spectral density ASD := amplitude spectral density N := number of samples in the data ASD = np.sqrt(2*PSD/N) caveat: this is how it works in general; I haven't actually tried the astropy Lomb-Scargle yet. Looking at the docs you'll have to choose normalization='psd'. ? Ricky > On Jul 26, 2016, at 8:46 AM, ?lie Bouffard wrote: > > Hi everyone, > I'm presently working with the Lomb-Scargle periodogram in Astropy. It is very good, but I have a question. From the power outputs, how can you compute the corresponding amplitude of the sinusoid corresponding to that frequency? I know that you can use the .model method, but I would like to know the exact relation between power and sinusoid amplitude, because I want to know the amplitude instead of the power. > Thanks! > -?lie > > _______________________________________________ > AstroPy mailing list > AstroPy at scipy.org > https://mail.scipy.org/mailman/listinfo/astropy