Skip to content

Instantly share code, notes, and snippets.

@MShirazAhmad
Created February 2, 2020 12:12
Show Gist options
  • Save MShirazAhmad/04fd1e98cc886637d662cf392ee47905 to your computer and use it in GitHub Desktop.
Save MShirazAhmad/04fd1e98cc886637d662cf392ee47905 to your computer and use it in GitHub Desktop.
Clipping raw data on two levels and normalizing to unity
import numpy as np
def clipping(data):
temp = data
cond_zero = (temp <= 0.7) & (temp <= 1.5)
cond_one = (temp >= 0.7) & (temp >= 1.5)
temp[cond_zero] = 0
temp[cond_one] = 1
return temp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment