Closed stephenmwilkins closed 5 days ago
This issue has grown to highlight a more general issue. The following is taken from slack detailing the proposed solution to clean all of this up:
def get_mask(self, filter_attr, threshold, thresh_type):
attr = getattr(self, filter_attr)
if thresh_type == "<":
return attr < thresh
elif thresh_type == "<=":
return attr <= thresh
...
else:
raise UnrecognisedArgument("WHAT ARE YOU DOING!?")
Possibly a redundant point now but there's no need for get_transmission
to take a mask. Sed.apply_attenuation
takes a mask and is the intended way to attenuate a spectra. Calculating a transmission should transparently adopt the shape of the input tau_v
array.
Of course this may be superseded by the EmissionModel
approach soon to be raised.
For particle based methods at the moment we can only mask with the
young
andold
arguments. We should add an optionmask
argument that allows the use of a generic mask. I believe this simply means addingmask
to list of arguments and then modifying_get_mask
.