Пример #1
0
def _get_step_weighted_slice(slice_low, slice_high, z_bracket_high, z_bracket_low, z):
    '''
    Interpolate using a step function where the step position is based
    on the proximity to an ionized region
    '''
    smoothed = smoothing.smooth_gauss(slice_high, sigma=4.) 
    diff = np.abs(slice_high-slice_low)
    
    #smoothed=1 means early transition. smoothed=0 means late
    #smoothed -= changed_cells.min()
    #smoothed /= (changed_cells.max()-changed_cells.min())
    step_transitions = _get_step_transitions(smoothed, diff>1.e-3)
    step_transitions = z_bracket_low + step_transitions*(z_bracket_high-z_bracket_low)
    
    interp_slice = slice_high.copy()
    interp_slice[z < step_transitions] = slice_low[z < step_transitions]
    return interp_slice
Пример #2
0
def _get_step_weighted_slice(slice_low, slice_high, z_bracket_high,
                             z_bracket_low, z):
    '''
    Interpolate using a step function where the step position is based
    on the proximity to an ionized region
    '''
    smoothed = smoothing.smooth_gauss(slice_high, sigma=4.)
    diff = np.abs(slice_high - slice_low)

    #smoothed=1 means early transition. smoothed=0 means late
    #smoothed -= changed_cells.min()
    #smoothed /= (changed_cells.max()-changed_cells.min())
    step_transitions = _get_step_transitions(smoothed, diff > 1.e-3)
    step_transitions = z_bracket_low + step_transitions * (z_bracket_high -
                                                           z_bracket_low)

    interp_slice = slice_high.copy()
    interp_slice[z < step_transitions] = slice_low[z < step_transitions]
    return interp_slice
Пример #3
0
def smooth(input_array, sigma):
    return smoothing.smooth_gauss(input_array, sigma)
Пример #4
0
def smooth(input_array, sigma):
    return smoothing.smooth_gauss(input_array, sigma)