Exemplo n.º 1
0
    def test_lc(self):

        test_out_dir = self.set_outputfolder("test_lc")


        ag = AGAnalysis(self.agilepyConf, self.sourcesConfTxt)

        ag.setOptions(energybins=[[100, 300]], fovbinnumber=1) # to reduce the computational time

        ag.freeSources(lambda name: name == self.VELA, "flux", True)

        lightCurveData = ag.lightCurveMLE(self.VELA, tmin=433860000, tmax=433880000, timetype="TT", binsize=20000)

        self.assertEqual(True, os.path.isfile(lightCurveData))

        with open(lightCurveData, "r") as lcd:
            lines = lcd.readlines()
            # print("readlines: ", lines)
        self.assertEqual(True,len(lines) == 1+1) # 1 header + 2 temporal bins

        lightCurveData = ag.lightCurveMLE(self.VELA, tmin=433900000, tmax=433940000, timetype="TT", binsize=20000)

        self.assertEqual(True, os.path.isfile(lightCurveData))

        with open(lightCurveData, "r") as lcd:
            lines = lcd.readlines()
            # print("readlines: ", lines)
        self.assertEqual(True, len(lines) == 1+2) # 1 header + 3 temporal bins

        lightCurvePlot = ag.displayLightCurve("mle", saveImage=True)
        self.assertEqual(True, os.path.isfile(lightCurvePlot))

        ag.destroy()
Exemplo n.º 2
0
    def test_generic_column(self):

        test_out_dir = self.set_outputfolder("g_col")

        ag = AGAnalysis(self.agilepyConf, self.sourcesConfTxt)

        ag.setOptions(energybins=[[100, 300]], fovbinnumber=1)

        ag.freeSources(lambda name: name == self.VELA, "flux", True)

        lightCurveData = ag.lightCurveMLE(
            self.VELA, tmin=433860000, tmax=433880000, timetype="TT", binsize=20000)

        #filename = ag.displayGenericColumns(
        #    lightCurveData, columns=["l_peak"], um=["test_um"], saveImage=True)

        filename = ag.displayGenericColumns(
            lightCurveData, columns=["l_peak", "counts"], um=["test_um", "counts"], saveImage=True)

        self.assertEqual(True, os.path.isfile(filename))

        ag.destroy()