<commit_before>import os
import sys
import copy
from fermipy.gtanalysis import GTAnalysis
import numpy as np
import itertools
import argparse

os.environ['USE_ADAPTIVE_PSF_ESTIMATOR']='1'

usage = "usage: %(prog)s [config file]"
description = "Run fermipy analysis chain."
parser = argparse.ArgumentParser(usage=usage,description=description)

parser.add_argument('--config', default = 'sample_config.yaml')
parser.add_argument('--source', default = None)

args = parser.parse_args()
gta = GTAnalysis(args.config,logging={'verbosity' : 3})

gta.setup()

model0 = { 'SpatialModel' : 'PointSource', 'Index' : 1.5 }
model1 = { 'SpatialModel' : 'PointSource', 'Index' : 2.0 }
model2 = { 'SpatialModel' : 'PointSource', 'Index' : 2.5 }
src_name = gta.roi.sources[0].name

# reset the source map
gta.update_source_map(src_name)

# -----------------------------------
# Get a Baseline Model
# -----------------------------------
<commit_msg>Change to fermipy interface.<commit_after>import os
import sys
import copy
from fermipy.gtanalysis import GTAnalysis
import numpy as np
import itertools
import argparse

os.environ['USE_ADAPTIVE_PSF_ESTIMATOR']='1'

usage = "usage: %(prog)s [config file]"
description = "Run fermipy analysis chain."
parser = argparse.ArgumentParser(usage=usage,description=description)

parser.add_argument('--config', default = 'sample_config.yaml')
parser.add_argument('--source', default = None)

args = parser.parse_args()
gta = GTAnalysis(args.config,logging={'verbosity' : 3})

gta.setup()

model0 = { 'SpatialModel' : 'PointSource', 'Index' : 1.5 }
model1 = { 'SpatialModel' : 'PointSource', 'Index' : 2.0 }
model2 = { 'SpatialModel' : 'PointSource', 'Index' : 2.5 }
src_name = gta.roi.sources[0].name

# reset the source map
gta.reload_source(src_name)

# -----------------------------------
# Get a Baseline Model
# -----------------------------------

{'fraction_non_alphanumeric': 0.20596061734965407, 'fraction_numerical': 0.012772751463544438, 'mean_word_length': 3.688279301745636, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6109676', 'n_tokens_mistral': 628, 'n_tokens_neox': 611, 'n_words': 141}