Giter Site home page Giter Site logo

Various small things about species HOT 7 CLOSED

gabrielastro avatar gabrielastro commented on July 17, 2024 1
Various small things

from species.

Comments (7)

tomasstolker avatar tomasstolker commented on July 17, 2024 1

Done! The sampling can be obtained with the get_sampling() method from ReadModel.

from species.

gabrielastro avatar gabrielastro commented on July 17, 2024 1

Excellent! Thank you very much. While marking this as closed, I would just suggest in the species.util.data_util.convert_units docstring:

…
"Jy", "MJy"). One can use "um" or "µm" interchangeably, and similarly "AA", "Å", "A", or "angstrom".

from species.

tomasstolker avatar tomasstolker commented on July 17, 2024

Hi Gabriel! I think this has all been implemented in the meanwhile? For 10, you can use the new units parameter in plot_spectrum. For 9, this will get adjusted I think when setting the ylim parameter. I have added the spec_res attribute to the ModelBox in the latest commit f1f6807. I hope this helps!

from species.

gabrielastro avatar gabrielastro commented on July 17, 2024

Hello Tomas! Very nice—thanks a lot!

  • I will try out 8. but if you say it is done, of course I believe you.
  • Excellent for 9.! Indeed, it is necessary and sufficient to set ylim. I tried other options and it indeed all seems to work ✔️.
  • Thanks for spec_res. This will get saved in the database automatically I guess, yes? Will you distinguish somehow between the resolution and the sampling…?
  • For 10.: Thank you. Maybe a missing popular flux density unit is erg/s/cm²/Å (only …/Hz is available, which is not a trivial transformation). Also, the linguist and culture-lover in me would suggest using "AA" instead of "A" ( 🇳🇴 🇩🇰 🇸🇪), and of offering the synonyms "Å" and "µm" 🤓… Sorry but "Å" is really not pronounced the same as "A" 😄!

from species.

gabrielastro avatar gabrielastro commented on July 17, 2024

Thanks 😁! Sorry, last tweaks ("sigh once, give lots of users even more comfort"):

  • When specifying e.g. units=("AA","W m-2 µm-1"), the AA does not get converted and the -2 and -1 are not exponents in the plot.
  • The µ, Å, AA are not "advertised" in the docstring of species.util.data_util.convert_units. Maybe just addd a note at the end of the entry for units_in (and use "AA" by default in the documentation because it is shorter to type…)
  • Offer the synonyms "erg/s/cm^2/AA", etc. (with slashes) for typing convenience? It is a bit difficult to suppress the "LaTeX" reflexes and use spaces and no ^… 🤓. But this is really a small one. Fortunately, one does not change the units too often :).

from species.

gabrielastro avatar gabrielastro commented on July 17, 2024

Also, sorry but when using units=("µm","erg s-1 cm-2 angstrom-1"), there must be a factor of cm/µm=1e-4 dividing instead of multiplying in the flux density because I plot some data with "W m-2 µm-1" and get F_lambda = 1e-16 W/m²/µm but supposedly F_lambda = 1e-9 erg/s/cm²/Å instead of 1e-17 erg/s/cm²/Å; the difference is 1e-8 = (1e-4)² 😄… a classic.

from species.

tomasstolker avatar tomasstolker commented on July 17, 2024

Ah! My bad, I thought the conversion from cm-2 and A-1 cancelled out. This has been fixed now 👍, so we can close this issue.

from species.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.