Commit 18316594 authored by Heller, William T.'s avatar Heller, William T.
Browse files

Delete sas_temper

parent 4ce65c9f
Loading
Loading
Loading
Loading

scripts/sas_temper

deleted100644 → 0
+0 −57
Original line number Diff line number Diff line
#!/usr/bin/env python
r"""
sas_temper

__main__.py:  this is where the action happens

Oak Ridge National Laboratory, 2020

"""

import sys
import copy
import time as tm
import os
import numpy as np

# these are from this particular project
import sas_temper.sas_temper_config as sa_config
import sas_temper.modelconfig as modelconfig
import sas_temper.parse_conf as parse_conf
import sas_temper.output as output
import sas_temper.sas_temper_engine as engine
import sas_temper.sas_data as sas_data

# will need to import material from sasview.src.sas.sascalc directories
#   the directories are all useful, but are not simple files in themselves


 # see if the program has been called correctly
if len(sys.argv) < 2:
    raise Exception("No configuration file was specified")

# parse the configuration file for the parameters
#modelConf = modelconfig.ModelConfig()
#sasTemperConf = sa_config.SAConfiguration()
sasTemperConf, modelConf = parse_conf.parse_config(sys.argv[1])

# Get the data from the data file
experimentalData = sas_data.SAData(sasTemperConf.datafile,sasTemperConf.qmin,sasTemperConf.qmax)

# This is the outer control loop to generate the set of results
results = np.empty(sasTemperConf.models, "object")
models = np.empty(sasTemperConf.models, "object")
models_usm = np.empty(sasTemperConf.models, "object")

# seed the random number generator
np.random.seed(int(tm.time()) + int(os.getpid()))

# this loop creates the set of models
for i in range(0,sasTemperConf.models):
    results[i], models[i], models_usm[i] = engine.sa_control(sasTemperConf,modelConf,experimentalData)

    #output the results of the single fitting
    output.outputSingleRes(sasTemperConf, experimentalData, models[i], i, results[i])

# and output the analysis of the set of models found
output.outputSetRes(sasTemperConf, results)