Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I ended up by creating my own function.

def crop(CC_value, RR_threshold):
    if abs(CC_value.real()) > RR_threshold and abs(CC_value.imag()) > RR_threshold:
        return CC_value
    elif abs(CC_value.real()) > RR_threshold and abs(CC_value.imag()) < RR_threshold:
        return CC_value.real()
    elif abs(CC_value.real()) < RR_threshold and abs(CC_value.imag()) > RR_threshold:
        return CC_value.imag()*i
    else:
        return 0

print(crop(0.6671 + 1.660*i, 10^-10))
print(crop(0.6671*10^-15 + 1.660*i, 10^-10))
print(crop(2/3 - 1.660*10^-13*i, 10^-10))
print(crop(0.6671*10^-11 + 1.660*10^-17*i, 10^-10))
print(crop(1*10^-11 - 1.660*10^-17*i, 10^-15))

Output

0.667100000000000 + 1.66000000000000*I
1.66000000000000*I
0.666666666666667
0
1.00000000000000e-11