[AstroPy] units in ascii read/write?
Tom Aldcroft
aldcroft at head.cfa.harvard.edu
Wed May 15 08:14:20 EDT 2013
Hi Rolf,
Unfortunately units parsing isn't currently supported in the SExtractor
format.
This should be relatively easy to add, but biggest question is about the
format of the header lines that provide the units. In the example you
showed the column definition line ends with an optional set of units within
square brackets like [eV]. Are there any other variations in the header
format possible? I looked at the SExtractor manual but there is no
specification of the output format(s). My guess for a rule is that if a
header line ends with something in square brackets then that is a unit. Do
you think that will work? (I don't use SExtractor myself).
This is now issue 1093:
https://github.com/astropy/astropy/issues/1093
Thanks,
Tom
On Wed, May 15, 2013 at 4:29 AM, Rolf Buehler <rolf.buehler at desy.de> wrote:
> Dear Astropy developers,
> thank you for this great tool, I have been looking for something like
> this for a long time.
> I have a problem when reading in ascii files, the units dont get read
> nor saved in the ascii.SExtractor format. Below I post more details.
> Could you please tell me if this is currently a missinf feature or I am
> doing something wrong?
> Thank you again and cheers,
> Rolf
>
> Example file I am reading:
> # 1 flux Fluss [eV]
> # 2 time Zeit [MJD]
> 1 34
> 3 56
>
> data =
>
> ascii.read("sextractor.dat",Reader=ascii.SExtractor,guess=False,delimiter='\t',comment="#")
>
> After I get:
>
> In [49]: data["flux"]
> Out[49]:
> <Column name='flux' units=None format=None description=None>
> array([1, 3])
>
> So units are not there.
>
> --
> +49 337627-7249
> www.rolfbuehler.net
>
> _______________________________________________
> 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/20130515/113ba281/attachment.html>
More information about the AstroPy
mailing list