From cwp.paxson at gmail.com Wed Apr 4 16:10:49 2018 From: cwp.paxson at gmail.com (Charles Paxson) Date: Wed, 4 Apr 2018 16:10:49 -0400 Subject: [AstroPy] pyfits - Header Keywords with Units Message-ID: In regard to working with pyfits, I am having difficulty finding the syntax to place units into FITS formatted header keys. These are header keys that *do not *describe the table columns, but single values with units. As work around, or maybe its the accepted way to do this, I have added the units within a bracket [ units ] and concatenated the bracketed string to the description. I pass the tuple of (value, description) to the proper header object and I receive the correct results. In describing columns in the hdu tables, there is an explicit keyword for units that gets set for TUNITSn, but for keywords that do not describe column data, I have so far found no such units setting. Thanks. Regards, Charles -------------- next part -------------- An HTML attachment was scrubbed... URL: From jordan.alexander at aut.ac.nz Tue Apr 17 06:53:01 2018 From: jordan.alexander at aut.ac.nz (Jordan Alexander) Date: Tue, 17 Apr 2018 10:53:01 +0000 Subject: [AstroPy] Accessing a FITS table generates "ValueError: Inconsistent data column lengths: set([0, 27645])" Message-ID: First, thank you astropy for this outstanding package. It played an important role in the completion of my PhD; much respect :) Using python 2.7.12 & astropy 2.0.5 and following Lia R. Corrales' useful tutorial, http://www.astropy.org/astropy-tutorials/FITS-tables.html I am trying to access data stored in a FITS table, which generates ValueError: Inconsistent data column lengths: set([0, 27645])" Below are my steps and intermediate results that leads to this error... Can you please help here, astropy at python.org? P.S. I am able to access other tables in the following FITS file, just not the one I am interested in... -------- from astropy.io import fits from astropy.table import Table hdulist = fits.open('WS001H.0.bin0000.source0000.FITS') hdulist.info() Filename: WS001H.0.bin0000.source0000.FITS No. Name Ver Type Cards Dimensions Format 0 PRIMARY 1 GroupsHDU 51 () 0 Groups 0 Parameters 1 ARRAY_GEOMETRY 1 BinTableHDU 53 2R x 7C [8A, 3D, 3E, 0D, 1J, 1J, 3E] 2 SOURCE 1 BinTableHDU 89 3R x 26C [1J, 16A, 1J, 4A, 1J, 8E, 8E, 8E, 8E, 8E, 8D, 1D, 1D, 8A, 1D, 1D, 8D, 8A, 8A, 8D, 1D, 1D, 1E, 1D, 1D, 1D] 3 ANTENNA 1 BinTableHDU 52 18R x 13C [1D, 1E, 8A, 1J, 1J, 1J, 1J, 1A, 8E, 8E, 1A, 8E, 8E] 4 FREQUENCY 1 BinTableHDU 35 1R x 6C [1J, 8D, 8E, 8E, 8J, 8J] 5 INTERFEROMETER_MODEL 1 BinTableHDU 83 946R x 20C [1D, 1E, 1J, 1J, 1J, 1J, 1E, 8E, 48D, 6D, 48D, 6D, 1E, 1E, 48D, 6D, 48D, 6D, 1E, 1E] 6 CALC 1 BinTableHDU 75 5R x 11C ['1D', '1D', '1D', '1D', '1A', '2D', '1A', '1D', '1D', '1D', '1D'] 7 MODEL_COMPS 1 BinTableHDU 86 946R x 21C ['1D', '1J', '1J', '1J', '1J', '1D', '1D', '1D', '1D', '1D', '1D', '8E', '8E', '1E', '1E', '1D', '1D', '8E', '8E', '1E', '1E'] 8 UV_DATA 1 BinTableHDU 93 27645R x 13C ['1E', '1E', '1E', '1D', '1D', '1J', '1J', '1J', '1J', '1E', '32E', '0J', '4096E'] 9 PHASE-CAL 1 BinTableHDU 61 2406R x 17C [1D, 1E, 1J, 1J, 1J, 1J, 1D, 32E, 16D, 16E, 16E, 16E, 32E, 16D, 16E, 16E, 16E] 10 GAIN_CURVE 1 BinTableHDU 62 0R x 19C [1J, 1J, 1J, 8J, 8J, 8J, 8J, 8E, 48E, 48E, 8E, 8J, 8J, 8J, 8J, 8E, 48E, 48E, 8E] Table(hdulist[8].data) ValueError Traceback (most recent call last) in () 1 hdulist.info() ----> 2 Table(hdulist[8].data) /usr/local/lib/python2.7/dist-packages/astropy/table/table.pyc in __init__(self, data, masked, names, dtype, meta, copy, rows, copy_indices, **kwargs) 411 init_func(data, names, dtype, n_cols, copy) 412 --> 413 # Whatever happens above, the masked property should be set to a boolean 414 if type(self.masked) is not bool: 415 raise TypeError("masked property has not been set to True or False") /usr/local/lib/python2.7/dist-packages/astropy/table/table.pyc in _init_from_ndarray(self, data, names, dtype, n_cols, copy) 700 self._init_from_list(cols, names, dtype, n_cols, copy) 701 else: --> 702 dtype = [(name, col.dtype, col.shape[1:]) for name, col in zip(names, cols)] 703 newdata = data.view(dtype).ravel() 704 columns = self.TableColumns() /usr/local/lib/python2.7/dist-packages/astropy/table/table.pyc in _init_from_list(self, data, names, dtype, n_cols, copy) 684 self._init_from_cols(cols) 685 --> 686 def _init_from_ndarray(self, data, names, dtype, n_cols, copy): 687 """Initialize table from an ndarray structured array""" 688 /usr/local/lib/python2.7/dist-packages/astropy/table/table.pyc in _init_from_cols(self, cols) 749 .format(lengths)) 750 --> 751 # Set the table masking 752 self._set_masked_from_cols(cols) 753 ValueError: Inconsistent data column lengths: set([0, 27645]) -------------- next part -------------- An HTML attachment was scrubbed... URL: From aldcroft at head.cfa.harvard.edu Tue Apr 17 08:45:37 2018 From: aldcroft at head.cfa.harvard.edu (Aldcroft, Thomas) Date: Tue, 17 Apr 2018 08:45:37 -0400 Subject: [AstroPy] Accessing a FITS table generates "ValueError: Inconsistent data column lengths: set([0, 27645])" In-Reply-To: References: Message-ID: Hi Jordan, That particular HDU (#8) has a table with a column that has data type 0J. This the source of the problem. I see that numpy arrays can have a length with zero-width (e.g. shape=(10, 0)), so in theory astropy should be able to support this. If you can file this as an issue on GitHub that would be very helpful. In the meantime something like this might work (untested) to just skip that column: dat = hdulist[8].data names = [name for name in dat.dtype.names if name != 'col_with_0J'] cols = [dat[name] for name in names] tbl = Table(cols, names=names) - Tom On Tue, Apr 17, 2018 at 6:53 AM, Jordan Alexander < jordan.alexander at aut.ac.nz> wrote: > First, thank you astropy for this outstanding package. It played an > important role in the completion of my PhD; much respect :) > > Using python 2.7.12 & astropy 2.0.5 and following Lia R. Corrales' useful > tutorial, > > http://www.astropy.org/astropy-tutorials/FITS-tables.html > > I am trying to access data stored in a FITS table, which generates > > ValueError: Inconsistent data column lengths: set([0, 27645])" > > Below are my steps and intermediate results that leads to this error... > > Can you please help here, astropy at python.org? > > P.S. I am able to access other tables in the following FITS file, just not > the one I am interested in... > > -------- > > from astropy.io import fits > > from astropy.table import Table > > hdulist = fits.open('WS001H.0.bin0000.source0000.FITS') > > hdulist.info() > > > > Filename: WS001H.0.bin0000.source0000.FITS > No. Name Ver Type Cards Dimensions Format > 0 PRIMARY 1 GroupsHDU 51 () 0 Groups 0 Parameters > 1 ARRAY_GEOMETRY 1 BinTableHDU 53 2R x 7C [8A, 3D, 3E, 0D, 1J, 1J, 3E] > 2 SOURCE 1 BinTableHDU 89 3R x 26C [1J, 16A, 1J, 4A, 1J, 8E, 8E, 8E, 8E, 8E, 8D, 1D, 1D, 8A, 1D, 1D, 8D, 8A, 8A, 8D, 1D, 1D, 1E, 1D, 1D, 1D] > 3 ANTENNA 1 BinTableHDU 52 18R x 13C [1D, 1E, 8A, 1J, 1J, 1J, 1J, 1A, 8E, 8E, 1A, 8E, 8E] > 4 FREQUENCY 1 BinTableHDU 35 1R x 6C [1J, 8D, 8E, 8E, 8J, 8J] > 5 INTERFEROMETER_MODEL 1 BinTableHDU 83 946R x 20C [1D, 1E, 1J, 1J, 1J, 1J, 1E, 8E, 48D, 6D, 48D, 6D, 1E, 1E, 48D, 6D, 48D, 6D, 1E, 1E] > 6 CALC 1 BinTableHDU 75 5R x 11C ['1D', '1D', '1D', '1D', '1A', '2D', '1A', '1D', '1D', '1D', '1D'] > 7 MODEL_COMPS 1 BinTableHDU 86 946R x 21C ['1D', '1J', '1J', '1J', '1J', '1D', '1D', '1D', '1D', '1D', '1D', '8E', '8E', '1E', '1E', '1D', '1D', '8E', '8E', '1E', '1E'] > 8 UV_DATA 1 BinTableHDU 93 27645R x 13C ['1E', '1E', '1E', '1D', '1D', '1J', '1J', '1J', '1J', '1E', '32E', '0J', '4096E'] > 9 PHASE-CAL 1 BinTableHDU 61 2406R x 17C [1D, 1E, 1J, 1J, 1J, 1J, 1D, 32E, 16D, 16E, 16E, 16E, 32E, 16D, 16E, 16E, 16E] > 10 GAIN_CURVE 1 BinTableHDU 62 0R x 19C [1J, 1J, 1J, 8J, 8J, 8J, 8J, 8E, 48E, 48E, 8E, 8J, 8J, 8J, 8J, 8E, 48E, 48E, 8E] > > > Table(hdulist[8].data) > > > > ValueError Traceback (most recent call last) in () 1 hdulist.info()----> 2 Table(hdulist[8].data) > /usr/local/lib/python2.7/dist-packages/astropy/table/table.pyc in __init__(self, data, masked, names, dtype, meta, copy, rows, copy_indices, **kwargs) 411 init_func(data, names, dtype, n_cols, copy) 412 --> 413 # Whatever happens above, the masked property should be set to a boolean 414 if type(self.masked) is not bool: 415 raise TypeError("masked property has not been set to True or False") > /usr/local/lib/python2.7/dist-packages/astropy/table/table.pyc in _init_from_ndarray(self, data, names, dtype, n_cols, copy) 700 self._init_from_list(cols, names, dtype, n_cols, copy) 701 else:--> 702 dtype = [(name, col.dtype, col.shape[1:]) for name, col in zip(names, cols)] 703 newdata = data.view(dtype).ravel() 704 columns = self.TableColumns() > /usr/local/lib/python2.7/dist-packages/astropy/table/table.pyc in _init_from_list(self, data, names, dtype, n_cols, copy) 684 self._init_from_cols(cols) 685 --> 686 def _init_from_ndarray(self, data, names, dtype, n_cols, copy): 687 """Initialize table from an ndarray structured array""" 688 > /usr/local/lib/python2.7/dist-packages/astropy/table/table.pyc in _init_from_cols(self, cols) 749 .format(lengths)) 750 --> 751 # Set the table masking 752 self._set_masked_from_cols(cols) 753 > ValueError: Inconsistent data column lengths: set([0, 27645]) > > > _______________________________________________ > AstroPy mailing list > AstroPy at python.org > https://mail.python.org/mailman/listinfo/astropy > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From derek at astro.physik.uni-goettingen.de Tue Apr 17 09:23:24 2018 From: derek at astro.physik.uni-goettingen.de (Derek Homeier) Date: Tue, 17 Apr 2018 15:23:24 +0200 Subject: [AstroPy] Accessing a FITS table generates "ValueError: Inconsistent data column lengths: set([0, 27645])" In-Reply-To: References: Message-ID: <5E720951-0028-4A20-9F95-CA51F73CF74A@astro.physik.uni-goettingen.de> On 17. Apr 2018, at 2:45 PM, Aldcroft, Thomas wrote: > > That particular HDU (#8) has a table with a column that has data type 0J. This the source of the problem. I see that numpy arrays can have a length with zero-width (e.g. shape=(10, 0)), so in theory astropy should be able to support this. If you can file this as an issue on GitHub that would be very helpful. > I see some similar problems in this minimal example: a = np.ones(shape=(5,), dtype=[ ('X', 'f4'), ('Y', '2i2'), ('Z', '0i4')]) t1 = Table(a) t2 = Table([a[n] for n in a.dtype.names if a[n].shape[-1]>0]) Creating t1 still works for me, and I can in fact access t1[?Z?].data, but trying e.g. to print the table raises an IndexError, while t2 is safe as expected. Cheers, Derek From derek at astro.physik.uni-goettingen.de Tue Apr 17 08:52:43 2018 From: derek at astro.physik.uni-goettingen.de (Derek Homeier) Date: Tue, 17 Apr 2018 14:52:43 +0200 Subject: [AstroPy] Accessing a FITS table generates "ValueError: Inconsistent data column lengths: set([0, 27645])" In-Reply-To: References: Message-ID: On 17. Apr 2018, at 12:53 PM, Jordan Alexander wrote: > > First, thank you astropy for this outstanding package. It played an important role in the completion of my PhD; much respect :) > > Using python 2.7.12 & astropy 2.0.5 and following Lia R. Corrales' useful tutorial, > > http://www.astropy.org/astropy-tutorials/FITS-tables.html > > I am trying to access data stored in a FITS table, which generates > > ValueError: Inconsistent data column lengths: set([0, 27645])" > > Below are my steps and intermediate results that leads to this error... > > Can you please help here, astropy at python.org? > > P.S. I am able to access other tables in the following FITS file, just not the one I am interested in... > > -------- > > from astropy.io import fits > > from astropy.table import Table > > hdulist = fits.open('WS001H.0.bin0000.source0000.FITS') > > hdulist.info() > > > Filename: WS001H.0.bin0000.source0000.FITS > No. Name Ver Type Cards Dimensions Format > 0 PRIMARY 1 GroupsHDU 51 () 0 Groups 0 Parameters > 1 ARRAY_GEOMETRY 1 BinTableHDU 53 2R x 7C [8A, 3D, 3E, 0D, 1J, 1J, 3E] > 2 SOURCE 1 BinTableHDU 89 3R x 26C [1J, 16A, 1J, 4A, 1J, 8E, 8E, 8E, 8E, 8E, 8D, 1D, 1D, 8A, 1D, 1D, 8D, 8A, 8A, 8D, 1D, 1D, 1E, 1D, 1D, 1D] > 3 ANTENNA 1 BinTableHDU 52 18R x 13C [1D, 1E, 8A, 1J, 1J, 1J, 1J, 1A, 8E, 8E, 1A, 8E, 8E] > 4 FREQUENCY 1 BinTableHDU 35 1R x 6C [1J, 8D, 8E, 8E, 8J, 8J] > 5 INTERFEROMETER_MODEL 1 BinTableHDU 83 946R x 20C [1D, 1E, 1J, 1J, 1J, 1J, 1E, 8E, 48D, 6D, 48D, 6D, 1E, 1E, 48D, 6D, 48D, 6D, 1E, 1E] > 6 CALC 1 BinTableHDU 75 5R x 11C ['1D', '1D', '1D', '1D', '1A', '2D', '1A', '1D', '1D', '1D', '1D'] > 7 MODEL_COMPS 1 BinTableHDU 86 946R x 21C ['1D', '1J', '1J', '1J', '1J', '1D', '1D', '1D', '1D', '1D', '1D', '8E', '8E', '1E', '1E', '1D', '1D', '8E', '8E', '1E', '1E'] > 8 UV_DATA 1 BinTableHDU 93 27645R x 13C ['1E', '1E', '1E', '1D', '1D', '1J', '1J', '1J', '1J', '1E', '32E', '0J', '4096E'] > That?s a somewhat unusual, if not pathological, table shape in HDU 8 - column 12 has zero width, i.e. shape (0, nrow). If that?s actually allowed by the FITS standard, it might be a bug, as astropy apparently converts this into a column of length 0 (instead of a shape=(0, ), length nrow=27645 column) which then fails in initialising the table. Can you read hdulist[1].data (which has a zero width column as well)? Cheers, Derek From d.f.evans at keele.ac.uk Tue Apr 17 09:38:42 2018 From: d.f.evans at keele.ac.uk (Daniel Evans) Date: Tue, 17 Apr 2018 14:38:42 +0100 Subject: [AstroPy] Accessing a FITS table generates "ValueError: Inconsistent data column lengths: set([0, 27645])" In-Reply-To: References: Message-ID: > [...] column 12 has zero width, i.e. shape (0, nrow). If that?s actually allowed by the FITS standard >From my non-expert reading of the standard, v4 Sect. 7.3.1, it looks to be explicitly permitted: "The repeat count *r* is the ASCII representation of a non-negative integer specifying the number of elements in field n. The default value of *r* is 1; the repeat count need not be present if it has the default value. A zero element count, indicating an empty field, is permitted." Regards, Daniel On 17 April 2018 at 13:52, Derek Homeier < derek at astro.physik.uni-goettingen.de> wrote: > On 17. Apr 2018, at 12:53 PM, Jordan Alexander > wrote: > > > > First, thank you astropy for this outstanding package. It played an > important role in the completion of my PhD; much respect :) > > > > Using python 2.7.12 & astropy 2.0.5 and following Lia R. Corrales' > useful tutorial, > > > > http://www.astropy.org/astropy-tutorials/FITS-tables.html > > > > I am trying to access data stored in a FITS table, which generates > > > > ValueError: Inconsistent data column lengths: set([0, 27645])" > > > > Below are my steps and intermediate results that leads to this error... > > > > Can you please help here, astropy at python.org? > > > > P.S. I am able to access other tables in the following FITS file, just > not the one I am interested in... > > > > -------- > > > > from astropy.io import fits > > > > from astropy.table import Table > > > > hdulist = fits.open('WS001H.0.bin0000.source0000.FITS') > > > > hdulist.info() > > > > > > Filename: WS001H.0.bin0000.source0000.FITS > > No. Name Ver Type Cards Dimensions Format > > 0 PRIMARY 1 GroupsHDU 51 () 0 Groups 0 Parameters > > 1 ARRAY_GEOMETRY 1 BinTableHDU 53 2R x 7C [8A, 3D, 3E, 0D, > 1J, 1J, 3E] > > 2 SOURCE 1 BinTableHDU 89 3R x 26C [1J, 16A, 1J, 4A, > 1J, 8E, 8E, 8E, 8E, 8E, 8D, 1D, 1D, 8A, 1D, 1D, 8D, 8A, 8A, 8D, 1D, 1D, 1E, > 1D, 1D, 1D] > > 3 ANTENNA 1 BinTableHDU 52 18R x 13C [1D, 1E, 8A, 1J, > 1J, 1J, 1J, 1A, 8E, 8E, 1A, 8E, 8E] > > 4 FREQUENCY 1 BinTableHDU 35 1R x 6C [1J, 8D, 8E, 8E, 8J, > 8J] > > 5 INTERFEROMETER_MODEL 1 BinTableHDU 83 946R x 20C [1D, > 1E, 1J, 1J, 1J, 1J, 1E, 8E, 48D, 6D, 48D, 6D, 1E, 1E, 48D, 6D, 48D, 6D, 1E, > 1E] > > 6 CALC 1 BinTableHDU 75 5R x 11C ['1D', '1D', '1D', > '1D', '1A', '2D', '1A', '1D', '1D', '1D', '1D'] > > 7 MODEL_COMPS 1 BinTableHDU 86 946R x 21C ['1D', '1J', > '1J', '1J', '1J', '1D', '1D', '1D', '1D', '1D', '1D', '8E', '8E', '1E', > '1E', '1D', '1D', '8E', '8E', '1E', '1E'] > > 8 UV_DATA 1 BinTableHDU 93 27645R x 13C ['1E', '1E', > '1E', '1D', '1D', '1J', '1J', '1J', '1J', '1E', '32E', '0J', '4096E'] > > > That?s a somewhat unusual, if not pathological, table shape in HDU 8 - > column 12 has zero width, i.e. shape (0, nrow). > If that?s actually allowed by the FITS standard, it might be a bug, as > astropy apparently converts this into a column of > length 0 (instead of a shape=(0, ), length nrow=27645 column) which then > fails in initialising the table. > Can you read hdulist[1].data (which has a zero width column as well)? > > Cheers, > Derek > _______________________________________________ > AstroPy mailing list > AstroPy at python.org > https://mail.python.org/mailman/listinfo/astropy > -------------- next part -------------- An HTML attachment was scrubbed... URL: From derek at astro.physik.uni-goettingen.de Tue Apr 17 09:47:51 2018 From: derek at astro.physik.uni-goettingen.de (Derek Homeier) Date: Tue, 17 Apr 2018 15:47:51 +0200 Subject: [AstroPy] Accessing a FITS table generates "ValueError: Inconsistent data column lengths: set([0, 27645])" In-Reply-To: References: Message-ID: <7EECF512-F3E3-456F-9583-B6B08A23E446@astro.physik.uni-goettingen.de> On 17. Apr 2018, at 3:38 PM, Daniel Evans wrote: > > > [...] column 12 has zero width, i.e. shape (0, nrow). If that?s actually allowed by the FITS standard > > From my non-expert reading of the standard, v4 Sect. 7.3.1, it looks to be explicitly permitted: > > "The repeat count r is the ASCII representation of a non-negative integer specifying the number of elements in field n. The default value of r is 1; the repeat count need not be present if it has the default value. A zero element count, indicating an empty field, is permitted." > > Regards, > Daniel > > On 17 April 2018 at 13:52, Derek Homeier wrote: > On 17. Apr 2018, at 12:53 PM, Jordan Alexander wrote: > > > > First, thank you astropy for this outstanding package. It played an important role in the completion of my PhD; much respect :) > > > > Using python 2.7.12 & astropy 2.0.5 and following Lia R. Corrales' useful tutorial, > > > > http://www.astropy.org/astropy-tutorials/FITS-tables.html > > > > I am trying to access data stored in a FITS table, which generates > > > > ValueError: Inconsistent data column lengths: set([0, 27645])" Jordan, then I?d also suggest to file an issue on https://github.com/astropy/astropy/issues if you could provide an example file. I guess reading the HDU directly into a Table as dat = Table.read('WS001H.0.bin0000.source0000.FITS?, hdu=8) fails in the same way? Cheers, Derek From jordan.alexander at aut.ac.nz Tue Apr 17 15:58:28 2018 From: jordan.alexander at aut.ac.nz (Jordan Alexander) Date: Tue, 17 Apr 2018 19:58:28 +0000 Subject: [AstroPy] Accessing a FITS table generates "ValueError: Inconsistent data column lengths: set([0, 27645])" In-Reply-To: <7EECF512-F3E3-456F-9583-B6B08A23E446@astro.physik.uni-goettingen.de> References: , <7EECF512-F3E3-456F-9583-B6B08A23E446@astro.physik.uni-goettingen.de> Message-ID: > On 17 April 2018 at 13:52, Derek Homeier wrote: >Jordan, then I?d also suggest to file an issue on https://github.com/astropy/astropy/issues >if you could provide an example file. I guess reading the HDU directly into a Table as >dat = Table.read('WS001H.0.bin0000.source0000.FITS?, hdu=8) >fails in the same way? >Cheers, > Derek Thanks for responding, Derek, Daniel, and Tom. Yes, it fails in the same way, as shown below. Also, > Can you read hdulist[1].data (which has a zero width column as well)? fails in the same way, as you predicted, given the zero width column. As suggested, I will file this issue with https://github.com/astropy/astropy/issues. The FITS file in question with tables containing zero-width columns that generates this issue is ~0.5Gbytes, so will try to find a smaller-sized example file.... Will follow-up with your untested work-around, Tom... --------- Table.read("WS001H.0.bin0000.source0000.FITS", hdu=8) ValueError Traceback (most recent call last) in () 3 #Table(hdulist[1].data) 4 #Table(hdulist[8].data) ----> 5 Table.read("WS001H.0.bin0000.source0000.FITS", hdu=8) /usr/local/lib/python2.7/dist-packages/astropy/table/table.pyc in read(cls, *args, **kwargs) 2519 out = io_registry.read(cls, *args, **kwargs) 2520 # For some readers (e.g., ascii.ecsv), the returned `out` class is not -> 2521 # guaranteed to be the same as the desired output `cls`. If so, 2522 # try coercing to desired class without copying (io.registry.read 2523 # would normally do a copy). The normal case here is swapping /usr/local/lib/python2.7/dist-packages/astropy/io/registry.pyc in read(cls, *args, **kwargs) 529 530 reader = get_reader(format, cls) --> 531 data = reader(*args, **kwargs) 532 533 if not isinstance(data, cls): /usr/local/lib/python2.7/dist-packages/astropy/io/fits/connect.pyc in read_table_fits(input, hdu) 134 135 try: --> 136 return read_table_fits(hdulist, hdu=hdu) 137 finally: 138 hdulist.close() /usr/local/lib/python2.7/dist-packages/astropy/io/fits/connect.pyc in read_table_fits(input, hdu) 146 147 # Convert to an astropy.table.Table object --> 148 t = Table(table.data, masked=masked) 149 150 # Copy over null values if needed /usr/local/lib/python2.7/dist-packages/astropy/table/table.pyc in __init__(self, data, masked, names, dtype, meta, copy, rows, copy_indices, **kwargs) 411 init_func(data, names, dtype, n_cols, copy) 412 --> 413 # Whatever happens above, the masked property should be set to a boolean 414 if type(self.masked) is not bool: 415 raise TypeError("masked property has not been set to True or False") /usr/local/lib/python2.7/dist-packages/astropy/table/table.pyc in _init_from_ndarray(self, data, names, dtype, n_cols, copy) 700 self._init_from_list(cols, names, dtype, n_cols, copy) 701 else: --> 702 dtype = [(name, col.dtype, col.shape[1:]) for name, col in zip(names, cols)] 703 newdata = data.view(dtype).ravel() 704 columns = self.TableColumns() /usr/local/lib/python2.7/dist-packages/astropy/table/table.pyc in _init_from_list(self, data, names, dtype, n_cols, copy) 684 self._init_from_cols(cols) 685 --> 686 def _init_from_ndarray(self, data, names, dtype, n_cols, copy): 687 """Initialize table from an ndarray structured array""" 688 /usr/local/lib/python2.7/dist-packages/astropy/table/table.pyc in _init_from_cols(self, cols) 749 .format(lengths)) 750 --> 751 # Set the table masking 752 self._set_masked_from_cols(cols) 753 ValueError: Inconsistent data column lengths: set([0, 27645]) From derek at astro.physik.uni-goettingen.de Tue Apr 17 16:41:42 2018 From: derek at astro.physik.uni-goettingen.de (Derek Homeier) Date: Tue, 17 Apr 2018 22:41:42 +0200 Subject: [AstroPy] Accessing a FITS table generates "ValueError: Inconsistent data column lengths: set([0, 27645])" In-Reply-To: References: <7EECF512-F3E3-456F-9583-B6B08A23E446@astro.physik.uni-goettingen.de> Message-ID: <237F0C97-A1B6-4D68-86F6-990E360680D7@astro.physik.uni-goettingen.de> On 17 Apr 2018, at 9:58 pm, Jordan Alexander wrote: > >> Can you read hdulist[1].data (which has a zero width column as well)? > > fails in the same way, as you predicted, given the zero width column. > > As suggested, I will file this issue with https://github.com/astropy/astropy/issues. > > The FITS file in question with tables containing zero-width columns that generates this issue is ~0.5Gbytes, so will try to find a smaller-sized example file.... > > Will follow-up with your untested work-around, Tom... Thanks for the follow-up, Jordan! Could you make one more test and check what happens if you try tbl = Table(np.array(hdulist[1].data)) ? - hdulist[1].data is a FITS_rec, which is basically a container for a numpy record array, but I am wondering if casting it to a regular (structured) ndarray will let it proceed as far as creating the table, as it did in my tests. For the example file, you might try hdulist[:2].writeto(?ValueError.fits?) which should create a file from just the 0th and 1st HDU, sufficient to demonstrate the issue (unless it already fails along the way on the 0-dim column?). Best, Derek From jordan.alexander at aut.ac.nz Tue Apr 17 18:52:19 2018 From: jordan.alexander at aut.ac.nz (Jordan Alexander) Date: Tue, 17 Apr 2018 22:52:19 +0000 Subject: [AstroPy] Accessing a FITS table generates "ValueError: Inconsistent data column lengths: set([0, 27645])" In-Reply-To: <237F0C97-A1B6-4D68-86F6-990E360680D7@astro.physik.uni-goettingen.de> References: <7EECF512-F3E3-456F-9583-B6B08A23E446@astro.physik.uni-goettingen.de> , <237F0C97-A1B6-4D68-86F6-990E360680D7@astro.physik.uni-goettingen.de> Message-ID: >Could you make one more test and check what happens if you try >tbl = Table(np.array(hdulist[1].data)) ? Here's what happens, Derek: hdulist.info() Table(np.array(hdulist[1].data)) Filename: WS001H.0.bin0000.source0000.FITS No. Name Ver Type Cards Dimensions Format 0 PRIMARY 1 GroupsHDU 51 () 0 Groups 0 Parameters 1 ARRAY_GEOMETRY 1 BinTableHDU 53 2R x 7C ['8A', '3D', '3E', '0D', '1J', '1J', '3E'] 2 SOURCE 1 BinTableHDU 89 3R x 26C [1J, 16A, 1J, 4A, 1J, 8E, 8E, 8E, 8E, 8E, 8D, 1D, 1D, 8A, 1D, 1D, 8D, 8A, 8A, 8D, 1D, 1D, 1E, 1D, 1D, 1D] 3 ANTENNA 1 BinTableHDU 52 18R x 13C [1D, 1E, 8A, 1J, 1J, 1J, 1J, 1A, 8E, 8E, 1A, 8E, 8E] 4 FREQUENCY 1 BinTableHDU 35 1R x 6C [1J, 8D, 8E, 8E, 8J, 8J] 5 INTERFEROMETER_MODEL 1 BinTableHDU 83 946R x 20C [1D, 1E, 1J, 1J, 1J, 1J, 1E, 8E, 48D, 6D, 48D, 6D, 1E, 1E, 48D, 6D, 48D, 6D, 1E, 1E] 6 CALC 1 BinTableHDU 75 5R x 11C [1D, 1D, 1D, 1D, 1A, 2D, 1A, 1D, 1D, 1D, 1D] 7 MODEL_COMPS 1 BinTableHDU 86 946R x 21C [1D, 1J, 1J, 1J, 1J, 1D, 1D, 1D, 1D, 1D, 1D, 8E, 8E, 1E, 1E, 1D, 1D, 8E, 8E, 1E, 1E] 8 UV_DATA 1 BinTableHDU 93 27645R x 13C [1E, 1E, 1E, 1D, 1D, 1J, 1J, 1J, 1J, 1E, 32E, 0J, 4096E] 9 PHASE-CAL 1 BinTableHDU 61 2406R x 17C [1D, 1E, 1J, 1J, 1J, 1J, 1D, 32E, 16D, 16E, 16E, 16E, 32E, 16D, 16E, 16E, 16E] 10 GAIN_CURVE 1 BinTableHDU 62 0R x 19C [1J, 1J, 1J, 8J, 8J, 8J, 8J, 8E, 48E, 48E, 8E, 8J, 8J, 8J, 8J, 8E, 48E, 48E, 8E] --------------------------------------------------------------------------- IndexError Traceback (most recent call last) /usr/local/lib/python2.7/dist-packages/IPython/core/formatters.pyc in __call__(self, obj) 697 type_pprinters=self.type_printers, 698 deferred_pprinters=self.deferred_printers) --> 699 printer.pretty(obj) 700 printer.flush() 701 return stream.getvalue() /usr/local/lib/python2.7/dist-packages/IPython/lib/pretty.pyc in pretty(self, obj) 401 if cls is not object \ 402 and callable(cls.__dict__.get('__repr__')): --> 403 return _repr_pprint(obj, self, cycle) 404 405 return _default_pprint(obj, self, cycle) /usr/local/lib/python2.7/dist-packages/IPython/lib/pretty.pyc in _repr_pprint(obj, p, cycle) 701 """A pprint that just redirects to the normal repr function.""" 702 # Find newlines and replace them with p.break_() --> 703 output = repr(obj) 704 for idx,output_line in enumerate(output.splitlines()): 705 if idx: /usr/local/lib/python2.7/dist-packages/astropy/table/table.pyc in __repr__(self) 873 return self._base_repr_(html=False, max_width=None) 874 --> 875 def __unicode__(self): 876 return '\n'.join(self.pformat()) 877 if not six.PY2: /usr/local/lib/python2.7/dist-packages/astropy/table/table.pyc in _base_repr_(self, html, descr_vals, max_width, tableid, show_dtype, max_lines, tableclass) 860 max_lines=max_lines, tableclass=tableclass) 861 --> 862 out = descr + '\n'.join(data_lines) 863 if six.PY2 and isinstance(out, six.text_type): 864 out = out.encode('utf-8') /usr/local/lib/python2.7/dist-packages/astropy/table/pprint.pyc in _pformat_table(self, table, max_lines, max_width, show_name, show_unit, show_dtype, html, tableid, tableclass, align) 539 540 if not cols: --> 541 return [''], {'show_length': False} 542 543 # Use the values for the last column since they are all the same /usr/local/lib/python2.7/dist-packages/astropy/table/pprint.pyc in _pformat_col(self, col, max_lines, show_name, show_unit, show_dtype, show_length, html, align) 252 253 if html: --> 254 from ..utils.xml.writer import xml_escape 255 n_header = outs['n_header'] 256 for i, col_str in enumerate(col_strs): /usr/local/lib/python2.7/dist-packages/astropy/table/pprint.pyc in _pformat_col_iter(self, col, max_lines, show_name, show_unit, outs, show_dtype, show_length) 450 yield col_str 451 --> 452 outs['show_length'] = show_length 453 outs['n_header'] = n_header 454 outs['i_centers'] = i_centers astropy/table/_column_mixins.pyx in astropy.table._column_mixins._ColumnGetitemShim.__getitem__() astropy/table/_column_mixins.pyx in astropy.table._column_mixins.base_getitem() astropy/table/_column_mixins.pyx in astropy.table._column_mixins.column_getitem() IndexError: index 0 is out of bounds for axis 1 with size 0 --------------------------------------------------------------------------- IndexError Traceback (most recent call last) /usr/local/lib/python2.7/dist-packages/IPython/core/formatters.pyc in __call__(self, obj) 336 method = get_real_method(obj, self.print_method) 337 if method is not None: --> 338 return method() 339 return None 340 else: /usr/local/lib/python2.7/dist-packages/astropy/table/table.pyc in _repr_html_(self) 870 tableclass=conf.default_notebook_table_class) 871 --> 872 def __repr__(self): 873 return self._base_repr_(html=False, max_width=None) 874 /usr/local/lib/python2.7/dist-packages/astropy/table/table.pyc in _base_repr_(self, html, descr_vals, max_width, tableid, show_dtype, max_lines, tableclass) 860 max_lines=max_lines, tableclass=tableclass) 861 --> 862 out = descr + '\n'.join(data_lines) 863 if six.PY2 and isinstance(out, six.text_type): 864 out = out.encode('utf-8') /usr/local/lib/python2.7/dist-packages/astropy/table/pprint.pyc in _pformat_table(self, table, max_lines, max_width, show_name, show_unit, show_dtype, html, tableid, tableclass, align) 539 540 if not cols: --> 541 return [''], {'show_length': False} 542 543 # Use the values for the last column since they are all the same /usr/local/lib/python2.7/dist-packages/astropy/table/pprint.pyc in _pformat_col(self, col, max_lines, show_name, show_unit, show_dtype, show_length, html, align) 252 253 if html: --> 254 from ..utils.xml.writer import xml_escape 255 n_header = outs['n_header'] 256 for i, col_str in enumerate(col_strs): /usr/local/lib/python2.7/dist-packages/astropy/table/pprint.pyc in _pformat_col_iter(self, col, max_lines, show_name, show_unit, outs, show_dtype, show_length) 450 yield col_str 451 --> 452 outs['show_length'] = show_length 453 outs['n_header'] = n_header 454 outs['i_centers'] = i_centers astropy/table/_column_mixins.pyx in astropy.table._column_mixins._ColumnGetitemShim.__getitem__() astropy/table/_column_mixins.pyx in astropy.table._column_mixins.base_getitem() astropy/table/_column_mixins.pyx in astropy.table._column_mixins.column_getitem() IndexError: index 0 is out of bounds for axis 1 with size 0 ________________________________________ From: AstroPy [astropy-bounces+jordan.alexander=aut.ac.nz at python.org] on behalf of Derek Homeier [derek at astro.physik.uni-goettingen.de] Sent: 18 April 2018 08:41 To: Astronomical Python mailing list Subject: Re: [AstroPy] Accessing a FITS table generates "ValueError: Inconsistent data column lengths: set([0, 27645])" On 17 Apr 2018, at 9:58 pm, Jordan Alexander wrote: > >> Can you read hdulist[1].data (which has a zero width column as well)? > > fails in the same way, as you predicted, given the zero width column. > > As suggested, I will file this issue with https://github.com/astropy/astropy/issues. > > The FITS file in question with tables containing zero-width columns that generates this issue is ~0.5Gbytes, so will try to find a smaller-sized example file.... > > Will follow-up with your untested work-around, Tom... Thanks for the follow-up, Jordan! Could you make one more test and check what happens if you try tbl = Table(np.array(hdulist[1].data)) ? - hdulist[1].data is a FITS_rec, which is basically a container for a numpy record array, but I am wondering if casting it to a regular (structured) ndarray will let it proceed as far as creating the table, as it did in my tests. For the example file, you might try hdulist[:2].writeto(?ValueError.fits?) which should create a file from just the 0th and 1st HDU, sufficient to demonstrate the issue (unless it already fails along the way on the 0-dim column?). Best, Derek _______________________________________________ AstroPy mailing list AstroPy at python.org https://mail.python.org/mailman/listinfo/astropy From jordan.alexander at aut.ac.nz Tue Apr 17 18:59:11 2018 From: jordan.alexander at aut.ac.nz (Jordan Alexander) Date: Tue, 17 Apr 2018 22:59:11 +0000 Subject: [AstroPy] Accessing a FITS table generates "ValueError: Inconsistent data column lengths: set([0, 27645])" In-Reply-To: References: , Message-ID: Your "tested" work-around, Tom: hdulist.info() dat = hdulist[8].data names = [name for name in dat.dtype.names if name != 'col_with_0J'] cols = [dat[name] for name in names] tbl = Table(cols, names=names) Filename: WS001H.0.bin0000.source0000.FITS No. Name Ver Type Cards Dimensions Format 0 PRIMARY 1 GroupsHDU 51 () 0 Groups 0 Parameters 1 ARRAY_GEOMETRY 1 BinTableHDU 53 2R x 7C ['8A', '3D', '3E', '0D', '1J', '1J', '3E'] 2 SOURCE 1 BinTableHDU 89 3R x 26C [1J, 16A, 1J, 4A, 1J, 8E, 8E, 8E, 8E, 8E, 8D, 1D, 1D, 8A, 1D, 1D, 8D, 8A, 8A, 8D, 1D, 1D, 1E, 1D, 1D, 1D] 3 ANTENNA 1 BinTableHDU 52 18R x 13C [1D, 1E, 8A, 1J, 1J, 1J, 1J, 1A, 8E, 8E, 1A, 8E, 8E] 4 FREQUENCY 1 BinTableHDU 35 1R x 6C [1J, 8D, 8E, 8E, 8J, 8J] 5 INTERFEROMETER_MODEL 1 BinTableHDU 83 946R x 20C [1D, 1E, 1J, 1J, 1J, 1J, 1E, 8E, 48D, 6D, 48D, 6D, 1E, 1E, 48D, 6D, 48D, 6D, 1E, 1E] 6 CALC 1 BinTableHDU 75 5R x 11C [1D, 1D, 1D, 1D, 1A, 2D, 1A, 1D, 1D, 1D, 1D] 7 MODEL_COMPS 1 BinTableHDU 86 946R x 21C [1D, 1J, 1J, 1J, 1J, 1D, 1D, 1D, 1D, 1D, 1D, 8E, 8E, 1E, 1E, 1D, 1D, 8E, 8E, 1E, 1E] 8 UV_DATA 1 BinTableHDU 93 27645R x 13C [1E, 1E, 1E, 1D, 1D, 1J, 1J, 1J, 1J, 1E, 32E, 0J, 4096E] 9 PHASE-CAL 1 BinTableHDU 61 2406R x 17C [1D, 1E, 1J, 1J, 1J, 1J, 1D, 32E, 16D, 16E, 16E, 16E, 32E, 16D, 16E, 16E, 16E] 10 GAIN_CURVE 1 BinTableHDU 62 0R x 19C [1J, 1J, 1J, 8J, 8J, 8J, 8J, 8E, 48E, 48E, 8E, 8J, 8J, 8J, 8J, 8E, 48E, 48E, 8E] --------------------------------------------------------------------------- ValueError Traceback (most recent call last) in () 9 cols = [dat[name] for name in names] 10 ---> 11 tbl = Table(cols, names=names) /usr/local/lib/python2.7/dist-packages/astropy/table/table.pyc in __init__(self, data, masked, names, dtype, meta, copy, rows, copy_indices, **kwargs) 411 init_func(data, names, dtype, n_cols, copy) 412 --> 413 # Whatever happens above, the masked property should be set to a boolean 414 if type(self.masked) is not bool: 415 raise TypeError("masked property has not been set to True or False") /usr/local/lib/python2.7/dist-packages/astropy/table/table.pyc in _init_from_list(self, data, names, dtype, n_cols, copy) 684 self._init_from_cols(cols) 685 --> 686 def _init_from_ndarray(self, data, names, dtype, n_cols, copy): 687 """Initialize table from an ndarray structured array""" 688 /usr/local/lib/python2.7/dist-packages/astropy/table/table.pyc in _init_from_cols(self, cols) 749 .format(lengths)) 750 --> 751 # Set the table masking 752 self._set_masked_from_cols(cols) 753 ValueError: Inconsistent data column lengths: set([0, 27645]) ________________________________ From: AstroPy [astropy-bounces+jordan.alexander=aut.ac.nz at python.org] on behalf of Aldcroft, Thomas [aldcroft at head.cfa.harvard.edu] Sent: 18 April 2018 00:45 To: Astronomical Python mailing list Subject: Re: [AstroPy] Accessing a FITS table generates "ValueError: Inconsistent data column lengths: set([0, 27645])" Hi Jordan, That particular HDU (#8) has a table with a column that has data type 0J. This the source of the problem. I see that numpy arrays can have a length with zero-width (e.g. shape=(10, 0)), so in theory astropy should be able to support this. If you can file this as an issue on GitHub that would be very helpful. In the meantime something like this might work (untested) to just skip that column: dat = hdulist[8].data names = [name for name in dat.dtype.names if name != 'col_with_0J'] cols = [dat[name] for name in names] tbl = Table(cols, names=names) - Tom On Tue, Apr 17, 2018 at 6:53 AM, Jordan Alexander > wrote: First, thank you astropy for this outstanding package. It played an important role in the completion of my PhD; much respect :) Using python 2.7.12 & astropy 2.0.5 and following Lia R. Corrales' useful tutorial, http://www.astropy.org/astropy-tutorials/FITS-tables.html I am trying to access data stored in a FITS table, which generates ValueError: Inconsistent data column lengths: set([0, 27645])" Below are my steps and intermediate results that leads to this error... Can you please help here, astropy at python.org? P.S. I am able to access other tables in the following FITS file, just not the one I am interested in... -------- from astropy.io import fits from astropy.table import Table hdulist = fits.open('WS001H.0.bin0000.source0000.FITS') hdulist.info() Filename: WS001H.0.bin0000.source0000.FITS No. Name Ver Type Cards Dimensions Format 0 PRIMARY 1 GroupsHDU 51 () 0 Groups 0 Parameters 1 ARRAY_GEOMETRY 1 BinTableHDU 53 2R x 7C [8A, 3D, 3E, 0D, 1J, 1J, 3E] 2 SOURCE 1 BinTableHDU 89 3R x 26C [1J, 16A, 1J, 4A, 1J, 8E, 8E, 8E, 8E, 8E, 8D, 1D, 1D, 8A, 1D, 1D, 8D, 8A, 8A, 8D, 1D, 1D, 1E, 1D, 1D, 1D] 3 ANTENNA 1 BinTableHDU 52 18R x 13C [1D, 1E, 8A, 1J, 1J, 1J, 1J, 1A, 8E, 8E, 1A, 8E, 8E] 4 FREQUENCY 1 BinTableHDU 35 1R x 6C [1J, 8D, 8E, 8E, 8J, 8J] 5 INTERFEROMETER_MODEL 1 BinTableHDU 83 946R x 20C [1D, 1E, 1J, 1J, 1J, 1J, 1E, 8E, 48D, 6D, 48D, 6D, 1E, 1E, 48D, 6D, 48D, 6D, 1E, 1E] 6 CALC 1 BinTableHDU 75 5R x 11C ['1D', '1D', '1D', '1D', '1A', '2D', '1A', '1D', '1D', '1D', '1D'] 7 MODEL_COMPS 1 BinTableHDU 86 946R x 21C ['1D', '1J', '1J', '1J', '1J', '1D', '1D', '1D', '1D', '1D', '1D', '8E', '8E', '1E', '1E', '1D', '1D', '8E', '8E', '1E', '1E'] 8 UV_DATA 1 BinTableHDU 93 27645R x 13C ['1E', '1E', '1E', '1D', '1D', '1J', '1J', '1J', '1J', '1E', '32E', '0J', '4096E'] 9 PHASE-CAL 1 BinTableHDU 61 2406R x 17C [1D, 1E, 1J, 1J, 1J, 1J, 1D, 32E, 16D, 16E, 16E, 16E, 32E, 16D, 16E, 16E, 16E] 10 GAIN_CURVE 1 BinTableHDU 62 0R x 19C [1J, 1J, 1J, 8J, 8J, 8J, 8J, 8E, 48E, 48E, 8E, 8J, 8J, 8J, 8J, 8E, 48E, 48E, 8E] Table(hdulist[8].data) ValueError Traceback (most recent call last) in () 1 hdulist.info() ----> 2 Table(hdulist[8].data) /usr/local/lib/python2.7/dist-packages/astropy/table/table.pyc in __init__(self, data, masked, names, dtype, meta, copy, rows, copy_indices, **kwargs) 411 init_func(data, names, dtype, n_cols, copy) 412 --> 413 # Whatever happens above, the masked property should be set to a boolean 414 if type(self.masked) is not bool: 415 raise TypeError("masked property has not been set to True or False") /usr/local/lib/python2.7/dist-packages/astropy/table/table.pyc in _init_from_ndarray(self, data, names, dtype, n_cols, copy) 700 self._init_from_list(cols, names, dtype, n_cols, copy) 701 else: --> 702 dtype = [(name, col.dtype, col.shape[1:]) for name, col in zip(names, cols)] 703 newdata = data.view(dtype).ravel() 704 columns = self.TableColumns() /usr/local/lib/python2.7/dist-packages/astropy/table/table.pyc in _init_from_list(self, data, names, dtype, n_cols, copy) 684 self._init_from_cols(cols) 685 --> 686 def _init_from_ndarray(self, data, names, dtype, n_cols, copy): 687 """Initialize table from an ndarray structured array""" 688 /usr/local/lib/python2.7/dist-packages/astropy/table/table.pyc in _init_from_cols(self, cols) 749 .format(lengths)) 750 --> 751 # Set the table masking 752 self._set_masked_from_cols(cols) 753 ValueError: Inconsistent data column lengths: set([0, 27645]) _______________________________________________ AstroPy mailing list AstroPy at python.org https://mail.python.org/mailman/listinfo/astropy -------------- next part -------------- An HTML attachment was scrubbed... URL: From derek at astro.physik.uni-goettingen.de Tue Apr 17 19:18:04 2018 From: derek at astro.physik.uni-goettingen.de (Derek Homeier) Date: Wed, 18 Apr 2018 01:18:04 +0200 Subject: [AstroPy] Accessing a FITS table generates "ValueError: Inconsistent data column lengths: set([0, 27645])" In-Reply-To: References: Message-ID: <93017807-B186-4CCA-B8A7-58AA76326647@astro.physik.uni-goettingen.de> On 18 Apr 2018, at 12:59 am, Jordan Alexander wrote: > > Your "tested" work-around, Tom: > > hdulist.info() > dat = hdulist[8].data > names = [name for name in dat.dtype.names if name != 'col_with_0J'] > cols = [dat[name] for name in names] > tbl = Table(cols, names=names) ?col_with_0J? was meant to be the actual column name of the 0-width column (#12). names = [name for name in dat.dtype.names if dat[name].shape[-1] > 0] should automatically filter the 0-shaped columns out. Cheers, Derek From jordan.alexander at aut.ac.nz Tue Apr 17 19:46:28 2018 From: jordan.alexander at aut.ac.nz (Jordan Alexander) Date: Tue, 17 Apr 2018 23:46:28 +0000 Subject: [AstroPy] Accessing a FITS table generates "ValueError: Inconsistent data column lengths: set([0, 27645])" In-Reply-To: <93017807-B186-4CCA-B8A7-58AA76326647@astro.physik.uni-goettingen.de> References: , <93017807-B186-4CCA-B8A7-58AA76326647@astro.physik.uni-goettingen.de> Message-ID: Tom's suggested work-around saves the day, thank you folks! After Derek pointed out my mistake :) hdulist.info() dat = hdulist[8].data dat.dtype.names names = [name for name in dat.dtype.names if name != 'GATEID'] cols = [dat[name] for name in names] tbl = Table(cols, names=names) print names tbl Filename: WS001H.0.bin0000.source0000.FITS No. Name Ver Type Cards Dimensions Format 0 PRIMARY 1 GroupsHDU 51 () 0 Groups 0 Parameters 1 ARRAY_GEOMETRY 1 BinTableHDU 53 2R x 7C ['8A', '3D', '3E', '0D', '1J', '1J', '3E'] 2 SOURCE 1 BinTableHDU 89 3R x 26C [1J, 16A, 1J, 4A, 1J, 8E, 8E, 8E, 8E, 8E, 8D, 1D, 1D, 8A, 1D, 1D, 8D, 8A, 8A, 8D, 1D, 1D, 1E, 1D, 1D, 1D] 3 ANTENNA 1 BinTableHDU 52 18R x 13C [1D, 1E, 8A, 1J, 1J, 1J, 1J, 1A, 8E, 8E, 1A, 8E, 8E] 4 FREQUENCY 1 BinTableHDU 35 1R x 6C [1J, 8D, 8E, 8E, 8J, 8J] 5 INTERFEROMETER_MODEL 1 BinTableHDU 83 946R x 20C [1D, 1E, 1J, 1J, 1J, 1J, 1E, 8E, 48D, 6D, 48D, 6D, 1E, 1E, 48D, 6D, 48D, 6D, 1E, 1E] 6 CALC 1 BinTableHDU 75 5R x 11C [1D, 1D, 1D, 1D, 1A, 2D, 1A, 1D, 1D, 1D, 1D] 7 MODEL_COMPS 1 BinTableHDU 86 946R x 21C [1D, 1J, 1J, 1J, 1J, 1D, 1D, 1D, 1D, 1D, 1D, 8E, 8E, 1E, 1E, 1D, 1D, 8E, 8E, 1E, 1E] 8 UV_DATA 1 BinTableHDU 93 27645R x 13C ['1E', '1E', '1E', '1D', '1D', '1J', '1J', '1J', '1J', '1E', '32E', '0J', '4096E'] 9 PHASE-CAL 1 BinTableHDU 61 2406R x 17C [1D, 1E, 1J, 1J, 1J, 1J, 1D, 32E, 16D, 16E, 16E, 16E, 32E, 16D, 16E, 16E, 16E] 10 GAIN_CURVE 1 BinTableHDU 62 0R x 19C [1J, 1J, 1J, 8J, 8J, 8J, 8J, 8E, 48E, 48E, 8E, 8J, 8J, 8J, 8J, 8E, 48E, 48E, 8E] ('UU---SIN', 'VV---SIN', 'WW---SIN', 'DATE', 'TIME', 'BASELINE', 'FILTER', 'SOURCE', 'FREQID', 'INTTIM', 'WEIGHT', 'GATEID', 'FLUX') ['UU---SIN', 'VV---SIN', 'WW---SIN', 'DATE', 'TIME', 'BASELINE', 'FILTER', 'SOURCE', 'FREQID', 'INTTIM', 'WEIGHT', 'FLUX'] UU---SIN VV---SIN WW---SIN DATE TIME BASELINE FILTER SOURCE FREQID INTTIM WEIGHT [32] FLUX [4096] float32 float32 float32 float64 float64 int32 int32 int32 int32 float32 float32 float32 -3.5595775e-07 4.8471287e-07 -1.3040803e-07 2458150.5 0.46869212962962964 258 0 1 1 4.0 0.498897 .. 0.498897 -0.00053550233 .. 0.0001868349 0.0 0.0 0.0 2458150.5 0.46869212962962964 257 0 1 1 4.0 0.498897 .. 0.498897 0.12680201 .. -0.00014993937 0.0 0.0 0.0 2458150.5 0.46869212962962964 514 0 1 1 4.0 0.498898 .. 0.498898 0.13645686 .. -4.7759924e-05 -3.559708e-07 4.8473083e-07 -1.3030568e-07 2458150.5 0.4687384259259259 258 0 1 1 4.0 1.0 .. 1.0 0.00012936759 .. 0.00020031894 0.0 0.0 0.0 2458150.5 0.4687384259259259 257 0 1 1 4.0 1.0 .. 1.0 0.25439927 .. -0.00019075086 0.0 0.0 0.0 2458150.5 0.4687384259259259 514 0 1 1 4.0 1.0 .. 1.0 0.27794644 .. -0.000108667715 -3.5598381e-07 4.8474874e-07 -1.302033e-07 2458150.5 0.4687847222222222 258 0 1 1 4.0 1.0 .. 1.0 -7.832311e-05 .. 0.00019760148 0.0 0.0 0.0 2458150.5 0.4687847222222222 257 0 1 1 4.0 1.0 .. 1.0 0.25515017 .. 3.8746617e-05 0.0 0.0 0.0 2458150.5 0.4687847222222222 514 0 1 1 4.0 1.0 .. 1.0 0.27692768 .. -8.5447784e-05 -3.559968e-07 4.847667e-07 -1.3010094e-07 2458150.5 0.4688310185185185 258 0 1 1 4.0 1.0 .. 1.0 0.00023608183 .. 0.00012750328 ... ... ... ... ... ... ... ... ... ... ... ... 0.0 0.0 0.0 2458150.5 0.9504282407407407 257 0 3 1 4.0 1.0 .. 1.0 0.25559133 .. 9.5562056e-05 0.0 0.0 0.0 2458150.5 0.9504282407407407 514 0 3 1 4.0 1.0 .. 1.0 0.27768683 .. 9.952805e-05 -1.2753328e-07 5.2233025e-07 -2.9934213e-07 2458150.5 0.950474537037037 258 0 3 1 4.0 1.0 .. 1.0 0.0016913593 .. 5.9099006e-05 0.0 0.0 0.0 2458150.5 0.950474537037037 257 0 3 1 4.0 1.0 .. 1.0 0.25483266 .. -1.5832578e-05 0.0 0.0 0.0 2458150.5 0.950474537037037 514 0 3 1 4.0 1.0 .. 1.0 0.27675447 .. 6.571587e-05 -1.2743546e-07 5.223637e-07 -2.9932542e-07 2458150.5 0.9505208333333334 258 0 3 1 4.0 1.0 .. 1.0 0.00025846672 .. -0.0002902149 0.0 0.0 0.0 2458150.5 0.9505208333333334 257 0 3 1 4.0 1.0 .. 1.0 0.255608 .. -0.0001676612 0.0 0.0 0.0 2458150.5 0.9505208333333334 514 0 3 1 4.0 1.0 .. 1.0 0.27796867 .. 0.00022455976 -1.2733761e-07 5.223971e-07 -2.993087e-07 2458150.5 0.9505671296296296 258 0 3 1 4.0 1.0 .. 1.0 -0.00098487 .. 8.03614e-05 0.0 0.0 0.0 2458150.5 0.9505671296296296 257 0 3 1 4.0 1.0 .. 1.0 0.25570583 .. -5.7318623e-05 ________________________________________ From: AstroPy [astropy-bounces+jordan.alexander=aut.ac.nz at python.org] on behalf of Derek Homeier [derek at astro.physik.uni-goettingen.de] Sent: 18 April 2018 11:18 To: Astronomical Python mailing list Subject: Re: [AstroPy] Accessing a FITS table generates "ValueError: Inconsistent data column lengths: set([0, 27645])" On 18 Apr 2018, at 12:59 am, Jordan Alexander wrote: > > Your "tested" work-around, Tom: > > hdulist.info() > dat = hdulist[8].data > names = [name for name in dat.dtype.names if name != 'col_with_0J'] > cols = [dat[name] for name in names] > tbl = Table(cols, names=names) ?col_with_0J? was meant to be the actual column name of the 0-width column (#12). names = [name for name in dat.dtype.names if dat[name].shape[-1] > 0] should automatically filter the 0-shaped columns out. Cheers, Derek _______________________________________________ AstroPy mailing list AstroPy at python.org https://mail.python.org/mailman/listinfo/astropy From jordan.alexander at aut.ac.nz Wed Apr 18 02:59:24 2018 From: jordan.alexander at aut.ac.nz (Jordan Alexander) Date: Wed, 18 Apr 2018 06:59:24 +0000 Subject: [AstroPy] Accessing a FITS table generates "ValueError: Inconsistent data column lengths: set([0, 27645])" In-Reply-To: References: , <93017807-B186-4CCA-B8A7-58AA76326647@astro.physik.uni-goettingen.de>, Message-ID: Hello Team, As suggested, I posted this issue on https://github.com/astropy/astropy/issues as #7386 Accessing a FITS table with a zero-width column generates "ValueError: Inconsistent data column lengths: set([0, 27645])" Thanks, again, for all your help; I am off and running! ________________________________________ From: AstroPy [astropy-bounces+jordan.alexander=aut.ac.nz at python.org] on behalf of Jordan Alexander [jordan.alexander at aut.ac.nz] Sent: 18 April 2018 11:46 To: Astronomical Python mailing list Subject: Re: [AstroPy] Accessing a FITS table generates "ValueError: Inconsistent data column lengths: set([0, 27645])" Tom's suggested work-around saves the day, thank you folks! After Derek pointed out my mistake :) hdulist.info() dat = hdulist[8].data dat.dtype.names names = [name for name in dat.dtype.names if name != 'GATEID'] cols = [dat[name] for name in names] tbl = Table(cols, names=names) print names tbl Filename: WS001H.0.bin0000.source0000.FITS No. Name Ver Type Cards Dimensions Format 0 PRIMARY 1 GroupsHDU 51 () 0 Groups 0 Parameters 1 ARRAY_GEOMETRY 1 BinTableHDU 53 2R x 7C ['8A', '3D', '3E', '0D', '1J', '1J', '3E'] 2 SOURCE 1 BinTableHDU 89 3R x 26C [1J, 16A, 1J, 4A, 1J, 8E, 8E, 8E, 8E, 8E, 8D, 1D, 1D, 8A, 1D, 1D, 8D, 8A, 8A, 8D, 1D, 1D, 1E, 1D, 1D, 1D] 3 ANTENNA 1 BinTableHDU 52 18R x 13C [1D, 1E, 8A, 1J, 1J, 1J, 1J, 1A, 8E, 8E, 1A, 8E, 8E] 4 FREQUENCY 1 BinTableHDU 35 1R x 6C [1J, 8D, 8E, 8E, 8J, 8J] 5 INTERFEROMETER_MODEL 1 BinTableHDU 83 946R x 20C [1D, 1E, 1J, 1J, 1J, 1J, 1E, 8E, 48D, 6D, 48D, 6D, 1E, 1E, 48D, 6D, 48D, 6D, 1E, 1E] 6 CALC 1 BinTableHDU 75 5R x 11C [1D, 1D, 1D, 1D, 1A, 2D, 1A, 1D, 1D, 1D, 1D] 7 MODEL_COMPS 1 BinTableHDU 86 946R x 21C [1D, 1J, 1J, 1J, 1J, 1D, 1D, 1D, 1D, 1D, 1D, 8E, 8E, 1E, 1E, 1D, 1D, 8E, 8E, 1E, 1E] 8 UV_DATA 1 BinTableHDU 93 27645R x 13C ['1E', '1E', '1E', '1D', '1D', '1J', '1J', '1J', '1J', '1E', '32E', '0J', '4096E'] 9 PHASE-CAL 1 BinTableHDU 61 2406R x 17C [1D, 1E, 1J, 1J, 1J, 1J, 1D, 32E, 16D, 16E, 16E, 16E, 32E, 16D, 16E, 16E, 16E] 10 GAIN_CURVE 1 BinTableHDU 62 0R x 19C [1J, 1J, 1J, 8J, 8J, 8J, 8J, 8E, 48E, 48E, 8E, 8J, 8J, 8J, 8J, 8E, 48E, 48E, 8E] ('UU---SIN', 'VV---SIN', 'WW---SIN', 'DATE', 'TIME', 'BASELINE', 'FILTER', 'SOURCE', 'FREQID', 'INTTIM', 'WEIGHT', 'GATEID', 'FLUX') ['UU---SIN', 'VV---SIN', 'WW---SIN', 'DATE', 'TIME', 'BASELINE', 'FILTER', 'SOURCE', 'FREQID', 'INTTIM', 'WEIGHT', 'FLUX']
UU---SIN VV---SIN WW---SIN DATE TIME BASELINE FILTER SOURCE FREQID INTTIM WEIGHT [32] FLUX [4096] float32 float32 float32 float64 float64 int32 int32 int32 int32 float32 float32 float32 -3.5595775e-07 4.8471287e-07 -1.3040803e-07 2458150.5 0.46869212962962964 258 0 1 1 4.0 0.498897 .. 0.498897 -0.00053550233 .. 0.0001868349 0.0 0.0 0.0 2458150.5 0.46869212962962964 257 0 1 1 4.0 0.498897 .. 0.498897 0.12680201 .. -0.00014993937 0.0 0.0 0.0 2458150.5 0.46869212962962964 514 0 1 1 4.0 0.498898 .. 0.498898 0.13645686 .. -4.7759924e-05 -3.559708e-07 4.8473083e-07 -1.3030568e-07 2458150.5 0.4687384259259259 258 0 1 1 4.0 1.0 .. 1.0 0.00012936759 .. 0.00020031894 0.0 0.0 0.0 2458150.5 0.4687384259259259 257 0 1 1 4.0 1.0 .. 1.0 0.25439927 .. -0.00019075086 0.0 0.0 0.0 2458150.5 0.4687384259259259 514 0 1 1 4.0 1.0 .. 1.0 0.27794644 .. -0.000108667715 -3.5598381e-07 4.8474874e-07 -1.302033e-07 2458150.5 0.4687847222222222 258 0 1 1 4.0 1.0 .. 1.0 -7.832311e-05 .. 0.00019760148 0.0 0.0 0.0 2458150.5 0.4687847222222222 257 0 1 1 4.0 1.0 .. 1.0 0.25515017 .. 3.8746617e-05 0.0 0.0 0.0 2458150.5 0.4687847222222222 514 0 1 1 4.0 1.0 .. 1.0 0.27692768 .. -8.5447784e-05 -3.559968e-07 4.847667e-07 -1.3010094e-07 2458150.5 0.4688310185185185 258 0 1 1 4.0 1.0 .. 1.0 0.00023608183 .. 0.00012750328 ... ... ... ... ... ... ... ... ... ... ... ... 0.0 0.0 0.0 2458150.5 0.9504282407407407 257 0 3 1 4.0 1.0 .. 1.0 0.25559133 .. 9.5562056e-05 0.0 0.0 0.0 2458150.5 0.9504282407407407 514 0 3 1 4.0 1.0 .. 1.0 0.27768683 .. 9.952805e-05 -1.2753328e-07 5.2233025e-07 -2.9934213e-07 2458150.5 0.950474537037037 258 0 3 1 4.0 1.0 .. 1.0 0.0016913593 .. 5.9099006e-05 0.0 0.0 0.0 2458150.5 0.950474537037037 257 0 3 1 4.0 1.0 .. 1.0 0.25483266 .. -1.5832578e-05 0.0 0.0 0.0 2458150.5 0.950474537037037 514 0 3 1 4.0 1.0 .. 1.0 0.27675447 .. 6.571587e-05 -1.2743546e-07 5.223637e-07 -2.9932542e-07 2458150.5 0.9505208333333334 258 0 3 1 4.0 1.0 .. 1.0 0.00025846672 .. -0.0002902149 0.0 0.0 0.0 2458150.5 0.9505208333333334 257 0 3 1 4.0 1.0 .. 1.0 0.255608 .. -0.0001676612 0.0 0.0 0.0 2458150.5 0.9505208333333334 514 0 3 1 4.0 1.0 .. 1.0 0.27796867 .. 0.00022455976 -1.2733761e-07 5.223971e-07 -2.993087e-07 2458150.5 0.9505671296296296 258 0 3 1 4.0 1.0 .. 1.0 -0.00098487 .. 8.03614e-05 0.0 0.0 0.0 2458150.5 0.9505671296296296 257 0 3 1 4.0 1.0 .. 1.0 0.25570583 .. -5.7318623e-05 ________________________________________ From: AstroPy [astropy-bounces+jordan.alexander=aut.ac.nz at python.org] on behalf of Derek Homeier [derek at astro.physik.uni-goettingen.de] Sent: 18 April 2018 11:18 To: Astronomical Python mailing list Subject: Re: [AstroPy] Accessing a FITS table generates "ValueError: Inconsistent data column lengths: set([0, 27645])" On 18 Apr 2018, at 12:59 am, Jordan Alexander wrote: > > Your "tested" work-around, Tom: > > hdulist.info() > dat = hdulist[8].data > names = [name for name in dat.dtype.names if name != 'col_with_0J'] > cols = [dat[name] for name in names] > tbl = Table(cols, names=names) ?col_with_0J? was meant to be the actual column name of the 0-width column (#12). names = [name for name in dat.dtype.names if dat[name].shape[-1] > 0] should automatically filter the 0-shaped columns out. Cheers, Derek _______________________________________________ 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 jbc.develop at gmail.com Thu Apr 19 09:55:27 2018 From: jbc.develop at gmail.com (Juan BC) Date: Thu, 19 Apr 2018 13:55:27 +0000 Subject: [AstroPy] [ANN] feets 0.4 Message-ID: Dear all, We announce the first public release (0.4) of the feature-extraction-for-time-series project feets. the project start as a fork of an old project called FATS, but currently we support a more clean API, Python-3 and access to more data sets (astropy-affiliation was submitted) The installation and tutorial can be found att: http://feets.readthedocs.io/ (expect some enhancement on this week) Or simple install with: pip install feets -- Juan BC (from phone) -------------- next part -------------- An HTML attachment was scrubbed... URL: From stefanv at berkeley.edu Thu Apr 19 11:47:48 2018 From: stefanv at berkeley.edu (Stefan van der Walt) Date: Thu, 19 Apr 2018 08:47:48 -0700 Subject: [AstroPy] [ANN] feets 0.4 In-Reply-To: References: Message-ID: <20180419154748.fannym7qwya3b74u@carbo> Hi Juan, On Thu, 19 Apr 2018 13:55:27 +0000, Juan BC wrote: > Dear all, > > We announce the first public release (0.4) of the > feature-extraction-for-time-series project feets. Very nicely done! If you are interested in time series feature extraction and classification of lightcurves, you may also find our project Cesium of interest: http://cesium-ml.org/docs/feature_table.html In addition to the library, there is also a web application that allows users without programming skills to submit datasets, extract features, and build classification models. Best regards, St?fan From jbc.develop at gmail.com Thu Apr 19 13:13:26 2018 From: jbc.develop at gmail.com (Juan BC) Date: Thu, 19 Apr 2018 17:13:26 +0000 Subject: [AstroPy] [ANN] feets 0.4 In-Reply-To: <20180419154748.fannym7qwya3b74u@carbo> References: <20180419154748.fannym7qwya3b74u@carbo> Message-ID: Cool, maybe we can talk about to split the functionalities between the projects to make the development more "easy" On Thu, 19 Apr 2018 at 12:48 Stefan van der Walt wrote: > Hi Juan, > > On Thu, 19 Apr 2018 13:55:27 +0000, Juan BC wrote: > > Dear all, > > > > We announce the first public release (0.4) of the > > feature-extraction-for-time-series project feets. > > Very nicely done! > > If you are interested in time series feature extraction and > classification of lightcurves, you may also find our project Cesium of > interest: > > http://cesium-ml.org/docs/feature_table.html > > In addition to the library, there is also a web application that allows > users without programming skills to submit datasets, extract features, > and build classification models. > > Best regards, > St?fan > _______________________________________________ > AstroPy mailing list > AstroPy at python.org > https://mail.python.org/mailman/listinfo/astropy > -- Juan BC (from phone) -------------- next part -------------- An HTML attachment was scrubbed... URL: From 2015011024 at cuit.edu.cn Fri Apr 20 23:59:16 2018 From: 2015011024 at cuit.edu.cn (2015011024 at cuit.edu.cn) Date: Sat, 21 Apr 2018 11:59:16 +0800 Subject: [AstroPy] Translation Authority of Astropy Message-ID: <201804211159166802961@cuit.edu.cn> Dear Astropy manager, Thank you for taking the pressure time to read my Email. My name is Tan Zhetao, an Chinese college student in software engineering major, as well as an amateur astronomer. After reading and using your Python package on astronomy, I came up with the idea of declaring and promoting the application of Python in the development of Astronomy. Because of this purpose, I wanted to translate the Astropy package into Chinese with my friends, purely. Although Python is an open source project, we still hope to get your support and translation authority. We will indicate the source address and source name in the translation and we will not be used for commercial profit. We sincerely hope to obtain your support and authorization. Looking forward to your reply. Sincerely, Zhetao Tan 2015011024 at cuit.edu.cn -------------- next part -------------- An HTML attachment was scrubbed... URL: From erwin at mpe.mpg.de Mon Apr 23 09:31:45 2018 From: erwin at mpe.mpg.de (Peter Erwin) Date: Mon, 23 Apr 2018 15:31:45 +0200 Subject: [AstroPy] Announcing version 2.0 of telarchive Message-ID: Hi, This is an announcement about an updated version of telarchive, my quick-and-dirty Python-based command-line tool for searching telescope archives (see below for a brief description of what it does): http://www.mpe.mpg.de/~erwin/code/ The new version (2.0) add support for Python 3 (finally!), and includes various fixes to restore proper access to (and processing of results from) the ESO, SMOKA, and Gemini Observatory archives. In addition, SDSS spectroscopic searches now use SDSS Data Release 14. Other additions include the ability to specify coordinate searches using decimal degrees and to skip one or more archives during a search (e.g., when a particular archive or archives are temporarily inaccessible). For installation, the new version can be downloaded from the URL above, and is also available from PyPi ? e.g., ?pip install telarchive? (or ?pip install --upgrade telarchive? if you?ve already installed it that way). Finally, the full source (including unit tests, etc.) is also now available on Github, at: https://github.com/perwin/telarchive About telarchive: Telarchive is a Python-based command-line utility for doing quick searches of multiple astronomical telescope data archives -- specifically, to determine if a particular target or location on the sky has been observed or not. If the archive makes such information available, then brief summaries of what kinds of data (e.g., imaging versus spectroscopy, instruments used) are included. Targets can be searched for using standard astronomical names (using SIMBAD for name resolution) or via RA,Dec coordinates (coordinates can be in sexagesimal -- e.g. "hh mm ss dd mm ss" -- or decimal-degree formats). Example of use: $ telarchive 'NGC 4321' SIMBAD (Simbad 4, France): Found object coordinates: RA = 12 22 54.899, Dec = +15 49 20.57 Searching archives for NGC 4321 (RA = 12 22 54.899, dec = +15 49 20.57), with search box = 4.0 arcmin... CFHT Archive: Data exists! (269 observations found) MegaPrime (223), HRCAM (46) UKIRT Archive: Data exists! (58 observations found) UFTI (58) Mikulski Archive for Space Telescopes (MAST): Data exists! (155 observations found) FUSE (1); HUT (1); IUE (40); SWIFTUVOT (106); UIT (6); XMM-OM (1) Gemini Science Archive: No data found. AAT Archive: Data exists! (41 observations found) -- 22 images, 21 spectra, 0 polarimetry Spitzer archive: Data exists! (31 records found) 5 iracmap, 5 irsmap, 4 irspeakup, 2 mipsscan, 1 mipssed, 12 iracmapp, 2 irsstare ING Archive (La Palma): Data exists! (253 observations found) 117 images, 136 spectra WHT -- AF2 (17), ISIS (62), LIRIS (25), PFIP (10), PNS (9), SAURON (52), TAURUS (5); INT -- WFC (71); JKT -- JAG (2) HST archive: Data exists! (285 records found) 37 ACS, 45 STIS, 14 WFPC, 6 WFC3, 170 WFPC2, 7 FOS, 6 FOC ESO Archive: Data exists! (765 observations found) 109 continuum, 45 spectra, 318 images, 40 mos, 60 polarimetry, 126 spectrum,nodding, 21 ifu, 38 echelle, 8 image,pre APEXBOL (109), EMMI (29), FORS1 (109), HAWKI (48), ISAAC (126), MUSE (1), EMMI/1.57 (9), SOFI (225), WFI (4) SMOKA (Subaru Mitaka Okayama Kiso Archive): Data exists! (1154 observations found) Subaru -- FOCAS (10), Subaru -- MOIRCS (60), Kiso -- 1k CCD (30), Kiso -- 2k CCD (155), Okayama -- SNG (8), MITSuME -- OAO (891) Sloan Digital Sky Survey (DR7+DR12): Data exists! 1 DR7 field; 6 DR12 fields; 0 spectra (within 0.10 arcmin of search center) Telarchive should work with both versions 2 and 3 of Python. (It has been tested with Python 2.7, 3.5, and 3.6.) cheers, Peter ============================================================= Peter Erwin Max-Planck-Insitute for Extraterrestrial erwin at mpe.mpg.de Physics, Giessenbachstrasse tel. +49 (0)176 2481 7713 85748 Garching, Germany fax +49 (0)89 30000 3495 http://www.mpe.mpg.de/~erwin From stuart at cadair.com Tue Apr 24 07:33:04 2018 From: stuart at cadair.com (Stuart Mumford) Date: Tue, 24 Apr 2018 12:33:04 +0100 Subject: [AstroPy] SunPy 0.9 Released! Message-ID: <953c5a6e-7014-c1cc-74fa-85fbefaca870@cadair.com> Hello all, The SunPy project is very happy to announce the release of SunPy 0.9, the latest release of the SunPy core package. SunPy 0.9 brings improved support for downloading data from the JSOC and bugfixes compared to the 0.8.x series of releases. The 0.9.x series will be the last series of SunPy releases to support Python 2. This is because Python 2 will not be maintained after 2019 . The 0.9.x series will receive bugfixs only up until the and of life of Python 2 (around 18 months), and will also be the last version to include sunpy.spectra, sunpy.lightcurve and sunpy.wcs, all of which were deprecated in 0.8. SunPy v0.9.0 contains 807 commits in 147 merged pull requests closing 310 issues from 31 people, 19 of which are first time contributors to SunPy. For more details on What's new in 0.9 see our website . SunPy 0.9 can be installed from pip or conda using the following commands: using conda: $ conda config channels --append conda-forge $ conda install sunpy or using pip: $ pip install sunpy and updated using conda: $ conda update sunpy or pip: $ pip install -U sunpy The people who have contributed to the code for this release are: * Nabil Freij * Stuart Mumford * Nitin Choudhary * David Stansby * * Prateek Chanda * Jack Ireland * Daniel Ryan * Himanshu * * Yash Jain * * James Paul Mason * * Michael Charlton * Vishnunarayan K I. * * Swapnil Sharma * * Albert Y. Shih * David P?rez-Su?rez * Shresth Verma * * Sanjeev Dubey * * Brigitta Sipocz * Andrew Leonard * Nick Murphy * * Shane Maloney * Carlos Molina * * Yash Kothari * * Dang Trung Kien * * Gulshan Mittal * * Rajasekhar Reddy Mekala * * S Shashank * * Tannmay Yadav * * Will Barnes * * Yudhik Agrawal * * codetriage-readme-bot * Where a * indicates their first contribution to SunPy. In addition to the contributions to the core SunPy library, we would like to thank Kolja Glogowski for his help with the JSOC project, and welcome his package 'drms' as a SunPy affiliated package, which is now powering our JSOC client. Finally, we would like to thank David P?rez-Su?rez and Brigitta Sipocz, who are leading the GSOC process for OpenAstronomy, which is of massive benefit to the SunPy community. Stuart Mumford, on belhaf of the SunPy project. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bsipocz at gmail.com Tue Apr 24 10:18:47 2018 From: bsipocz at gmail.com (Brigitta Sipocz) Date: Tue, 24 Apr 2018 15:18:47 +0100 Subject: [AstroPy] ANN: astropy bugfix releases v3.0.2 and v2.0.6 (LTS) Message-ID: Dear All, Bugfix releases have been made for both the stable (v3.0.2) and LTS (v2.0.6) edition of astropy. They are available either on PyPI or on the usual conda channels. These releases contain another fix for a security vulnerability in the cfitsio library that was identified and fixed very recently. The full list of fixes can be found in the changelog: https://github.com/astropy/astropy/blob/v3.0.2/CHANGES.rst and https://github.com/astropy/astropy/blob/v2.0.6/CHANGES.rst Thank you for everyone who contributed for these releases! Cheers, Brigitta -------------- next part -------------- An HTML attachment was scrubbed... URL: From leo.p.singer at nasa.gov Thu Apr 26 12:25:13 2018 From: leo.p.singer at nasa.gov (Singer, Leo P. (GSFC-6610)) Date: Thu, 26 Apr 2018 12:25:13 -0400 Subject: [AstroPy] Mangled reference numbers in spinx documentation for Astropy affiliated package Message-ID: <22DA0904-0543-43F6-A814-54F4FC21070D@nasa.gov> Hi, In the Sphinx documentation for my Astropy-affiliated package, I am finding that numbers for references are getting mangle into something that looks like a git hash (e.g. "[R23d00ce4ef89-1]"). Here is an example: https://leo-singer.docs.ligo.org/ligo.skymap/ligo/skymap/bayestar.html How do I prevent sphinx from mangling my reference numbers? Thanks, Leo ---- Dr. Leo P. Singer NASA Goddard Space Flight Center Astroparticle Physics Laboratory Code 661, 8800 Greenbelt Rd. Greenbelt, MD 20771, U.S.A. From thomas.robitaille at gmail.com Thu Apr 26 13:56:34 2018 From: thomas.robitaille at gmail.com (Thomas Robitaille) Date: Thu, 26 Apr 2018 18:56:34 +0100 Subject: [AstroPy] Mangled reference numbers in spinx documentation for Astropy affiliated package In-Reply-To: <22DA0904-0543-43F6-A814-54F4FC21070D@nasa.gov> References: <22DA0904-0543-43F6-A814-54F4FC21070D@nasa.gov> Message-ID: Hi Leo, I think this *may* be an issue that would be resolved with the latest version of numpydoc. I need to update the package-template to use the new sphinx-astropy infrastructure which allows you to use the latest version of numpydoc. Cheers, Tom On 26 April 2018 at 17:25, Singer, Leo P. (GSFC-6610) wrote: > Hi, > > In the Sphinx documentation for my Astropy-affiliated package, I am finding that numbers for references are getting mangle into something that looks like a git hash (e.g. "[R23d00ce4ef89-1]"). Here is an example: > > https://leo-singer.docs.ligo.org/ligo.skymap/ligo/skymap/bayestar.html > > How do I prevent sphinx from mangling my reference numbers? > > Thanks, > Leo > > > ---- > Dr. Leo P. Singer > NASA Goddard Space Flight Center > Astroparticle Physics Laboratory > Code 661, 8800 Greenbelt Rd. > Greenbelt, MD 20771, U.S.A. > > > > > _______________________________________________ > AstroPy mailing list > AstroPy at python.org > https://mail.python.org/mailman/listinfo/astropy From jbc.develop at gmail.com Thu Apr 26 14:08:28 2018 From: jbc.develop at gmail.com (Juan BC) Date: Thu, 26 Apr 2018 18:08:28 +0000 Subject: [AstroPy] Mangled reference numbers in spinx documentation for Astropy affiliated package In-Reply-To: References: <22DA0904-0543-43F6-A814-54F4FC21070D@nasa.gov> Message-ID: This feature (?) solves the problem, if two documentations has the same reference. for example 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 def foo(): """foo the faa[something2018] References ---------- .. [something2018] foo the faa the thing in spam """ pass def foo2(): """foo2 the faa[something2018] References ---------- .. [something2018] foo the faa the thing in spam """ pass The two function has the same reference name but sphinx link to they own reference On Thu, 26 Apr 2018 at 14:57 Thomas Robitaille wrote: > Hi Leo, > > I think this *may* be an issue that would be resolved with the latest > version of numpydoc. > > I need to update the package-template to use the new sphinx-astropy > infrastructure which allows you to use the latest version of numpydoc. > > Cheers, > Tom > > > On 26 April 2018 at 17:25, Singer, Leo P. (GSFC-6610) > wrote: > > Hi, > > > > In the Sphinx documentation for my Astropy-affiliated package, I am > finding that numbers for references are getting mangle into something that > looks like a git hash (e.g. "[R23d00ce4ef89-1]"). Here is an example: > > > > https://leo-singer.docs.ligo.org/ligo.skymap/ligo/skymap/bayestar.html > > > > How do I prevent sphinx from mangling my reference numbers? > > > > Thanks, > > Leo > > > > > > ---- > > Dr. Leo P. Singer > > NASA Goddard Space Flight Center > > Astroparticle Physics Laboratory > > Code 661, 8800 Greenbelt Rd. > > Greenbelt, MD 20771, U.S.A. > > > > > > > > > > _______________________________________________ > > 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 > -- Juan BC (from phone) -------------- next part -------------- An HTML attachment was scrubbed... URL: From pebarrett at gmail.com Thu Apr 26 18:35:49 2018 From: pebarrett at gmail.com (Paul Barrett) Date: Thu, 26 Apr 2018 18:35:49 -0400 Subject: [AstroPy] Translation Authority of Astropy In-Reply-To: <201804211159166802961@cuit.edu.cn> References: <201804211159166802961@cuit.edu.cn> Message-ID: Sounds like an excellent idea. Please do. I think the astronomical community will appreciate it. On Fri, Apr 20, 2018 at 11:59 PM, 2015011024 at cuit.edu.cn < 2015011024 at cuit.edu.cn> wrote: > Dear Astropy manager, > > Thank you for taking the pressure time to read my Email. > > My name is Tan Zhetao, an Chinese college student in software engineering > major, as well as an amateur astronomer. After reading and using your > Python package on astronomy, I came up with the idea of declaring and > promoting the application of Python in the development of Astronomy. > Because of this purpose, I wanted to translate the Astropy package into > Chinese with my friends, purely. Although Python is an open source project, > we still hope to get your support and translation authority. We will > indicate the source address and source name in the translation and we will > not be used for commercial profit. > > We sincerely hope to obtain your support and authorization. > > Looking forward to your reply. > > Sincerely, > > Zhetao Tan > > ------------------------------ > 2015011024 at cuit.edu.cn > > _______________________________________________ > AstroPy mailing list > AstroPy at python.org > https://mail.python.org/mailman/listinfo/astropy > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dps.helio at gmail.com Fri Apr 27 14:32:00 2018 From: dps.helio at gmail.com (DVD PS) Date: Fri, 27 Apr 2018 19:32:00 +0100 Subject: [AstroPy] Translation Authority of Astropy In-Reply-To: References: <201804211159166802961@cuit.edu.cn> Message-ID: Hi Zhetao Tan, And please, share the process!! What are you trying to translate? The documentation? the docstrings? or going even as far as the code itself ( http://reganmian.net/blog/2008/11/21/chinese-python-translating-a-programming-language/ ) ?? I don't know what astropy would like to do, but I appreciate to find everything in the same place where you can switch from one language to another and know whether you are reading an up to date document or something that happened n years ago for a version that's not maintained anymore. 2 links that may help the process: - http://www.sphinx-doc.org/en/master/intl.html - http://docs.readthedocs.io/en/latest/localization.html As I'm in a similar endeavour for a different project (not based on python or sphinx), please - keep me in the loop about what you've tried and what works better for you. Thanks! David On 26 April 2018 at 23:35, Paul Barrett wrote: > Sounds like an excellent idea. Please do. I think the astronomical > community will appreciate it. > > On Fri, Apr 20, 2018 at 11:59 PM, 2015011024 at cuit.edu.cn < > 2015011024 at cuit.edu.cn> wrote: > >> Dear Astropy manager, >> >> Thank you for taking the pressure time to read my Email. >> >> My name is Tan Zhetao, an Chinese college student in software engineering >> major, as well as an amateur astronomer. After reading and using your >> Python package on astronomy, I came up with the idea of declaring and >> promoting the application of Python in the development of Astronomy. >> Because of this purpose, I wanted to translate the Astropy package into >> Chinese with my friends, purely. Although Python is an open source project, >> we still hope to get your support and translation authority. We will >> indicate the source address and source name in the translation and we will >> not be used for commercial profit. >> >> We sincerely hope to obtain your support and authorization. >> >> Looking forward to your reply. >> >> Sincerely, >> >> Zhetao Tan >> >> ------------------------------ >> 2015011024 at cuit.edu.cn >> >> _______________________________________________ >> 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: