[AstroPy] Problems reading CDS catalogue

Aldcroft, Thomas aldcroft at head.cfa.harvard.edu
Thu Mar 20 21:31:15 EDT 2014


I believe this is a bug in the CDS reader, which isn't correctly handling a
ReadMe that has multiple lines of the Byte-by-byte Description of file like
this:

Byte-by-byte Description of file: o9v.dat, b57v.dat, a2v.dat
Byte-by-byte Description of file: b12iii.dat, b3iii.dat, b5iii.dat,
b9iii.dat
Byte-by-byte Description of file: a0iii.dat, b0i.dat, b5i.dat, b8i.dat
--------------------------------------------------------------------------------
   Bytes    Format  Units   Label   Explanations
--------------------------------------------------------------------------------
   1-  7     F7.1   0.1nm  lambda   wavelength (in Angstroms)
   8- 17    F10.6    ---   nflam    component-averaged f(lambda)/f(5556 A)
  19- 27     F9.6    ---   sdnflam  std. dev. of avg. at this wavelength
  28- 37    F10.6    ---   fi       f(lambda)/f(5556 A) from Cat. <III/83>
  39- 47     F9.6    ---   fg       f(lambda)/f(5556 A) from Cat. <III/88>
  49- 57     F9.6    ---   fj       f(lambda)/f(5556 A) from Cat. <III/92>
  59- 67     F9.6    ---   fd       f(lambda)/f(5556 A) from
1994PASP..106..382D
--------------------------------------------------------------------------------

As a workaround you can modify your local ReadMe to have only one such line
corresponding to the file you want.

This is now an astropy issue: https://github.com/astropy/astropy/issues/2218
.

Cheers,
Tom



On Thu, Mar 20, 2014 at 7:38 PM, Sergio Pascual <sergio.pasra at gmail.com>wrote:

> Hi, I'm having problems reading the catalog in
> http://cdsarc.u-strasbg.fr/viz-bin/Cat?J/PASP/110/863 (file
> J_PASP_110_863.tar.gz)
>
> The files inside are compressed, so I uncompress them before.
>
> I create a reader object,  (I'm using astropy 0.3, BTW)
>
> readme = 'ReadMe'
>
> r = ascii.get_reader(ascii.Cds, readme=readme)
>
> This reader works only for some specta. For example, m2v and goi works,
> but the star 'o9v' doesn't work. Inserting this last star generates the
> following exception
>
> >>> r.read('o9v.dat')
>
> /usr/lib64/python2.7/site-packages/astropy/io/ascii/core.pyc in read(self,
> table)
>     831
>     832         # Get the table column definitions
> --> 833         self.header.get_cols(self.lines)
>     834
>     835         cols = self.header.cols
>
> /usr/lib64/python2.7/site-packages/astropy/io/ascii/cds.pyc in
> get_cols(self, lines)
>     164                     cols[-1].description += line.strip()
>     165                 else:
> --> 166                     raise ValueError('Line "%s" not parsable as
> CDS header' % line)
>     167
>     168         self.names = [x.name for x in cols]
>
> ValueError: Line "Bytes    Format  Units   Label   Explanations" not
> parsable as CDS header
>
>
>
> Any hint?
>
> Sergio
>
>
> _______________________________________________
> AstroPy mailing list
> AstroPy at scipy.org
> http://mail.scipy.org/mailman/listinfo/astropy
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20140320/5814a5dc/attachment.html>


More information about the AstroPy mailing list