def loadMapTask(clip): value = clip.value path = lpp.getLppDir() mapFile = os.path.join(path, "octave/maps/mapQ1Q17DR24-DVMed6084.mat") #This isn't sufficient. I have to massage this to #become acceptable to oct2py as a matlab struct of arrays print "Cp1 %i" % value lppObj = sio.loadmat(mapFile, squeeze_me=True, struct_as_record=False)['map'] print "Cp2 %i" % value struct = dict() struct['nDim'] = lppObj.nDim struct['knn'] = lppObj.knn struct['knnGood'] = lppObj.knnGood struct['mapped'] = lppObj.mapped clip['lppObj'] = struct print "Cp3 %i" % value octave = Oct2Py() path = lpp.getLppDir() octave.addpath(path) # octave.addpath(os.getcwd()) # mapping = octave.testFunc2(struct) # print "mapping is %s" %(str(mapping)) # clip['mapping'] = mapping return clip
def loadDefaultConfig(): cfg = dict() cfg['debug'] = True cfg['campaign'] = 3 cfg['timeout_sec'] = 120 cfg['nPointsForMedianSmooth'] = 48 cfg['blsMinPeriod'] = 0.5 cfg['blsMaxPeriod'] = 30 cfg['detrendType'] = 'PDC' #Thermal resettling tends to bugger up the first day or so of K2 data #It seems best to just cut out a chunk. cfg['numInitialCadencesToIgnore'] = 50 #Vetting parameters cfg['minSnrForDetection'] = 10. cfg['maxLppForTransit'] = 10**-2.1 #How significant must centroid offset be to claim a false positive. #This value is between 0 and 1. Higher values mean fewer false positives cfg['minProbDiffImgCentroidForFail'] = 0.99 #The LPP mapping file is used by LPP to define the regions of param #space where the transits cluster. try: path = lpp.getLppDir() cfg['lppMapFilePath'] = os.path.join( path, "octave/maps/mapQ1Q17DR24-DVMed6084.mat") except NameError: cfg['lppMapFilePath'] = "NotNeeded" davePath = os.path.join(os.environ['HOME'], "daveOutput", "") cfg['modshiftBasename'] = davePath cfg['onepageBasename'] = davePath cfg['clipSavePath'] = davePath #Location of the place all the light curves and TPF files are stored cfg['dataStorePath'] = os.path.join(os.environ['HOME'], ".mastio/k2") #Location of the model PRF fits files. cfg['prfPath'] = os.path.join(os.environ['HOME'], ".mastio/keplerprf") #My front end tasks = """checkDirExistTask serveTask extractLightcurveTask computeCentroidsTask rollPhaseTask cotrendSffDataTask detrendDataTask fblsTask trapezoidFitTask vetTask plotTask saveClip""".split( ) # Jeff added plotTask cfg['taskList'] = tasks searchTaskList = """blsTask trapezoidFitTask modshiftTask measureDiffImgCentroidsTask dispositionTask""".split() cfg['searchTaskList'] = searchTaskList cfg['keysToIgnoreWhenSaving'] = ["serve"] return cfg
def loadDefaultConfig(): cfg = dict() cfg['debug'] = True cfg['campaign'] = 3 cfg['timeout_sec'] = 120 cfg['nPointsForMedianSmooth'] = 48 cfg['blsMinPeriod'] = 0.5 cfg['blsMaxPeriod'] = 30 #Thermal resettling tends to bugger up the first day or so of K2 data #It seems best to just cut out a chunk. cfg['numInitialCadencesToIgnore'] = 50 #Vetting parameters cfg['minSnrForDetection'] = 10. cfg['maxLppForTransit'] = 10**-2.1 #How significant must centroid offset be to claim a false positive. #This value is between 0 and 1. Higher values mean fewer false positives cfg['minProbDiffImgCentroidForFail'] = 0.99 #The LPP mapping file is used by LPP to define the regions of param #space where the transits cluster. try: path = lpp.getLppDir() cfg['lppMapFilePath'] = os.path.join(path, "octave/maps/mapQ1Q17DR24-DVMed6084.mat") except NameError: cfg['lppMapFilePath'] = "NotNeeded" davePath = os.path.join(os.environ['HOME'],"daveOutput","") cfg['modshiftBasename'] = davePath cfg['onepageBasename'] = davePath cfg['clipSavePath'] = davePath #Location of the place all the light curves and TPF files are stored cfg['dataStorePath'] = os.path.join(os.environ['HOME'],".mastio/k2") #Location of the model PRF fits files. cfg['prfPath'] = os.path.join(os.environ['HOME'], ".mastio/keplerprf") #My front end tasks = """checkDirExistTask serveTask extractLightcurveTask computeCentroidsTask rollPhaseTask cotrendSffDataTask detrendDataTask' fblsTask trapezoidFitTask vetTask plotTask saveClip""".split() # Jeff added plotTask cfg['taskList'] = tasks searchTaskList = """blsTask trapezoidFitTask modshiftTask measureDiffImgCentroidsTask dispositionTask""".split() cfg['searchTaskList'] = searchTaskList cfg['keysToIgnoreWhenSaving'] = ["serve"] return cfg
def testTask(clip): path = lpp.getLppDir() octave = Oct2Py() octave.addpath(path) octave.addpath(os.getcwd()) mapFile = os.path.join(path, "octave/maps/mapQ1Q17DR24-DVMed6084.mat") total = octave.testFunc(mapFile) clip['lpp'] = total print clip['value'], total return clip
def loadMultiEventConfig(): cfg = dict() cfg['debug'] = True cfg['campaign'] = 3 cfg['timeout_sec'] = 120 cfg['nPointsForMedianSmooth'] = 2*48 cfg['maxNumEvents'] = 10 cfg['blsMinPeriod'] = 0.5 cfg['blsMaxPeriod'] = 30 #Vetting parameters cfg['minSnrForDetection'] = 10. cfg['maxLppForTransit'] = 0.03 cfg['minCentroidSignifForFp'] = 3.0 #The LPP mapping file is used by LPP to define the regions of param #space where the transits cluster. path = lpp.getLppDir() cfg['lppMapFilePath'] = \ os.path.join(path, "octave/maps/mapQ1Q17DR24-DVMed6084.mat") cfg['modshiftBasename'] = \ os.path.join(os.environ['HOME'],"daveOutput","modshift") cfg['onepageBasename'] = \ os.path.join(os.environ['HOME'],"daveOutput","onepage") #Location of the place all the light curves and TPF files are stored cfg['dataStorePath'] = os.path.join(os.environ['HOME'],".mastio/k2") #Location of the model PRF fits files. cfg['prfPath'] = os.path.join(os.environ['HOME'], ".mastio/keplerprf") #My front end tasks = """pl.checkDirExistTask pl.serveTask pl.extractLightcurveTask pl.computeCentroidsTask pl.rollPhaseTask pl.cotrendDataTask pl.detrendDataTask singleEventSearchTask pl.saveOnError""".split() cfg['taskList'] = tasks cfg['singleEventTaskList'] = "blsTask trapezoidFitTask vetTask".split() cfg['clipSavePath'] = "./clips" cfg['keysToIgnoreWhenSaving'] = ["serve"] return cfg
def loadMultiEventConfig(): cfg = dict() cfg['debug'] = True cfg['campaign'] = 3 cfg['timeout_sec'] = 120 cfg['nPointsForMedianSmooth'] = 2 * 48 cfg['maxNumEvents'] = 10 cfg['blsMinPeriod'] = 0.5 cfg['blsMaxPeriod'] = 30 #Vetting parameters cfg['minSnrForDetection'] = 10. cfg['maxLppForTransit'] = 0.03 cfg['minCentroidSignifForFp'] = 3.0 #The LPP mapping file is used by LPP to define the regions of param #space where the transits cluster. path = lpp.getLppDir() cfg['lppMapFilePath'] = \ os.path.join(path, "octave/maps/mapQ1Q17DR24-DVMed6084.mat") cfg['modshiftBasename'] = \ os.path.join(os.environ['HOME'],"daveOutput","modshift") cfg['onepageBasename'] = \ os.path.join(os.environ['HOME'],"daveOutput","onepage") #Location of the place all the light curves and TPF files are stored cfg['dataStorePath'] = os.path.join(os.environ['HOME'], ".mastio/k2") #Location of the model PRF fits files. cfg['prfPath'] = os.path.join(os.environ['HOME'], ".mastio/keplerprf") #My front end tasks = """pl.checkDirExistTask pl.serveTask pl.extractLightcurveTask pl.computeCentroidsTask pl.rollPhaseTask pl.cotrendDataTask pl.detrendDataTask singleEventSearchTask pl.saveOnError""".split() cfg['taskList'] = tasks cfg['singleEventTaskList'] = "blsTask trapezoidFitTask vetTask".split() cfg['clipSavePath'] = "./clips" cfg['keysToIgnoreWhenSaving'] = ["serve"] return cfg