Wise tasks module¶
-
wise.tasks.
build_final_dfc
(ctx, merge_file, final_sep)¶ Build a final separation file from a merge file.
Merge file shall be located in ctx.get_data_dir(). One final component per line, described by a list of link id separated by a ‘,’.
Parameters: - ctx (
wise.project.AnalysisContext
) – - merge_file (str) – Merge file name.
- final_sep (str) – Name of the final separation file.
- ctx (
-
wise.tasks.
info_files
(ctx)¶ Print List of selected files with information on beam and pixel scales
Parameters: ctx ( wise.project.AnalysisContext
) –
-
wise.tasks.
set_stack_image_as_ref
(ctx, nsigma=3, nsigma_connected=True)¶ Set the reference image from a stacked images
Parameters: - ctx (
wise.project.AnalysisContext
) – - nsigma (int, optional) – Clip data below nsigma time the background level.
- nsigma_connected (bool, optional) – Keep only the brightest isolated structure.
- ctx (
-
wise.tasks.
set_mask_from_stack_img
(ctx, nsigma=3, nsigma_connected=True)¶ Set the mask image from a stacked images
Parameters: - ctx (
wise.project.AnalysisContext
) – - nsigma (int, optional) – Clip data below nsigma time the background level.
- nsigma_connected (bool, optional) – Keep only the brightest isolated structure.
- ctx (
-
wise.tasks.
info_files_delta
(ctx, delta_time_unit=Unit("d"), angular_velocity_unit=Unit("mas / yr"), proper_velocity_unit=Unit("c"))¶ Print List of selected pair of files with information on velocity resolution
Parameters: - ctx (
wise.project.AnalysisContext
) – - delta_time_unit (
astropy.units.Unit
, optional) – - angular_velocity_unit (
astropy.units.Unit
, optional) – - proper_velocity_unit (
astropy.units.Unit
, optional) –
- ctx (
-
wise.tasks.
detection_all
(ctx, filter=None)¶ Run the Segmented wavelet decomposition on all selected files
Parameters: - ctx (
wise.project.AnalysisContext
) – - filter (
wise.features.FeatureFilter
, optional) –
- ctx (
-
wise.tasks.
match_all
(ctx, filter=None)¶ Run matching on all selected files
Parameters: - ctx (
wise.project.AnalysisContext
) – - filter (
wise.features.FeatureFilter
, optional) –
- ctx (
-
wise.tasks.
save
(ctx, name, coord_mode='com', measured_delta=True)¶ Save current result to disk
Parameters: - ctx (
wise.project.AnalysisContext
) – - name (str) – Prefix name for the save files
- coord_mode (str, optional) –
- measured_delta (bool, optional) –
- ctx (
-
wise.tasks.
load
(ctx, name, projection=None, merge_with_previous=False, min_link_size=2)¶ Load result from files
Parameters: - ctx (
wise.project.AnalysisContext
) – - name (str) – Prefix name of the saved files
- projection (
libwise.imgutils.Projection
, optional) – If not provided, default Projection will be used - merge_with_previous (bool, optional) – If True, this result will be added to current result
- min_link_size (int, optional) – Filter out links with size < min_link_size
- ctx (
-
wise.tasks.
view_all
(ctx, preprocess=True, show_mask=True, show_regions=[], save_filename=None, align=True, **kwargs)¶ Preview all images
Parameters: - ctx (
wise.project.AnalysisContext
) – - preprocess (bool, optional) – If True, run the pre_process fct on each images
- show_mask (bool, optional) – If True, show the saved mask in the map
- show_regions (list of
libwise.imgutils.Region
, optional) – Plot the regions - save_filename (str, optional) – If not None, the resulting maps will be saved in the project data dir with this filename.
- **kwargs – Arguments to pass to
libwise.plotutils.imshow_image()
- ctx (
-
wise.tasks.
view_stack
(ctx, preprocess=True, nsigma=0, nsigma_connected=False, show_mask=True, show_regions=[], intensity_colorbar=False, save_filename=None, **kwargs)¶ Preview the stack image
Parameters: - ctx (
wise.project.AnalysisContext
) – - preprocess (bool, optional) – If True, run the pre_process fct on each images
- nsigma (int, optional) – Clip bg below nsigma level
- nsigma_connected (bool, optional) – If True, keep only the brightest connected structure
- show_mask (bool, optional) – If True, show the saved mask in the map
- show_regions (list of
libwise.imgutils.Region
, optional) – Plot the regions - intensity_colorbar (bool, optional) – Add an intensity colorbar
- save_filename (str, optional) – If not None, the resulting maps will be saved in the project data dir with this filename.
- **kwargs – Arguments to pass to
libwise.plotutils.imshow_image()
- ctx (
-
wise.tasks.
view_wds
(ctx, title=True, num=True, scales=None, save_filename=None, **kwargs)¶ Plot WDS decomposition
Parameters: - ctx (
wise.project.AnalysisContext
) – - title (bool, optional) – If True, add a title to the map
- num (bool, optional) – If True, annotate each segments
- scales (list or int, optional) – Plot only for scale or list of scales (in pixel)
- save_filename (TYPE, optional) – Description
- **kwargs – Description
- ctx (
-
wise.tasks.
view_all_features
(ctx, scales, region_list=None, legend=False, feature_filter=None, save_filename=None, **img_kargs)¶ Plot all features location
Parameters: - ctx (
wise.project.AnalysisContext
) – - scales (int or list) – Filter the results to scale or list of scales (in pixel)
- region_list (list of
libwise.imgutils.Region
, optional) – Plot the regions, and set the features color according to the region - legend (bool, optional) – Add a legend
- feature_filter (
wise.features.FeatureFilter
, optional) – Filter the results - save_filename (TYPE, optional) – If not None, the resulting maps will be saved in the project data dir with this filename.
- **img_kargs – Additional arguments to pass to
libwise.plotutils.imshow_image()
- ctx (
-
wise.tasks.
plot_separation_from_core
(ctx, scales=None, feature_filter=None, min_link_size=2, title=True, pa=False, snr=False, num=False, fit_fct=None, save_filename=None, **kwargs)¶ Plot separation from core with time
Parameters: - ctx (
wise.project.AnalysisContext
) – - scales (int or list, optional) – Filter the results to scale or list of scales (in pixel)
- feature_filter (
wise.features.FeatureFilter
, optional) – Filter the results - min_link_size (int, optional) – Filter out links with size < min_link_size
- title (bool, optional) –
- pa (bool, optional) – Additionaly plot the PA vs epoch (only pa or snr)
- snr (bool, optional) – Additionaly plot the snr vs epoch (only pa or snr)
- num (bool, optional) – Annotate each links
- fit_fct (
libwise.nputils.AbstractFct
, optional) – Fit each links with provided fct - save_filename (str, optional) – If not None, the resulting maps will be saved in the project data dir with this filename.
- **kwargs – Additional arguments to pass to
wise.wiseutils.plot_links_dfc()
- ctx (
-
wise.tasks.
plot_all_features
(ctx, scales=None, pa=False, feature_filter=None, save_filename=None)¶ Plot all features distance from core with time
Parameters: - ctx (
wise.project.AnalysisContext
) – - scales (int or list, optional) – Filter the results to scale or list of scales (in pixel)
- pa (bool, optional) – Additionaly plot the PA vs epoch
- feature_filter (
wise.features.FeatureFilter
, optional) – Filter the results - save_filename (str, optional) – If not None, the resulting maps will be saved in the project data dir with this filename.
- ctx (
-
wise.tasks.
view_displacements
(ctx, scale, feature_filter=None, title=True, save_filename=None)¶ Plot individual match results at specified scale
Parameters: - ctx (
wise.project.AnalysisContext
) – Description - scales (int) – Scale in pixel
- feature_filter (
wise.features.FeatureFilter
, optional) – Filter the results - save_filename (str, optional) – If not None, the resulting maps will be saved in the project data dir with this filename.
- title (bool, optional) –
- ctx (
-
wise.tasks.
view_links
(ctx, scales=None, feature_filter=None, min_link_size=2, map_cmap='YlGnBu_r', vector_width=6, title=True, color_style='link', save_filename=None, **kwargs)¶ Plot all components trajectories on a map
Parameters: - ctx (
wise.project.AnalysisContext
) – - scales (int or list, optional) – Filter the results to scale or list of scales (in pixel)
- feature_filter (
wise.features.FeatureFilter
, optional) – Filter the results - min_link_size (int, optional) – Filter out links with size < min_link_size
- map_cmap (str, optional) – Colormap of the background map
- vector_width (int, optional) – Width of the displacement vectors
- title (bool, optional) –
- color_style (str, optional) – ‘link’: one color per components ‘date’: colors correspond to the epoch color_str: use color_str as color for all components
- save_filename (str, optional) – If not None, the resulting maps will be saved in the project data dir with this filename.
- **kwargs – Additional arguments to pass to
libwise.plot_links_map()
- ctx (
-
wise.tasks.
create_poly_region
(ctx, img=None, features=None)¶ Create a region file
Parameters: - ctx (
wise.project.AnalysisContext
) – - img (
libwise.imgutils.Image
, optional) – Image to use as background - features (
wise.features.FeaturesGroup
, optional) – Features to plot on top of the image
- ctx (
-
wise.tasks.
list_saved_results
(ctx)¶ List all saved results
Parameters: ctx ( wise.project.AnalysisContext
) –
-
wise.tasks.
list_tasks
()¶ Lists all WISE tasks
-
wise.tasks.
preview_detection_stack
(ctx, stack_detection_name, count_threshold=0, ms_set=None, date_filter=None, show_regions=[])¶ Plot detection in stack
-
wise.tasks.
stack_cross_correlation
(ctx, config, debug=0, nwise=2, stack=None)¶ Perform a Stack Cross Correlation analysis
Parameters: - ctx (
wise.project.AnalysisContext
) – - config (
wise.scc.SCCConfiguration
) – - debug (int, optional) –
- nwise (int, optional) –
- stack (
libwise.plotutils.FigureStack
, optional) –
Returns: :class:`wise.scc.StackCrossCorrelation`
Return type: a StackCrossCorrelation containing the results of the analysis
- ctx (
-
wise.tasks.
bootstrap_scc
(ctx, config, output_dir, n, nwise=2, append=False, verbose=False, seperate_scales=False)¶ Perform Stack Cross Correlation analysis n time and store results in output_dir
Parameters: - ctx (
wise.project.AnalysisContext
) – - config (
wise.scc.SCCConfiguration
) – - output_dir (str) –
- n (int) –
- append (bool, optional) – Append results
- seperate_scales (bool, optional) –
- ctx (
-
wise.tasks.
build_final_dfc
(ctx, merge_file, final_sep) Build a final separation file from a merge file.
Merge file shall be located in ctx.get_data_dir(). One final component per line, described by a list of link id separated by a ‘,’.
Parameters: - ctx (
wise.project.AnalysisContext
) – - merge_file (str) – Merge file name.
- final_sep (str) – Name of the final separation file.
- ctx (
-
wise.tasks.
info_files
(ctx) Print List of selected files with information on beam and pixel scales
Parameters: ctx ( wise.project.AnalysisContext
) –
-
wise.tasks.
set_stack_image_as_ref
(ctx, nsigma=3, nsigma_connected=True) Set the reference image from a stacked images
Parameters: - ctx (
wise.project.AnalysisContext
) – - nsigma (int, optional) – Clip data below nsigma time the background level.
- nsigma_connected (bool, optional) – Keep only the brightest isolated structure.
- ctx (
-
wise.tasks.
set_mask_from_stack_img
(ctx, nsigma=3, nsigma_connected=True) Set the mask image from a stacked images
Parameters: - ctx (
wise.project.AnalysisContext
) – - nsigma (int, optional) – Clip data below nsigma time the background level.
- nsigma_connected (bool, optional) – Keep only the brightest isolated structure.
- ctx (
-
wise.tasks.
info_files_delta
(ctx, delta_time_unit=Unit("d"), angular_velocity_unit=Unit("mas / yr"), proper_velocity_unit=Unit("c")) Print List of selected pair of files with information on velocity resolution
Parameters: - ctx (
wise.project.AnalysisContext
) – - delta_time_unit (
astropy.units.Unit
, optional) – - angular_velocity_unit (
astropy.units.Unit
, optional) – - proper_velocity_unit (
astropy.units.Unit
, optional) –
- ctx (
-
wise.tasks.
detection_all
(ctx, filter=None) Run the Segmented wavelet decomposition on all selected files
Parameters: - ctx (
wise.project.AnalysisContext
) – - filter (
wise.features.FeatureFilter
, optional) –
- ctx (
-
wise.tasks.
match_all
(ctx, filter=None) Run matching on all selected files
Parameters: - ctx (
wise.project.AnalysisContext
) – - filter (
wise.features.FeatureFilter
, optional) –
- ctx (
-
wise.tasks.
save
(ctx, name, coord_mode='com', measured_delta=True) Save current result to disk
Parameters: - ctx (
wise.project.AnalysisContext
) – - name (str) – Prefix name for the save files
- coord_mode (str, optional) –
- measured_delta (bool, optional) –
- ctx (
-
wise.tasks.
load
(ctx, name, projection=None, merge_with_previous=False, min_link_size=2) Load result from files
Parameters: - ctx (
wise.project.AnalysisContext
) – - name (str) – Prefix name of the saved files
- projection (
libwise.imgutils.Projection
, optional) – If not provided, default Projection will be used - merge_with_previous (bool, optional) – If True, this result will be added to current result
- min_link_size (int, optional) – Filter out links with size < min_link_size
- ctx (
-
wise.tasks.
view_all
(ctx, preprocess=True, show_mask=True, show_regions=[], save_filename=None, align=True, **kwargs) Preview all images
Parameters: - ctx (
wise.project.AnalysisContext
) – - preprocess (bool, optional) – If True, run the pre_process fct on each images
- show_mask (bool, optional) – If True, show the saved mask in the map
- show_regions (list of
libwise.imgutils.Region
, optional) – Plot the regions - save_filename (str, optional) – If not None, the resulting maps will be saved in the project data dir with this filename.
- **kwargs – Arguments to pass to
libwise.plotutils.imshow_image()
- ctx (
-
wise.tasks.
view_stack
(ctx, preprocess=True, nsigma=0, nsigma_connected=False, show_mask=True, show_regions=[], intensity_colorbar=False, save_filename=None, **kwargs) Preview the stack image
Parameters: - ctx (
wise.project.AnalysisContext
) – - preprocess (bool, optional) – If True, run the pre_process fct on each images
- nsigma (int, optional) – Clip bg below nsigma level
- nsigma_connected (bool, optional) – If True, keep only the brightest connected structure
- show_mask (bool, optional) – If True, show the saved mask in the map
- show_regions (list of
libwise.imgutils.Region
, optional) – Plot the regions - intensity_colorbar (bool, optional) – Add an intensity colorbar
- save_filename (str, optional) – If not None, the resulting maps will be saved in the project data dir with this filename.
- **kwargs – Arguments to pass to
libwise.plotutils.imshow_image()
- ctx (
-
wise.tasks.
view_wds
(ctx, title=True, num=True, scales=None, save_filename=None, **kwargs) Plot WDS decomposition
Parameters: - ctx (
wise.project.AnalysisContext
) – - title (bool, optional) – If True, add a title to the map
- num (bool, optional) – If True, annotate each segments
- scales (list or int, optional) – Plot only for scale or list of scales (in pixel)
- save_filename (TYPE, optional) – Description
- **kwargs – Description
- ctx (
-
wise.tasks.
view_all_features
(ctx, scales, region_list=None, legend=False, feature_filter=None, save_filename=None, **img_kargs) Plot all features location
Parameters: - ctx (
wise.project.AnalysisContext
) – - scales (int or list) – Filter the results to scale or list of scales (in pixel)
- region_list (list of
libwise.imgutils.Region
, optional) – Plot the regions, and set the features color according to the region - legend (bool, optional) – Add a legend
- feature_filter (
wise.features.FeatureFilter
, optional) – Filter the results - save_filename (TYPE, optional) – If not None, the resulting maps will be saved in the project data dir with this filename.
- **img_kargs – Additional arguments to pass to
libwise.plotutils.imshow_image()
- ctx (
-
wise.tasks.
plot_separation_from_core
(ctx, scales=None, feature_filter=None, min_link_size=2, title=True, pa=False, snr=False, num=False, fit_fct=None, save_filename=None, **kwargs) Plot separation from core with time
Parameters: - ctx (
wise.project.AnalysisContext
) – - scales (int or list, optional) – Filter the results to scale or list of scales (in pixel)
- feature_filter (
wise.features.FeatureFilter
, optional) – Filter the results - min_link_size (int, optional) – Filter out links with size < min_link_size
- title (bool, optional) –
- pa (bool, optional) – Additionaly plot the PA vs epoch (only pa or snr)
- snr (bool, optional) – Additionaly plot the snr vs epoch (only pa or snr)
- num (bool, optional) – Annotate each links
- fit_fct (
libwise.nputils.AbstractFct
, optional) – Fit each links with provided fct - save_filename (str, optional) – If not None, the resulting maps will be saved in the project data dir with this filename.
- **kwargs – Additional arguments to pass to
wise.wiseutils.plot_links_dfc()
- ctx (
-
wise.tasks.
plot_all_features
(ctx, scales=None, pa=False, feature_filter=None, save_filename=None) Plot all features distance from core with time
Parameters: - ctx (
wise.project.AnalysisContext
) – - scales (int or list, optional) – Filter the results to scale or list of scales (in pixel)
- pa (bool, optional) – Additionaly plot the PA vs epoch
- feature_filter (
wise.features.FeatureFilter
, optional) – Filter the results - save_filename (str, optional) – If not None, the resulting maps will be saved in the project data dir with this filename.
- ctx (
-
wise.tasks.
view_displacements
(ctx, scale, feature_filter=None, title=True, save_filename=None) Plot individual match results at specified scale
Parameters: - ctx (
wise.project.AnalysisContext
) – Description - scales (int) – Scale in pixel
- feature_filter (
wise.features.FeatureFilter
, optional) – Filter the results - save_filename (str, optional) – If not None, the resulting maps will be saved in the project data dir with this filename.
- title (bool, optional) –
- ctx (
-
wise.tasks.
view_links
(ctx, scales=None, feature_filter=None, min_link_size=2, map_cmap='YlGnBu_r', vector_width=6, title=True, color_style='link', save_filename=None, **kwargs) Plot all components trajectories on a map
Parameters: - ctx (
wise.project.AnalysisContext
) – - scales (int or list, optional) – Filter the results to scale or list of scales (in pixel)
- feature_filter (
wise.features.FeatureFilter
, optional) – Filter the results - min_link_size (int, optional) – Filter out links with size < min_link_size
- map_cmap (str, optional) – Colormap of the background map
- vector_width (int, optional) – Width of the displacement vectors
- title (bool, optional) –
- color_style (str, optional) – ‘link’: one color per components ‘date’: colors correspond to the epoch color_str: use color_str as color for all components
- save_filename (str, optional) – If not None, the resulting maps will be saved in the project data dir with this filename.
- **kwargs – Additional arguments to pass to
libwise.plot_links_map()
- ctx (
-
wise.tasks.
create_poly_region
(ctx, img=None, features=None) Create a region file
Parameters: - ctx (
wise.project.AnalysisContext
) – - img (
libwise.imgutils.Image
, optional) – Image to use as background - features (
wise.features.FeaturesGroup
, optional) – Features to plot on top of the image
- ctx (
-
wise.tasks.
list_saved_results
(ctx) List all saved results
Parameters: ctx ( wise.project.AnalysisContext
) –
-
wise.tasks.
list_tasks
() Lists all WISE tasks
-
wise.tasks.
preview_detection_stack
(ctx, stack_detection_name, count_threshold=0, ms_set=None, date_filter=None, show_regions=[]) Plot detection in stack
-
wise.tasks.
stack_cross_correlation
(ctx, config, debug=0, nwise=2, stack=None) Perform a Stack Cross Correlation analysis
Parameters: - ctx (
wise.project.AnalysisContext
) – - config (
wise.scc.SCCConfiguration
) – - debug (int, optional) –
- nwise (int, optional) –
- stack (
libwise.plotutils.FigureStack
, optional) –
Returns: :class:`wise.scc.StackCrossCorrelation`
Return type: a StackCrossCorrelation containing the results of the analysis
- ctx (
-
wise.tasks.
bootstrap_scc
(ctx, config, output_dir, n, nwise=2, append=False, verbose=False, seperate_scales=False) Perform Stack Cross Correlation analysis n time and store results in output_dir
Parameters: - ctx (
wise.project.AnalysisContext
) – - config (
wise.scc.SCCConfiguration
) – - output_dir (str) –
- n (int) –
- append (bool, optional) – Append results
- seperate_scales (bool, optional) –
- ctx (
-
wise.tasks.
test
= [<function bootstrap_scc>, <function stack_cross_correlation>]¶ list() -> new empty list list(iterable) -> new list initialized from iterable’s items