コード例 #1
0
ファイル: project.py プロジェクト: flomertens/wise
    def __init__(self):
        data = [
        ["data_dir", None, "Base data directory", validator_is(str), str, str, 0],
        ["fits_extension", 0, "Extension index", validator_is(int), int, str, 0],
        ["stack_image_filename", "full_stack_image.fits", "Stack Image filename", nputils.validator_is(str), str, str, 2],
        ["ref_image_filename", "reference_image", "Reference image filename", validator_is(str), str, str, 0],
        ["mask_filename", "mask.fits", "Mask filename", validator_is(str), str, str, 0],
        ["bg_fct", None, "Background extraction fct", is_callable, None, None, 2],
        ["bg_coords", None, "Background region in coordinates [Xa,Ya,Xb,Yb]", validator_list(4, (int, float)), 
            str2floatlist, jp.encode, 0],
        ["bg_use_ksigma_method", False, "Use ksigma method to estimate the background level", validator_is(bool), str2bool, str, 0],
        ["roi_coords", None, "Region of interest in coordinates [Xa,Ya,Xb,Yb]", validator_list(4, (int, float)), 
            str2floatlist, jp.encode, 0],            
        ["core_offset_filename", "core.dat", "Core offset filename", validator_is(str), str, str, 0],
        ["core_offset_fct", None, "Core offset generation fct", is_callable, None, None, 2],
        ["pre_bg_process_fct", None, "Initial processing before bg extraction", is_callable, None, None, 2],
        ["pre_process_fct", None, "Pre detection processing", is_callable, None, None, 2],
        ["post_process_fct", None, "Post detection processing", is_callable, None, None, 2],
        ["crval", None, "CRVAL", validator_is(list), jp.decode, jp.encode, 1],
        ["crpix", None, "CRPIX", validator_is(list), jp.decode, jp.encode, 1],
        ["projection_unit", u.mas, "Unit used for the projection", validator_is(u.Unit), u.Unit, str, 0],
        ["projection_relative", True, "Use relative projection", validator_is(bool), str2bool, str, 0],
        ["projection_center", "pix_ref", "Method used to get the center", validator_is(str), str, str, 0],
        ["object_distance", None, "Object distance", validator_is(u.Quantity), quantity_decode, str, 0],
        ["object_z", 0, "Object z", validator_in_range(0, 5), float, str, 0],
        ]

        # nputils.BaseConfiguration.__init__(self, data, title="Finder configuration")
        super(DataConfiguration, self).__init__(data, title="Data configuration")
コード例 #2
0
ファイル: scc.py プロジェクト: flomertens/wise
    def __init__(self):
        data = [
        ["unit", u.mas / u.year, "Velocity unit", nputils.validator_is(u.Unit)],
        ["bounds", [1, 1, 1, 1], "Velocity bounds", nputils.validator_list(4, (int, float))],
        ["filter1", None, "Filter for the first image", nputils.validator_is((NoneType, nputils.AbstractFilter))],
        ["filter2", None, "Filter for the second image", nputils.validator_is((NoneType, nputils.AbstractFilter))],
        ["tol_pix_range", [4, 25], "Allowed range of pixel velocity resolution", nputils.validator_list(2, int)],
        ["ncc_threshold", 0.6, "Threshold for the NCC", nputils.validator_is(bool)],
        ["factor", 10, "Zoom factor of the resulting map", nputils.validator_in_range(1, 20)],
        ["method", 'ncc_peaks_direct', "Method used to compute the SCC", lambda v: v in ['ncc', 'ncc_peaks', 'ncc_peaks_direct']],
        ["vector_direction", None, "Project the result on this direction", lambda v: v == 'position_angle' or nputils.is_callable(v) or isinstance(v, (list, np.ndarray, NoneType))],
        ["velocity_trans", None, "Do any transform on the velocity vector, pre projection", lambda v: nputils.is_callable(v)],
        ["rnd_pos_shift", False, "Randomly shift the segments position", nputils.validator_is((bool, NoneType))],
        ["rnd_pos_factor", 1.5, "Factor of the standart deviation of the shift", nputils.validator_in_range(0.1, 5)],
        ["img_rnd_shift", 0, "Randomly shift the images (pixel std)", nputils.validator_in_range(0, 10)],
        ["shuffle", False, "Suffle the list of images", nputils.validator_is(bool)],
        ]

        nputils.BaseConfiguration.__init__(self, data, title="Stack cross correlation configuration")
コード例 #3
0
ファイル: wds.py プロジェクト: flomertens/wise
    def __init__(self):
        data = [
        ["alpha_threashold", 3, "Significance threshold", validator_in_range(0.1, 20), float, str, 0],
        ["alpha_detection", 4, "Detection threshold", validator_in_range(0.1, 20), float, str, 0],
        ["min_scale", 1, "Minimum Wavelet scale", validator_in_range(0, 10, instance=int), int, str, 0],
        ["max_scale", 4, "Maximum Wavelet scale", validator_in_range(1, 10, instance=int), int, str, 0],
        ["scales_snr_filter", None, "Per scales detection threshold", validator_is(dict), jp.decode, jp.encode, 1],
        ["ms_dec_klass", WaveletMultiscaleDecomposition, "Multiscale decompostion class", 
            validator_is_class(AbstractMultiScaleDecomposition), lambda s: jp.decode(str2jsonclass(s)), jp.encode, 1],
        ["use_iwd", False, "Use Intermediate Wavelet Decomposition", validator_is(bool), str2bool, str, 0],
        ["dec", wtutils.uiwt, "Multiscale decompostion class", is_callable, lambda s: jp.decode(str2jsonfunction(s)), jp.encode, 1],
        ["wd_wavelet", 'b1', "Wavelet to use for the Wavelet Decomposition", validator_is(str), str, str, 1],
        ["iwd_wavelet", 'b3', "Wavelet to use for the Intermediate Wavelet Decomposition", validator_is(str), str, str, 1],
        ["dog_step", True, "DOG", validator_is(int), None, None, 2],
        ["dog_angle", True, "DOG", validator_is((int, float)), None, None, 2],
        ["dog_ellipticity", True, "DOG", validator_is((int, float)), None, None, 2],
        ["exclude_border_dist", 1, "Number of pixel from border to exclude", validator_is(int), int, str, 0],
        ["exclude_noise", True, "Include coefficients below threshold in resulting image", validator_is(bool), str2bool, str, 1],
        ]

        super(FinderConfiguration, self).__init__(data, title="Finder configuration")
コード例 #4
0
    def __init__(self):
        data = [
            [
                "unit", u.mas / u.year, "Velocity unit",
                nputils.validator_is(u.Unit)
            ],
            [
                "bounds", [1, 1, 1, 1], "Velocity bounds",
                nputils.validator_list(4, (int, float))
            ],
            [
                "filter1", None, "Filter for the first image",
                nputils.validator_is((NoneType, nputils.AbstractFilter))
            ],
            [
                "filter2", None, "Filter for the second image",
                nputils.validator_is((NoneType, nputils.AbstractFilter))
            ],
            [
                "tol_pix_range", [4, 25],
                "Allowed range of pixel velocity resolution",
                nputils.validator_list(2, int)
            ],
            [
                "ncc_threshold", 0.6, "Threshold for the NCC",
                nputils.validator_is(bool)
            ],
            [
                "factor", 10, "Zoom factor of the resulting map",
                nputils.validator_in_range(1, 20)
            ],
            [
                "method", 'ncc_peaks_direct', "Method used to compute the SCC",
                lambda v: v in ['ncc', 'ncc_peaks', 'ncc_peaks_direct']
            ],
            [
                "vector_direction", None,
                "Project the result on this direction",
                lambda v: v == 'position_angle' or nputils.is_callable(
                    v) or isinstance(v, (list, np.ndarray, NoneType))
            ],
            [
                "velocity_trans", None,
                "Do any transform on the velocity vector, pre projection",
                lambda v: nputils.is_callable(v)
            ],
            [
                "rnd_pos_shift", False, "Randomly shift the segments position",
                nputils.validator_is((bool, NoneType))
            ],
            [
                "rnd_pos_factor", 1.5,
                "Factor of the standart deviation of the shift",
                nputils.validator_in_range(0.1, 5)
            ],
            [
                "img_rnd_shift", 0, "Randomly shift the images (pixel std)",
                nputils.validator_in_range(0, 10)
            ],
            [
                "shuffle", False, "Suffle the list of images",
                nputils.validator_is(bool)
            ],
        ]

        nputils.BaseConfiguration.__init__(
            self, data, title="Stack cross correlation configuration")
コード例 #5
0
    def __init__(self):
        data = [
            [
                "alpha_threashold", 3, "Significance threshold",
                validator_in_range(0.1, 20), float, str, 0
            ],
            [
                "alpha_detection", 4, "Detection threshold",
                validator_in_range(0.1, 20), float, str, 0
            ],
            [
                "min_scale", 1, "Minimum Wavelet scale",
                validator_in_range(0, 10, instance=int), int, str, 0
            ],
            [
                "max_scale", 4, "Maximum Wavelet scale",
                validator_in_range(1, 10, instance=int), int, str, 0
            ],
            [
                "scales_snr_filter", None, "Per scales detection threshold",
                validator_is(dict), jp.decode, jp.encode, 1
            ],
            [
                "ms_dec_klass", WaveletMultiscaleDecomposition,
                "Multiscale decompostion class",
                validator_is_class(AbstractMultiScaleDecomposition),
                lambda s: jp.decode(str2jsonclass(s)), jp.encode, 1
            ],
            [
                "use_iwd", False, "Use Intermediate Wavelet Decomposition",
                validator_is(bool), str2bool, str, 0
            ],
            [
                "dec", wtutils.uiwt, "Multiscale decompostion class",
                is_callable, lambda s: jp.decode(str2jsonfunction(s)),
                jp.encode, 1
            ],
            [
                "wd_wavelet", 'b1',
                "Wavelet to use for the Wavelet Decomposition",
                validator_is(str), str, str, 1
            ],
            [
                "iwd_wavelet", 'b3',
                "Wavelet to use for the Intermediate Wavelet Decomposition",
                validator_is(str), str, str, 1
            ],
            ["dog_step", True, "DOG",
             validator_is(int), None, None, 2],
            [
                "dog_angle", True, "DOG",
                validator_is((int, float)), None, None, 2
            ],
            [
                "dog_ellipticity", True, "DOG",
                validator_is((int, float)), None, None, 2
            ],
            [
                "exclude_border_dist", 1,
                "Number of pixel from border to exclude",
                validator_is(int), int, str, 0
            ],
            [
                "exclude_noise", True,
                "Include coefficients below threshold in resulting image",
                validator_is(bool), str2bool, str, 1
            ],
        ]

        super(FinderConfiguration, self).__init__(data,
                                                  title="Finder configuration")
コード例 #6
0
    def __init__(self):
        data = [
            [
                "data_dir", None, "Base data directory",
                validator_is(str), str, str, 0
            ],
            [
                "fits_extension", 0, "Extension index",
                validator_is(int), int, str, 0
            ],
            [
                "stack_image_filename", "full_stack_image.fits",
                "Stack Image filename",
                nputils.validator_is(str), str, str, 2
            ],
            [
                "ref_image_filename", "reference_image",
                "Reference image filename",
                validator_is(str), str, str, 0
            ],
            [
                "mask_filename", "mask.fits", "Mask filename",
                validator_is(str), str, str, 0
            ],
            [
                "bg_fct", None, "Background extraction fct", is_callable, None,
                None, 2
            ],
            [
                "bg_coords", None,
                "Background region in coordinates [Xa,Ya,Xb,Yb]",
                validator_list(4, (int, float)), str2floatlist, jp.encode, 0
            ],
            [
                "bg_use_ksigma_method", False,
                "Use ksigma method to estimate the background level",
                validator_is(bool), str2bool, str, 0
            ],
            [
                "roi_coords", None,
                "Region of interest in coordinates [Xa,Ya,Xb,Yb]",
                validator_list(4, (int, float)), str2floatlist, jp.encode, 0
            ],
            [
                "core_offset_filename", "core.dat", "Core offset filename",
                validator_is(str), str, str, 0
            ],
            [
                "core_offset_fct", None, "Core offset generation fct",
                is_callable, None, None, 2
            ],
            [
                "pre_bg_process_fct", None,
                "Initial processing before bg extraction", is_callable, None,
                None, 2
            ],
            [
                "pre_process_fct", None, "Pre detection processing",
                is_callable, None, None, 2
            ],
            [
                "post_process_fct", None, "Post detection processing",
                is_callable, None, None, 2
            ],
            [
                "crval", None, "CRVAL",
                validator_is(list), jp.decode, jp.encode, 1
            ],
            [
                "crpix", None, "CRPIX",
                validator_is(list), jp.decode, jp.encode, 1
            ],
            [
                "projection_unit", u.mas, "Unit used for the projection",
                validator_is(u.Unit), u.Unit, str, 0
            ],
            [
                "projection_relative", True, "Use relative projection",
                validator_is(bool), str2bool, str, 0
            ],
            [
                "projection_center", "pix_ref",
                "Method used to get the center",
                validator_is(str), str, str, 0
            ],
            [
                "object_distance", None, "Object distance",
                validator_is(u.Quantity), quantity_decode, str, 0
            ],
            [
                "object_z", 0, "Object z",
                validator_in_range(0, 5), float, str, 0
            ],
        ]

        # nputils.BaseConfiguration.__init__(self, data, title="Finder configuration")
        super(DataConfiguration, self).__init__(data,
                                                title="Data configuration")