Skip to content

Define constant to represent the HST area as Quantity #101

Closed

Description

@ibusko

So user code doesn't have to define it every time it needs to do count rate calculations. One can simply import the appropriate module and grab the constant from there.

Define it as a Quantity with the appropriate units.

It makes sense to define the HST area in stsynphot since the package was meant to support HST anyway.

Activity

  1. pllim commented on Jan 24, 2020

    @pllim
    Contributor

    It is a configuration item now:

    # Telescope primary mirror collecting area in cm^2
    area = ConfigItem(45238.93416, 'Telescope collecting area in cm^2')

    It uses Astropy's configuration system.

  2. pllim commented on Jan 24, 2020

    @pllim
    Contributor

    To use it:

    stsynphot.conf.area
  3. pllim commented on Jan 24, 2020

    @pllim
    Contributor

    But if you want area to be a Quantity, I think I have to add in new code to support that...

  4. pllim commented on Jan 28, 2020

    @pllim
    Contributor

    @ibusko , just to be clear. Is stsynphot.conf.area as a float sufficient for your use case, or do you absolutely need a Quantity? For backward compatibility, when area is passed in without units, it is assumed to be cm^2.

  5. ibusko commented on Jan 28, 2020

    @ibusko
    Author

    It's OK as is. I think that having a Quantity would avoid potential problems for generic users since then the units become attached to the value by definition. But a scalar works fine from the pyetc viewpoint. No need to change it.
    Thanks!

  6. pllim commented on Jan 28, 2020

    @pllim
    Contributor

    @ibusko , okay. I am closing this issue then. If you have strong feelings about supporting config item as Quantity, please comment upstream at astropy/astropy#9893 . I thought about it a little but I cannot find an elegant way to have astropy.config natively supporting Quantity without having to patch up the bundled configobj, which is not trivial.

  7. changed the title [-]Define constant to represent the HST area[/-] [+]Define constant to represent the HST area as Quantity[/+] on Jan 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions