Skip to content

Add a check for whether the spectrum is continuum subtracted for centroid #290

@eteq

Description

@eteq

#270 (not merged at the time of this message, but probably will be soon) adds a centroid calculation. The trouble is that centroid algorithms can go wrong if there's a substantial un-subtracted continuum. @brechmos-stsci rightly points out in the docstring that this is essentially the user's responsibility... but we know how users can be about reading docs 😉.

So I think once #210 is in we should consider putting in a check at the top of the centroid function that tries to infer if the continuum has been subtracted. This could do something like:

  1. run the continuum estimation function
  2. ask if the resulting continuum is "close" (to be defined...) to zero.
  3. If no, trigger a warning "Hey user, maybe you forgot to subtract the continuum? If so your centroiding is probably going to fail...", if yes, proceed with centroiding

Definitely will want an argument to turn this off though, since a user who explicitly says "no, trust me, it is subtracted" won't want to have to have the compute expense or potential annoyance of this warning.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions