CreateMasks¶
-
class
muse_origin.
CreateMasks
(orig, idx, param)[source]¶ Bases:
muse_origin.Step
Create source masks and sky masks.
This step create the mask and sky mask for each source.
- Parameters
- path
str
Path where the masks will be saved. By default this is
<output_dir>/masks
.- overwritebool
Overwrite the folder if it already exists, True by default.
- mask_size: int
Minimal width in pixel for the square masks. The mask size must be odd. If this parameter is even, 1 will be added to it when creating the masks. Defaults to 25.
- min_sky_npixel: int
Minimum number of sky pixels in the mask, defaults to 100.
- seg_thres_factor: float
Factor applied to the detection threshold to get the threshold used for mask creation, defaults to 0.5
- fwhm_factor: float
When creating a source, for each line a disk with a diameter of the FWMH multiplied by this factor is added to the source mask, defaults to 2.
- plot_problems: bool
If true, when the mask or a source seems dubious, some diagnostic plots about the source and its lines is saved in the output folder. Note that this may be problematic when running the code inside a notebook, hence the option is False by default.
- path
Attributes Summary
Processing status (
muse_origin.Status
):Methods Summary
__call__
(self, \*args, \*\*kwargs)Run a step, calling its
run
method.dump
(self, outpath)Save the attributes that have been created by the steps, and unload them to free memory.
load
(self, outpath)Recreate attributes of a step, not really loading them as just the file is set, and files are loaded in memory only if needed.
run
(self, orig[, path, overwrite, …])store_cube
(self, name, data, \*\*kwargs)Create a MPDAF Cube and store it as an attribute.
store_image
(self, name, data, \*\*kwargs)Create a MPDAF Image and store it as an attribute.
Attributes Documentation
-
desc
= 'Mask creation'¶
-
name
= 'create_masks'¶
-
require
= ('clean_results',)¶
-
status
¶ Processing status (
muse_origin.Status
):NOTRUN: The step has not been run.
RUN: The step has been run but not saved.
DUMP: The step has been run and its outputs saved to disk.
FAILED: The step has been run but it failed.
Methods Documentation
-
__call__
(self, *args, **kwargs)¶ Run a step, calling its
run
method.This method is the one that is called from the ORIGIN object. It calls the
run
method of the step and also does a few additional things like storing the parameters, execution time and date.
-
dump
(self, outpath)¶ Save the attributes that have been created by the steps, and unload them to free memory.
-
load
(self, outpath)¶ Recreate attributes of a step, not really loading them as just the file is set, and files are loaded in memory only if needed.
-
run
(self, orig, path=None, overwrite=True, mask_size=25, min_sky_npixels=100, seg_thres_factor=0.5, fwhm_factor=2, plot_problems=False)[source]¶
-
store_cube
(self, name, data, **kwargs)¶ Create a MPDAF Cube and store it as an attribute.
-
store_image
(self, name, data, **kwargs)¶ Create a MPDAF Image and store it as an attribute.