def modshiftTask(clip): time = clip['serve.time'] flux = clip['serve.detrendFlux'] if clip['config.detrendType'] == "tess" else clip['detrend.flux_frac'] model = clip['serve.modelFlux'] if clip['config.detrendType'] == "tess" else clip['trapFit.bestFitModel'] period_days = clip['serve.param.orbitalPeriod_days'] epoch_btjd = clip['serve.param.epoch_btjd'] #Filter out nans idx = np.isnan(time) | np.isnan(flux) | np.isnan(model) time = time[~idx] flux = flux[~idx] model = model[~idx] tic = clip['config.tic'] basePath = clip['config.modshiftBasename'] ticStr = "%016i" %(tic) basename = tessfunc.getOutputBasename(basePath, ticStr) # Name that will go in title of modshift plot objectname = "TIC %012i" % (tic) modplotint = 1 # Change to 0 or anything besides 1 to not have modshift produce plot plotname = "%s-%02i-%04i" % (basename, np.round(period_days*10), np.round(epoch_btjd)) out = ModShift.runModShift(time, flux, model, \ plotname, objectname, period_days, epoch_btjd, modplotint) clip['modshift'] = out #Enforce contract clip['modshift.mod_Fred'] clip['modshift.mod_ph_pri'] clip['modshift.mod_secdepth'] clip['modshift.mod_sig_pri'] return clip
def modshiftTask(clip): time = clip['serve.time'] flux = clip['detrend.flux_frac'] fl = clip['flags'] epic = clip['value'] basename = clip['config.modshiftBasename'] + "%010i" %(epic) period_days = clip['trapFit.period_days'] epoch_bkjd = clip['trapFit.epoch_bkjd'] dur_hrs = clip['trapFit.duration_hrs'] ingress_hrs = clip['trapFit.ingress_hrs'] depth_ppm = 1e6*clip['trapFit.depth_frac'] subSampleN= 15 ioBlock = trapFit.trapezoid_model_onemodel(time[~fl], period_days, \ epoch_bkjd, depth_ppm, dur_hrs, \ ingress_hrs, subSampleN) model = ioBlock.modellc -1 #Want mean of zero # model *= -1 #Invert for testing basename = "%s-%010i" %(basename, epic) modplotint=1 # Change to 0 or anything besides 1 to not have modshift produce plot out = ModShift.runModShift(time[~fl], flux[~fl], model, basename, \ "OBJECTNAME", period_days, epoch_bkjd, modplotint) clip['modshift'] = out #I don't know which values are important, so I can't enfornce contract yet return clip
def modshiftTask(clip): time = clip['serve.time'] flux = clip['detrend.flux_frac'] fl = clip['flags'] epic = clip['value'] basename = clip['config.modshiftBasename'] + "%010i" % (epic) period_days = clip['trapFit.period_days'] epoch_bkjd = clip['trapFit.epoch_bkjd'] dur_hrs = clip['trapFit.duration_hrs'] ingress_hrs = clip['trapFit.ingress_hrs'] depth_ppm = 1e6 * clip['trapFit.depth_frac'] subSampleN = 15 ioBlock = trapFit.trapezoid_model_onemodel(time[~fl], period_days, \ epoch_bkjd, depth_ppm, dur_hrs, \ ingress_hrs, subSampleN) model = ioBlock.modellc - 1 #Want mean of zero # model *= -1 #Invert for testing basename = "%s-%010i" % (basename, epic) modplotint = 1 # Change to 0 or anything besides 1 to not have modshift produce plot out = ModShift.runModShift(time[~fl], flux[~fl], model, basename, \ "OBJECTNAME", period_days, epoch_bkjd, modplotint) clip['modshift'] = out #I don't know which values are important, so I can't enfornce contract yet return clip
def modshiftTask(clip): time = clip['serve.time'] flux = clip['detrend.flux_frac'] fl = clip['detrend.flags'] period_days = clip['trapFit.period_days'] epoch_bkjd = clip['trapFit.epoch_bkjd'] detrendType = clip.config.detrendType #dur_hrs = clip['trapFit.duration_hrs'] #ingress_hrs = clip['trapFit.ingress_hrs'] #depth_ppm = 1e6*clip['trapFit.depth_frac'] epic = clip['value'] basePath = clip['config.modshiftBasename'] epicStr = "%09i" % (epic) basename = getOutputBasename(basePath, epicStr) # Name that will go in title of modshift plot objectname = "EPIC %09i" % (epic) # # subSampleN= 15 # ioBlock = trapFit.trapezoid_model_onemodel(time[~fl], period_days, \ # epoch_bkjd, depth_ppm, dur_hrs, \ # ingress_hrs, subSampleN) # model = ioBlock.modellc -1 #Want mean of zero # #model *= -1 #Invert for testing model = clip['trapFit.bestFitModel'] modplotint = int( 1 ) # Change to 0 or anything besides 1 to not have modshift produce plot plotname = "%s-%02i-%04i-%s" % (basename, np.round( clip.bls.period * 10), np.round( clip.bls.epoch), clip.config.detrendType) out = ModShift.runModShift(time[~fl], flux[~fl], model[~fl], \ plotname, objectname, period_days, epoch_bkjd, modplotint) clip['modshift'] = out #Enforce contract clip['modshift.mod_Fred'] clip['modshift.mod_ph_pri'] clip['modshift.mod_secdepth'] clip['modshift.mod_sig_pri'] return clip
def modshiftTask(clip): time = clip['serve.time'] flux = clip['detrend.flux_frac'] fl = clip['detrend.flags'] period_days = clip['trapFit.period_days'] epoch_bkjd = clip['trapFit.epoch_bkjd'] #dur_hrs = clip['trapFit.duration_hrs'] #ingress_hrs = clip['trapFit.ingress_hrs'] #depth_ppm = 1e6*clip['trapFit.depth_frac'] epic = clip['value'] basePath = clip['config.modshiftBasename'] epicStr = "%09i" %(epic) basename = getOutputBasename(basePath, epicStr) # Name that will go in title of modshift plot objectname = "EPIC %09i" %(epic) # # subSampleN= 15 # ioBlock = trapFit.trapezoid_model_onemodel(time[~fl], period_days, \ # epoch_bkjd, depth_ppm, dur_hrs, \ # ingress_hrs, subSampleN) # model = ioBlock.modellc -1 #Want mean of zero # #model *= -1 #Invert for testing model = clip['trapFit.bestFitModel'] modplotint=1 # Change to 0 or anything besides 1 to not have modshift produce plot plotname = "%s-%02i-%04i-%s" % (basename,np.round(clip.bls.period*10),np.round(clip.bls.epoch),clip.config.detrendType) out = ModShift.runModShift(time[~fl], flux[~fl], model[~fl], \ plotname, objectname, period_days, epoch_bkjd, modplotint) clip['modshift'] = out #Enforce contract clip['modshift.mod_Fred'] clip['modshift.mod_ph_pri'] clip['modshift.mod_secdepth'] clip['modshift.mod_sig_pri'] return clip