def compiledFunction(current_observation): filteron = False annotations={} calccount=10000 bright = False nopointunderneath = True mover = True real = False slope = 0.0 t_slope = 0.0 rb = 0.0 positivesubtraction = False brightstar = False scorr = 0.0 prevcandidates = current_observation['prv_candidates'] m_now = current_observation['candidate']['magpsf'] t_now = current_observation['candidate']['jd'] fid_now = current_observation['candidate']['fid'] sgscore = current_observation['candidate']['sgscore1'] rbscore = current_observation['candidate']['rb'] magnr = current_observation['candidate']['magnr'] distnr = current_observation['candidate']['distnr'] scorr = current_observation['candidate']['scorr'] bright = m_now < 19.0 if (current_observation['candidate']['isdiffpos'] and (current_observation['candidate']['isdiffpos'] == 't' or current_observation['candidate']['isdiffpos'] == '1')): positivesubtraction = True calccount -= 2 if (rbscore and rbscore > 0.2): real = True calccount -= 2 if (sgscore and sgscore > 0.74): nopointunderneath = False calccount -= 2 if (magnr and magnr < 15.0 and distnr and distnr < 10): brightstar = True calccount -= 2 for candidate in prevcandidates: calccount -= 2 if (candidate['jd'] and candidate['magpsf'] and candidate['fid'] and candidate['isdiffpos'] and (candidate['isdiffpos'] == 't' or candidate['isdiffpos'] == '1')): dt = t_now - candidate['jd'] if (dt > 0.02 and candidate['magpsf'] < 99): mover = False calccount -= 2 if (dt != 0.0 and candidate['magpsf'] < 99): if (candidate['jd'] > t_slope and candidate['fid'] == fid_now): t_slope = candidate['jd'] slope = (m_now - candidate['magpsf']) / dt calccount -= 3 calccount -= 2 calccount -= 4 if calccount < 0: break annotations['magnitude'] = m_now annotations['sgscore'] = sgscore annotations['slope'] = slope annotations['rbscore'] = rbscore annotations['mover'] = mover annotations['real'] = real annotations['positiveSubtraction'] = positivesubtraction annotations['brightStar'] = brightstar annotations['magnr'] = magnr annotations['distnr'] = distnr annotations['scorr'] = scorr filteron = bright and nopointunderneath and ((not mover)) and real and positivesubtraction and ((not brightstar)) return filteron,annotations