From perrymasonary at gmail.com Fri Sep 3 17:05:30 2021 From: perrymasonary at gmail.com (Tom Donaldson) Date: Fri, 03 Sep 2021 17:05:30 -0400 Subject: [AstroPy] accessing raw astropy.io.votable.tree.Resource content In-Reply-To: <11bbe985-f547-bf73-3cbb-faeece844b4c@astro.unistra.fr> References: <11bbe985-f547-bf73-3cbb-faeece844b4c@astro.unistra.fr> Message-ID: <997DFF8D-232D-4938-B8CF-E07931ED0419@gmail.com> Hi Laurent, Having just returned from vacation, I can take a look at this next week. However as I recall, I think it will require some changes to astropy.io.votable to save some of the content that it's not actively using. That should be very doable and something we can work on together to make sure it does what we need. Thanks, Tom ?On 8/31/21, 4:22 AM, "AstroPy on behalf of Laurent Michel" wrote: Hello, In the frame the VO data modeling efforts, I'm exercising the annotation of VOTable resources with data model meta-data. These annotations are XML pieces matching their own schema. For doing this without touching the VOTable schema, the annotations are enclosed in a Resource of type "meta". The VOTable structure looks like this: <==== My DM stuff ====> This approach has been validated by using standard XML parsers and validators and I'm now investigating a possible connection with Astropy. For this, I need to be able to get the content of such a resource by using the astropy.io.votable API. My problem is that I do not know how to get that stuff as an XML DOM or even as a string either. I would like to do something like: votable = parse(votable_path) for resource in votable.resources: if resource.type == "results": for sub_resource in resource.resources: if sub_resource.type == "meta": print("here is my DM stuff") >>> annotation_content = sub_resource.content() Does anyone know a way to get the raw content of a resource? Laurent -- jesuischarlie/Tunis/Paris/Bruxelles/Berlin Laurent Michel SSC XMM-Newton T?l : +33 (0)3 68 85 24 37 Fax : +33 (0)3 )3 68 85 24 32 Universit? de Strasbourg Observatoire Astronomique 11 Rue de l'Universit? F - 67200 Strasbourg _______________________________________________ AstroPy mailing list AstroPy at python.org https://mail.python.org/mailman/listinfo/astropy From laurent.michel at astro.unistra.fr Mon Sep 6 13:12:21 2021 From: laurent.michel at astro.unistra.fr (Laurent Michel) Date: Mon, 6 Sep 2021 19:12:21 +0200 Subject: [AstroPy] accessing raw astropy.io.votable.tree.Resource content In-Reply-To: <997DFF8D-232D-4938-B8CF-E07931ED0419@gmail.com> References: <11bbe985-f547-bf73-3cbb-faeece844b4c@astro.unistra.fr> <997DFF8D-232D-4938-B8CF-E07931ED0419@gmail.com> Message-ID: <772C3C82-9C37-487B-83DC-13908F91E251@astro.unistra.fr> Hi Tom, I?m a novice with the Astropy dev cycle, your help would be very appreciated. I?ll first write an ?new feature? issue telling what I?m expecting. After this we will be able to put our hands-on. Laurent ? Translate with https: //www.deepl.com/translator -- jesuischarlie/Tunis/Paris/Bruxelles/Berlin Laurent Michel SSC XMM-Newton T?l : +33 (0)3 68 85 24 37 Fax : +33 (0)3 )3 68 85 24 32 Universit? de Strasbourg Observatoire Astronomique 11 Rue de l'Universit? F - 67200 Strasbourg > On 3 Sep 2021, at 23:05, Tom Donaldson wrote: > > Hi Laurent, > > Having just returned from vacation, I can take a look at this next week. However as I recall, I think it will require some changes to astropy.io.votable to save some of the content that it's not actively using. That should be very doable and something we can work on together to make sure it does what we need. > > Thanks, > Tom > > > ?On 8/31/21, 4:22 AM, "AstroPy on behalf of Laurent Michel" wrote: > > Hello, > > In the frame the VO data modeling efforts, I'm exercising the annotation of VOTable resources with data model meta-data. > These annotations are XML pieces matching their own schema. > For doing this without touching the VOTable schema, the annotations are enclosed in a Resource of type "meta". > The VOTable structure looks like this: > > > > > <==== My DM stuff ====> > >
> > This approach has been validated by using standard XML parsers and validators and I'm now investigating a possible connection > with Astropy. > For this, I need to be able to get the content of such a resource by using the astropy.io.votable API. > My problem is that I do not know how to get that stuff as an XML DOM or even as a string either. > > I would like to do something like: > > votable = parse(votable_path) > for resource in votable.resources: > if resource.type == "results": > for sub_resource in resource.resources: > if sub_resource.type == "meta": > print("here is my DM stuff") >>>> annotation_content = sub_resource.content() > > Does anyone know a way to get the raw content of a resource? > > Laurent > -- > jesuischarlie/Tunis/Paris/Bruxelles/Berlin > > Laurent Michel > SSC XMM-Newton > T?l : +33 (0)3 68 85 24 37 > Fax : +33 (0)3 )3 68 85 24 32 > Universit? de Strasbourg > Observatoire Astronomique > 11 Rue de l'Universit? > F - 67200 Strasbourg > _______________________________________________ > 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 eperez at iaa.es Fri Sep 10 07:41:14 2021 From: eperez at iaa.es (eperez) Date: Fri, 10 Sep 2021 13:41:14 +0200 Subject: [AstroPy] blackbody_lambda Message-ID: I am running Astropy 4.3.1. I am not able to reproduce these two lines of code, where i am interested in the BB in Flux_lambda units: from astropy.analytic_functions import blackbody_lambda flux_lam = blackbody_lambda(wv*u.AA, temperature*u.K) I understand that astropy.analytic_functions is no longer available, but i cannot find the equivalent blackbody_lambda in the current: from astropy.modeling.models import BlackBody Thanks for your help. ES.Enrique From rbaer25 at gmail.com Fri Sep 10 11:11:01 2021 From: rbaer25 at gmail.com (Rudolf Baer) Date: Fri, 10 Sep 2021 17:11:01 +0200 Subject: [AstroPy] blackbody_lambda In-Reply-To: References: Message-ID: Hi Enrique For bb fitting I am using* lmfit *and the actual formula *def bb(x, T, *const)*:* * from scipy.constants import h,k,c* * x = 1e-6 * x # convert to metres from um* * return const*2*h*c**2 / (x**5 * (np.exp(h*c / (x*k*T)) - 1)) * Depending on you application you may not need the const With kind regards Rudolf Baer On Fri, Sep 10, 2021 at 1:47 PM eperez wrote: > > I am running Astropy 4.3.1. > > I am not able to reproduce these two lines of code, where i am interested > in the BB in Flux_lambda units: > > from astropy.analytic_functions import blackbody_lambda > flux_lam = blackbody_lambda(wv*u.AA, temperature*u.K) > > I understand that astropy.analytic_functions is no longer available, but i > cannot find the equivalent blackbody_lambda in the current: from > astropy.modeling.models import BlackBody > > Thanks for your help. > ES.Enrique > _______________________________________________ > 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 Sat Sep 11 12:27:15 2021 From: derek at astro.physik.uni-goettingen.de (Derek Homeier) Date: Sat, 11 Sep 2021 18:27:15 +0200 Subject: [AstroPy] blackbody_lambda In-Reply-To: References: Message-ID: Hol?, > On 10 Sep 2021, at 1:41 pm, eperez wrote: > > I am not able to reproduce these two lines of code, where i am interested in the BB in Flux_lambda units: > > from astropy.analytic_functions import blackbody_lambda > flux_lam = blackbody_lambda(wv*u.AA, temperature*u.K) > > I understand that astropy.analytic_functions is no longer available, but i cannot find the equivalent blackbody_lambda in the current: from astropy.modeling.models import BlackBody there is no longer a specific function for B_lamba; with the new model class you can either transform the default return in B_nu as from astropy.units.equivalencies import spectral_density bnu_of_t = BlackBody(temperature*u.K) flux_lam = bb_of_t(wv*u.AA).to('erg / (cm2 AA s sr)', equivalencies=spectral_density(wv*u.AA)) or directly set up the model to return B_lambda: blam_of_t = BlackBody(temperature*u.K, scale=1*u.Unit('W / (m2 nm sr)')) ? see https://docs.astropy.org/en/v4.1/modeling/blackbody_deprecated.html#blackbody-functions-deprecated Cheers, Derek From sebastien.maret at univ-grenoble-alpes.fr Thu Sep 23 05:01:01 2021 From: sebastien.maret at univ-grenoble-alpes.fr (=?utf-8?Q?S=C3=A9bastien_Maret?=) Date: Thu, 23 Sep 2021 11:01:01 +0200 Subject: [AstroPy] Maps in relative coordinates with WCSAxes Message-ID: <495D5838-FD75-4AE2-A748-B24D277DA3F1@univ-grenoble-alpes.fr> Hello, I find the WCSAxes framework extremely useful for making maps in celestial coordinates (e.g. RA and Dec.). However, I sometime need to make maps in *relative* coordinates instead (that is RA and Dec spherical offsets with respect to given position). How can I do this with WCSAxes? Thanks, S?bastien -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3527 bytes Desc: not available URL: From mcraig at mnstate.edu Mon Sep 27 10:32:35 2021 From: mcraig at mnstate.edu (Craig, Matthew W) Date: Mon, 27 Sep 2021 14:32:35 +0000 Subject: [AstroPy] New place for users to ask (and answer) questions: community.openastronomy.org Message-ID: Dear colleagues, We are excited to announce a new and recommended forum for asking questions about using Astropy, built with Discourse: https://community.openastronomy.org/ This forum allows questions to be tagged by topic, is searchable on Google, and displays code snippets better than some of our current alternatives. We plan to redirect user questions from Slack, Twitter, and mailing lists to this new site starting now and going forward. You might ask why the project has added another forum for users to ask and answer questions. There are a few reasons: * The most active user forum for Astropy and Python-related questions is the Facebook group ?Python users in Astronomy?. We hope that continues to thrive -- thank you so much to all of the members of that group who ask and answer questions -- but want to provide a more open (and searchable) option for users who are not on Facebook. * Slack has worked well for developer discussions but it is very hard for users to track down answers to questions, and it is not used by a lot of users. * There are a lot of Astropy-related questions on Stack Overflow, but there are fairly high barriers to asking your first question and replies on Stack Overflow (at least to non-Astropy questions) are not always constructive. The Discourse platform used at https://community.openastronomy.org/ was chosen in part because it was designed to encourage constructive discussions. * The remaining forums (mailing list, Twitter) are either limited in what can be posted, hard to search, or relatively inactive. To start using https://community.openastronomy.org/ you will need to create an account there with either an email address or through your github account. Once that is done you should be able to ask (and answer) questions. Finally, we would like to emphasize that, while Astropy contributors will naturally be present and active in the Discourse forum, there is no guarantee that answers will come from an Astropy contributor or developer. In fact, we encourage (and will help to foster) user-to-user interactions within the forum. As with any communication channel related to the Astropy project, we expect all posts, replies, and interactions to follow the Astropy Code of Conduct. On behalf of the Coordination Committee, Matt Craig Schedule: http://physics.mnstate.edu/craig --- Professor, Department of Physics and Astronomy MSUM -------------- next part -------------- An HTML attachment was scrubbed... URL: