Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a Mask class #409

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Create a Mask class #409

wants to merge 10 commits into from

Conversation

PabloCorcho
Copy link
Member

This PR includes the implementation of a new class for storing a bitmask in terms of several flagging criteria.

@PabloCorcho
Copy link
Member Author

@paranoya @angelrls this is somewhat the idea that I had in my mind for implementing the mask class. This could become an attribute of each data container and be saved in the final FITS file in the extension "MASK". Let me know what do you think.

def add_flags(self, **extra_flags):
"""Add a new flag to the mask."""
self.flag_map = bitmask.extend_bit_flag_map(
"DQ_MASK", self.flag_map, **extra_flags)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here your peg is gone ;^D
I guess we don't need this function, but I guess/hope it would complain"DQ_MASK" does not exist...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class has been refactored significantly, aiming for a more simple approach without additional dependencies.

@PabloCorcho
Copy link
Member Author

The PR now includes a final version of the DataMask class, as well as a method for dumping the information to a HDU, included in the FITS produced by the Cube and RSS classes (the latter has been updated).

@PabloCorcho
Copy link
Member Author

@paranoya I believe this mask can also be used to store information produced by the Correction modules (e.g, flag pixels that are classified as sky/lines or stuff like that).
For now, there is no module that is making use of the mask. Once we are happy with its design and implementation, I will proceed to merge this branch and include it in the cubing process on a separate one.

@PabloCorcho PabloCorcho added the enhancement New feature or request label May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants