[AstroPy] AstroPy Digest, Vol 102, Issue 12

Jeetendra Joshi jsjeetendra at gmail.com
Sat Mar 28 02:26:39 EDT 2015


00000 74444
On Mar 27, 2015 7:56 PM, <astropy-request at scipy.org> wrote:

> Send AstroPy mailing list submissions to
>         astropy at scipy.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://mail.scipy.org/mailman/listinfo/astropy
> or, via email, send a message with subject or body 'help' to
>         astropy-request at scipy.org
>
> You can reach the person managing the list at
>         astropy-owner at scipy.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of AstroPy digest..."
>
>
> Today's Topics:
>
>    1. Quantity does not own its own data with copy=True (Duncan Macleod)
>    2. getting id value from xml files (Grigoris Maravelias)
>    3. disable fatal errors on illegal keywords in FITS Header
>       created by Header.fromstring (JJ Kavelaars)
>    4. Re: disable fatal errors on illegal keywords in FITS Header
>       created by Header.fromstring (Simon Conseil)
>    5. Re: getting id value from xml files (Michael Droettboom)
>    6. Re: getting id value from xml files (Michael Droettboom)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Thu, 26 Mar 2015 13:00:38 -0500
> From: Duncan Macleod <duncan.macleod at ligo.org>
> Subject: [AstroPy] Quantity does not own its own data with copy=True
> To: astropy <AstroPy at scipy.org>
> Message-ID: <EC6A1943-43A0-4CE2-85A4-9DB06A7D710A at ligo.org>
> Content-Type: text/plain; charset="utf-8"
>
> Hi all,
>
> I?m wondering why a new astropy.units.Quantity doesn?t own its own data,
> even when I specify copy=True when creating it:
>
> >>> from astropy.units import Quantity
> >>> a = Quantity([1, 2, 3], copy=True)
> >>> print(a.flags.owndata)
> False
>
> I know technically how that is true, since there is a view() call in the
> __new__ constructor, but not why is was implemented in this way. There are
> lines in other parts of quantity.py that reference this fact, which makes
> it seem like this was a conscious decision, rather than an accident.
>
> Can someone explain the thinking behind this decision?
>
> I realise I can use Quantity([1, 2, 3]).copy() to create a clean copy that
> does own the data, but that seems a little inelegant.
>
>
> Thanks
> Duncan
> --
> Duncan Macleod
> duncan.macleod at ligo.org
> LIGO Data Grid systems development
> Louisiana State University
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://mail.scipy.org/pipermail/astropy/attachments/20150326/b3650171/attachment-0001.html
>
> ------------------------------
>
> Message: 2
> Date: Fri, 27 Mar 2015 00:47:02 +0100
> From: Grigoris Maravelias <gr.maravelias at gmail.com>
> Subject: [AstroPy] getting id value from xml files
> To: Astronomical Python mailing list <astropy at scipy.org>
> Message-ID: <55149A76.5050504 at gmail.com>
> Content-Type: text/plain; charset=utf-8
>
> Hi to all!
>
> I have a quick question with probably a rather straightforward answer
> which probably may have slipped me.
> What is the fastest way to call the value of a field id in an xml file
> (produced by astropy).
>
> For example to get the value from the ID 'sfr'
> <INFO ID="sfr" name="sfr" value="1.34267351483e-40"/>
>
> Best
> Grigoris
>
>
>
>
> ------------------------------
>
> Message: 3
> Date: Thu, 26 Mar 2015 20:19:02 -0700
> From: JJ Kavelaars <jjk at uvic.ca>
> Subject: [AstroPy] disable fatal errors on illegal keywords in FITS
>         Header  created by Header.fromstring
> To: Astronomical Python mailing list <astropy at scipy.org>
> Message-ID: <029B7C03-E391-4E6E-9886-452370E4C7EA at uvic.ca>
> Content-Type: text/plain; charset=utf-8
>
> I am creating headers with the class method Header.fromfile.  These older
> files contain the keyword 'IRAF-B/P?.   This keyword violates the FITS
> standard, these files pre-date the standard.
>
> In astropy the existence of the IRAF-B/P keyword causes a fatal error when
> attempting to print the header.
>
> Is there a flag that will set an ?ignore? flag when creating the header
> via the Header.fromfile method such that errors are ignored rather than
> fatal?
>
> thanks,
> JJ
>
>
>
> ------------------------------
>
> Message: 4
> Date: Fri, 27 Mar 2015 10:06:48 +0100
> From: Simon Conseil <simon at sconseil.fr>
> Subject: Re: [AstroPy] disable fatal errors on illegal keywords in
>         FITS Header created by Header.fromstring
> To: Astronomical Python mailing list <astropy at scipy.org>
> Message-ID: <55151DA8.1050903 at sconseil.fr>
> Content-Type: text/plain; charset=utf-8; format=flowed
>
> Hello,
>
> I had the same error with this 'IRAF-B/P? keyword, there is a related
> issue here: https://github.com/astropy/astropy/issues/887
>
> Simon
>
>
> Le 27/03/2015 04:19, JJ Kavelaars a ?crit :
> > I am creating headers with the class method Header.fromfile.  These
> older files contain the keyword 'IRAF-B/P?.   This keyword violates the
> FITS standard, these files pre-date the standard.
> >
> > In astropy the existence of the IRAF-B/P keyword causes a fatal error
> when attempting to print the header.
> >
> > Is there a flag that will set an ?ignore? flag when creating the header
> via the Header.fromfile method such that errors are ignored rather than
> fatal?
> >
> > thanks,
> > JJ
> >
> > _______________________________________________
> > AstroPy mailing list
> > AstroPy at scipy.org
> > http://mail.scipy.org/mailman/listinfo/astropy
>
>
> --
> Simon Conseil
> CRAL - Observatoire de Lyon
> 9, avenue Charles Andr?
> 69230 Saint-Genis-Laval
>
>
> ------------------------------
>
> Message: 5
> Date: Fri, 27 Mar 2015 09:43:12 -0400
> From: Michael Droettboom <mdroe at stsci.edu>
> Subject: Re: [AstroPy] getting id value from xml files
> To: <astropy at scipy.org>
> Message-ID: <55155E70.8070904 at stsci.edu>
> Content-Type: text/plain; charset="utf-8"
>
> I assume you are asking how to do this with astropy.io.votable?
>
> INFO tags can appear in a number of places in a VOTable file, so without
> seeing the whole file, it?s hard to say.
>
> For example, if you had a file like:
>
> |<VOTABLE>
>    <RESOURCE>
>      <INFO ID="sfr" name="sfr" value="1.34267351483e-40"/>
>    </RESOURCE>
> </VOTABLE>
> |
>
> The you could do:
>
> |from astropy.io import votable
> vot = votable.parse("file.xml")
> value = vot.resources[0].infos[0].value
> |
>
> |astropy.io.votable| doesn?t currently have a ?get info by ID? method,
> but those exist for some other things, so should probably be added.
> (I?ll make a PR and update you on that).
>
> You could probably also do this with |astropy.io.votable| using Python?s
> built-in elementtree and XPath to match on the ID.
>
> Mike
>
> On 03/26/2015 07:47 PM, Grigoris Maravelias wrote:
>
> > Hi to all!
> >
> > I have a quick question with probably a rather straightforward answer
> > which probably may have slipped me.
> > What is the fastest way to call the value of a field id in an xml file
> > (produced by astropy).
> >
> > For example to get the value from the ID 'sfr'
> > <INFO ID="sfr" name="sfr" value="1.34267351483e-40"/>
> >
> > Best
> > Grigoris
> >
> >
> > _______________________________________________
> > AstroPy mailing list
> > AstroPy at scipy.org
> > http://mail.scipy.org/mailman/listinfo/astropy
>
> ?
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://mail.scipy.org/pipermail/astropy/attachments/20150327/f6ea0b7e/attachment-0001.html
>
> ------------------------------
>
> Message: 6
> Date: Fri, 27 Mar 2015 10:25:37 -0400
> From: Michael Droettboom <mdroe at stsci.edu>
> Subject: Re: [AstroPy] getting id value from xml files
> To: <astropy at scipy.org>
> Message-ID: <55156861.5090202 at stsci.edu>
> Content-Type: text/plain; charset="utf-8"
>
> See http://github.com/astropy/astropy/pull/3633 for an implementation of
> get_info_by_id.
>
> Mike
>
> On 03/27/2015 09:43 AM, Michael Droettboom wrote:
> >
> > I assume you are asking how to do this with astropy.io.votable?
> >
> > INFO tags can appear in a number of places in a VOTable file, so
> > without seeing the whole file, it?s hard to say.
> >
> > For example, if you had a file like:
> >
> > |<VOTABLE>
> >    <RESOURCE>
> >      <INFO ID="sfr" name="sfr" value="1.34267351483e-40"/>
> >    </RESOURCE>
> > </VOTABLE>
> > |
> >
> > The you could do:
> >
> > |from astropy.io import votable
> > vot = votable.parse("file.xml")
> > value = vot.resources[0].infos[0].value
> > |
> >
> > |astropy.io.votable| doesn?t currently have a ?get info by ID? method,
> > but those exist for some other things, so should probably be added.
> > (I?ll make a PR and update you on that).
> >
> > You could probably also do this with |astropy.io.votable| using
> > Python?s built-in elementtree and XPath to match on the ID.
> >
> > Mike
> >
> > On 03/26/2015 07:47 PM, Grigoris Maravelias wrote:
> >
> >> Hi to all!
> >>
> >> I have a quick question with probably a rather straightforward answer
> >> which probably may have slipped me.
> >> What is the fastest way to call the value of a field id in an xml file
> >> (produced by astropy).
> >>
> >> For example to get the value from the ID 'sfr'
> >> <INFO ID="sfr" name="sfr" value="1.34267351483e-40"/>
> >>
> >> Best
> >> Grigoris
> >>
> >>
> >> _______________________________________________
> >> AstroPy mailing list
> >> AstroPy at scipy.org
> >> http://mail.scipy.org/mailman/listinfo/astropy
> > ?
> >
> >
> > _______________________________________________
> > AstroPy mailing list
> > AstroPy at scipy.org
> > http://mail.scipy.org/mailman/listinfo/astropy
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://mail.scipy.org/pipermail/astropy/attachments/20150327/1ed50e93/attachment.html
>
> ------------------------------
>
> _______________________________________________
> AstroPy mailing list
> AstroPy at scipy.org
> http://mail.scipy.org/mailman/listinfo/astropy
>
>
> End of AstroPy Digest, Vol 102, Issue 12
> ****************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20150328/e00c5a9e/attachment.html>


More information about the AstroPy mailing list