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 latitude = True rock = False prevcandidates = current_observation['prv_candidates'] m_now = current_observation['candidate']['magpsf'] m_app = current_observation['candidate']['magap'] t_now = current_observation['candidate']['jd'] fid_now = current_observation['candidate']['fid'] sgscore = current_observation['candidate']['sgscore1'] sgscore2 = current_observation['candidate']['sgscore2'] sgscore3 = current_observation['candidate']['sgscore3'] srmag = current_observation['candidate']['srmag1'] srmag2 = current_observation['candidate']['srmag2'] srmag3 = current_observation['candidate']['srmag3'] sgmag = current_observation['candidate']['sgmag1'] simag = current_observation['candidate']['simag1'] rbscore = current_observation['candidate']['rb'] magnr = current_observation['candidate']['magnr'] distnr = current_observation['candidate']['distnr'] distpsnr1 = current_observation['candidate']['distpsnr1'] distpsnr2 = current_observation['candidate']['distpsnr2'] distpsnr3 = current_observation['candidate']['distpsnr3'] scorr = current_observation['candidate']['scorr'] fwhm = current_observation['candidate']['fwhm'] elong = current_observation['candidate']['elong'] nbad = current_observation['candidate']['nbad'] chipsf = current_observation['candidate']['chipsf'] gal_lat = current_observation['candidate']['gal_lat'] ssdistnr = current_observation['candidate']['ssdistnr'] ssnamenr = current_observation['candidate']['ssnamenr'] t_start = current_observation['candidate']['jdstarthist'] age = t_now - t_start bright = m_now < 19.0 if (gal_lat and gal_lat < 7 and gal_lat > (-7)): latitude = False calccount -= 2 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 distpsnr1 and sgscore > 0.76 and distpsnr1 < 2): nopointunderneath = False calccount -= 2 if ((distpsnr1 and srmag and distpsnr1 < 20 and srmag < 15.0 and srmag > 0 and sgscore > 0.49) or (distpsnr2 and srmag2 and distpsnr2 < 20 and srmag2 < 15.0 and srmag2 > 0 and sgscore2 > 0.49) or (distpsnr3 and srmag3 and distpsnr3 < 20 and srmag3 < 15.0 and srmag3 > 0 and sgscore3 > 0.49) or (sgscore == 0.5 and distpsnr1 < 0.5 and (sgmag < 17 or srmag < 17 or simag < 17))): 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 variablesource = False if (distnr < 0.25 and magnr < 19 and age > 45): variablesource = True calccount -= 2 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 annotations['gal_lat'] = gal_lat annotations['ssdistnr'] = ssdistnr annotations['ssnamenr'] = ssnamenr annotations['variableSource'] = variablesource filteron = latitude and bright and nopointunderneath and ((not mover)) and real and positivesubtraction and ((not brightstar)) return filteron,annotations