Пример #1
0
        try:
            if just_prefactor:
                fit_prefactor(roi, name)
            else:
                roi.fit(fit_bg_first=fit_bg_first)
        except Exception, ex:
            print 'ERROR spectral fitting pointlike for hypothesis %s:' % hypothesis, ex
            traceback.print_exc(file=sys.stdout)
        print_summary()

    fit(just_prefactor=True)
    fit(fit_bg_first=True)
    fit()

    if localize:
        paranoid_localize(roi, name, verbosity=4)

    if fit_extension:
        roi.fit_extension(which=name)
        paranoid_localize(roi, name)

    fit()

    print 'Making pointlike SED for hypothesis %s' % hypothesis
    sed = PointlikeSED(roi, name, verbosity=4)
    sed.save('%s/sed_pointlike_4bpd_%s_%s.yaml' %
             (pipeline.dirdict['seds'], hypothesis, name))
    sed.plot('%s/sed_pointlike_4bpd_%s_%s.png' %
             (pipeline.dirdict['seds'], hypothesis, name))

    print_summary()
Пример #2
0
        try:
            if just_prefactor:
                fit_prefactor(roi, name) 
            else:
                roi.fit(fit_bg_first=fit_bg_first)
        except Exception, ex:
            print 'ERROR spectral fitting pointlike for hypothesis %s:' % hypothesis, ex
            traceback.print_exc(file=sys.stdout)
        print_summary()

    fit(just_prefactor=True)
    fit(fit_bg_first=True)
    fit() 

    if localize:
        paranoid_localize(roi, name, verbosity=4)

    if fit_extension:
        roi.fit_extension(which=name)
        paranoid_localize(roi, name)

    fit()

    print 'Making pointlike SED for hypothesis %s' % hypothesis
    sed = PointlikeSED(roi, name, verbosity=4)
    sed.save('%s/sed_pointlike_4bpd_%s_%s.yaml' % (pipeline.dirdict['seds'],hypothesis,name))
    sed.plot('%s/sed_pointlike_4bpd_%s_%s.png' % (pipeline.dirdict['seds'],hypothesis,name)) 

    print_summary()

    p = source_dict(roi, name)
Пример #3
0
            traceback.print_exc(file=sys.stdout)
        print_summary()

    fit(just_prefactor=True)
    fit(fit_bg_first=True)
    fit() 

    frozen  = freeze_far_away(roi, roi.get_source(name).skydir, max_free)

    if localize:
        if override_localization is None:
            print 'About to Grid localize for hypothesis %s' % hypothesis
            grid=GridLocalize(roi, name, size=0.5, pixelsize=0.1, verbosity=4)
            print_summary()
            
            ellipse = paranoid_localize(roi, name, verbosity=4)
            print 'Localization Ellipse:',ellipse
        else:
            print 'Override Localization for source %s:', name
            print 'override_localization=',override_localization
            roi.modify(which=None, skydir=override_localization['init_position'])

            assert override_localization['method'] == 'MinuitLocalizer'
            m=MinuitLocalizer(roi, name, verbosity=4)
            print 'Localization Ellipse:',m.todict()


    if fit_extension:
        roi.fit_extension(which=name)
        ellipse = paranoid_localize(roi, name)
        print ellipse