Open hcferguson opened 4 years ago
Of course there is a question of whether the bounds should be inclusive or not. In the example above the bounds are exclusive at the lower end and inclusive at the upper end, which seems like it's a fairly common convention. Having them be exclusive would mean that concatenating a bunch of adjacent masks could result in gaps.
The document on extract_region doesn't say what it is doing at the boundaries. Looking at the extract_spectral_region.py
code, it is doing
right_index = int(np.floor(spectrum.wcs.world_to_pixel([right_reg_in_spec_unit]))) + 1
So this looks like it is inclusive at the top end.
I'm not finding in the documentation any function to create a mask from a set of regions. Seems like we should have that, and maybe the inverse as well.
Something like this...