def check_dmspan(groups, dt, lofreq, hifreq): """Read in groups and check whether each group's DM span exceeds the threshold. """ for grp in groups: for sp in grp.singlepulses: if sp[1] == grp.max_sigma: downsamp = (sp[2]/dt)/sp[3] width_ms = 1000.0*sp[4]*dt*downsamp break if (grp.max_dm-grp.min_dm > 5*spio.theoritical_dmspan(grp.max_sigma, 5.0, width_ms, lofreq, hifreq)): # checks if the DM span is more than 5 times theoritical dm value. if not ((grp.rank == 5) or (grp.rank == 6) or (grp.rank == 7)): #if group is not good /excellent/unique grp.rank = 2 # then its most likely RFI.
def check_dmspan(groups, dt, lofreq, hifreq): """Read in groups and check whether each group's DM span exceeds the threshold. """ for grp in groups: for sp in grp.singlepulses: if sp[1] == grp.max_sigma: downsamp = (sp[2]/dt)/sp[3] width_ms = 1000.0*sp[4]*dt*downsamp break if (grp.max_dm-grp.min_dm > 5*spio.theoritical_dmspan(grp.max_sigma, 5.0, width_ms, lofreq, hifreq)): # checks if the DM span is more than 5 times theoritical dm value. if not ((grp.rank == 5) or (grp.rank == 6)): #if group is not good or excellent grp.rank = 2 # then its most likely RFI.