From aldcroft at head.cfa.harvard.edu Tue Mar 1 09:38:33 2016 From: aldcroft at head.cfa.harvard.edu (Aldcroft, Thomas) Date: Tue, 1 Mar 2016 09:38:33 -0500 Subject: [AstroPy] Google Summer of Code 2016 for astronomy! Message-ID: In case you didn't see it on Facebook, there is a great opportunity for students to get paid for contributing to astronomy open-source projects this summer. Please read the original announcement from Nathan Goldbaum: OpenAstronomy has been accepted as a mentoring organization for Google Summer of Code (GSOC) 2016. Students applying with OpenAstronomy this summer will be able to work on projects that will improve Astropy, SunPy, yt, ChiantiPy, or Julia Astro. GSOC is a great opportunity for students to get real-world experience in active open source software projects. This will lead to real improvements in software that will be visible to thousands of scientists who make use of the OpenAstronomy projects every day. Please forward this announcement to students at any level who might be interested in getting paid to improve open source software this summer. Students have until March 25th to put in their applications. I'm also happy to answer questions about this on facebook or via e-mail ( ngoldbau at illinois.edu). More information on this at OpenAstronomy.org: http://openastronomy.org/gsoc/ And from Google: https://summerofcode.withgoogle.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From ghang.naoc at gmail.com Sat Mar 5 09:20:37 2016 From: ghang.naoc at gmail.com (gonghang.naoc) Date: Sat, 5 Mar 2016 22:20:37 +0800 Subject: [AstroPy] time-series tools in Python Message-ID: Hi all, This may not be a good question posted here, but possibly there should be pythoners who work in this field. I wonder anybody knows an algorithm for the detection of periodic signals in gapped data? I searched ADS, but it seems most of the data people deal with are evenly sampled. Thank you. Regards, Hang -------------- next part -------------- An HTML attachment was scrubbed... URL: From sic at elte.hu Sat Mar 5 09:53:41 2016 From: sic at elte.hu (Brigitta Sipocz) Date: Sat, 5 Mar 2016 14:53:41 +0000 Subject: [AstroPy] time-series tools in Python In-Reply-To: References: Message-ID: Hi Hang, The "Python users in astronomy" facebook group [0] may be a better place to ask these kind of general questions as there may be more people reading and answering it there. The answer may depend on what kind of periodic signals you are looking for. I have more experience with the following two options below, but there are several more approaches, too e.g. using wavelets, or gaussian process, etc. One of the fastest/simplest method would be to run Lomb-Scargle [1], but it has some serious limitations if your signal is far from being sinusoidal, or you are going after quasi periodicity with changing signal shape, etc. There are quite a few python implementation, e.g in scipy or gatspy. Another method to search for a period is to use the autocorrelation function. Since your data is unevenly sampled you should use a *discrete correlation function *instead. Python implementations can be found in the time_series module of the astroML package. Chapter 10 in the book of Statistics, Data Mining, and Machine Learning in Astronomy by Ivezi? et al, is also an excellent guide on the subject. Hope it helped. Cheers, Brigitta [0] - https://www.facebook.com/groups/astropython/ [1] - https://jakevdp.github.io/blog/2015/06/13/lomb-scargle-in-python/ On 5 March 2016 at 14:20, gonghang.naoc wrote: > Hi all, > This may not be a good question posted here, but possibly there should be > pythoners who work in this field. > I wonder anybody knows an algorithm for the detection of periodic signals > in gapped data? > I searched ADS, but it seems most of the data people deal with are evenly > sampled. > > Thank you. > Regards, > Hang > > _______________________________________________ > AstroPy mailing list > AstroPy at scipy.org > https://mail.scipy.org/mailman/listinfo/astropy > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From matteo at matteobachetti.it Sat Mar 5 14:12:57 2016 From: matteo at matteobachetti.it (Matteo) Date: Sat, 05 Mar 2016 19:12:57 +0000 Subject: [AstroPy] time-series tools in Python In-Reply-To: References: Message-ID: Hi Hang, If you just mean orbital (regular) gaps, and you're looking for short-term variability, MaLTPyNT should work. Otherwise L-S, that you have used previously. Take also a look at CARMA, it's very powerful for long - term variability. Cheers, Matteo Matteo. On 15:53, Sat, Mar 5, 2016 Brigitta Sipocz wrote: > Hi Hang, > > The "Python users in astronomy" facebook group [0] may be a better place > to ask these kind of general questions as there may be more people reading > and answering it there. > > The answer may depend on what kind of periodic signals you are looking > for. I have more experience with the following two options below, but there > are several more approaches, too e.g. using wavelets, or gaussian process, > etc. > > One of the fastest/simplest method would be to run Lomb-Scargle [1], but > it has some serious limitations if your signal is far from being > sinusoidal, or you are going after quasi periodicity with changing signal > shape, etc. There are quite a few python implementation, e.g in scipy or > gatspy. > Another method to search for a period is to use the autocorrelation > function. Since your data is unevenly sampled you should use a *discrete > correlation function *instead. Python implementations can be found in the > time_series module of the astroML package. > Chapter 10 in the book of Statistics, Data Mining, and Machine Learning > in Astronomy by Ivezi? et al, is also an excellent guide on the subject. > > Hope it helped. > > Cheers, > Brigitta > > > [0] - https://www.facebook.com/groups/astropython/ > [1] - https://jakevdp.github.io/blog/2015/06/13/lomb-scargle-in-python/ > > > On 5 March 2016 at 14:20, gonghang.naoc wrote: > >> Hi all, >> This may not be a good question posted here, but possibly there should be >> pythoners who work in this field. >> I wonder anybody knows an algorithm for the detection of periodic signals >> in gapped data? >> I searched ADS, but it seems most of the data people deal with are evenly >> sampled. >> >> Thank you. >> Regards, >> Hang >> >> _______________________________________________ >> 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 ghang.naoc at gmail.com Sun Mar 6 05:48:56 2016 From: ghang.naoc at gmail.com (gonghang.naoc) Date: Sun, 6 Mar 2016 18:48:56 +0800 Subject: [AstroPy] time-series tools in Python In-Reply-To: References: Message-ID: Thank you. Good idea. Hang On Sun, Mar 6, 2016 at 3:12 AM, Matteo wrote: > Hi Hang, > > If you just mean orbital (regular) gaps, and you're looking for > short-term variability, MaLTPyNT should work. > > Otherwise L-S, that you have used previously. Take also a look at CARMA, > it's very powerful for long - term variability. > > Cheers, > > Matteo > > > Matteo. > > On 15:53, Sat, Mar 5, 2016 Brigitta Sipocz wrote: > >> Hi Hang, >> >> The "Python users in astronomy" facebook group [0] may be a better place >> to ask these kind of general questions as there may be more people reading >> and answering it there. >> >> The answer may depend on what kind of periodic signals you are looking >> for. I have more experience with the following two options below, but there >> are several more approaches, too e.g. using wavelets, or gaussian process, >> etc. >> >> One of the fastest/simplest method would be to run Lomb-Scargle [1], but >> it has some serious limitations if your signal is far from being >> sinusoidal, or you are going after quasi periodicity with changing signal >> shape, etc. There are quite a few python implementation, e.g in scipy or >> gatspy. >> Another method to search for a period is to use the autocorrelation >> function. Since your data is unevenly sampled you should use a *discrete >> correlation function *instead. Python implementations can be found in >> the time_series module of the astroML package. >> Chapter 10 in the book of Statistics, Data Mining, and Machine Learning >> in Astronomy by Ivezi? et al, is also an excellent guide on the subject. >> >> Hope it helped. >> >> Cheers, >> Brigitta >> >> >> [0] - https://www.facebook.com/groups/astropython/ >> [1] - https://jakevdp.github.io/blog/2015/06/13/lomb-scargle-in-python/ >> >> >> On 5 March 2016 at 14:20, gonghang.naoc wrote: >> >>> Hi all, >>> This may not be a good question posted here, but possibly there should >>> be pythoners who work in this field. >>> I wonder anybody knows an algorithm for the detection of periodic >>> signals in gapped data? >>> I searched ADS, but it seems most of the data people deal with are >>> evenly sampled. >>> >>> Thank you. >>> Regards, >>> Hang >>> >>> _______________________________________________ >>> 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 jgv.home at gmail.com Sun Mar 6 10:48:21 2016 From: jgv.home at gmail.com (j. vickroy) Date: Sun, 06 Mar 2016 15:48:21 +0000 Subject: [AstroPy] UserWarning When Opening FITS File Message-ID: Hi, My system is: Microsoft Windows 10 (64-bit) Python 3.5.1 AstroPy 1.1.1 (from http://www.lfd.uci.edu/~gohlke/pythonlibs/#astropy) NumPy 1.10.4 (from http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy) The following is an interactive session illustrating the warning: PythonWin 3.5.1 (v3.5.1:37a07cee5969, Dec 6 2015, 01:54:25) [MSC v.1900 64 bit (AMD64)] on win32. Portions Copyright 1994-2008 Mark Hammond - see 'Help/About PythonWin' for further copyright information. >>> import astropy.io.fits >>> import numpy >>> astropy.__version__ '1.1.1' >>> numpy.__version__ '1.10.4' >>> sourcefile = r'C:\Users\jgv\Pictures\Astro\Calibration\Darks\DARK_5m_001.fit' >>> HDUs = astropy.io.fits.open (sourcefile) C:\Users\jgv\AppData\Local\Programs\Python\Python35\lib\site-packages\astropy\io\fits\util.py:578: UserWarning: Could not find appropriate MS Visual C Runtime library or library is corrupt/misconfigured; cannot determine whether your file object was opened in append mode. Please consider using a file object opened in write mode instead. 'Could not find appropriate MS Visual C Runtime ' >>> I would appreciate feedback about what is wrong with my setup and how to repair it. Thanks, --jv -------------- next part -------------- An HTML attachment was scrubbed... URL: From demitri.muna at gmail.com Sun Mar 6 11:03:32 2016 From: demitri.muna at gmail.com (Demitri Muna) Date: Sun, 6 Mar 2016 11:03:32 -0500 Subject: [AstroPy] UserWarning When Opening FITS File In-Reply-To: References: Message-ID: <1E0A9CC7-775C-4C48-84B8-E21D0C607ADF@gmail.com> While not a direct answer to your question, I?d probably recommend installing the Anaconda Python: https://www.continuum.io/downloads Demitri --- On Mar 6, 2016, at 10:48 AM, j. vickroy wrote: > Hi, > > My system is: > > Microsoft Windows 10 (64-bit) > Python 3.5.1 > AstroPy 1.1.1 (from http://www.lfd.uci.edu/~gohlke/pythonlibs/#astropy) > NumPy 1.10.4 (from http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy) > > The following is an interactive session illustrating the warning: > > PythonWin 3.5.1 (v3.5.1:37a07cee5969, Dec 6 2015, 01:54:25) [MSC v.1900 64 bit (AMD64)] on win32. > Portions Copyright 1994-2008 Mark Hammond - see 'Help/About PythonWin' for further copyright information. > >>> import astropy.io.fits > >>> import numpy > >>> astropy.__version__ > '1.1.1' > >>> numpy.__version__ > '1.10.4' > >>> sourcefile = r'C:\Users\jgv\Pictures\Astro\Calibration\Darks\DARK_5m_001.fit' > >>> HDUs = astropy.io.fits.open (sourcefile) > C:\Users\jgv\AppData\Local\Programs\Python\Python35\lib\site-packages\astropy\io\fits\util.py:578: UserWarning: Could not find appropriate MS Visual C Runtime library or library is corrupt/misconfigured; cannot determine whether your file object was opened in append mode. Please consider using a file object opened in write mode instead. > 'Could not find appropriate MS Visual C Runtime ' > >>> > > I would appreciate feedback about what is wrong with my setup and how to repair it. > > Thanks, > --jv > _______________________________________________ > AstroPy mailing list > AstroPy at scipy.org > https://mail.scipy.org/mailman/listinfo/astropy From jgv.home at gmail.com Sun Mar 6 12:24:08 2016 From: jgv.home at gmail.com (j. vickroy) Date: Sun, 06 Mar 2016 17:24:08 +0000 Subject: [AstroPy] UserWarning When Opening FITS File In-Reply-To: <1E0A9CC7-775C-4C48-84B8-E21D0C607ADF@gmail.com> Message-ID: Thanks for your quick reply. My preference is to avoid these distributions -- mostly because of a frustrating experience with Canopy a few years back. Do you use the Anaconda distribution on Microsoft Windows? If so, any issues with it? --jv ------ Original Message ------ From: "Demitri Muna" To: "j. vickroy" ; "Astronomical Python mailing list" Sent: 3/6/2016 9:03:32 AM Subject: Re: [AstroPy] UserWarning When Opening FITS File > >While not a direct answer to your question, I?d probably recommend >installing the Anaconda Python: > >https://www.continuum.io/downloads > >Demitri > >--- > >On Mar 6, 2016, at 10:48 AM, j. vickroy wrote: > >> Hi, >> >> My system is: >> >> Microsoft Windows 10 (64-bit) >> Python 3.5.1 >> AstroPy 1.1.1 (from >>http://www.lfd.uci.edu/~gohlke/pythonlibs/#astropy) >> NumPy 1.10.4 (from http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy) >> >> The following is an interactive session illustrating the warning: >> >> PythonWin 3.5.1 (v3.5.1:37a07cee5969, Dec 6 2015, 01:54:25) [MSC >>v.1900 64 bit (AMD64)] on win32. >> Portions Copyright 1994-2008 Mark Hammond - see 'Help/About >>PythonWin' for further copyright information. >> >>> import astropy.io.fits >> >>> import numpy >> >>> astropy.__version__ >> '1.1.1' >> >>> numpy.__version__ >> '1.10.4' >> >>> sourcefile = >>r'C:\Users\jgv\Pictures\Astro\Calibration\Darks\DARK_5m_001.fit' >> >>> HDUs = astropy.io.fits.open (sourcefile) >> >>C:\Users\jgv\AppData\Local\Programs\Python\Python35\lib\site-packages\astropy\io\fits\util.py:578: >>UserWarning: Could not find appropriate MS Visual C Runtime library or >>library is corrupt/misconfigured; cannot determine whether your file >>object was opened in append mode. Please consider using a file object >>opened in write mode instead. >> 'Could not find appropriate MS Visual C Runtime ' >> >>> >> >> I would appreciate feedback about what is wrong with my setup and how >>to repair it. >> >> Thanks, >> --jv >> _______________________________________________ >> AstroPy mailing list >> AstroPy at scipy.org >> https://mail.scipy.org/mailman/listinfo/astropy > From anizami at macalester.edu Sun Mar 6 12:28:55 2016 From: anizami at macalester.edu (Asra Nizami) Date: Sun, 6 Mar 2016 11:28:55 -0600 Subject: [AstroPy] UserWarning When Opening FITS File In-Reply-To: References: <1E0A9CC7-775C-4C48-84B8-E21D0C607ADF@gmail.com> Message-ID: Hi Vicki, It seems like this is a known issue as mentioned in https://github.com/astropy/astropy/issues/4398 and you could just ignore the warning. By the way, I have a Windows 10 machine and I use Anaconda and it works really nicely! Best, Asra On Sun, Mar 6, 2016 at 11:24 AM, j. vickroy wrote: > Thanks for your quick reply. > > My preference is to avoid these distributions -- mostly because of a > frustrating experience with Canopy a few years back. > > Do you use the Anaconda distribution on Microsoft Windows? If so, any > issues with it? > > --jv > > > ------ Original Message ------ > From: "Demitri Muna" > To: "j. vickroy" ; "Astronomical Python mailing list" > > Sent: 3/6/2016 9:03:32 AM > Subject: Re: [AstroPy] UserWarning When Opening FITS File > > >> While not a direct answer to your question, I?d probably recommend >> installing the Anaconda Python: >> >> https://www.continuum.io/downloads >> >> Demitri >> >> --- >> >> On Mar 6, 2016, at 10:48 AM, j. vickroy wrote: >> >> Hi, >>> >>> My system is: >>> >>> Microsoft Windows 10 (64-bit) >>> Python 3.5.1 >>> AstroPy 1.1.1 (from http://www.lfd.uci.edu/~gohlke/pythonlibs/#astropy) >>> NumPy 1.10.4 (from http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy) >>> >>> The following is an interactive session illustrating the warning: >>> >>> PythonWin 3.5.1 (v3.5.1:37a07cee5969, Dec 6 2015, 01:54:25) [MSC >>> v.1900 64 bit (AMD64)] on win32. >>> Portions Copyright 1994-2008 Mark Hammond - see 'Help/About PythonWin' >>> for further copyright information. >>> >>> import astropy.io.fits >>> >>> import numpy >>> >>> astropy.__version__ >>> '1.1.1' >>> >>> numpy.__version__ >>> '1.10.4' >>> >>> sourcefile = >>> r'C:\Users\jgv\Pictures\Astro\Calibration\Darks\DARK_5m_001.fit' >>> >>> HDUs = astropy.io.fits.open (sourcefile) >>> C:\Users\jgv\AppData\Local\Programs\Python\Python35\lib\site-packages\astropy\io\fits\util.py:578: >>> UserWarning: Could not find appropriate MS Visual C Runtime library or >>> library is corrupt/misconfigured; cannot determine whether your file object >>> was opened in append mode. Please consider using a file object opened in >>> write mode instead. >>> 'Could not find appropriate MS Visual C Runtime ' >>> >>> >>> >>> I would appreciate feedback about what is wrong with my setup and how >>> to repair it. >>> >>> Thanks, >>> --jv >>> _______________________________________________ >>> 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 > -- Asra Nizami Physics with an Astronomy emphasis | Computer Science Macalester College '16 -------------- next part -------------- An HTML attachment was scrubbed... URL: From demitri.muna at gmail.com Sun Mar 6 12:29:10 2016 From: demitri.muna at gmail.com (Demitri Muna) Date: Sun, 6 Mar 2016 12:29:10 -0500 Subject: [AstroPy] UserWarning When Opening FITS File In-Reply-To: References: Message-ID: <9079D3B4-D6BD-4C8F-A865-5B4929E104F5@gmail.com> On Mar 6, 2016, at 12:24 PM, j. vickroy wrote: > My preference is to avoid these distributions -- mostly because of a frustrating experience with Canopy a few years back. > > Do you use the Anaconda distribution on Microsoft Windows? If so, any issues with it? I?ve never used Windows. I used to use the Enthought distribution, but over time it became more difficult to work with. By the time they introduced Canopy I switched over to Anaconda. It?s a very good, easy to use distribution. Give it a try; it?s well worth it. If you prefer, you can just install it and pretend it?s a standalone installation, but the ?conda? package manager is very easy to use. You can still use pip to install anything you want, but if you use conda for the packages Anaconda maintains, you won?t run into the dependency/library problems you have. Demitri _________________________________________ Demitri Muna http://muna.com Department of Astronomy La Ohio State University My Projects: http://nightlightapp.io http://trillianverse.org http://scicoder.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From jgv.home at gmail.com Sun Mar 6 12:35:32 2016 From: jgv.home at gmail.com (j. vickroy) Date: Sun, 06 Mar 2016 17:35:32 +0000 Subject: [AstroPy] UserWarning When Opening FITS File In-Reply-To: Message-ID: Hi Asara, Thanks for pointing out this is a known issue; I completely missed that in my search. Perhaps I should revisit Anaconda also. Regards, --jv ------ Original Message ------ From: "Asra Nizami" To: "j. vickroy" ; "Astronomical Python mailing list" Cc: "Demitri Muna" Sent: 3/6/2016 10:28:55 AM Subject: Re: [AstroPy] UserWarning When Opening FITS File >Hi Vicki, > >It seems like this is a known issue as mentioned in >https://github.com/astropy/astropy/issues/4398 and you could just >ignore the warning. By the way, I have a Windows 10 machine and I use >Anaconda and it works really nicely! > >Best, >Asra > >On Sun, Mar 6, 2016 at 11:24 AM, j. vickroy wrote: >>Thanks for your quick reply. >> >>My preference is to avoid these distributions -- mostly because of a >>frustrating experience with Canopy a few years back. >> >>Do you use the Anaconda distribution on Microsoft Windows? If so, any >>issues with it? >> >>--jv >> >> >>------ Original Message ------ >>From: "Demitri Muna" >>To: "j. vickroy" ; "Astronomical Python mailing >>list" >>Sent: 3/6/2016 9:03:32 AM >>Subject: Re: [AstroPy] UserWarning When Opening FITS File >> >>> >>>While not a direct answer to your question, I?d probably recommend >>>installing the Anaconda Python: >>> >>>https://www.continuum.io/downloads >>> >>>Demitri >>> >>>--- >>> >>>On Mar 6, 2016, at 10:48 AM, j. vickroy wrote: >>> >>>> Hi, >>>> >>>> My system is: >>>> >>>> Microsoft Windows 10 (64-bit) >>>> Python 3.5.1 >>>> AstroPy 1.1.1 (from >>>>http://www.lfd.uci.edu/~gohlke/pythonlibs/#astropy) >>>> NumPy 1.10.4 (from >>>>http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy) >>>> >>>> The following is an interactive session illustrating the warning: >>>> >>>> PythonWin 3.5.1 (v3.5.1:37a07cee5969, Dec 6 2015, 01:54:25) [MSC >>>>v.1900 64 bit (AMD64)] on win32. >>>> Portions Copyright 1994-2008 Mark Hammond - see 'Help/About >>>>PythonWin' for further copyright information. >>>> >>> import astropy.io.fits >>>> >>> import numpy >>>> >>> astropy.__version__ >>>> '1.1.1' >>>> >>> numpy.__version__ >>>> '1.10.4' >>>> >>> sourcefile = >>>>r'C:\Users\jgv\Pictures\Astro\Calibration\Darks\DARK_5m_001.fit' >>>> >>> HDUs = astropy.io.fits.open (sourcefile) >>>> >>>>C:\Users\jgv\AppData\Local\Programs\Python\Python35\lib\site-packages\astropy\io\fits\util.py:578: >>>>UserWarning: Could not find appropriate MS Visual C Runtime library >>>>or library is corrupt/misconfigured; cannot determine whether your >>>>file object was opened in append mode. Please consider using a file >>>>object opened in write mode instead. >>>> 'Could not find appropriate MS Visual C Runtime ' >>>> >>> >>>> >>>> I would appreciate feedback about what is wrong with my setup and >>>>how to repair it. >>>> >>>> Thanks, >>>> --jv >>>> _______________________________________________ >>>> 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 > > > >-- >Asra Nizami >Physics with an Astronomy emphasis | Computer Science >Macalester College '16 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jgv.home at gmail.com Sun Mar 6 12:43:05 2016 From: jgv.home at gmail.com (j. vickroy) Date: Sun, 06 Mar 2016 17:43:05 +0000 Subject: [AstroPy] UserWarning When Opening FITS File In-Reply-To: <9079D3B4-D6BD-4C8F-A865-5B4929E104F5@gmail.com> Message-ID: ------ Original Message ------ From: "Demitri Muna" To: "j. vickroy" Cc: "Astronomical Python mailing list" Sent: 3/6/2016 10:29:10 AM Subject: Re: [AstroPy] UserWarning When Opening FITS File > >On Mar 6, 2016, at 12:24 PM, j. vickroy wrote: > >>My preference is to avoid these distributions -- mostly because of a >>frustrating experience with Canopy a few years back. >> >>Do you use the Anaconda distribution on Microsoft Windows? If so, any >>issues with it? > >I?ve never used Windows. I used to use the Enthought distribution, but >over time it became more difficult to work with. By the time they >introduced Canopy I switched over to Anaconda. It?s a very good, easy >to use distribution. Give it a try; it?s well worth it. > >If you prefer, you can just install it and pretend it?s a standalone >installation, but the ?conda? package manager is very easy to use. You >can still use pip to install anything you want, but if you use conda >for the packages Anaconda maintains, you won?t run into the >dependency/library problems you have. Ok, I will take a look at Anaconda again. A few years ago (post Canopy), I tried Anaconda and discovered a bug (not present in the standard C-Python distribution) in one of the libraries. I reported the bug and did receive a response from tech support, but the time-line. to release a fix, was months so I moved on. > >Demitri > >_________________________________________ >Demitri Muna >http://muna.com > >Department of Astronomy >La Ohio State University > >My Projects: >http://nightlightapp.io >http://trillianverse.org >http://scicoder.org > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kwang at eso.org Mon Mar 7 10:52:59 2016 From: kwang at eso.org (Ke Wang) Date: Mon, 7 Mar 2016 16:52:59 +0100 Subject: [AstroPy] APLpy color bar for markers Message-ID: Hi, This should be a simple question, but I just don't find an obvious solution: I use APLpy to plot a FITS image with nice wcs coordinates support, and overlay color coded markers: fig = aplpy.FITSFigure('image.fits') fig.show_colorscale(cmap='gray') fig.show_markers(ra, dec, c=velocity, cmap='rainbow') fig.add_colorbar() This will plot a gray color bar (for the image). But I want to display the rainbow (for markers). Any idea would be appreciated. Cheers, Ke -------------- next part -------------- An HTML attachment was scrubbed... URL: From trive at astro.su.se Mon Mar 7 12:38:27 2016 From: trive at astro.su.se (=?UTF-8?Q?Th=c3=b8ger_Emil_Rivera-Thorsen?=) Date: Mon, 7 Mar 2016 18:38:27 +0100 Subject: [AstroPy] APLpy color bar for markers In-Reply-To: References: Message-ID: <56DDBC93.2080304@astro.su.se> I would do this by tapping directly into the Matplotlib/pylab api to do this: |import matplotlib.pyplot as plt import aplpy as ap fig = ap.FITSFigure('myimage.fits') fig.show_grayscale() f, a = plt.gcf(), plt.gca() x, y = fig.world2pixel(ra, dec) points = a.scatter(ra, dec, c=velocity, cmap='rainbow') fig.colorbar(points) | The colorbar is not as neatly aligned as the APLPy function does, but this can be refined and tweaked, if you read the matplotlib docs (or you can just use it as-is). On 03/07/2016 04:52 PM, Ke Wang wrote: > Hi, > > This should be a simple question, but I just don't find an obvious > solution: > > I use APLpy to plot a FITS image with nice wcs coordinates support, > and overlay color coded markers: > > fig = aplpy.FITSFigure('image.fits') > fig.show_colorscale(cmap='gray') > fig.show_markers(ra, dec, c=velocity, cmap='rainbow') > fig.add_colorbar() > > This will plot a gray color bar (for the image). But I want to display > the rainbow (for markers). Any idea would be appreciated. > > Cheers, > Ke > > > _______________________________________________ > AstroPy mailing list > AstroPy at scipy.org > https://mail.scipy.org/mailman/listinfo/astropy ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From trive at astro.su.se Mon Mar 7 12:55:20 2016 From: trive at astro.su.se (=?UTF-8?Q?Th=c3=b8ger_Emil_Rivera-Thorsen?=) Date: Mon, 7 Mar 2016 18:55:20 +0100 Subject: [AstroPy] APLpy color bar for markers In-Reply-To: <56DDBC93.2080304@astro.su.se> References: <56DDBC93.2080304@astro.su.se> Message-ID: <56DDC088.1020301@astro.su.se> Sorry for flooding, but I just worked out a better solution: |import matplotlib.pyplot as plt import aplpy as ap f = plt.figure() fig = ap.FITSFigure('/path/to/myimage.fits', figure=f) a = fig.axes[0] # Or alternatively, a = plt.gca() x, y = fig.world2pixel(ra, dec) points = a.scatter(x, y, c=velocity, cmap='rainbow') f.colorbar(ax=a, use_gridspec=True) | This should give you what you want, and look a good deal nicer than my first suggestion. You can set the width etc. of the colorbar in the |f.colorbar()| call, just read the documentation (|f.colorbar?| in IPython). On 03/07/2016 06:38 PM, Th?ger Emil Rivera-Thorsen wrote: > I would do this by tapping directly into the Matplotlib/pylab api to > do this: > > |import matplotlib.pyplot as plt import aplpy as ap fig = > ap.FITSFigure('myimage.fits') fig.show_grayscale() f, a = plt.gcf(), > plt.gca() x, y = fig.world2pixel(ra, dec) points = a.scatter(ra, dec, > c=velocity, cmap='rainbow') fig.colorbar(points) | > > The colorbar is not as neatly aligned as the APLPy function does, but > this can be refined and tweaked, if you read the matplotlib docs (or > you can just use it as-is). > > On 03/07/2016 04:52 PM, Ke Wang wrote: > >> Hi, >> >> This should be a simple question, but I just don't find an obvious >> solution: >> >> I use APLpy to plot a FITS image with nice wcs coordinates support, >> and overlay color coded markers: >> >> fig = aplpy.FITSFigure('image.fits') >> fig.show_colorscale(cmap='gray') >> fig.show_markers(ra, dec, c=velocity, cmap='rainbow') >> fig.add_colorbar() >> >> This will plot a gray color bar (for the image). But I want to >> display the rainbow (for markers). Any idea would be appreciated. >> >> Cheers, >> Ke >> >> >> _______________________________________________ >> 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 kwang at eso.org Mon Mar 7 16:03:24 2016 From: kwang at eso.org (Ke Wang) Date: Mon, 7 Mar 2016 22:03:24 +0100 Subject: [AstroPy] APLpy color bar for markers In-Reply-To: <2bc068b5778d44f5a8a1d4aaebe54504@HQHTC1.ads.eso.org> References: <56DDBC93.2080304@astro.su.se> <2bc068b5778d44f5a8a1d4aaebe54504@HQHTC1.ads.eso.org> Message-ID: Thank you Th?ger! I got this error, which I don't understand. Any idea ? In [19]: f.colorbar(ax=a, use_gridspec=True) --------------------------------------------------------------------------- TypeError Traceback (most recent call last) in () ----> 1 f.colorbar(ax=a, use_gridspec=True) TypeError: colorbar() takes at least 2 arguments (3 given) --- Dr. Ke Wang Associate, European Southern Observatory http://www.eso.org/~kwang On Mon, Mar 7, 2016 at 6:55 PM, Th?ger Emil Rivera-Thorsen < trive at astro.su.se> wrote: > Sorry for flooding, but I just worked out a better solution: > > import matplotlib.pyplot as pltimport aplpy as ap > > f = plt.figure() > fig = ap.FITSFigure('/path/to/myimage.fits', figure=f) > a = fig.axes[0] # Or alternatively, a = plt.gca() > x, y = fig.world2pixel(ra, dec) > > points = a.scatter(x, y, c=velocity, cmap='rainbow') > f.colorbar(ax=a, use_gridspec=True) > > This should give you what you want, and look a good deal nicer than my > first suggestion. > You can set the width etc. of the colorbar in the f.colorbar() call, just > read the documentation (f.colorbar? in IPython). > > On 03/07/2016 06:38 PM, Th?ger Emil Rivera-Thorsen wrote: > > I would do this by tapping directly into the Matplotlib/pylab api to do > this: > > import matplotlib.pyplot as pltimport aplpy as ap > > fig = ap.FITSFigure('myimage.fits') > fig.show_grayscale() > > f, a = plt.gcf(), plt.gca() > x, y = fig.world2pixel(ra, dec) > > points = a.scatter(ra, dec, c=velocity, cmap='rainbow') > fig.colorbar(points) > > The colorbar is not as neatly aligned as the APLPy function does, but this > can be refined and tweaked, if you read the matplotlib docs (or you can > just use it as-is). > > On 03/07/2016 04:52 PM, Ke Wang wrote: > > Hi, > > This should be a simple question, but I just don't find an obvious > solution: > > I use APLpy to plot a FITS image with nice wcs coordinates support, and > overlay color coded markers: > > fig = aplpy.FITSFigure('image.fits') > fig.show_colorscale(cmap='gray') > fig.show_markers(ra, dec, c=velocity, cmap='rainbow') > fig.add_colorbar() > > This will plot a gray color bar (for the image). But I want to display the > rainbow (for markers). Any idea would be appreciated. > > Cheers, > Ke > > > _______________________________________________ > AstroPy mailing listAstroPy at scipy.orghttps://mail.scipy.org/mailman/listinfo/astropy > > ? > > > _______________________________________________ > AstroPy mailing listAstroPy at scipy.orghttps://mail.scipy.org/mailman/listinfo/astropy > > ? > -------------- next part -------------- An HTML attachment was scrubbed... URL: From trive at astro.su.se Mon Mar 7 16:08:48 2016 From: trive at astro.su.se (=?UTF-8?Q?Th=c3=b8ger_Emil_Rivera-Thorsen?=) Date: Mon, 7 Mar 2016 22:08:48 +0100 Subject: [AstroPy] APLpy color bar for markers In-Reply-To: References: <56DDBC93.2080304@astro.su.se> <2bc068b5778d44f5a8a1d4aaebe54504@HQHTC1.ads.eso.org> Message-ID: <56DDEDE0.4030700@astro.su.se> My fault, a typo again (I hit ?send? too fast, it seems). Let me try and get it right this time: |import matplotlib.pyplot as plt import aplpy as ap f = plt.figure() fig = ap.FITSFigure('/path/to/myimage.fits', figure=f) a = f.axes[0] # Or alternatively, a = plt.gca() x, y = fig.world2pixel(ra, dec) points = a.scatter(x, y, c=velocity, cmap='rainbow') f.colorbar(points, ax=a, use_gridspec=True) | I had forgotten to pass the |points| object to the |colorbar()| call. Should work now - I hope. Cheers! On 03/07/2016 10:03 PM, Ke Wang wrote: > Thank you Th?ger! > I got this error, which I don't understand. Any idea ? > > In [19]: f.colorbar(ax=a, use_gridspec=True) > --------------------------------------------------------------------------- > TypeError Traceback (most recent call > last) > in () > ----> 1 f.colorbar(ax=a, use_gridspec=True) > > TypeError: colorbar() takes at least 2 arguments (3 given) > > > --- > Dr. Ke Wang > Associate, European Southern Observatory > http://www.eso.org/~kwang > > On Mon, Mar 7, 2016 at 6:55 PM, Th?ger Emil Rivera-Thorsen > > wrote: > > Sorry for flooding, but I just worked out a better solution: > > |import matplotlib.pyplot as plt import aplpy as ap f = > plt.figure() fig = ap.FITSFigure('/path/to/myimage.fits', > figure=f) a = fig.axes[0] # Or alternatively, a = plt.gca() x, y = > fig.world2pixel(ra, dec) points = a.scatter(x, y, c=velocity, > cmap='rainbow') f.colorbar(ax=a, use_gridspec=True) | > > This should give you what you want, and look a good deal nicer > than my first suggestion. > You can set the width etc. of the colorbar in the |f.colorbar()| > call, just read the documentation (|f.colorbar?| in IPython). > > On 03/07/2016 06:38 PM, Th?ger Emil Rivera-Thorsen wrote: > >> I would do this by tapping directly into the Matplotlib/pylab api >> to do this: >> >> |import matplotlib.pyplot as plt import aplpy as ap fig = >> ap.FITSFigure('myimage.fits') fig.show_grayscale() f, a = >> plt.gcf(), plt.gca() x, y = fig.world2pixel(ra, dec) points = >> a.scatter(ra, dec, c=velocity, cmap='rainbow') fig.colorbar(points) | >> >> The colorbar is not as neatly aligned as the APLPy function does, >> but this can be refined and tweaked, if you read the matplotlib >> docs (or you can just use it as-is). >> >> On 03/07/2016 04:52 PM, Ke Wang wrote: >> >>> Hi, >>> >>> This should be a simple question, but I just don't find an >>> obvious solution: >>> >>> I use APLpy to plot a FITS image with nice wcs coordinates >>> support, and overlay color coded markers: >>> >>> fig = aplpy.FITSFigure('image.fits') >>> fig.show_colorscale(cmap='gray') >>> fig.show_markers(ra, dec, c=velocity, cmap='rainbow') >>> fig.add_colorbar() >>> >>> This will plot a gray color bar (for the image). But I want to >>> display the rainbow (for markers). Any idea would be appreciated. >>> >>> Cheers, >>> Ke >>> >>> >>> _______________________________________________ >>> 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 wangke1984roy at gmail.com Mon Mar 7 16:16:08 2016 From: wangke1984roy at gmail.com (Ke Wang) Date: Mon, 7 Mar 2016 22:16:08 +0100 Subject: [AstroPy] APLpy color bar for markers In-Reply-To: References: <56DDBC93.2080304@astro.su.se> <2bc068b5778d44f5a8a1d4aaebe54504@HQHTC1.ads.eso.org> Message-ID: It works now! Thanks a lot !! -------------- next part -------------- An HTML attachment was scrubbed... URL: From evert.rol at gmail.com Wed Mar 16 01:09:32 2016 From: evert.rol at gmail.com (Evert Rol) Date: Wed, 16 Mar 2016 16:09:32 +1100 Subject: [AstroPy] How to disable astropy warnings (in particular IERS precision warnings)? Message-ID: <4E18DD52-5F14-4BB8-A6B9-98D8FA8141E0@gmail.com> How do I disable (the logging of) astropy warnings? From the astropy logging documentation, I thought that `log.disable_warnings_logging()` would do it, but it looks like it doesn't. Setting the log level to 'ERROR' doesn't do it either. See below. (I also find it a tad odd that I get warned twice about the same issue, though granted that they are not the same error message.) I have managed to silence this, with the following construct: import warnings from astropy.utils.exceptions import AstropyWarning with warnings.catch_warnings(): warnings.simplefilter('ignore', category=AstropyWarning) but that seems rather complex compared to a simple `log.disable_warnings_logging()` call. What am I missing? Thanks, Evert Example that I thought should shut up the IERS warnings: >>> from astropy import log >>> from astropy.time import Time >>> from astropy.coordinates import get_sun, EarthLocation, AltAz >>> log.disable_warnings_logging() >>> log.setLevel('ERROR') >>> t = Time.now() >>> frame = AltAz(obstime=t, location=EarthLocation(lon=0, lat=0, height=0)) >>> get_sun(t).transform_to(frame) /usr/local/lib/python3.5/site-packages/astropy/coordinates/builtin_frames/utils.py:93: AstropyWarning: Tried to get polar motions for times after IERS data is valid. Defaulting to polar motion from the 50-yr mean for those. If you need enough precision such that this matters (~<10 arcsec), you can use the latest IERS predictions by running: >>> from astropy.utils import iers >>> iers.IERS.iers_table = iers.IERS_A.open(iers.IERS_A_URL) warnings.warn(wmsg, AstropyWarning) /usr/local/lib/python3.5/site-packages/astropy/coordinates/builtin_frames/utils.py:107: AstropyWarning: (some) times are outside of range covered by IERS table. Assuming UT1-UTC=0 for coordinate transformations. If you need enough precision such that this matters (~<10 arcsec), you can use the latest IERS predictions by running: >>> from astropy.utils import iers >>> iers.IERS.iers_table = iers.IERS_A.open(iers.IERS_A_URL) warnings.warn(msg.format(ierserr.args[0], _IERS_HINT), AstropyWarning) >>> From crawfordsm at gmail.com Wed Mar 16 05:53:20 2016 From: crawfordsm at gmail.com (Steve Crawford) Date: Wed, 16 Mar 2016 11:53:20 +0200 Subject: [AstroPy] ANN: Release of ccdproc v1.0 Message-ID: Dear colleagues, We are pleased to announce the release of ccdproc v1.0. Ccdproc is is an Astropy affiliated package for basic data reduction of CCD images. Besides basic data reduction, some of the useful features in ccdproc include: - propogation of uncertainties and tracking of bad pixels - ImageFileCollections for easy sorting images by FITS keywords - combination of images based on WCS - easily built pipelines The new release features many updates that provide it with nearly all basic features available in other data reduction packages such as IRAF. We expect this version to have a stable API and long term support for bug fixes. More Information, repository, and issue tracker https://github.com/astropy/ccdproc Documentation http://ccdproc.readthedocs.org/en/latest/ Installation http://ccdproc.readthedocs.org/en/latest/ccdproc/install.html Special thanks to all the new contributors since the last major release including Christoph Deil, Forrest Gasdia, Carlos Gomez, Hans Moritz G?nther, Nathan Heidt, Anthony Horton, Jennifer Karr, Stefan Nelson, Joe Philip Ninan, Punyaslok Pattnaik, Evert Rol,William Schoenell, Michael Seifert, Sourav Singh, Brigitta Sipocz, Connor Stotts, Ole Streicher, Erik Tollerud, and Nathan Walker. We would also like to thank the contributions to astropy especially the NDData package, astroscrappy, reproject, numpy, scipy, and the astropy-helpers package. Feedback, contributions, and comments are welcome. We would especially be interested in contributions of examples of using ccdproc and comparisons to other reduction methods. Cheers, Steve Crawford and Matt Craig From jyee at cfa.harvard.edu Tue Mar 22 11:04:30 2016 From: jyee at cfa.harvard.edu (Yee, Jennifer) Date: Tue, 22 Mar 2016 11:04:30 -0400 Subject: [AstroPy] Problem with compound models using AiryDisk2D Message-ID: Hi, I am trying to fit a PSF with an Airy function. If I use AiryDisk2D alone, it works fine, but if I try to create a compound model, for example a constant+AiryDisk2D, the compound model cannot be evaluated because it has "no attribute _rz". Is this a bug? Does anyone know how to fix it? (Note I have no problems creating compound models with Gaussian2D). Example code and full error message below. python version: 2.7.5 numpy version: 1.10.4 astropy version: 1.1.2 Thanks, Jennifer EXAMPLE CODE: from astropy.modeling import models class Airy_with_Background(models.Const2D+models.AiryDisk2D): pass x,y = np.mgrid[:200,:200] airy_init = Airy_with_Background() airy_init(x,y) ERROR MESSAGE: Traceback (most recent call last): File "test_airy.py", line 20, in airy_init(x,y) File "/Path/lib/python2.7/site-packages/astropy/modeling/core.py", line 407, \ in __call__ __call__, args, [('model_set_axis', None)]) File "/Path/lib/python2.7/site-packages/astropy/modeling/core.py", line 403, \ in __call__ return super(cls, self).__call__(*inputs, **kwargs) File "/Path/lib/python2.7/site-packages/astropy/modeling/core.py", line 708, \ in __call__ outputs = self.evaluate(*chain(inputs, parameters)) File "/Path/lib/python2.7/site-packages/astropy/modeling/core.py", line 2514,\ in evaluate return self.__class__.evaluate(*args) File "/Path/lib/python2.7/site-packages/astropy/modeling/core.py", line 1997,\ in evaluate result = cls._evaluate(inputs, params) File "/Path/lib/python2.7/site-packages/astropy/modeling/utils.py", line 448,\ in g(inputs, params))) File "/Path/lib/python2.7/site-packages/astropy/modeling/core.py", line 2438,\ in (evaluate(*chain(inputs, islice(params, n_params))),) File "/Path/lib/python2.7/site-packages/astropy/modeling/functional_models.py\ ", line 1622, in evaluate r = np.sqrt((x - x_0) ** 2 + (y - y_0) ** 2) / (radius / cls._rz) AttributeError: type object 'AiryDisk2D' has no attribute '_rz' -------------------------------------------------------------- Dr. Jennifer C. Yee Office: P-344 Harvard-Smithsonian Center for Astrophysics 60 Garden St, MS-15 Cambridge, MA 02138 -------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From dencheva at stsci.edu Tue Mar 22 14:27:10 2016 From: dencheva at stsci.edu (Nadia Dencheva) Date: Tue, 22 Mar 2016 18:27:10 +0000 Subject: [AstroPy] Problem with compound models using AiryDisk2D In-Reply-To: References: Message-ID: <0153364C9F56D944B0A795780ECF88DF6796E23F@EXCHMAIL2.stsci.edu> Hi Jennifer, Could you file an issue on github. AiryDisk2D defines one of the class attributes inside the __init__ function. This was done to work around a problem with older versions of scipy and python3. Perhaps drop support for those older versions. Meanwhile if you don't have to inherit from the model classes you can do something like model = Const2D() + AiryDisk2D() and evaluate and fit this model. Cheers, Nadia ________________________________ From: AstroPy [astropy-bounces at scipy.org] on behalf of Yee, Jennifer [jyee at cfa.harvard.edu] Sent: Tuesday, March 22, 2016 11:04 AM To: astropy at scipy.org Subject: [AstroPy] Problem with compound models using AiryDisk2D Hi, I am trying to fit a PSF with an Airy function. If I use AiryDisk2D alone, it works fine, but if I try to create a compound model, for example a constant+AiryDisk2D, the compound model cannot be evaluated because it has "no attribute _rz". Is this a bug? Does anyone know how to fix it? (Note I have no problems creating compound models with Gaussian2D). Example code and full error message below. python version: 2.7.5 numpy version: 1.10.4 astropy version: 1.1.2 Thanks, Jennifer EXAMPLE CODE: from astropy.modeling import models class Airy_with_Background(models.Const2D+models.AiryDisk2D): pass x,y = np.mgrid[:200,:200] airy_init = Airy_with_Background() airy_init(x,y) ERROR MESSAGE: Traceback (most recent call last): File "test_airy.py", line 20, in airy_init(x,y) File "/Path/lib/python2.7/site-packages/astropy/modeling/core.py", line 407, \ in __call__ __call__, args, [('model_set_axis', None)]) File "/Path/lib/python2.7/site-packages/astropy/modeling/core.py", line 403, \ in __call__ return super(cls, self).__call__(*inputs, **kwargs) File "/Path/lib/python2.7/site-packages/astropy/modeling/core.py", line 708, \ in __call__ outputs = self.evaluate(*chain(inputs, parameters)) File "/Path/lib/python2.7/site-packages/astropy/modeling/core.py", line 2514,\ in evaluate return self.__class__.evaluate(*args) File "/Path/lib/python2.7/site-packages/astropy/modeling/core.py", line 1997,\ in evaluate result = cls._evaluate(inputs, params) File "/Path/lib/python2.7/site-packages/astropy/modeling/utils.py", line 448,\ in g(inputs, params))) File "/Path/lib/python2.7/site-packages/astropy/modeling/core.py", line 2438,\ in (evaluate(*chain(inputs, islice(params, n_params))),) File "/Path/lib/python2.7/site-packages/astropy/modeling/functional_models.py\ ", line 1622, in evaluate r = np.sqrt((x - x_0) ** 2 + (y - y_0) ** 2) / (radius / cls._rz) AttributeError: type object 'AiryDisk2D' has no attribute '_rz' -------------------------------------------------------------- Dr. Jennifer C. Yee Office: P-344 Harvard-Smithsonian Center for Astrophysics 60 Garden St, MS-15 Cambridge, MA 02138 -------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomas.robitaille at gmail.com Mon Mar 28 22:34:37 2016 From: thomas.robitaille at gmail.com (Thomas Robitaille) Date: Mon, 28 Mar 2016 22:34:37 -0400 Subject: [AstroPy] Request (and vote for) features for the Astropy project! Message-ID: Hi everyone, The Astropy project now has a site on which users can easily request and vote on significant features: http://astropy.userecho.com The aim of this site is to have a place to collect feature requests from users and gauge the Astronomy community's priorities in our Python-based coding efforts. We welcome requests for the astropy package, any affiliated packages, and any other functionality which you think would be widely useful to the Astronomy community. We would for example be interested in finding out what IRAF or IDL features are currently missing from the Python astronomy ecosystem. Note that this forum should not be used to report bugs or request small improvements to existing functionality. For these, please use the GitHub issue trackers for the relevant package (for example https://github.com/astropy/astropy/issues for the astropy core package). Please feel free to suggest any features and vote on all features that would be useful to you! Thanks! Tom From datilp at gmail.com Wed Mar 30 20:22:23 2016 From: datilp at gmail.com (Pistacho Datil) Date: Wed, 30 Mar 2016 17:22:23 -0700 Subject: [AstroPy] calculate a new coordinate on sky given RA and Dec offsets and midpoint coordinate between two targets on sky Message-ID: Hi, First of all apologies if these two questions are too simplistic. 1) I wonder if there is a way in astropy, given a target and an offset in RA and Dec to calculate a new target on sky. 2) Given two targets t1 and t2, is there a way using astropy of calculating the midpoint coordinate also on sky? Many thanks in advance, Frank -------------- next part -------------- An HTML attachment was scrubbed... URL: From ejensen1 at swarthmore.edu Wed Mar 30 21:26:21 2016 From: ejensen1 at swarthmore.edu (Eric Jensen) Date: Wed, 30 Mar 2016 21:26:21 -0400 Subject: [AstroPy] calculate a new coordinate on sky given RA and Dec offsets and midpoint coordinate between two targets on sky In-Reply-To: References: Message-ID: Hi Frank, For #1, here?s a way you can do it: from astropy.coordinates import Angle, SkyCoord from astropy import units as u # Define our initial coordinate position: old_pos = SkyCoord('00h42m30s', '+61d12m00s', frame='icrs') # Define the offsets: ra_offset = Angle(15, unit=u.arcsec) dec_offset = Angle(-4.5, unit=u.arcsec) # Add the offsets to create a new coordinate position: new_pos = SkyCoord(old_pos.ra + ra_offset, old_pos.dec + dec_offset, frame='icrs') print(old_pos.to_string('hmsdms')) print(new_pos.to_string('hmsdms')) 00h42m30s +61d12m00s 00h42m31s +61d11m55.5s One thing to watch out for if you do it this way: notice that the RA offset is 15 arcseconds *of RA*, not 15 arcseconds *on the sky*. At a dec of 61 degrees, 15 arcseconds of angle on the sky would be more like 30 arcseconds of RA (or in HMS, about 2 seconds of time rather than 1). If you want to specify the RA offset in real angle on the sky and convert it to the appropriate RA offset to add to the initial coords, you could change the above to do something like import numpy as np ra_offset = Angle(15, unit=u.arcsec) / np.cos(old_pos.dec.to('radian')) and then proceeding as before, you would get output: 00h42m30s +61d12m00s 00h42m32.0757s +61d11m55.5s For your question number 2, you should be able to just do the arithmetic with subtracting the two RA values to find the RA separation, then halve it and add it to t1?s RA, then similarly with Dec, following the example above, to get the midpoint coordinates. Both of the above answers probably break down at some level if you have large angular separations, but for small separations they should be reasonably good. I also don?t know how these coordinate object handle edge cases, like crossing over RA = 0 or Dec = 90, but you could test it out. Eric On Mar 30, 2016, at 8:22 PM, Pistacho Datil wrote: > Hi, > > First of all apologies if these two questions are too simplistic. > > 1) I wonder if there is a way in astropy, given a target and an offset in RA and Dec to calculate a new target on sky. > > 2) Given two targets t1 and t2, is there a way using astropy of calculating the midpoint coordinate also on sky? > > Many thanks in advance, > > Frank > > _______________________________________________ > AstroPy mailing list > AstroPy at scipy.org > https://mail.scipy.org/mailman/listinfo/astropy -------------- next part -------------- An HTML attachment was scrubbed... URL: From datilp at gmail.com Thu Mar 31 18:54:20 2016 From: datilp at gmail.com (Pistacho Datil) Date: Thu, 31 Mar 2016 15:54:20 -0700 Subject: [AstroPy] AstroPy Digest, Vol 114, Issue 12 In-Reply-To: References: Message-ID: thanks Eric For the midpoint I went for def midpoint(coord1, coord2): ra1 = coord1.ra dec1 = coord1.dec ra2 = coord2.ra dec2 = coord2.dec delta_ra = ra2 - ra1 bx = np.cos(dec2) * np.cos(delta_ra) by = np.cos(dec2) * np.sin(delta_ra) dec_term1 = np.sin(dec1) + np.sin(dec2) dec_term2 = np.sqrt(np.power((np.cos(dec1) + bx), 2) + np.power(by, 2)) decMid = np.arctan2(dec_term1, dec_term2) raMid = ra1 + np.arctan2(by, np.cos(dec1) + bx) return SkyCoord(raMid, decMid, frame='fk5') not my code but it calculates the midpoint on sky. Thanks again, Frank On Thu, Mar 31, 2016 at 5:00 AM, wrote: > Send AstroPy mailing list submissions to > astropy at scipy.org > > To subscribe or unsubscribe via the World Wide Web, visit > https://mail.scipy.org/mailman/listinfo/astropy > or, via email, send a message with subject or body 'help' to > astropy-request at scipy.org > > You can reach the person managing the list at > astropy-owner at scipy.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of AstroPy digest..." > > > Today's Topics: > > 1. calculate a new coordinate on sky given RA and Dec offsets > and midpoint coordinate between two targets on sky (Pistacho Datil) > 2. Re: calculate a new coordinate on sky given RA and Dec > offsets and midpoint coordinate between two targets on sky > (Eric Jensen) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 30 Mar 2016 17:22:23 -0700 > From: Pistacho Datil > To: astropy at scipy.org > Subject: [AstroPy] calculate a new coordinate on sky given RA and Dec > offsets and midpoint coordinate between two targets on sky > Message-ID: > < > CABH4OQKtS1s7js1s5823_EO4xJgOj8j19c1scTgTVeNK-jJFvA at mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Hi, > > First of all apologies if these two questions are too simplistic. > > 1) I wonder if there is a way in astropy, given a target and an offset in > RA and Dec to calculate a new target on sky. > > 2) Given two targets t1 and t2, is there a way using astropy of calculating > the midpoint coordinate also on sky? > > Many thanks in advance, > > Frank > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > https://mail.scipy.org/pipermail/astropy/attachments/20160330/0e20a58b/attachment-0001.html > > > > ------------------------------ > > Message: 2 > Date: Wed, 30 Mar 2016 21:26:21 -0400 > From: Eric Jensen > To: Astronomical Python mailing list > Subject: Re: [AstroPy] calculate a new coordinate on sky given RA and > Dec offsets and midpoint coordinate between two targets on sky > Message-ID: > Content-Type: text/plain; charset="windows-1252" > > Hi Frank, > > For #1, here?s a way you can do it: > > from astropy.coordinates import Angle, SkyCoord > from astropy import units as u > > # Define our initial coordinate position: > old_pos = SkyCoord('00h42m30s', '+61d12m00s', frame='icrs') > > # Define the offsets: > ra_offset = Angle(15, unit=u.arcsec) > dec_offset = Angle(-4.5, unit=u.arcsec) > > # Add the offsets to create a new coordinate position: > new_pos = SkyCoord(old_pos.ra + ra_offset, old_pos.dec + dec_offset, > frame='icrs') > > print(old_pos.to_string('hmsdms')) > print(new_pos.to_string('hmsdms')) > > > 00h42m30s +61d12m00s > 00h42m31s +61d11m55.5s > > One thing to watch out for if you do it this way: notice that the RA > offset is 15 arcseconds *of RA*, not 15 arcseconds *on the sky*. At a dec > of 61 degrees, 15 arcseconds of angle on the sky would be more like 30 > arcseconds of RA (or in HMS, about 2 seconds of time rather than 1). > > If you want to specify the RA offset in real angle on the sky and convert > it to the appropriate RA offset to add to the initial coords, you could > change the above to do something like > > import numpy as np > ra_offset = Angle(15, unit=u.arcsec) / np.cos(old_pos.dec.to('radian')) > > and then proceeding as before, you would get output: > > 00h42m30s +61d12m00s > 00h42m32.0757s +61d11m55.5s > > For your question number 2, you should be able to just do the arithmetic > with subtracting the two RA values to find the RA separation, then halve it > and add it to t1?s RA, then similarly with Dec, following the example > above, to get the midpoint coordinates. > > Both of the above answers probably break down at some level if you have > large angular separations, but for small separations they should be > reasonably good. I also don?t know how these coordinate object handle > edge cases, like crossing over RA = 0 or Dec = 90, but you could test it > out. > > Eric > > > > On Mar 30, 2016, at 8:22 PM, Pistacho Datil wrote: > > > Hi, > > > > First of all apologies if these two questions are too simplistic. > > > > 1) I wonder if there is a way in astropy, given a target and an offset > in RA and Dec to calculate a new target on sky. > > > > 2) Given two targets t1 and t2, is there a way using astropy of > calculating the midpoint coordinate also on sky? > > > > Many thanks in advance, > > > > Frank > > > > _______________________________________________ > > AstroPy mailing list > > AstroPy at scipy.org > > https://mail.scipy.org/mailman/listinfo/astropy > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > https://mail.scipy.org/pipermail/astropy/attachments/20160330/b8b29f53/attachment-0001.html > > > > ------------------------------ > > Subject: Digest Footer > > _______________________________________________ > AstroPy mailing list > AstroPy at scipy.org > https://mail.scipy.org/mailman/listinfo/astropy > > > ------------------------------ > > End of AstroPy Digest, Vol 114, Issue 12 > **************************************** > -------------- next part -------------- An HTML attachment was scrubbed... URL: