From npross at roe.ac.uk Mon Sep 2 08:53:54 2019 From: npross at roe.ac.uk (Nicholas Ross) Date: Mon, 2 Sep 2019 12:53:54 +0000 Subject: [AstroPy] SpecViz and SpecUtils In-Reply-To: References: Message-ID: <6607D51E-7D4F-4F81-825F-11EDAAEE2B27@roe.ac.uk> Dear All, I?m keen to starting using SpecViz and SpecUtils in my research analyses. I?ve followed the instructions at https://specviz.readthedocs.io/en/stable/installation.html but when I come to run specviz on the command line, I get:: > specviz Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.7/bin/specviz", line 11, in load_entry_point('specviz==0.3.0', 'console_scripts', 'specviz')() File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2793, in load_entry_point return ep.load() File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2411, in load return self.resolve() File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2417, in resolve module = __import__(self.module_name, fromlist=['__name__'], level=0) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/specviz-0.3.0-py3.7.egg/specviz/__init__.py", line 17, in from . import analysis File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/specviz-0.3.0-py3.7.egg/specviz/analysis/__init__.py", line 3, in from .statistics import * File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/specviz-0.3.0-py3.7.egg/specviz/analysis/statistics.py", line 10, in from ..core.data import Spectrum1DRef File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/specviz-0.3.0-py3.7.egg/specviz/core/data.py", line 15, in from specutils.core.generic import Spectrum1DRef ModuleNotFoundError: No module named ?specutils.core' However(!!) if I then do: > ipython In [1]: import specutils.core as core WARNING: AstropyDeprecationWarning: astropy.extern.six will be removed in 4.0, use the six module directly if it is still needed [astropy.extern.six] In [2]: from specutils.core.generic import Spectrum1DRef In [3]: ? it definitely seems as if I have specutils installed. Do we know what might be going on here??!! Many thanks as usual, Nic ==================================== Dr. Nicholas P. Ross STFC Ernest Rutherford Fellow Institute for Astronomy University of Edinburgh Royal Observatory, Blackford Hill Edinburgh EH9 3HJ, United Kingdom +44 (0)131-668 8351 d80b2t.github.io ==================================== From contact at nicholasearl.me Tue Sep 3 13:12:09 2019 From: contact at nicholasearl.me (Nicholas Earl) Date: Tue, 03 Sep 2019 13:12:09 -0400 Subject: [AstroPy] SpecViz and SpecUtils In-Reply-To: <6607D51E-7D4F-4F81-825F-11EDAAEE2B27@roe.ac.uk> References: <6607D51E-7D4F-4F81-825F-11EDAAEE2B27@roe.ac.uk> Message-ID: <5100fc30-031a-4ee4-8d98-f4fe87a7631f@www.fastmail.com> Hi Nic, Specutils hasn't had a 'core' module in several versions, and it looks like you're attempting to install SpecViz v0.3.0 (where as the current version is 0.7.0). How are you attempting to install SpecViz (through anaconda, pip, or from source)? Cheers, Nick On Mon, Sep 2, 2019, at 8:53 AM, Nicholas Ross wrote: > Dear All, > > I?m keen to starting using SpecViz and SpecUtils in my research analyses. > I?ve followed the instructions at > https://specviz.readthedocs.io/en/stable/installation.html > > but when I come to run specviz on the command line, I get:: > > > specviz > Traceback (most recent call last): > File "/Library/Frameworks/Python.framework/Versions/3.7/bin/specviz", > line 11, in > load_entry_point('specviz==0.3.0', 'console_scripts', 'specviz')() > File > "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point > return get_distribution(dist).load_entry_point(group, name) > File > "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2793, in load_entry_point > return ep.load() > File > "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2411, in load > return self.resolve() > File > "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2417, in resolve > module = __import__(self.module_name, fromlist=['__name__'], > level=0) > File > "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/specviz-0.3.0-py3.7.egg/specviz/__init__.py", line 17, in > from . import analysis > File > "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/specviz-0.3.0-py3.7.egg/specviz/analysis/__init__.py", line 3, in > from .statistics import * > File > "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/specviz-0.3.0-py3.7.egg/specviz/analysis/statistics.py", line 10, in > from ..core.data import Spectrum1DRef > File > "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/specviz-0.3.0-py3.7.egg/specviz/core/data.py", line 15, in > from specutils.core.generic import Spectrum1DRef > ModuleNotFoundError: No module named ?specutils.core' > > However(!!) if I then do: > > ipython > In [1]: import specutils.core as core > > > > WARNING: AstropyDeprecationWarning: astropy.extern.six will be removed > in 4.0, use the six module directly if it is still needed > [astropy.extern.six] > In [2]: from specutils.core.generic import Spectrum1DRef > > > > In [3]: > > > ? it definitely seems as if I have specutils installed. > > Do we know what might be going on here??!! > > Many thanks as usual, > Nic > > > ==================================== > Dr. Nicholas P. Ross > STFC Ernest Rutherford Fellow > Institute for Astronomy > University of Edinburgh > Royal Observatory, Blackford Hill > Edinburgh EH9 3HJ, United Kingdom > +44 (0)131-668 8351 > d80b2t.github.io > ==================================== > > > > _______________________________________________ > AstroPy mailing list > AstroPy at python.org > https://mail.python.org/mailman/listinfo/astropy > From keith at sloan-home.co.uk Sun Sep 8 10:43:55 2019 From: keith at sloan-home.co.uk (keith) Date: Sun, 8 Sep 2019 15:43:55 +0100 Subject: [AstroPy] Storing results into Tables for further SQL queries. Message-ID: <54d772e2-7971-9437-029a-2c48a0eb2afc@sloan-home.co.uk> Apologies for a newby question. For my MSc project I need? to run SQL queries against GAMA and SDSS. I am using Jupyter on Ubuntu 18.04. I can successfully retrieve data by using the astropy python modules. I would like to store the results from the more complicated SQL queries into a Table, so that I can perform further joins on both GAMA and SDSS? tables. How do I go about this? Do I have to setup a local database? Thanks -- ========== Art & Ceramics =========== https://www.instagram.com/ksloan1952/ From trive at astro.su.se Mon Sep 9 05:20:28 2019 From: trive at astro.su.se (T. Emil Rivera-Thorsen) Date: Mon, 9 Sep 2019 11:20:28 +0200 Subject: [AstroPy] Storing results into Tables for further SQL queries. In-Reply-To: <54d772e2-7971-9437-029a-2c48a0eb2afc@sloan-home.co.uk> References: <54d772e2-7971-9437-029a-2c48a0eb2afc@sloan-home.co.uk> Message-ID: <775b0ee5-4d3c-4941-16cf-57324f16256e@astro.su.se> Hi Keith. I don?t know the specifics of your project in detail, but is sounds like a job for the Pandas module, which is good at labeled, heterogeneous data and light database-like operations like joine, merge, pivot etc. http://pandas.pydata.org /Emil On 9/8/19 4:43 PM, keith wrote: > Apologies for a newby question. > > For my MSc project I need? to run SQL queries against GAMA and SDSS. > > I am using Jupyter on Ubuntu 18.04. > > I can successfully retrieve data by using the astropy python modules. > > I would like to store the results from the more complicated SQL queries > into a Table, > so that I can perform further joins on both GAMA and SDSS tables. > > How do I go about this? > > Do I have to setup a local database? > > Thanks > > -- > ========== Art & Ceramics =========== > https://www.instagram.com/ksloan1952/ > > _______________________________________________ > AstroPy mailing list > AstroPy at python.org > https://mail.python.org/mailman/listinfo/astropy -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcraig at mnstate.edu Mon Sep 9 10:34:50 2019 From: mcraig at mnstate.edu (Craig, Matthew W) Date: Mon, 9 Sep 2019 14:34:50 +0000 Subject: [AstroPy] ccdproc 2! Message-ID: Hi, We are delighted to announce the release of ccdproc version 2. See ccdproc.readthedocs.io for installation instructions or read on... This is the first release of ccdproc that is Python 3 only! A special thanks to first-time code contributors Jaime A. Alvarado-Montes, Julio C. N. Campagnolo, Mihai Cara, Michael Hlabathe, and Luca Rizzi, and to everyone who opened issues. **New and improved** The `ImageFileCollection` for working with sets of images has several new features: + Construct a collection from an explicit list of files. + Filter files using regular expression matching. + Create a new collection by filtering an existing collection. **Other new features include:** + Weights in image combination can be a 1D array. + Reduced memory in image combination. + Many fewer files open during image combination when using memory mapping and breaking the image stack into chunks. + Better performance and a wider array of compression types for `ImageFileCollection`. + Better handling of constructing error array when some image value are negative. + Better computation of boolean mask from bit planes. ?> In addition, several bugs were fixed: https://github.com/astropy/ccdproc/blob/v2.0.0/CHANGES.rst **Installation** You can install the latest version (which is actually 2.0.1) with conda or with pip: conda install -c astropy ccdproc=2 OR pip install ccdproc If you are updating from an earlier version of ccdproc using pip do this: pip install -U ccdproc Sincerely, Matt Craig, Steve Crawford and Michael Seifert ccdproc maintainers From martinberoiz at gmail.com Mon Sep 9 11:20:05 2019 From: martinberoiz at gmail.com (Martin Beroiz) Date: Mon, 9 Sep 2019 10:20:05 -0500 Subject: [AstroPy] question about RotateNative2Celestial In-Reply-To: References: Message-ID: <1346a89d-3f77-4242-a39e-a071f7524cb7@Spark> Hello, I?m toying a little with WCS and?the functions on astropy.modeling.rotations. I?m not sure if I found a bug or if I don?t understand yet the API for?RotateNative2Celestial Here?s the small example that I came up with and the traceback I get from astropy.modeling import rotations as r lon = 100.00 lat = -63.00 alpha_c = 100.00 delta_c = -63.00 lon_pole = 180.0 n2c = r.RotateNative2Celestial(lon, lat, lon_pole) n2c.evaluate(0., 90., lon, lat, lon_pole) --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) in ----> 1 n2c.evaluate(0., 90., lon, lat, lon_pole) ~/anaconda3/lib/python3.7/site-packages/astropy/modeling/rotations.py in evaluate(self, phi_N, theta_N, lon, lat, lon_pole) 252 theta = - (np.pi / 2 - lat) 253 psi = -(np.pi / 2 + lon) --> 254 alpha_C, delta_C = super()._evaluate(phi_N, theta_N, phi, theta, psi) 255 return alpha_C, delta_C 256 ~/anaconda3/lib/python3.7/site-packages/astropy/modeling/rotations.py in _evaluate(self, phi, theta, lon, lat, lon_pole) 183 def _evaluate(self, phi, theta, lon, lat, lon_pole): 184 alpha, delta = super().evaluate(phi, theta, lon, lat, lon_pole, --> 185 self.axes_order) 186 mask = alpha < 0 187 if isinstance(mask, np.ndarray): ~/anaconda3/lib/python3.7/site-packages/astropy/modeling/rotations.py in evaluate(self, alpha, delta, phi, theta, psi, axes_order) 89 shape = alpha.shape 90 inp = self.spherical2cartesian(alpha, delta) ---> 91 matrix = self._create_matrix(phi, theta, psi, axes_order) 92 result = np.dot(matrix, inp) 93 a, b = self.cartesian2spherical(*result) ~/anaconda3/lib/python3.7/site-packages/astropy/modeling/rotations.py in _create_matrix(self, phi, theta, psi, axes_order) 47 if isinstance(angle, u.Quantity): 48 angle = angle.value ---> 49 angle = angle.item() 50 matrices.append(rotation_matrix(angle, axis, unit=u.rad)) 51 result = matrix_product(*matrices[::-1]) AttributeError: 'float' object has no attribute 'item' I don't understand why it is expecting `angle` to have the `item` attribute. Does anyone know what I'm doing wrong? Any help would be much appreciated. Thanks! M. -------------- next part -------------- An HTML attachment was scrubbed... URL: From aldcroft at head.cfa.harvard.edu Mon Sep 9 13:33:35 2019 From: aldcroft at head.cfa.harvard.edu (Aldcroft, Thomas) Date: Mon, 9 Sep 2019 13:33:35 -0400 Subject: [AstroPy] Storing results into Tables for further SQL queries. In-Reply-To: <54d772e2-7971-9437-029a-2c48a0eb2afc@sloan-home.co.uk> References: <54d772e2-7971-9437-029a-2c48a0eb2afc@sloan-home.co.uk> Message-ID: Hi Keith, With the astropy Table object you can do table operations like join and merge: https://docs.astropy.org/en/stable/table/operations.html#table-operations I'm not entirely clear if your question is about how to get your SQL query results into a Table, or how to do joins with a Table. Can you provide a bit more detail? - Tom On Sun, Sep 8, 2019 at 10:44 AM keith wrote: > Apologies for a newby question. > > For my MSc project I need to run SQL queries against GAMA and SDSS. > > I am using Jupyter on Ubuntu 18.04. > > I can successfully retrieve data by using the astropy python modules. > > I would like to store the results from the more complicated SQL queries > into a Table, > so that I can perform further joins on both GAMA and SDSS tables. > > How do I go about this? > > Do I have to setup a local database? > > Thanks > > -- > ========== Art & Ceramics =========== > https://www.instagram.com/ksloan1952/ > > _______________________________________________ > AstroPy mailing list > AstroPy at python.org > https://mail.python.org/mailman/listinfo/astropy > -------------- next part -------------- An HTML attachment was scrubbed... URL: From keith at sloan-home.co.uk Mon Sep 9 13:44:16 2019 From: keith at sloan-home.co.uk (keith) Date: Mon, 9 Sep 2019 18:44:16 +0100 Subject: [AstroPy] Storing results into Tables for further SQL queries. In-Reply-To: References: <54d772e2-7971-9437-029a-2c48a0eb2afc@sloan-home.co.uk> Message-ID: Below is the sort of thing I would like to do from python for both GAMA and SDSS It is an example of my use of the SDSS CasJob facility I would like to do the same from python and similar accessing GAMA. The way the CasJob seems to work is to store to an external database as the query specifies into mydb.E_Galaxies where mydb is particular to my login and the other tables are available i.e. DR15.Galaxy Having created mydb.E_Galaxies I would then use the table in future joins etc without having to repeat the execution for a large number of future queries. SELECT TOP 5000 ObjID,r,g,i,u,u-r as redness into mydb.E_Galaxies from DR15.Galaxy as G WHERE G.lnlDev_r > G.lnlExp_r + 0.1 and G.lnlExp_r > -999 and (G.flags & (dbo.fPhotoFlags('BINNED1') + dbo.fPhotoFlags('BINNED2') + dbo.fPhotoFlags('BINNED4'))) > 0 and (G.flags & ( dbo.fPhotoFlags('BLENDED') + dbo.fPhotoFlags('NODEBLEND') + dbo.fPhotoFlags('CHILD'))) != dbo.fPhotoFlags('BLENDED') and (G.flags & (dbo.fPhotoFlags('EDGE') + dbo.fPhotoFlags('SATURATED'))) = 0 and G.petroMag_i > 17.5 and (G.petroMag_r > 15.5 or G.petror50_r > 2) and (G.petroMag_r > 0 and G.g > 0 and G.r > 0 and G.i > 0) and ( (G.petroMag_r - G.extinction_r) < 19.2 and (G.petroMag_r - G.extinction_r < (13.1 + (7/3)*(G.g - G.r) + 4 *(G.r - G.i) - 4 * 0.18 ) ) and ( (G.r - G.i - (G.g - G.r)/4 - 0.18) < 0.2 ) and ( (G.r - G.i - (G.g - G.r)/4 - 0.18) > -0.2 ) ) or ( (G.petroMag_r - G.extinction_r < 19.5) and ( (G.r - G.i - (G.g - G.r)/4 - 0.18) > (0.45 - 4*(G.g - G.r) ) ) and ( (G.g - G.r) > (1.35 + 0.25 *(G.r - G.i) ) ) ) On 09/09/2019 18:33, Aldcroft, Thomas wrote: > Hi Keith, > > With the astropy Table object you can do table operations like join > and merge: > > https://docs.astropy.org/en/stable/table/operations.html#table-operations > > I'm not entirely clear if your question is about how to get your SQL > query results into a Table, or how to do joins with a Table.? Can you > provide a bit more detail? > > - Tom > > On Sun, Sep 8, 2019 at 10:44 AM keith > wrote: > > Apologies for a newby question. > > For my MSc project I need? to run SQL queries against GAMA and SDSS. > > I am using Jupyter on Ubuntu 18.04. > > I can successfully retrieve data by using the astropy python modules. > > I would like to store the results from the more complicated SQL > queries > into a Table, > so that I can perform further joins on both GAMA and SDSS tables. > > How do I go about this? > > Do I have to setup a local database? > > Thanks > > -- > ========== Art & Ceramics =========== > https://www.instagram.com/ksloan1952/ > > _______________________________________________ > AstroPy mailing list > AstroPy at python.org > https://mail.python.org/mailman/listinfo/astropy > > > _______________________________________________ > AstroPy mailing list > AstroPy at python.org > https://mail.python.org/mailman/listinfo/astropy -- ========== Art & Ceramics =========== https://www.instagram.com/ksloan1952/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From stefano.covino at gmail.com Mon Sep 9 13:51:17 2019 From: stefano.covino at gmail.com (Covino, Stefano) Date: Mon, 9 Sep 2019 19:51:17 +0200 Subject: [AstroPy] Storing results into Tables for further SQL queries. In-Reply-To: References: <54d772e2-7971-9437-029a-2c48a0eb2afc@sloan-home.co.uk> Message-ID: Probably something like this could work:? import mysql.connector as pm from astropy.table import Table def readMySQLTable (ihost, idbase, iuser, ipwd, icmd): db = pm.connect(user=iuser, password=ipwd, host=ihost, database=idbase, connect_timeout=60) cursor = db.cursor() cursor.execute(icmd) cols = cursor.column_names dt = [a for a in cursor] t = Table(rows=dt,names=cols) return t Where ?icmd? is the sql command. Stefano Il giorno luned? 9 settembre 2019, keith ha scritto: > Below is the sort of thing I would like to do from python for both GAMA > and SDSS > > It is an example of my use of the SDSS CasJob facility I would like to do > the same from python and similar accessing GAMA. The way the CasJob seems > to work is to store to an external database as the query specifies into mydb.E_Galaxies > where mydb is particular to my login and the other tables are available > i.e. DR15.Galaxy > > Having created mydb.E_Galaxies I would then use the table in future joins > etc without having to repeat the execution for a large number of future > queries. > > SELECT TOP 5000 ObjID,r,g,i,u,u-r as redness into mydb.E_Galaxies from > DR15.Galaxy as G > WHERE > G.lnlDev_r > G.lnlExp_r + 0.1 > and G.lnlExp_r > -999 > > and (G.flags & (dbo.fPhotoFlags('BINNED1') + dbo.fPhotoFlags('BINNED2') + > dbo.fPhotoFlags('BINNED4'))) > 0 > > and (G.flags & ( dbo.fPhotoFlags('BLENDED') + dbo.fPhotoFlags('NODEBLEND') > + dbo.fPhotoFlags('CHILD'))) != dbo.fPhotoFlags('BLENDED') > > and (G.flags & (dbo.fPhotoFlags('EDGE') + dbo.fPhotoFlags('SATURATED'))) = > 0 > > and G.petroMag_i > 17.5 > > and (G.petroMag_r > 15.5 or G.petror50_r > 2) > and (G.petroMag_r > 0 and G.g > 0 and G.r > 0 and G.i > 0) > and ( (G.petroMag_r - G.extinction_r) < 19.2 > and (G.petroMag_r - G.extinction_r < > (13.1 + (7/3)*(G.g - G.r) + 4 *(G.r - G.i) - 4 * 0.18 ) ) > and ( (G.r - G.i - (G.g - G.r)/4 - 0.18) < 0.2 ) > and ( (G.r - G.i - (G.g - G.r)/4 - 0.18) > -0.2 ) ) > or ( (G.petroMag_r - G.extinction_r < 19.5) > and ( (G.r - G.i - (G.g - G.r)/4 - 0.18) > > (0.45 - 4*(G.g - G.r) ) ) > and ( (G.g - G.r) > (1.35 + 0.25 *(G.r - G.i) ) ) ) > On 09/09/2019 18:33, Aldcroft, Thomas wrote: > > Hi Keith, > > With the astropy Table object you can do table operations like join and > merge: > > https://docs.astropy.org/en/stable/table/operations.html#table-operations > > I'm not entirely clear if your question is about how to get your SQL query > results into a Table, or how to do joins with a Table. Can you provide a > bit more detail? > > - Tom > > On Sun, Sep 8, 2019 at 10:44 AM keith wrote: > >> Apologies for a newby question. >> >> For my MSc project I need to run SQL queries against GAMA and SDSS. >> >> I am using Jupyter on Ubuntu 18.04. >> >> I can successfully retrieve data by using the astropy python modules. >> >> I would like to store the results from the more complicated SQL queries >> into a Table, >> so that I can perform further joins on both GAMA and SDSS tables. >> >> How do I go about this? >> >> Do I have to setup a local database? >> >> Thanks >> >> -- >> ========== Art & Ceramics =========== >> https://www.instagram.com/ksloan1952/ >> >> _______________________________________________ >> AstroPy mailing list >> AstroPy at python.org >> https://mail.python.org/mailman/listinfo/astropy >> > > _______________________________________________ > AstroPy mailing listAstroPy at python.orghttps://mail.python.org/mailman/listinfo/astropy > > -- > ========== Art & Ceramics ===========https://www.instagram.com/ksloan1952/ > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From keith at sloan-home.co.uk Mon Sep 9 14:12:19 2019 From: keith at sloan-home.co.uk (keith) Date: Mon, 9 Sep 2019 19:12:19 +0100 Subject: [AstroPy] I think I made a mix up of names ( Trouble being Similar ) In-Reply-To: References: <54d772e2-7971-9437-029a-2c48a0eb2afc@sloan-home.co.uk> Message-ID: I would like to store results from astroquery requests for subsequent astroquery requests. i.e. make query with from astroquery.gama import GAMA result = GAMA.query_sql('SELECT * FROM SpecAll LIMIT 100') and from astroquery.sdss import SDSS result = SDSS.query_sql('SELECT * FROM SpecAll LIMIT 100') i.e. https://astroquery.readthedocs.io/en/latest/index.html# Or is that a different mailing list On 09/09/2019 18:51, Covino, Stefano wrote: > Probably something like this could work:? > > import mysql.connector as pm > from astropy.table import Table > > > def readMySQLTable (ihost, idbase, iuser, ipwd, icmd): > ? ? db = pm.connect(user=iuser, password=ipwd, host=ihost, > database=idbase, connect_timeout=60) > ? ? cursor = db.cursor() > ? ? cursor.execute(icmd) > ? ? cols = cursor.column_names > ? ? dt = [a for a in cursor] > ? ? t = Table(rows=dt,names=cols) > ? ? return t > > Where ?icmd? is the sql command. > > ? ?Stefano > > > > Il giorno luned? 9 settembre 2019, keith > ha scritto: > > Below is the sort of thing I would like to do from python for both > GAMA and SDSS > > It is an example of my use of the SDSS CasJob facility I would > like to do the same from python and similar accessing GAMA. The > way the CasJob seems to work is to store to an external database > as the query specifies into mydb.E_Galaxies where mydb is > particular to my login and the other tables are available i.e. > DR15.Galaxy > > Having created mydb.E_Galaxies I would then use the table in > future joins etc without having to repeat the execution for a > large number of future queries. > > SELECT TOP 5000 ObjID,r,g,i,u,u-r as redness into mydb.E_Galaxies > from DR15.Galaxy as G > WHERE > G.lnlDev_r > G.lnlExp_r + 0.1 > and G.lnlExp_r > -999 > > and (G.flags & (dbo.fPhotoFlags('BINNED1') + > dbo.fPhotoFlags('BINNED2') + dbo.fPhotoFlags('BINNED4'))) > 0 > > and (G.flags & ( dbo.fPhotoFlags('BLENDED') + > dbo.fPhotoFlags('NODEBLEND') + dbo.fPhotoFlags('CHILD'))) != > dbo.fPhotoFlags('BLENDED') > > and (G.flags & (dbo.fPhotoFlags('EDGE') + > dbo.fPhotoFlags('SATURATED'))) = 0 > > and G.petroMag_i > 17.5 > > and (G.petroMag_r > 15.5 or G.petror50_r > 2) > and (G.petroMag_r > 0 and G.g > 0 and G.r > 0 and G.i > 0) > and ( (G.petroMag_r - G.extinction_r) < 19.2 > and (G.petroMag_r - G.extinction_r < > (13.1 + (7/3)*(G.g - G.r) + 4 *(G.r - G.i) - 4 * 0.18 ) ) > and ( (G.r - G.i - (G.g - G.r)/4 - 0.18) < 0.2 ) > and ( (G.r - G.i - (G.g - G.r)/4 - 0.18) > -0.2 ) ) > or ( (G.petroMag_r - G.extinction_r < 19.5) > and ( (G.r - G.i - (G.g - G.r)/4 - 0.18) > > (0.45 - 4*(G.g - G.r) ) ) > and ( (G.g - G.r) > (1.35 + 0.25 *(G.r - G.i) ) ) ) > > On 09/09/2019 18:33, Aldcroft, Thomas wrote: >> Hi Keith, >> >> With the astropy Table object you can do table operations like >> join and merge: >> >> https://docs.astropy.org/en/stable/table/operations.html#table-operations >> >> >> I'm not entirely clear if your question is about how to get your >> SQL query results into a Table, or how to do joins with a Table.? >> Can you provide a bit more detail? >> >> - Tom >> >> On Sun, Sep 8, 2019 at 10:44 AM keith > > wrote: >> >> Apologies for a newby question. >> >> For my MSc project I need? to run SQL queries against GAMA >> and SDSS. >> >> I am using Jupyter on Ubuntu 18.04. >> >> I can successfully retrieve data by using the astropy python >> modules. >> >> I would like to store the results from the more complicated >> SQL queries >> into a Table, >> so that I can perform further joins on both GAMA and SDSS? >> tables. >> >> How do I go about this? >> >> Do I have to setup a local database? >> >> Thanks >> >> -- >> ========== Art & Ceramics =========== >> https://www.instagram.com/ksloan1952/ >> >> >> _______________________________________________ >> AstroPy mailing list >> AstroPy at python.org >> https://mail.python.org/mailman/listinfo/astropy >> >> >> >> _______________________________________________ >> AstroPy mailing list >> AstroPy at python.org >> https://mail.python.org/mailman/listinfo/astropy > > -- > ========== Art & Ceramics =========== > https://www.instagram.com/ksloan1952/ > > > _______________________________________________ > AstroPy mailing list > AstroPy at python.org > https://mail.python.org/mailman/listinfo/astropy -- ========== Art & Ceramics =========== https://www.instagram.com/ksloan1952/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From dull4.ja at gmail.com Mon Sep 9 18:47:18 2019 From: dull4.ja at gmail.com (James Dull) Date: Mon, 9 Sep 2019 16:47:18 -0600 Subject: [AstroPy] Executable Script fitsheader Message-ID: I would like to extract header information from several hundred fits files and put it into a csv file. I ran across the executable script information fitsheader that appears to do just that. It works perfectly for a single file. However, when I follow the online command for that uses a wildcard so multiple files can be completed in a single pass I get "unrecognized command" Something similar happens with the other scripts if I use a wildcard. I feel I'm missing something simple. The command I'm using is: fitsheader --table ascii.csv *.fits > keywords.csv thanks Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: From dencheva at stsci.edu Tue Sep 10 07:25:16 2019 From: dencheva at stsci.edu (Nadia Dencheva) Date: Tue, 10 Sep 2019 11:25:16 +0000 Subject: [AstroPy] question about RotateNative2Celestial In-Reply-To: <1346a89d-3f77-4242-a39e-a071f7524cb7@Spark> References: <1346a89d-3f77-4242-a39e-a071f7524cb7@Spark> Message-ID: <625553F3-78F7-40F2-AA2C-931ECB9FC5A0@stsci.edu> Hi Martin, Astropy.modeling models have a ?__call__ method and are supposed to be called as functions. The ?__call__? method does some additional reformatting of inputs and outputs (basically using arrays internally). Try calling it like this: n2c(x, y) Cheers, Nadia From: AstroPy on behalf of Martin Beroiz Reply-To: Astronomical Python mailing list Date: Monday, September 9, 2019 at 11:20 AM To: "astropy at python.org" Subject: [AstroPy] question about RotateNative2Celestial Hello, I?m toying a little with WCS and the functions on astropy.modeling.rotations. I?m not sure if I found a bug or if I don?t understand yet the API for RotateNative2Celestial Here?s the small example that I came up with and the traceback I get from astropy.modeling import rotations as r lon = 100.00 lat = -63.00 alpha_c = 100.00 delta_c = -63.00 lon_pole = 180.0 n2c = r.RotateNative2Celestial(lon, lat, lon_pole) n2c.evaluate(0., 90., lon, lat, lon_pole) --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) in ----> 1 n2c.evaluate(0., 90., lon, lat, lon_pole) ~/anaconda3/lib/python3.7/site-packages/astropy/modeling/rotations.py in evaluate(self, phi_N, theta_N, lon, lat, lon_pole) 252 theta = - (np.pi / 2 - lat) 253 psi = -(np.pi / 2 + lon) --> 254 alpha_C, delta_C = super()._evaluate(phi_N, theta_N, phi, theta, psi) 255 return alpha_C, delta_C 256 ~/anaconda3/lib/python3.7/site-packages/astropy/modeling/rotations.py in _evaluate(self, phi, theta, lon, lat, lon_pole) 183 def _evaluate(self, phi, theta, lon, lat, lon_pole): 184 alpha, delta = super().evaluate(phi, theta, lon, lat, lon_pole, --> 185 self.axes_order) 186 mask = alpha < 0 187 if isinstance(mask, np.ndarray): ~/anaconda3/lib/python3.7/site-packages/astropy/modeling/rotations.py in evaluate(self, alpha, delta, phi, theta, psi, axes_order) 89 shape = alpha.shape 90 inp = self.spherical2cartesian(alpha, delta) ---> 91 matrix = self._create_matrix(phi, theta, psi, axes_order) 92 result = np.dot(matrix, inp) 93 a, b = self.cartesian2spherical(*result) ~/anaconda3/lib/python3.7/site-packages/astropy/modeling/rotations.py in _create_matrix(self, phi, theta, psi, axes_order) 47 if isinstance(angle, u.Quantity): 48 angle = angle.value ---> 49 angle = angle.item() 50 matrices.append(rotation_matrix(angle, axis, unit=u.rad)) 51 result = matrix_product(*matrices[::-1]) AttributeError: 'float' object has no attribute 'item' I don't understand why it is expecting `angle` to have the `item` attribute. Does anyone know what I'm doing wrong? Any help would be much appreciated. Thanks! M. -------------- next part -------------- An HTML attachment was scrubbed... URL: From martinberoiz at gmail.com Tue Sep 10 08:54:36 2019 From: martinberoiz at gmail.com (Martin Beroiz) Date: Tue, 10 Sep 2019 07:54:36 -0500 Subject: [AstroPy] question about RotateNative2Celestial In-Reply-To: <625553F3-78F7-40F2-AA2C-931ECB9FC5A0@stsci.edu> References: <1346a89d-3f77-4242-a39e-a071f7524cb7@Spark> <625553F3-78F7-40F2-AA2C-931ECB9FC5A0@stsci.edu> Message-ID: Hi Nadia, Oh, I see! That worked well. Thank you very much. M. On Sep 10, 2019, 6:40 AM -0500, Nadia Dencheva , wrote: > Hi Martin, > > Astropy.modeling models have a ?__call__ method and are supposed to be called as functions. > The ?__call__? method does some additional reformatting of inputs and outputs (basically using > arrays internally). > > Try calling it like this: > > n2c(x, y) > > Cheers, > Nadia > > From: AstroPy on behalf of Martin Beroiz > Reply-To: Astronomical Python mailing list > Date: Monday, September 9, 2019 at 11:20 AM > To: "astropy at python.org" > Subject: [AstroPy] question about RotateNative2Celestial > > Hello, > > I?m toying a little with WCS and?the functions on astropy.modeling.rotations. > I?m not sure if I found a bug or if I don?t understand yet the API for?RotateNative2Celestial > Here?s the small example that I came up with and the traceback I get > > from astropy.modeling import rotations as r > lon = 100.00 > lat = -63.00 > alpha_c = 100.00 > delta_c = -63.00 > lon_pole = 180.0 > > n2c = r.RotateNative2Celestial(lon, lat, lon_pole) > n2c.evaluate(0., 90., lon, lat, lon_pole) > > --------------------------------------------------------------------------- > AttributeError Traceback (most recent call last) > in > ----> 1 n2c.evaluate(0., 90., lon, lat, lon_pole) > ~/anaconda3/lib/python3.7/site-packages/astropy/modeling/rotations.py in evaluate(self, phi_N, theta_N, lon, lat, lon_pole) > 252 theta = - (np.pi / 2 - lat) > 253 psi = -(np.pi / 2 + lon) > --> 254 alpha_C, delta_C = super()._evaluate(phi_N, theta_N, phi, theta, psi) > 255 return alpha_C, delta_C > 256 > ~/anaconda3/lib/python3.7/site-packages/astropy/modeling/rotations.py in _evaluate(self, phi, theta, lon, lat, lon_pole) > 183 def _evaluate(self, phi, theta, lon, lat, lon_pole): > 184 alpha, delta = super().evaluate(phi, theta, lon, lat, lon_pole, > --> 185 self.axes_order) > 186 mask = alpha < 0 > 187 if isinstance(mask, np.ndarray): > ~/anaconda3/lib/python3.7/site-packages/astropy/modeling/rotations.py in evaluate(self, alpha, delta, phi, theta, psi, axes_order) > 89 shape = alpha.shape > 90 inp = self.spherical2cartesian(alpha, delta) > ---> 91 matrix = self._create_matrix(phi, theta, psi, axes_order) > 92 result = np.dot(matrix, inp) > 93 a, b = self.cartesian2spherical(*result) > ~/anaconda3/lib/python3.7/site-packages/astropy/modeling/rotations.py in _create_matrix(self, phi, theta, psi, axes_order) > 47 if isinstance(angle, u.Quantity): > 48 angle = angle.value > ---> 49 angle = angle.item() > 50 matrices.append(rotation_matrix(angle, axis, unit=u.rad)) > 51 result = matrix_product(*matrices[::-1]) > AttributeError: 'float' object has no attribute 'item' > > > I don't understand why it is expecting `angle` to have the `item` attribute. > > Does anyone know what I'm doing wrong? Any help would be much appreciated. > > Thanks! > M. > > > > > _______________________________________________ > AstroPy mailing list > AstroPy at python.org > https://mail.python.org/mailman/listinfo/astropy -------------- next part -------------- An HTML attachment was scrubbed... URL: From mburger at stsci.edu Tue Sep 10 09:12:57 2019 From: mburger at stsci.edu (Matthew Burger) Date: Tue, 10 Sep 2019 13:12:57 +0000 Subject: [AstroPy] Solar System ephemerides in astropy.coordinates Message-ID: <51BA6907-C232-4167-AAB7-3078BC6609E1@contoso.com> I?m trying to use astropy.coordinates.solar_system_ephemeris to calculate the RA and Dec of other bodies besides planets. Is this possible? I know which JPL SPICE kernels I want to use, but I can?t load them. If I specify another kernel with a url (e.g., https://naif.jpl.nasa.gov/pub/naif/generic_kernels/spk/satellites/jup310.bsp), it downloads the file but can?t use it. I?m using astropy 3.2.1 with python 3.7.4. Thanks, Matt ************************************************************* Matthew Burger Archive Scientist Data Processing & Archive Services (DPAS), Deputy Branch Manager Space Telescope Science Institute mburger at stsci.edu 410/338-6810 ************************************************************* -------------- next part -------------- An HTML attachment was scrubbed... URL: From juanlu001 at gmail.com Tue Sep 10 09:41:29 2019 From: juanlu001 at gmail.com (Juan Luis Cano) Date: Tue, 10 Sep 2019 15:41:29 +0200 Subject: [AstroPy] Solar System ephemerides in astropy.coordinates In-Reply-To: <51BA6907-C232-4167-AAB7-3078BC6609E1@contoso.com> References: <51BA6907-C232-4167-AAB7-3078BC6609E1@contoso.com> Message-ID: Hello Matt, The SPK segments are hardcoded (see links and comments in https://github.com/astropy/astropy/issues/6472) so, unless I'm mistaken, I don't think this is something that can be easily done in Astropy. I would be interested to see this happening though. As an alternative, you might be interested in checking SpiceyPy https://github.com/AndrewAnnex/SpiceyPy/ (installable with pip and conda-forge) and try to combine it with astropy.coordinates. Regards, On Tue, Sep 10, 2019 at 3:28 PM Matthew Burger wrote: > I?m trying to use astropy.coordinates.solar_system_ephemeris to calculate > the RA and Dec of other bodies besides planets. Is this possible? I know > which JPL SPICE kernels I want to use, but I can?t load them. If I specify > another kernel with a url (e.g., > https://naif.jpl.nasa.gov/pub/naif/generic_kernels/spk/satellites/jup310.bsp), > it downloads the file but can?t use it. > > > > I?m using astropy 3.2.1 with python 3.7.4. > > > > Thanks, > > Matt > > > > ************************************************************* > > Matthew Burger > > Archive Scientist > > Data Processing & Archive Services (DPAS), Deputy Branch Manager > > Space Telescope Science Institute > > mburger at stsci.edu > > 410/338-6810 > > ************************************************************* > > > > > _______________________________________________ > AstroPy mailing list > AstroPy at python.org > https://mail.python.org/mailman/listinfo/astropy > -- Juan Luis Cano -------------- next part -------------- An HTML attachment was scrubbed... URL: From Andrew.Williams at curtin.edu.au Tue Sep 10 10:22:09 2019 From: Andrew.Williams at curtin.edu.au (Andrew Williams) Date: Tue, 10 Sep 2019 14:22:09 +0000 Subject: [AstroPy] Solar System ephemerides in astropy.coordinates In-Reply-To: References: <51BA6907-C232-4167-AAB7-3078BC6609E1@contoso.com> Message-ID: <013e6789-fca9-de5a-c79a-642e06b00030@curtin.edu.au> Hi Matt, I'd give skyfield (https://rhodesmill.org/skyfield/) a try - it's a complete rewrite of pyephem by the original package maintainer. It's very fast, uses the JPL ephemeris as well as parsing satellite TLEs, and plays nicely with astropy objects (converting times and coordinates to and from astropy Time and SkyCoord objects). Andrew On 2019-09-10 9:41 PM, Juan Luis Cano wrote: > Hello Matt, > > The SPK segments are hardcoded (see links and comments in > https://github.com/astropy/astropy/issues/6472) so, unless I'm mistaken, > I don't think this is something that can be easily done in Astropy. I > would be interested to see this happening though. > > As an alternative, you might be interested in checking SpiceyPy > https://github.com/AndrewAnnex/SpiceyPy/ (installable with pip and > conda-forge) and try to combine it with astropy.coordinates. > > Regards, > > On Tue, Sep 10, 2019 at 3:28 PM Matthew Burger > wrote: > > I?m trying to use astropy.coordinates.solar_system_ephemeris to > calculate the RA and Dec of other bodies besides planets. Is this > possible? I know which JPL SPICE kernels I want to use, but I can?t > load them. If I specify another kernel with a url (e.g., > https://naif.jpl.nasa.gov/pub/naif/generic_kernels/spk/satellites/jup310.bsp), > it downloads the file but can?t use it.____ > > __ __ > > I?m using astropy 3.2.1 with python 3.7.4.____ > > __ __ > > Thanks,____ > > Matt____ > > __ __ > > *************************************************************____ > > Matthew Burger____ > > Archive Scientist____ > > Data Processing & Archive Services (DPAS), Deputy Branch Manager____ > > Space Telescope Science Institute____ > > mburger at stsci.edu ____ > > 410/338-6810____ > > *************************************************************____ > > __ __ > > __ __ > > _______________________________________________ > AstroPy mailing list > AstroPy at python.org > https://mail.python.org/mailman/listinfo/astropy > > > > -- > Juan Luis Cano > > _______________________________________________ > AstroPy mailing list > AstroPy at python.org > https://mail.python.org/mailman/listinfo/astropy > From mburger at stsci.edu Tue Sep 10 10:28:59 2019 From: mburger at stsci.edu (Matthew Burger) Date: Tue, 10 Sep 2019 14:28:59 +0000 Subject: [AstroPy] AstroPy Digest, Vol 156, Issue 8 In-Reply-To: References: Message-ID: <75E5799A-7B25-4EA0-AC97-2851E4F4C140@stsci.edu> Thanks for these suggestions. I've used spicepy, but astropy.coordinates was easier (for planets) and didn't add any dependencies. I haven't looked at skyfield yet. Matt Message: 2 Date: Tue, 10 Sep 2019 15:41:29 +0200 From: Juan Luis Cano To: Astronomical Python mailing list Subject: Re: [AstroPy] Solar System ephemerides in astropy.coordinates Message-ID: Content-Type: text/plain; charset="utf-8" Hello Matt, The SPK segments are hardcoded (see links and comments in https://github.com/astropy/astropy/issues/6472) so, unless I'm mistaken, I don't think this is something that can be easily done in Astropy. I would be interested to see this happening though. As an alternative, you might be interested in checking SpiceyPy https://github.com/AndrewAnnex/SpiceyPy/ (installable with pip and conda-forge) and try to combine it with astropy.coordinates. Regards, On Tue, Sep 10, 2019 at 3:28 PM Matthew Burger wrote: > I?m trying to use astropy.coordinates.solar_system_ephemeris to calculate > the RA and Dec of other bodies besides planets. Is this possible? I know > which JPL SPICE kernels I want to use, but I can?t load them. If I specify > another kernel with a url (e.g., > https://naif.jpl.nasa.gov/pub/naif/generic_kernels/spk/satellites/jup310.bsp), > it downloads the file but can?t use it. > > > > I?m using astropy 3.2.1 with python 3.7.4. > > > > Thanks, > > Matt > > > > ************************************************************* > > Matthew Burger > > Archive Scientist > > Data Processing & Archive Services (DPAS), Deputy Branch Manager > > Space Telescope Science Institute > > mburger at stsci.edu > > 410/338-6810 > > ************************************************************* > > > > > _______________________________________________ > AstroPy mailing list > AstroPy at python.org > https://mail.python.org/mailman/listinfo/astropy > -- Juan Luis Cano -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Message: 3 Date: Tue, 10 Sep 2019 14:22:09 +0000 From: Andrew Williams To: Astronomical Python mailing list Subject: Re: [AstroPy] Solar System ephemerides in astropy.coordinates Message-ID: <013e6789-fca9-de5a-c79a-642e06b00030 at curtin.edu.au> Content-Type: text/plain; charset="utf-8" Hi Matt, I'd give skyfield (https://rhodesmill.org/skyfield/) a try - it's a complete rewrite of pyephem by the original package maintainer. It's very fast, uses the JPL ephemeris as well as parsing satellite TLEs, and plays nicely with astropy objects (converting times and coordinates to and from astropy Time and SkyCoord objects). Andrew On 2019-09-10 9:41 PM, Juan Luis Cano wrote: > Hello Matt, > > The SPK segments are hardcoded (see links and comments in > https://github.com/astropy/astropy/issues/6472) so, unless I'm mistaken, > I don't think this is something that can be easily done in Astropy. I > would be interested to see this happening though. > > As an alternative, you might be interested in checking SpiceyPy > https://github.com/AndrewAnnex/SpiceyPy/ (installable with pip and > conda-forge) and try to combine it with astropy.coordinates. > > Regards, > > On Tue, Sep 10, 2019 at 3:28 PM Matthew Burger > wrote: > > I?m trying to use astropy.coordinates.solar_system_ephemeris to > calculate the RA and Dec of other bodies besides planets. Is this > possible? I know which JPL SPICE kernels I want to use, but I can?t > load them. If I specify another kernel with a url (e.g., > https://naif.jpl.nasa.gov/pub/naif/generic_kernels/spk/satellites/jup310.bsp), > it downloads the file but can?t use it.____ > > __ __ > > I?m using astropy 3.2.1 with python 3.7.4.____ > > __ __ > > Thanks,____ > > Matt____ > > __ __ > > *************************************************************____ > > Matthew Burger____ > > Archive Scientist____ > > Data Processing & Archive Services (DPAS), Deputy Branch Manager____ > > Space Telescope Science Institute____ > > mburger at stsci.edu ____ > > 410/338-6810____ > > *************************************************************____ > > __ __ > > __ __ > > _______________________________________________ > AstroPy mailing list > AstroPy at python.org > https://mail.python.org/mailman/listinfo/astropy > > > > -- > Juan Luis Cano > > _______________________________________________ > AstroPy mailing list > AstroPy at python.org > https://mail.python.org/mailman/listinfo/astropy > ------------------------------ Subject: Digest Footer _______________________________________________ AstroPy mailing list AstroPy at python.org https://mail.python.org/mailman/listinfo/astropy ------------------------------ End of AstroPy Digest, Vol 156, Issue 8 *************************************** From jgv.home at gmail.com Tue Sep 10 10:44:23 2019 From: jgv.home at gmail.com (j. vickroy) Date: Tue, 10 Sep 2019 14:44:23 +0000 Subject: [AstroPy] Executable Script fitsheader In-Reply-To: References: Message-ID: Sorry I do not have an answer, but since there have been no responses, here is what I'm seeing: C:\Pictures\Astro>fitsheader *.fit ERROR: [Errno 22] Invalid argument: '*.fit' [astropy.io.fits.scripts.fitsheader] My setup is: Microsoft Windows 10 fully-updatedPython 3.7.3astropy 3.2.1 When I have some time, I will look at fitsheader.py to see what the problem is. Regards, /jimv On 9/9/2019 4:47:18 PM, "James Dull" wrote: >I would like to extract header information from several hundred fits >files and put it into a csv file. I ran across the executable script >information fitsheader that appears to do just that. It works perfectly >for a single file. However, when I follow the online command for that >uses a wildcard so multiple files can be completed in a single pass I >get "unrecognized command" > >Something similar happens with the other scripts if I use a wildcard. > >I feel I'm missing something simple. > >The command I'm using is: fitsheader --table ascii.csv *.fits > >keywords.csv > >thanks >Jim > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sn.fotop at gmail.com Tue Sep 10 10:55:28 2019 From: sn.fotop at gmail.com (Sotiria Fotopoulou) Date: Tue, 10 Sep 2019 15:55:28 +0100 Subject: [AstroPy] Executable Script fitsheader In-Reply-To: References: Message-ID: Hi Jim, your command works fine for me. However, if you are in pinch and since it seems to work for a single file, you could consider using a bash for loop like the following: for FILE in *fits; do fitsheader --table ascii.csv $FILE >> keywords.csv;done Cheers, Sotiria On Mon, Sep 9, 2019 at 11:47 PM James Dull wrote: > I would like to extract header information from several hundred fits files > and put it into a csv file. I ran across the executable script information > fitsheader that appears to do just that. It works perfectly for a single > file. However, when I follow the online command for that uses a wildcard so > multiple files can be completed in a single pass I get "unrecognized > command" > > Something similar happens with the other scripts if I use a wildcard. > > I feel I'm missing something simple. > > The command I'm using is: fitsheader --table ascii.csv *.fits > > keywords.csv > > thanks > Jim > > > _______________________________________________ > AstroPy mailing list > AstroPy at python.org > https://mail.python.org/mailman/listinfo/astropy > -------------- next part -------------- An HTML attachment was scrubbed... URL: From teuben at astro.umd.edu Tue Sep 10 10:55:35 2019 From: teuben at astro.umd.edu (Peter Teuben) Date: Tue, 10 Sep 2019 10:55:35 -0400 Subject: [AstroPy] Executable Script fitsheader In-Reply-To: References: Message-ID: more than likely the argument is not fed via the glob module, as it seems to take *.fit as a literal, not a meta character. Looking at the documentation, it seems to support wildcards, but I should also note the documentation (in the source code) has 'errors', e.g. it lists fitsheader --keyword NAXIS* filename.fits as an example which I'm pretty sure doesn't work in all shells. In bash it will, since it's an overly controlling shell, or smart shell as some call it :-)? In csh, i can promise you, it won't work. Since DOS does wildcards I believe, the other possibility could be that the command fitsheader doesn't point to the fitsheader.py from astropy, but from another package, since the name is pretty easy to come up with. Is there a "which" command in DOS ? Does the command do the expected thing if you manually feed it more than one fit(s) file? - peter On 9/10/19 10:44 AM, j. vickroy wrote: > Sorry I do not have an answer, but since there have been no responses, > ?here is what I'm seeing: > > C:\Pictures\Astro>fitsheader *.fit > ERROR: [Errno 22] Invalid argument: '*.fit' > [astropy.io.fits.scripts.fitsheader] > > My setup is: > > * Microsoft Windows 10 fully-updated > * Python 3.7.3 > * astropy 3.2.1 > > > When I have some time, I will look at fitsheader.py to see what the > problem is. > > Regards, > /jimv > > > On 9/9/2019 4:47:18 PM, "James Dull" > wrote: > >> I would like to extract header information from several hundred fits >> files and put it into a csv file. I ran across the executable script >> information fitsheader that appears to do just that. It works >> perfectly for a single file. However, when I follow the online >> command for that uses a wildcard so multiple files can be completed >> in a single pass I get "unrecognized command" >> >> Something similar happens with the other scripts if I use a wildcard. >> >> I feel I'm missing something simple. >> >> The command I'm using is: fitsheader --table ascii.csv *.fits > >> keywords.csv >> >> thanks >> Jim >> >> > > _______________________________________________ > AstroPy mailing list > AstroPy at python.org > https://mail.python.org/mailman/listinfo/astropy -------------- next part -------------- An HTML attachment was scrubbed... URL: From jgv.home at gmail.com Tue Sep 10 11:10:09 2019 From: jgv.home at gmail.com (j. vickroy) Date: Tue, 10 Sep 2019 15:10:09 +0000 Subject: [AstroPy] Executable Script fitsheader In-Reply-To: References: Message-ID: As a quick followup ... line 262 in function print_headers_traditional of ...\Python\Python37\Lib\site-packages\astropy\io\fits\scripts\fitsheader.py is: for idx, filename in enumerate(args.filename): # support wildcards filename, immediately after line 262, is simply "*.fit" which indicates args.filename has not been previously expanded if a wildcard has been specified. At least that is the the behavior when running fitsheader.py from the C:\Windows\System32\cmd.exe shell on Microsoft Windows 10. /jimv On 9/9/2019 4:47:18 PM, "James Dull" wrote: >I would like to extract header information from several hundred fits >files and put it into a csv file. I ran across the executable script >information fitsheader that appears to do just that. It works perfectly >for a single file. However, when I follow the online command for that >uses a wildcard so multiple files can be completed in a single pass I >get "unrecognized command" > >Something similar happens with the other scripts if I use a wildcard. > >I feel I'm missing something simple. > >The command I'm using is: fitsheader --table ascii.csv *.fits > >keywords.csv > >thanks >Jim > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dull4.ja at gmail.com Tue Sep 10 13:04:01 2019 From: dull4.ja at gmail.com (James Dull) Date: Tue, 10 Sep 2019 11:04:01 -0600 Subject: [AstroPy] Executable Script fitsheader In-Reply-To: References: Message-ID: Thanks for all of the input. I should have provided more information. I have the same set-up as described below and get the same error. I am using Windows 10. Jim On Tue, Sep 10, 2019 at 8:44 AM j. vickroy wrote: > Sorry I do not have an answer, but since there have been no responses, > here is what I'm seeing: > > C:\Pictures\Astro>fitsheader *.fit > ERROR: [Errno 22] Invalid argument: '*.fit' > [astropy.io.fits.scripts.fitsheader] > > My setup is: > > - Microsoft Windows 10 fully-updated > - Python 3.7.3 > - astropy 3.2.1 > > > When I have some time, I will look at fitsheader.py to see what the > problem is. > > Regards, > /jimv > > > On 9/9/2019 4:47:18 PM, "James Dull" wrote: > > I would like to extract header information from several hundred fits files > and put it into a csv file. I ran across the executable script information > fitsheader that appears to do just that. It works perfectly for a single > file. However, when I follow the online command for that uses a wildcard so > multiple files can be completed in a single pass I get "unrecognized > command" > > Something similar happens with the other scripts if I use a wildcard. > > I feel I'm missing something simple. > > The command I'm using is: fitsheader --table ascii.csv *.fits > > keywords.csv > > thanks > Jim > > > _______________________________________________ > AstroPy mailing list > AstroPy at python.org > https://mail.python.org/mailman/listinfo/astropy > -------------- next part -------------- An HTML attachment was scrubbed... URL: From miguel.deval at gmail.com Tue Sep 10 15:35:47 2019 From: miguel.deval at gmail.com (Miguel de Val-Borro) Date: Tue, 10 Sep 2019 15:35:47 -0400 Subject: [AstroPy] Solar System ephemerides in astropy.coordinates In-Reply-To: <013e6789-fca9-de5a-c79a-642e06b00030@curtin.edu.au> References: <51BA6907-C232-4167-AAB7-3078BC6609E1@contoso.com> <013e6789-fca9-de5a-c79a-642e06b00030@curtin.edu.au> Message-ID: <20190910193547.GA2233@tolstoy> As yet another alternative, you could try the web interface to the JPL Horizons ephemerides system for solar-system bodies available as an astroquery module: https://astroquery.readthedocs.io/en/latest/jplhorizons/jplhorizons.html Miguel On Tue, Sep 10, 2019 at 02:22:09PM +0000, Andrew Williams wrote: > > Hi Matt, I'd give skyfield (https://rhodesmill.org/skyfield/) a try - > it's a complete rewrite of pyephem by the original package maintainer. > It's very fast, uses the JPL ephemeris as well as parsing satellite > TLEs, and plays nicely with astropy objects (converting times and > coordinates to and from astropy Time and SkyCoord objects). > > Andrew > > On 2019-09-10 9:41 PM, Juan Luis Cano wrote: > > Hello Matt, > > > > The SPK segments are hardcoded (see links and comments in > > https://github.com/astropy/astropy/issues/6472) so, unless I'm mistaken, > > I don't think this is something that can be easily done in Astropy. I > > would be interested to see this happening though. > > > > As an alternative, you might be interested in checking SpiceyPy > > https://github.com/AndrewAnnex/SpiceyPy/ (installable with pip and > > conda-forge) and try to combine it with astropy.coordinates. > > > > Regards, > > > > On Tue, Sep 10, 2019 at 3:28 PM Matthew Burger > > wrote: > > > > I?m trying to use astropy.coordinates.solar_system_ephemeris to > > calculate the RA and Dec of other bodies besides planets. Is this > > possible? I know which JPL SPICE kernels I want to use, but I can?t > > load them. If I specify another kernel with a url (e.g., > > https://naif.jpl.nasa.gov/pub/naif/generic_kernels/spk/satellites/jup310.bsp), > > it downloads the file but can?t use it.____ > > > > __ __ > > > > I?m using astropy 3.2.1 with python 3.7.4.____ > > > > __ __ > > > > Thanks,____ > > > > Matt____ > > > > __ __ > > > > *************************************************************____ > > > > Matthew Burger____ > > > > Archive Scientist____ > > > > Data Processing & Archive Services (DPAS), Deputy Branch Manager____ > > > > Space Telescope Science Institute____ > > > > mburger at stsci.edu ____ > > > > 410/338-6810____ > > > > *************************************************************____ > > > > __ __ > > > > __ __ > > > > _______________________________________________ > > AstroPy mailing list > > AstroPy at python.org > > https://mail.python.org/mailman/listinfo/astropy > > > > > > > > -- > > Juan Luis Cano > > > > _______________________________________________ > > AstroPy mailing list > > AstroPy at python.org > > https://mail.python.org/mailman/listinfo/astropy > > > > _______________________________________________ > AstroPy mailing list > AstroPy at python.org > https://mail.python.org/mailman/listinfo/astropy From simon at sconseil.fr Tue Sep 10 16:54:33 2019 From: simon at sconseil.fr (Simon Conseil) Date: Tue, 10 Sep 2019 22:54:33 +0200 Subject: [AstroPy] Executable Script fitsheader In-Reply-To: References: Message-ID: <99edb966-2b63-5fc2-3f2f-1a18e3e1d0c7@sconseil.fr> Hi, Usually for this kind of script the shell takes care of the wildcard expansion (e.g. with bash/zsh on Linux/MacOS). I don't know much about Windows, a quick search seems to show cmd.exe does not support wildcard expansion, but Powershell does (https://superuser.com/questions/460598/is-there-any-way-to-get-the-windows-cmd-shell-to-expand-wildcard-paths). Simon Le 10/09/2019 ? 19:04, James Dull a ?crit?: > Thanks for all of the input. > > I should have provided more information. I have the same set-up as > described below and get the same error. > I am using Windows 10. > > Jim > > On Tue, Sep 10, 2019 at 8:44 AM j. vickroy wrote: > >> Sorry I do not have an answer, but since there have been no responses, >> here is what I'm seeing: >> >> C:\Pictures\Astro>fitsheader *.fit >> ERROR: [Errno 22] Invalid argument: '*.fit' >> [astropy.io.fits.scripts.fitsheader] >> >> My setup is: >> >> - Microsoft Windows 10 fully-updated >> - Python 3.7.3 >> - astropy 3.2.1 >> >> >> When I have some time, I will look at fitsheader.py to see what the >> problem is. >> >> Regards, >> /jimv >> >> >> On 9/9/2019 4:47:18 PM, "James Dull" wrote: >> >> I would like to extract header information from several hundred fits files >> and put it into a csv file. I ran across the executable script information >> fitsheader that appears to do just that. It works perfectly for a single >> file. However, when I follow the online command for that uses a wildcard so >> multiple files can be completed in a single pass I get "unrecognized >> command" >> >> Something similar happens with the other scripts if I use a wildcard. >> >> I feel I'm missing something simple. >> >> The command I'm using is: fitsheader --table ascii.csv *.fits > >> keywords.csv >> >> thanks >> Jim >> >> >> _______________________________________________ >> AstroPy mailing list >> AstroPy at python.org >> https://mail.python.org/mailman/listinfo/astropy >> > > _______________________________________________ > AstroPy mailing list > AstroPy at python.org > https://mail.python.org/mailman/listinfo/astropy -------------- next part -------------- An HTML attachment was scrubbed... URL: From pdzwig at summaventures.com Wed Sep 11 05:38:54 2019 From: pdzwig at summaventures.com (Peter Dzwig) Date: Wed, 11 Sep 2019 11:38:54 +0200 Subject: [AstroPy] Executable Script fitsheader In-Reply-To: <99edb966-2b63-5fc2-3f2f-1a18e3e1d0c7@sconseil.fr> References: <99edb966-2b63-5fc2-3f2f-1a18e3e1d0c7@sconseil.fr> Message-ID: <577d16f2-a641-17a9-8d54-51c369fe90f8@summaventures.com> I tend to agree, although it is some time since I used Windows as a serious compute environment, I seem to recall that cmd.exe lacked a lot of the support that Powershell gives/gave better support. Should this be reported to astropy as a bug? Peter Dzwig On 10/09/2019 22:54, Simon Conseil wrote: > Hi, > > Usually for this kind of script the shell takes care of the wildcard > expansion (e.g. with bash/zsh on Linux/MacOS). > > I don't know much about Windows, a quick search seems to show cmd.exe > does not support wildcard expansion, but Powershell does > (https://superuser.com/questions/460598/is-there-any-way-to-get-the-windows-cmd-shell-to-expand-wildcard-paths). > > Simon > > > Le 10/09/2019 ? 19:04, James Dull a ?crit?: >> Thanks for all of the input. >> >> I should have provided more information. I have the same set-up as >> described below and get the same error. >> I am using Windows 10. >> >> Jim >> >> On Tue, Sep 10, 2019 at 8:44 AM j. vickroy wrote: >> >>> Sorry I do not have an answer, but since there have been no responses, >>> here is what I'm seeing: >>> >>> C:\Pictures\Astro>fitsheader *.fit >>> ERROR: [Errno 22] Invalid argument: '*.fit' >>> [astropy.io.fits.scripts.fitsheader] >>> >>> My setup is: >>> >>> - Microsoft Windows 10 fully-updated >>> - Python 3.7.3 >>> - astropy 3.2.1 >>> >>> >>> When I have some time, I will look at fitsheader.py to see what the >>> problem is. >>> >>> Regards, >>> /jimv >>> >>> >>> On 9/9/2019 4:47:18 PM, "James Dull" wrote: >>> >>> I would like to extract header information from several hundred fits files >>> and put it into a csv file. I ran across the executable script information >>> fitsheader that appears to do just that. It works perfectly for a single >>> file. However, when I follow the online command for that uses a wildcard so >>> multiple files can be completed in a single pass I get "unrecognized >>> command" >>> >>> Something similar happens with the other scripts if I use a wildcard. >>> >>> I feel I'm missing something simple. >>> >>> The command I'm using is: fitsheader --table ascii.csv *.fits > >>> keywords.csv >>> >>> thanks >>> Jim >>> >>> >>> _______________________________________________ >>> AstroPy mailing list >>> AstroPy at python.org >>> https://mail.python.org/mailman/listinfo/astropy >>> >> >> _______________________________________________ >> AstroPy mailing list >> AstroPy at python.org >> https://mail.python.org/mailman/listinfo/astropy > > _______________________________________________ > AstroPy mailing list > AstroPy at python.org > https://mail.python.org/mailman/listinfo/astropy > -- Dr. Peter Dzwig From sn.fotop at gmail.com Wed Sep 11 05:55:16 2019 From: sn.fotop at gmail.com (Sotiria Fotopoulou) Date: Wed, 11 Sep 2019 10:55:16 +0100 Subject: [AstroPy] Executable Script fitsheader In-Reply-To: <577d16f2-a641-17a9-8d54-51c369fe90f8@summaventures.com> References: <99edb966-2b63-5fc2-3f2f-1a18e3e1d0c7@sconseil.fr> <577d16f2-a641-17a9-8d54-51c369fe90f8@summaventures.com> Message-ID: I don't think the wildcard expansion is astropy's shortcoming. Perhaps an issue should be raised for a more informative error message or a suggestion to be printed to use powershell. Cheers, Sotiria On Wed, Sep 11, 2019 at 10:45 AM Peter Dzwig wrote: > I tend to agree, although it is some time since I used Windows as a > serious compute environment, I seem to recall that cmd.exe lacked a lot > of the support that Powershell gives/gave better support. > > Should this be reported to astropy as a bug? > > Peter Dzwig > > On 10/09/2019 22:54, Simon Conseil wrote: > > Hi, > > > > Usually for this kind of script the shell takes care of the wildcard > > expansion (e.g. with bash/zsh on Linux/MacOS). > > > > I don't know much about Windows, a quick search seems to show cmd.exe > > does not support wildcard expansion, but Powershell does > > ( > https://superuser.com/questions/460598/is-there-any-way-to-get-the-windows-cmd-shell-to-expand-wildcard-paths > ). > > > > Simon > > > > > > Le 10/09/2019 ? 19:04, James Dull a ?crit : > >> Thanks for all of the input. > >> > >> I should have provided more information. I have the same set-up as > >> described below and get the same error. > >> I am using Windows 10. > >> > >> Jim > >> > >> On Tue, Sep 10, 2019 at 8:44 AM j. vickroy wrote: > >> > >>> Sorry I do not have an answer, but since there have been no responses, > >>> here is what I'm seeing: > >>> > >>> C:\Pictures\Astro>fitsheader *.fit > >>> ERROR: [Errno 22] Invalid argument: '*.fit' > >>> [astropy.io.fits.scripts.fitsheader] > >>> > >>> My setup is: > >>> > >>> - Microsoft Windows 10 fully-updated > >>> - Python 3.7.3 > >>> - astropy 3.2.1 > >>> > >>> > >>> When I have some time, I will look at fitsheader.py to see what the > >>> problem is. > >>> > >>> Regards, > >>> /jimv > >>> > >>> > >>> On 9/9/2019 4:47:18 PM, "James Dull" wrote: > >>> > >>> I would like to extract header information from several hundred fits > files > >>> and put it into a csv file. I ran across the executable script > information > >>> fitsheader that appears to do just that. It works perfectly for a > single > >>> file. However, when I follow the online command for that uses a > wildcard so > >>> multiple files can be completed in a single pass I get "unrecognized > >>> command" > >>> > >>> Something similar happens with the other scripts if I use a wildcard. > >>> > >>> I feel I'm missing something simple. > >>> > >>> The command I'm using is: fitsheader --table ascii.csv *.fits > > >>> keywords.csv > >>> > >>> thanks > >>> Jim > >>> > >>> > >>> _______________________________________________ > >>> AstroPy mailing list > >>> AstroPy at python.org > >>> https://mail.python.org/mailman/listinfo/astropy > >>> > >> > >> _______________________________________________ > >> AstroPy mailing list > >> AstroPy at python.org > >> https://mail.python.org/mailman/listinfo/astropy > > > > _______________________________________________ > > AstroPy mailing list > > AstroPy at python.org > > https://mail.python.org/mailman/listinfo/astropy > > > > -- > > Dr. Peter Dzwig > _______________________________________________ > AstroPy mailing list > AstroPy at python.org > https://mail.python.org/mailman/listinfo/astropy > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jgv.home at gmail.com Wed Sep 11 09:54:29 2019 From: jgv.home at gmail.com (j. vickroy) Date: Wed, 11 Sep 2019 13:54:29 +0000 Subject: [AstroPy] Executable Script fitsheader In-Reply-To: References: <99edb966-2b63-5fc2-3f2f-1a18e3e1d0c7@sconseil.fr> <577d16f2-a641-17a9-8d54-51c369fe90f8@summaventures.com> Message-ID: Sine python provides the glob module, I believe these astropy scripts should not assume command-line expansion of wildcards. At a minimum, their documentation should be updated to state the implicit assumption that wildcard expansion is left to the shell, and that, in particular, they do not work as advertised when used in Microsoft Windows cmd.exe. Regards, /jimv On 9/11/2019 3:55:16 AM, "Sotiria Fotopoulou" wrote: >I don't think the wildcard expansion is astropy's shortcoming. >Perhaps an issue should be raised for a more informative error message >or a suggestion to be printed to use powershell. > >Cheers, >Sotiria > >On Wed, Sep 11, 2019 at 10:45 AM Peter Dzwig >wrote: >>I tend to agree, although it is some time since I used Windows as a >>serious compute environment, I seem to recall that cmd.exe lacked a >>lot >>of the support that Powershell gives/gave better support. >> >>Should this be reported to astropy as a bug? >> >>Peter Dzwig >> >>On 10/09/2019 22:54, Simon Conseil wrote: >> > Hi, >> > >> > Usually for this kind of script the shell takes care of the wildcard >> > expansion (e.g. with bash/zsh on Linux/MacOS). >> > >> > I don't know much about Windows, a quick search seems to show >>cmd.exe >> > does not support wildcard expansion, but Powershell does >> > >>(https://superuser.com/questions/460598/is-there-any-way-to-get-the-windows-cmd-shell-to-expand-wildcard-paths). >> > >> > Simon >> > >> > >> > Le 10/09/2019 ? 19:04, James Dull a ?crit : >> >> Thanks for all of the input. >> >> >> >> I should have provided more information. I have the same set-up as >> >> described below and get the same error. >> >> I am using Windows 10. >> >> >> >> Jim >> >> >> >> On Tue, Sep 10, 2019 at 8:44 AM j. vickroy >>wrote: >> >> >> >>> Sorry I do not have an answer, but since there have been no >>responses, >> >>> here is what I'm seeing: >> >>> >> >>> C:\Pictures\Astro>fitsheader *.fit >> >>> ERROR: [Errno 22] Invalid argument: '*.fit' >> >>> [astropy.io.fits.scripts.fitsheader] >> >>> >> >>> My setup is: >> >>> >> >>> - Microsoft Windows 10 fully-updated >> >>> - Python 3.7.3 >> >>> - astropy 3.2.1 >> >>> >> >>> >> >>> When I have some time, I will look at fitsheader.py to see what >>the >> >>> problem is. >> >>> >> >>> Regards, >> >>> /jimv >> >>> >> >>> >> >>> On 9/9/2019 4:47:18 PM, "James Dull" wrote: >> >>> >> >>> I would like to extract header information from several hundred >>fits files >> >>> and put it into a csv file. I ran across the executable script >>information >> >>> fitsheader that appears to do just that. It works perfectly for a >>single >> >>> file. However, when I follow the online command for that uses a >>wildcard so >> >>> multiple files can be completed in a single pass I get >>"unrecognized >> >>> command" >> >>> >> >>> Something similar happens with the other scripts if I use a >>wildcard. >> >>> >> >>> I feel I'm missing something simple. >> >>> >> >>> The command I'm using is: fitsheader --table ascii.csv *.fits > >> >>> keywords.csv >> >>> >> >>> thanks >> >>> Jim >> >>> >> >>> >> >>> _______________________________________________ >> >>> AstroPy mailing list >> >>> AstroPy at python.org >> >>> https://mail.python.org/mailman/listinfo/astropy >> >>> >> >> >> >> _______________________________________________ >> >> AstroPy mailing list >> >> AstroPy at python.org >> >> https://mail.python.org/mailman/listinfo/astropy >> > >> > _______________________________________________ >> > AstroPy mailing list >> > AstroPy at python.org >> > https://mail.python.org/mailman/listinfo/astropy >> > >> >>-- >> >>Dr. Peter Dzwig >>_______________________________________________ >>AstroPy mailing list >>AstroPy at python.org >>https://mail.python.org/mailman/listinfo/astropy -------------- next part -------------- An HTML attachment was scrubbed... URL: From bsipocz at gmail.com Thu Sep 12 14:19:25 2019 From: bsipocz at gmail.com (Brigitta Sipocz) Date: Thu, 12 Sep 2019 19:19:25 +0100 Subject: [AstroPy] astroML workshop at the 235th AAS Meeting Message-ID: Dear All, Registration is open for the upcoming astroML workshop . The workshop will be held at the AAS winter meeting, Monday, 6 January 2020. This workshop will introduce the astronomical community to the 2nd edition of the book *Statistics, Data Mining, and Machine Learning in Astronomy* and the associated software package astroML. The goal is to introduce participants to a variety of statistical and machine learning tools available within the open source astroML library. The format will be interactive, including short presentations on different machine learning methodologies followed by instructor-guided, Jupyter notebook based tutorials. In these tutorial sessions participants will be able to try out the tools and to ask questions from expert users and developers. Our primary focus will be on the new material and applications in the 2nd edition of the book. These include: - Traditional machine learning techniques for density estimation, - Approximate Bayesian computation, - Hierarchical Bayesian models, - Autoencoders as tools for data compression, - Deep learning and convolutional neural networks. In each tutorial example applications will be based on astronomical use cases and data sets. At the end of the workshop we will present a roadmap for future developments in astroML. This workshop is suitable for those with existing Python knowledge, including familiarity with the core packages in the numerical Python ecosystem such as numpy, scipy, scikit-learn, and matplotlib. Registration is open on the website of the meeting: https://aas.org/meetings/aas235 On behalf of the organizers, Brigitta Sip?cz -------------- next part -------------- An HTML attachment was scrubbed... URL: From peridot.faceted at gmail.com Wed Sep 18 12:41:47 2019 From: peridot.faceted at gmail.com (Anne Archibald) Date: Wed, 18 Sep 2019 18:41:47 +0200 Subject: [AstroPy] Instructions for using dev tools Message-ID: Hi, I have been working on a couple of astropy pull requests, and I would like to take advantage of various development tools, but I can't find any instructions and they don't seem to do the right thing by default. * How do I run flake8 to see if my files meet the coding standards? If I just run flake8 from the root directory I am submerged in a blizzard of warnings from files I have never touched. The same is true of python setup.py flake8. I see that there is a CI run that runs flake8 with all sorts of warnings turned off, but it's arranged through an environment variable so there's no easy way for me to use that (should I?). I can run flake8-diff, but again it complains about all sorts of things - often lines that are too long - that are clearly acceptable in astropy source code. Is the current situation because there are two levels of flake8 compliance - one that is needed to allow building at all, and a better one new code should meet? * How do I clear out the test environment? I find with python setup.py test astropy keeps running tests left over from another branch. I have no idea where these are stored, perhaps in the virtualenv of the installed package? I am happy to add the correct instructions to CONTRIBUTING.rst, when I find out what they are. Thanks, Anne -------------- next part -------------- An HTML attachment was scrubbed... URL: From aldcroft at head.cfa.harvard.edu Wed Sep 18 14:06:08 2019 From: aldcroft at head.cfa.harvard.edu (Aldcroft, Thomas) Date: Wed, 18 Sep 2019 14:06:08 -0400 Subject: [AstroPy] Instructions for using dev tools In-Reply-To: References: Message-ID: On Wed, Sep 18, 2019 at 12:42 PM Anne Archibald wrote: > Hi, > > I have been working on a couple of astropy pull requests, and I would like > to take advantage of various development tools, but I can't find any > instructions and they don't seem to do the right thing by default. > > * How do I run flake8 to see if my files meet the coding standards? If I > just run flake8 from the root directory I am submerged in a blizzard of > warnings from files I have never touched. The same is true of python > setup.py flake8. I see that there is a CI run that runs flake8 with all > sorts of warnings turned off, but it's arranged through an environment > variable so there's no easy way for me to use that (should I?). I can run > flake8-diff, but again it complains about all sorts of things - often lines > that are too long - that are clearly acceptable in astropy source code. Is > the current situation because there are two levels of flake8 compliance - > one that is needed to allow building at all, and a better one new code > should meet? > This is a great question and I look forward to hearing the answer from one of our infrastructure gurus. > > * How do I clear out the test environment? I find with python setup.py > test astropy keeps running tests left over from another branch. I have no > idea where these are stored, perhaps in the virtualenv of the installed > package? > I use the following hammer. There might be a better way, but I have had exactly the problem you described and this should fix it. First: $ git clean -nxd # Check files that are going to be cleaned Then: $ git clean -fxd # Remove *everything* that is not a tracked git file Another possibility (maybe try first?) is just `rm -rf build`. For instance the `git clean -fxd` will wipe out any IDE settings or other personal things you might have in the repo. - Tom > > I am happy to add the correct instructions to CONTRIBUTING.rst, when I > find out what they are. > > Thanks, > Anne > _______________________________________________ > AstroPy mailing list > AstroPy at python.org > https://mail.python.org/mailman/listinfo/astropy > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nathan.goldbaum at gmail.com Wed Sep 18 14:08:26 2019 From: nathan.goldbaum at gmail.com (Nathan) Date: Wed, 18 Sep 2019 12:08:26 -0600 Subject: [AstroPy] Instructions for using dev tools In-Reply-To: References: Message-ID: If astropy isn't doing it already, you could probably have the flake8 configuration in a setup.cfg file. Here's what I do for unyt: https://github.com/yt-project/unyt/blob/master/setup.cfg#L41 With this users just need to run `flake8` in the root of the project and it "just works". On Wed, Sep 18, 2019 at 12:06 PM Aldcroft, Thomas < aldcroft at head.cfa.harvard.edu> wrote: > > > On Wed, Sep 18, 2019 at 12:42 PM Anne Archibald > wrote: > >> Hi, >> >> I have been working on a couple of astropy pull requests, and I would >> like to take advantage of various development tools, but I can't find any >> instructions and they don't seem to do the right thing by default. >> >> * How do I run flake8 to see if my files meet the coding standards? If I >> just run flake8 from the root directory I am submerged in a blizzard of >> warnings from files I have never touched. The same is true of python >> setup.py flake8. I see that there is a CI run that runs flake8 with all >> sorts of warnings turned off, but it's arranged through an environment >> variable so there's no easy way for me to use that (should I?). I can run >> flake8-diff, but again it complains about all sorts of things - often lines >> that are too long - that are clearly acceptable in astropy source code. Is >> the current situation because there are two levels of flake8 compliance - >> one that is needed to allow building at all, and a better one new code >> should meet? >> > > This is a great question and I look forward to hearing the answer from one > of our infrastructure gurus. > > >> >> * How do I clear out the test environment? I find with python setup.py >> test astropy keeps running tests left over from another branch. I have no >> idea where these are stored, perhaps in the virtualenv of the installed >> package? >> > > I use the following hammer. There might be a better way, but I have had > exactly the problem you described and this should fix it. First: > > $ git clean -nxd # Check files that are going to be cleaned > > Then: > > $ git clean -fxd # Remove *everything* that is not a tracked git file > > Another possibility (maybe try first?) is just `rm -rf build`. For > instance the `git clean -fxd` will wipe out any IDE settings or other > personal things you might have in the repo. > > - Tom > > >> >> I am happy to add the correct instructions to CONTRIBUTING.rst, when I >> find out what they are. >> >> Thanks, >> Anne >> _______________________________________________ >> AstroPy mailing list >> AstroPy at python.org >> https://mail.python.org/mailman/listinfo/astropy >> > _______________________________________________ > AstroPy mailing list > AstroPy at python.org > https://mail.python.org/mailman/listinfo/astropy > -------------- next part -------------- An HTML attachment was scrubbed... URL: From p3y1i4n at gmail.com Mon Sep 23 12:44:54 2019 From: p3y1i4n at gmail.com (Pey Lian Lim) Date: Mon, 23 Sep 2019 12:44:54 -0400 Subject: [AstroPy] Astropy developer telecon (Sep 2019) Message-ID: Hello astropy core developers and stakeholders, You are cordially invited to our September 2019 developer telecon, mainly to discuss the upcoming 4.0 release (https://github.com/astropy/astropy/milestones/v4.0). Meeting info as follows. Sincerely, Pey-Lian (on behalf of the Astropy Project) ------------------------------ Astropy Project is inviting you to a scheduled Zoom meeting. Topic: Astropy developer telecon Time: Sep 24, 2019 02:00 PM Eastern Time (US and Canada) Join Zoom Meeting https://zoom.us/j/364224322 One tap mobile +16468769923,,364224322# US (New York) +16699006833,,364224322# US (San Jose) Dial by your location +1 646 876 9923 US (New York) +1 669 900 6833 US (San Jose) Meeting ID: 364 224 322 Find your local number: https://zoom.us/u/acK4MK6Tk4 From bsipocz at gmail.com Mon Sep 23 13:10:55 2019 From: bsipocz at gmail.com (Brigitta Sipocz) Date: Mon, 23 Sep 2019 10:10:55 -0700 Subject: [AstroPy] ANN: astroquery release v0.3.10 Message-ID: Dear All, We are happy to announce that a new astroquery version, v0.3.10 has been released and is available both to pip, or conda install (via the astropy or conda-forge channels). In this release there are several new services added, as well as numerous fixes have been made. Some new additions: - module for astrometry.net - module for the Canadian Astronomy Data Centre - module for the ESA Hubble Archive - module IMCCE to access their Miriade and SkyBoT services - MAST access to PanSTARRS catalogue data For a full list, please see the changelog: https://github.com/astropy/astroquery/blob/v0.3.10/CHANGES.rst As we did in the past year, we keep continuously releasing developer versions to PyPI. These can be pip installed with the `--pre` option. Thank you for everyone who contributed for these releases! Best wishes, Brigitta Sip?cz -------------- next part -------------- An HTML attachment was scrubbed... URL: From pdzwig at summaventures.com Tue Sep 24 05:00:43 2019 From: pdzwig at summaventures.com (Peter Dzwig) Date: Tue, 24 Sep 2019 10:00:43 +0100 Subject: [AstroPy] Issue when comparing thresholding and derivative changess for line-finding Message-ID: <758a7d89-bd9b-5099-f5c5-e7caa5692f27@summaventures.com> All, I am looking at some SDSS spectra, and will ultimately want to identify individual lines and want to compare thresholding and derivative changes as techniques to use. It keeps throwing errors that I can't make head or tail of. The core of the code is: ["norm_spec" is the continuum normalised spectrum (normalised over the whole range) which has been transformed to the rest frame.] from specutils import SpectralRegion from specutils.manipulation import noise_region_uncertainty from specutils.fitting import find_lines_threshold, find_lines_derivative noise_region = SpectralRegion(3250*u.AA, 3800*u.AA) spec_em_nr=noise_region_uncertainty(norm_spec, noise_region) # First use thresholding to get lines print( '\n'*2,"THRESHOLDING", '\n'*2) lines = find_lines_threshold(spec_em_nr, noise_factor=2) lem = lines[lines['line_type'] == 'emission'] labs = lines[lines['line_type'] == 'absorption'] print("Emission lines (thresholding)",lem[:]) print("Absorption lines (thresholding)",labs[:]) # Next use derivative to get lines print( '\n'*2,"DERIVATIVE", '\n'*2) lines = find_lines_derivative(spec_em_nr, flux_threshold=4.0) lem2 = lines[lines['line_type'] == 'emission'] labs2 = lines[lines['line_type'] == 'absorption'] print("Emission lines (derivative)",lem2[:]) print("Absorption lines (derivative)",labs2[:]) THRESHOLDING Emission lines (thresholding) line_center line_type line_center_index Angstrom ----------------- --------- ----------------- 2731.765380859375 emission 1652 2803.130615234375 emission 1764 4388.775390625 emission 3711 Absorption lines (thresholding) line_center line_type line_center_index Angstrom ----------- --------- ----------------- [ Don't expect any ALs. this is just there for completeness] DERIVATIVE Then: /home/peter/anaconda3/lib/python3.6/site-packages/astropy/table/column.py:965: FutureWarning: elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison return getattr(self.data, op)(other) --------------------------------------------------------------------------- IndexError Traceback (most recent call last) in () 288 lines = find_lines_derivative(spec_em_nr, flux_threshold=4.0) 289 --> 290 lem2 = lines[lines['line_type'] == 'emission'] 291 labs2 = lines[lines['line_type'] == 'absorption'] 292 ~/anaconda3/lib/python3.6/site-packages/astropy/table/table.py in __getitem__(self, item) 1225 return self.columns[item] 1226 elif isinstance(item, (int, np.integer)): -> 1227 return self.Row(self, item) 1228 elif (isinstance(item, np.ndarray) and item.shape == () and item.dtype.kind == 'i'): 1229 return self.Row(self, item.item()) ~/anaconda3/lib/python3.6/site-packages/astropy/table/row.py in __init__(self, table, index) 36 if index < -n or index >= n: 37 raise IndexError('index {0} out of range for table with length {1}' ---> 38 .format(index, len(table))) 39 40 # Ensure that the row index is positive [#8422] IndexError: index False out of range for table with length 0 ?The thresholding produces results, although poor. I don't understand the message when doing the derivative, nor why it has been thrown. Most of the code comes pretty much straight from the relevant pages in SpecUtils Can anyone offer any thoughts? recommendations? I am running astropy in Jupyter Notebooks, current versions of both and Ubuntu 18.04 with updates to date. Peter Dzwig PS FWIW the spectrum itself is at -- Dr. Peter Dzwig