Example #1
0
    def _map_function(defl, *args, **kwargs):
        """
        
        :param defl:
        :type defl:
        
        :param args:
        :type args:
        
        :param kwargs:
        :type kwargs:
        
        :returns: List [inst_freq, amplitude, phase, tfp, shift, pwr_diss]
            WHERE
            [type] inst_freq is...
            [type] amplitude is...
            [type] phase is...
            [type] tfp is...
            [type] shift is...
            [type] pwr_diss is...
        """
        parm_dict = args[0]
        pixel_params = args[1]
        impulse = args[2]

        pix = Pixel(defl, parm_dict, **pixel_params)

        if parm_dict['if_only']:
            inst_freq, _, _ = pix.generate_inst_freq()
            tfp = 0
            shift = 0
            amplitude = 0
            phase = 0
            pwr_diss = 0
        elif parm_dict['deconvolve']:
            iterations = parm_dict['conv_iterations']
            impulse = impulse[
                parm_dict['impulse_window'][0]:parm_dict['impulse_window'][1]]
            inst_freq, amplitude, phase = pix.generate_inst_freq()
            conv = restoration.richardson_lucy(inst_freq,
                                               impulse,
                                               clip=False,
                                               num_iter=iterations)
            pix.inst_freq = conv
            pix.find_tfp()
            tfp = pix.tfp
            shift = pix.shift
            pix.calculate_power_dissipation()
            pwr_diss = pix.power_dissipated
        else:
            tfp, shift, inst_freq = pix.analyze()
            pix.calculate_power_dissipation()
            amplitude = pix.amplitude
            phase = pix.phase
            pwr_diss = pix.power_dissipated

        return [inst_freq, amplitude, phase, tfp, shift, pwr_diss]
Example #2
0
    def _map_function(defl, *args, **kwargs):

        parm_dict = args[0]
        pixel_params = args[1]

        pix = Pixel(defl, parm_dict, **pixel_params)

        if parm_dict['if_only']:
            inst_freq, _, _ = pix.generate_inst_freq()
            tfp = 0
            shift = 0
            amplitude = 0
            phase = 0
            pwr_diss = 0
        else:
            tfp, shift, inst_freq = pix.analyze()
            pix.calculate_power_dissipation()
            amplitude = pix.amplitude
            phase = pix.phase
            pwr_diss = pix.power_dissipated

        return [inst_freq, amplitude, phase, tfp, shift, pwr_diss]