diff --git a/.github/workflows/pypi_publish.yml b/.github/workflows/pypi_publish.yml new file mode 100644 index 00000000..81ac43ae --- /dev/null +++ b/.github/workflows/pypi_publish.yml @@ -0,0 +1,32 @@ +# This workflows will upload a Python Package using Twine when a release is created +# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries + +name: Upload Python Package + +on: + push: + branches: [ master ] + +jobs: + deploy: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.8' + - uses: Gr1N/setup-poetry@v4 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + poetry update + - name: Build + run: | + poetry build + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@master + with: + password: ${{ secrets.PYPI_PASSWORD }} diff --git a/LICENSE b/LICENSE index c0f7977a..111a1bb3 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ BSD 3-Clause License -Copyright (c) 2021, European Spallation Source +Copyright (c) 2021-2022, European Spallation Source All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/README.md b/README.md index 55c227c3..96e38296 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# [![Unit Tests][20]][21] ![Release][31] [![Downloads][70]][71] [![Lines of code][81]](<>) [![Total lines][80]](<>) [![Files][82]](<>) [![License][50]][51] [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/easyScience/easyDiffractionLib/master) +# [![Unit Tests][20]][21] ![Release][31] [![Downloads][70]][71] [![Lines of code][81]](<>) [![Total lines][80]](<>) [![Files][82]](<>) [![License][50]][51] [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/easyScience/easyDiffractionLib/develop) diff --git a/easyDiffractionLib/Calculators/CFML.py b/easyDiffractionLib/Calculators/CFML.py index dafcbbfb..257abfca 100644 --- a/easyDiffractionLib/Calculators/CFML.py +++ b/easyDiffractionLib/Calculators/CFML.py @@ -1,11 +1,11 @@ __author__ = "github.com/wardsimon" __version__ = "0.0.1" -import os, pathlib - import CFML_api -import timeit +import os +import re +from typing import Tuple from easyCore import np, borg @@ -15,27 +15,24 @@ def __init__(self, filename: str = None): self.conditions = None self.background = None self.pattern = None - self.hkl_dict = { - 'ttheta': np.empty(0), - 'h': np.empty(0), - 'k': np.empty(0), - 'l': np.empty(0) - } + self.known_phases = {} + self.additional_data = {"phases": {}} + self.storage = {} - def createConditions(self, job_type='N'): + def createConditions(self, job_type="N"): self.conditions = { - 'lamb': 1.54, - 'u_resolution': 0.01, - 'v_resolution': 0.0, - 'w_resolution': 0.0, - 'x_resolution': 0.0, - 'y_resolution': 0.0, - 'z_resolution': 0.0 + "lamb": 1.54, + "u_resolution": 0.01, + "v_resolution": 0.0, + "w_resolution": 0.0, + "x_resolution": 0.0, + "y_resolution": 0.0, + "z_resolution": 0.0, } def conditionsUpdate(self, _, **kwargs): for key, value in kwargs.items(): - self.conditions[key]= value + self.conditions[key] = value def conditionsReturn(self, _, name): return self.conditions.get(name) @@ -51,9 +48,6 @@ def calculate(self, x_array: np.ndarray) -> np.ndarray: if self.filename is None: raise AttributeError - #print("\n\n\n") - start_time = timeit.default_timer() - if self.pattern is None: scale = 1.0 offset = 0 @@ -61,123 +55,200 @@ def calculate(self, x_array: np.ndarray) -> np.ndarray: scale = self.pattern.scale.raw_value offset = self.pattern.zero_shift.raw_value - end_time = timeit.default_timer() - #print("+ calculate A: {0:.4f} s".format(end_time - start_time)) - - start_time = timeit.default_timer() - this_x_array = x_array + offset - # Sample parameters - cif_file = CFML_api.CIFFile(self.filename) - cell = cif_file.cell - space_group = cif_file.space_group - atom_list = cif_file.atom_list - job_info = cif_file.job_info - - end_time = timeit.default_timer() - #print("+ calculate B: {0:.4f} s".format(end_time - start_time)) - - start_time = timeit.default_timer() - - #cell.print_description() - #space_group.print_description() - #atom_list.print_description() - #job_info.print_description() - # Experiment/Instrument/Simulation parameters x_min = this_x_array[0] x_max = this_x_array[-1] num_points = np.prod(x_array.shape) x_step = (x_max - x_min) / (num_points - 1) - job_info.range_2theta = (x_min, x_max) - job_info.theta_step = x_step - job_info.u_resolution = self.conditions['u_resolution'] - job_info.v_resolution = self.conditions['v_resolution'] - job_info.w_resolution = self.conditions['w_resolution'] - job_info.x_resolution = self.conditions['x_resolution'] - job_info.y_resolution = self.conditions['y_resolution'] - job_info.lambdas = (self.conditions['lamb'], self.conditions['lamb']) - job_info.bkg = 0.0 - - end_time = timeit.default_timer() - #print("+ calculate C: {0:.4f} s".format(end_time - start_time)) - - # Calculations - try: - start_time = timeit.default_timer() - reflection_list = CFML_api.ReflectionList(cell, - space_group, - True, - job_info) - end_time = timeit.default_timer() - #print("+ reflection_list = CFML_api.ReflectionList: {0:.4f} s".format(end_time - start_time)) - - start_time = timeit.default_timer() - reflection_list.compute_structure_factors(space_group, - atom_list, - job_info) - end_time = timeit.default_timer() - #print("+ reflection_list.compute_structure_factors: {0:.4f} s".format(end_time - start_time)) - - start_time = timeit.default_timer() - - hkltth = np.array([[*reflection_list[i].hkl, reflection_list[i].stl] for i in range(reflection_list.nref)]) - - self.hkl_dict['ttheta'] = np.rad2deg(np.arcsin(hkltth[:, 3] * job_info.lambdas[0])) * 2 - self.hkl_dict['h'] = hkltth[:, 0] - self.hkl_dict['k'] = hkltth[:, 1] - self.hkl_dict['l'] = hkltth[:, 2] - - end_time = timeit.default_timer() - #print("+ set reflection_list: {0:.4f} s".format(end_time - start_time)) - - start_time = timeit.default_timer() - diffraction_pattern = CFML_api.DiffractionPattern(job_info, - reflection_list, - cell.reciprocal_cell_vol) - end_time = timeit.default_timer() - #print("+ diffraction_pattern = CFML_api.DiffractionPattern: {0:.4f} s".format(end_time - start_time)) - - except: - raise ArithmeticError - finally: - - start_time = timeit.default_timer() - - # Clean up - for p in pathlib.Path(os.path.dirname(self.filename)).glob("easydiffraction_temp*"): - if os.path.basename(p) != "easydiffraction_temp.cif": - p.unlink() - - end_time = timeit.default_timer() - #print("+ calculate D: {0:.4f} s".format(end_time - start_time)) - - start_time = timeit.default_timer() if len(self.pattern.backgrounds) == 0: bg = np.zeros_like(this_x_array) else: bg = self.pattern.backgrounds[0].calculate(this_x_array) - res = scale * diffraction_pattern.ycalc + bg + dependents = [] - end_time = timeit.default_timer() - #print("+ calculate E: {0:.4f} s".format(end_time - start_time)) - - start_time = timeit.default_timer() + # Sample parameters + # We assume that the phases items has the same indexing as the knownphases item + cifs = self.grab_cifs() + if len(cifs) == 0: + raise ValueError("No phases found for calculation") + + for idx, file in enumerate(cifs): + cif_file = CFML_api.CIFFile(file) + cell = cif_file.cell + space_group = cif_file.space_group + atom_list = cif_file.atom_list + job_info = cif_file.job_info + + job_info.range_2theta = (x_min, x_max) + job_info.theta_step = x_step + job_info.u_resolution = self.conditions["u_resolution"] + job_info.v_resolution = self.conditions["v_resolution"] + job_info.w_resolution = self.conditions["w_resolution"] + job_info.x_resolution = self.conditions["x_resolution"] + job_info.y_resolution = self.conditions["y_resolution"] + job_info.lambdas = (self.conditions["lamb"], self.conditions["lamb"]) + job_info.bkg = 0.0 + + # Calculations + try: + reflection_list = CFML_api.ReflectionList( + cell, space_group, True, job_info + ) + + reflection_list.compute_structure_factors( + space_group, atom_list, job_info + ) + + diffraction_pattern = CFML_api.DiffractionPattern( + job_info, reflection_list, cell.reciprocal_cell_vol + ) + except Exception as e: + for cif in cifs: + os.remove(cif) + raise ArithmeticError + + item = list(self.known_phases.items())[idx] + key = list(self.known_phases.keys())[idx] + phase_scale = self.getPhaseScale(key) + + dependent, additional_data = self.nonPolarized_update( + item, diffraction_pattern, reflection_list, job_info, scales=phase_scale + ) + dependents.append(dependent) + self.additional_data["phases"].update(additional_data) + for cif in cifs: + os.remove(cif) + self.additional_data["global_scale"] = scale + self.additional_data["background"] = bg + self.additional_data["ivar_run"] = this_x_array + self.additional_data["ivar"] = x_array + self.additional_data["components"] = [scale * dep + bg for dep in dependents] + self.additional_data["phase_names"] = list(self.known_phases.items()) + self.additional_data["type"] = "powder1DCW" + + dependent_output = scale * np.sum(dependents, axis=0) + bg - np.set_printoptions(precision=3) if borg.debug: - print(f"y_calc: {res}") - - end_time = timeit.default_timer() - #print("+ calculate F: {0:.4f} s".format(end_time - start_time)) - - return res - - def get_hkl(self, tth: np.array = None) -> dict: - hkl_dict = self.hkl_dict - if tth is not None: - pass - return hkl_dict + print(f"y_calc: {dependent_output}") + return ( + np.sum( + [s["profile"] for s in self.additional_data["phases"].values()], axis=0 + ) + + self.additional_data["background"] + ) + + def get_hkl(self, x_array: np.ndarray = None, idx=0, phase_name=None, encoded_name=False) -> dict: + + # Do we need to re-run a calculation to get the HKL's + do_run = False + old_x = self.additional_data.get("ivar", np.array(())) + if not np.array_equal(old_x, x_array): + do_run = True + if do_run and x_array is not None: + _ = self.calculate(x_array) + + # Collate and return + if phase_name is None: + known_phases = list(self.known_phases.values()) + phase_name = known_phases[idx] + phase_data = self.additional_data.get(phase_name, {}) + return phase_data.get( + "hkl", + { + "ttheta": np.array([]), + "h": np.array([]), + "k": np.array([]), + "l": np.array([]), + }, + ) + + @staticmethod + def nonPolarized_update( + crystal_name, diffraction_pattern, reflection_list, job_info, scales=1 + ): + dependent = diffraction_pattern.ycalc + + hkltth = np.array( + [ + [*reflection_list[i].hkl, reflection_list[i].stl] + for i in range(reflection_list.nref) + ] + ) + + output = { + crystal_name: { + "hkl": { + "ttheta": np.rad2deg(np.arcsin(hkltth[:, 3] * job_info.lambdas[0])) + * 2, + "h": hkltth[:, 0], + "k": hkltth[:, 1], + "l": hkltth[:, 2], + }, + "profile": scales * dependent, + "components": {"total": dependent}, + "profile_scale": scales, + } + } + return dependent, output + + def add_phase(self, phase_id, phase_name): + self.known_phases[phase_id] = phase_name + + def remove_phase(self, phases_id): + if phases_id in self.known_phases: + name = self.known_phases.pop(phases_id) + if name in self.additional_data["phase_names"]: + del self.additional_data["phase_names"][name] + if name in self.additional_data["phases"].keys(): + del self.additional_data["phases"][name] + + def get_phase_components(self, phase_name): + data = None + if phase_name in self.additional_data["phase_names"]: + data = self.additional_data["phases"][phase_name].copy() + return data + + def get_calculated_y_for_phase(self, phase_idx: int) -> list: + """ + For a given phase index, return the calculated y + :param phase_idx: index of the phase + :type phase_idx: int + :return: calculated y + :rtype: np.ndarray + """ + if phase_idx > len(self.additional_data["components"]): + raise KeyError(f"phase_index incorrect: {phase_idx}") + return self.additional_data["phases"][ + self.additional_data["phase_names"][phase_idx] + ]["profile"] + + def get_total_y_for_phases(self) -> Tuple[np.ndarray, np.ndarray]: + x_values = self.additional_data["ivar_run"] + y_values = ( + np.sum( + [s["profile"] for s in self.additional_data["phases"].values()], axis=0 + ) + + self.additional_data["background"] + ) + return x_values, y_values + + def setPhaseScale(self, model_name, scale=1): + self.storage[str(model_name) + "_scale"] = scale + + def getPhaseScale(self, model_name, *args, **kwargs): + return self.storage.get(str(model_name) + "_scale", 1) + + def grab_cifs(self): + base, file = os.path.split(self.filename) + ext = file[-3:] + file = file[:-4] + files = [ + base + os.path.sep + f + for f in os.listdir(base) + if re.match(rf"{file}_[0-9]+.*\.{ext}", f) + ] + return files diff --git a/easyDiffractionLib/Calculators/GSASII.py b/easyDiffractionLib/Calculators/GSASII.py index 4c6f4a8e..38417eaf 100644 --- a/easyDiffractionLib/Calculators/GSASII.py +++ b/easyDiffractionLib/Calculators/GSASII.py @@ -157,8 +157,8 @@ def calculate(self, x_array: np.ndarray) -> np.ndarray: return res - def get_hkl(self, tth: np.array = None) -> dict: + def get_hkl(self, x_array: np.ndarray = None, idx=None, phase_name=None, encoded_name=False) -> dict: hkl_dict = self.hkl_dict - if tth is not None: + if x_array is not None: pass return hkl_dict diff --git a/easyDiffractionLib/Calculators/cryspy.py b/easyDiffractionLib/Calculators/cryspy.py index b32d939c..b9240aac 100644 --- a/easyDiffractionLib/Calculators/cryspy.py +++ b/easyDiffractionLib/Calculators/cryspy.py @@ -1,55 +1,53 @@ __author__ = "github.com/wardsimon" __version__ = "0.0.2" +import time +from typing import Tuple + import cryspy import warnings from easyCore import np, borg -warnings.filterwarnings('ignore') +# from pathos import multiprocessing as mp +import functools + +warnings.filterwarnings("ignore") + +normalization = 500.0 class Cryspy: def __init__(self): self.pattern = None self.conditions = { - 'wavelength': 1.25, - 'resolution': { - 'u': 0.001, - 'v': 0.001, - 'w': 0.001, - 'x': 0.000, - 'y': 0.000 - } - + "wavelength": 1.25, + "resolution": {"u": 0.001, "v": 0.001, "w": 0.001, "x": 0.000, "y": 0.000}, } self.conditions_TOF = { - 'ttheta_bank': 0, - 'dtt1': 0.1, - 'dtt2': 0, - 'resolution': { - 'sigma0': 0, - 'sigma1': 0, - 'sigma2': 0, - 'gamma0': 0, - 'gamma1': 0, - 'gamma2': 0, - 'alpha0': 0, - 'alpha1': 0, - 'beta0': 0, - 'beta1': 0} + "ttheta_bank": 0, + "dtt1": 0.1, + "dtt2": 0, + "resolution": { + "sigma0": 0, + "sigma1": 0, + "sigma2": 0, + "gamma0": 0, + "gamma1": 0, + "gamma2": 0, + "alpha0": 0, + "alpha1": 0, + "beta0": 0, + "beta1": 0, + }, } self.background = None - self.hkl_dict = { - 'ttheta': np.empty(0), - 'h': np.empty(0), - 'k': np.empty(0), - 'l': np.empty(0) - } self.storage = {} self.current_crystal = {} self.model = None self.phases = cryspy.PhaseL() - self.type = 'powder1DCW' + self.type = "powder1DCW" + self.additional_data = {"phases": {}} + self.polarized = False @property def cif_str(self): @@ -60,19 +58,22 @@ def cif_str(self): def cif_str(self, value): self.createCrystal_fromCifStr(value) - def createModel(self, model_id, model_type='powder1DCW'): - model = { - 'background': cryspy.PdBackgroundL(), - 'phase': self.phases - } + def createModel(self, model_id, model_type="powder1DCW"): + model = {"background": cryspy.PdBackgroundL(), "phase": self.phases} + + self.polarized = False + if model_type.endswith("Pol"): + self.polarized = True + model_type = model_type.split("Pol")[0] + cls = cryspy.Pd - if model_type == 'powder1DTOF': + if model_type == "powder1DTOF": cls = cryspy.TOF - model['background'] = cryspy.TOFBackground() + model["background"] = cryspy.TOFBackground() self.type = model_type self.model = cls(**model) - def createPhase(self, crystal_name, key='phase'): + def createPhase(self, crystal_name, key="phase"): phase = cryspy.Phase(label=crystal_name, scale=1, igsize=0) self.storage[key] = phase return key @@ -83,8 +84,18 @@ def assignPhase(self, model_name, phase_name): def removePhase(self, model_name, phase_name): phase = self.storage[phase_name] - idx = self.model.phase.items.index(phase) - self.model.phase.items.pop(idx) + del self.storage[phase_name] + del self.storage[phase_name.split("_")[0] + "_scale"] + self.phases.items.pop(self.phases.items.index(phase)) + name = self.current_crystal.pop(int(phase_name.split("_")[0])) + if name in self.additional_data["phases"].keys(): + del self.additional_data["phases"][name] + + def setPhaseScale(self, model_name, scale=1): + self.storage[str(model_name) + "_scale"] = scale + + def getPhaseScale(self, model_name, *args, **kwargs): + return self.storage.get(str(model_name) + "_scale", 1) def createCrystal_fromCifStr(self, cif_str: str): crystal = cryspy.Crystal.from_cif(cif_str) @@ -99,11 +110,11 @@ def createEmptyCrystal(self, crystal_name, key=None): if key is None: key = crystal_name self.storage[key] = crystal - self.createPhase(crystal_name, key=str(key) + '_phase') + self.createPhase(crystal_name, key=str(key) + "_phase") self.current_crystal[key] = crystal_name return key - def createCell(self, key='cell'): + def createCell(self, key="cell"): cell = cryspy.Cell() self.storage[key] = cell return key @@ -113,9 +124,9 @@ def assignCell_toCrystal(self, cell_name, crystal_name): cell = self.storage[cell_name] crystal.cell = cell - def createSpaceGroup(self, key='spacegroup', name_hm_alt='P 1'): - sg_split = name_hm_alt.split(':') - opts = {'name_hm_alt': sg_split[0]} + def createSpaceGroup(self, key="spacegroup", name_hm_alt="P 1"): + sg_split = name_hm_alt.split(":") + opts = {"name_hm_alt": sg_split[0]} # if len(sg_split) > 1: # opts['it_coordinate_system_code'] = sg_split[1] # try: @@ -128,10 +139,10 @@ def createSpaceGroup(self, key='spacegroup', name_hm_alt='P 1'): def getSpaceGroupSymbol(self, spacegroup_name: str, *args, **kwargs): sg = self.storage[spacegroup_name] - hm_alt = getattr(sg, 'name_hm_alt') - setting = getattr(sg, 'it_coordinate_system_code') + hm_alt = getattr(sg, "name_hm_alt") + setting = getattr(sg, "it_coordinate_system_code") if setting: - hm_alt += ':' + setting + hm_alt += ":" + setting return hm_alt def assignSpaceGroup_toCrystal(self, spacegroup_name, crystal_name): @@ -139,20 +150,23 @@ def assignSpaceGroup_toCrystal(self, spacegroup_name, crystal_name): return crystal = self.storage[crystal_name] space_group: cryspy.SpaceGroup = self.storage[spacegroup_name] - setattr(crystal, 'space_group', space_group) + setattr(crystal, "space_group", space_group) for atom in crystal.atom_site.items: atom.define_space_group_wyckoff(space_group.space_group_wyckoff) atom.form_object() def updateSpacegroup(self, sg_key, **kwargs): # This has to be done as sg.name_hm_alt = 'blah' doesn't work :-( + keys = list(self.current_crystal.keys()) + previous_key = "" + for key in keys: + if key in self.storage.keys(): + previous_sg = getattr(self.storage[key], "space_group", None) + if previous_sg == self.storage[sg_key]: + previous_key = key + break sg_key = self.createSpaceGroup(key=sg_key, **kwargs) - key = list(self.current_crystal.keys()) - if len(key) > 0: - key = key[0] - else: - key = '' - self.assignSpaceGroup_toCrystal(sg_key, key) + self.assignSpaceGroup_toCrystal(sg_key, previous_key) def createAtom(self, atom_name, **kwargs): atom = cryspy.AtomSite(**kwargs) @@ -180,25 +194,31 @@ def removeAtom_fromCrystal(self, atom_label, crystal_name): del item.items[idx] def createBackground(self, background_obj): - key = 'background' + key = "background" self.storage[key] = background_obj return key - def createSetup(self, key='setup', cls_type = None): + def createSetup(self, key="setup", cls_type=None): if cls_type is None: cls_type = self.type - if cls_type == 'powder1DCW': - setup = cryspy.Setup(wavelength=self.conditions['wavelength'], offset_ttheta=0) - elif cls_type == 'powder1DTOF': - setup = cryspy.TOFParameters(zero=0, dtt1=self.conditions_TOF['dtt1'], dtt2=self.conditions_TOF['dtt2'], - ttheta_bank=self.conditions_TOF['ttheta_bank']) + if cls_type == "powder1DCW": + setup = cryspy.Setup( + wavelength=self.conditions["wavelength"], offset_ttheta=0 + ) + elif cls_type == "powder1DTOF": + setup = cryspy.TOFParameters( + zero=0, + dtt1=self.conditions_TOF["dtt1"], + dtt2=self.conditions_TOF["dtt2"], + ttheta_bank=self.conditions_TOF["ttheta_bank"], + ) else: - raise AttributeError('The experiment is of an unknown type') + raise AttributeError("The experiment is of an unknown type") self.storage[key] = setup if self.model is not None: - setattr(self.model, 'setup', setup) + setattr(self.model, "setup", setup) return key def genericUpdate(self, item_key, **kwargs): @@ -211,20 +231,20 @@ def genericReturn(self, item_key, value_key): value = getattr(item, value_key) return value - def createResolution(self, cls_type = None): + def createResolution(self, cls_type=None): if cls_type is None: cls_type = self.type - if cls_type == 'powder1DCW': - key = 'pd_instr_resolution' - resolution = cryspy.PdInstrResolution(**self.conditions['resolution']) - elif cls_type == 'powder1DTOF': - key = 'tof_profile' - resolution = cryspy.TOFProfile(**self.conditions_TOF['resolution']) - resolution.peak_shape = 'Gauss' + if cls_type == "powder1DCW": + key = "pd_instr_resolution" + resolution = cryspy.PdInstrResolution(**self.conditions["resolution"]) + elif cls_type == "powder1DTOF": + key = "tof_profile" + resolution = cryspy.TOFProfile(**self.conditions_TOF["resolution"]) + resolution.peak_shape = "Gauss" else: - raise AttributeError('The experiment is of an unknown type') + raise AttributeError("The experiment is of an unknown type") self.storage[key] = resolution if self.model is not None: setattr(self.model, key, resolution) @@ -244,7 +264,7 @@ def powder_1d_calculate(self, x_array: np.ndarray) -> np.ndarray: :rtype: np.ndarray """ - for key_inner in ['pd_instr_resolution', 'setup']: + for key_inner in ["pd_instr_resolution", "setup"]: if not hasattr(self.model, key_inner): setattr(self.model, key_inner, self.storage[key_inner]) @@ -252,46 +272,15 @@ def powder_1d_calculate(self, x_array: np.ndarray) -> np.ndarray: scale = 1.0 offset = 0 else: - scale = self.pattern.scale.raw_value / 500.0 + scale = self.pattern.scale.raw_value / normalization offset = self.pattern.zero_shift.raw_value this_x_array = x_array + offset if borg.debug: - print('CALLING FROM Cryspy\n----------------------') - # USe the default for now - crystal = self.storage[list(self.current_crystal.keys())[-1]] - - if len(self.pattern.backgrounds) == 0: - bg = np.zeros_like(this_x_array) - else: - bg = self.pattern.backgrounds[0].calculate(this_x_array) + print("CALLING FROM Cryspy\n----------------------") - if crystal is None: - return bg - - crystals = [crystal] - phase_lists = [] - for crystal in crystals: - phasesL = cryspy.PhaseL() - idx = [idx for idx, item in reversed(list(enumerate(self.phases.items))) if item.label == crystal.data_name][0] - phasesL.items.append(self.phases.items[idx]) - phase_lists.append(phasesL) - - idx = [idx for idx, item in enumerate(self.model.items) if isinstance(item, cryspy.PhaseL)][0] - self.model.items[idx] = phase_lists[0] - - profile = self.model.calc_profile(this_x_array, crystals, True, False) - self.hkl_dict = { - 'ttheta': self.model.d_internal_val['peak_' + crystal.data_name].numpy_ttheta, - 'h': self.model.d_internal_val['peak_' + crystal.data_name].numpy_index_h, - 'k': self.model.d_internal_val['peak_' + crystal.data_name].numpy_index_k, - 'l': self.model.d_internal_val['peak_' + crystal.data_name].numpy_index_l, - } - res = scale * np.array(profile.intensity_total) + bg - if borg.debug: - print(f"y_calc: {res}") - return res + return self.do_calc_setup(scale, this_x_array) def powder_1d_tof_calculate(self, x_array: np.ndarray) -> np.ndarray: """ @@ -303,7 +292,7 @@ def powder_1d_tof_calculate(self, x_array: np.ndarray) -> np.ndarray: setup, tof_profile, phase, tof_background, tof_meas """ - for key_inner in ['tof_profile', 'setup']: + for key_inner in ["tof_profile", "setup"]: if not hasattr(self.model, key_inner): try: setattr(self.model, key_inner, self.storage[key_inner]) @@ -320,48 +309,100 @@ def powder_1d_tof_calculate(self, x_array: np.ndarray) -> np.ndarray: scale = 1.0 offset = 0 else: - scale = self.pattern.scale.raw_value / 500.0 + scale = self.pattern.scale.raw_value / normalization offset = self.pattern.zero_shift.raw_value - self.model['tof_parameters'].zero = offset + self.model["tof_parameters"].zero = offset this_x_array = x_array if borg.debug: - print('CALLING FROM Cryspy\n----------------------') - # USe the default for now - crystal = self.storage[list(self.current_crystal.keys())[-1]] + print("CALLING FROM Cryspy\n----------------------") + return self.do_calc_setup(scale, this_x_array) + def do_calc_setup(self, scale, this_x_array): if len(self.pattern.backgrounds) == 0: bg = np.zeros_like(this_x_array) else: bg = self.pattern.backgrounds[0].calculate(this_x_array) - if crystal is None: + num_crys = len(self.current_crystal.keys()) + + if num_crys == 0: return bg - crystals = [crystal] + crystals = [self.storage[key] for key in self.current_crystal.keys()] + phase_scales = [ + self.storage[str(key) + "_scale"] for key in self.current_crystal.keys() + ] phase_lists = [] + profiles = [] + peak_dat = [] for crystal in crystals: phasesL = cryspy.PhaseL() - idx = [idx for idx, item in reversed(list(enumerate(self.phases.items))) if item.label == crystal.data_name][0] + idx = [ + idx + for idx, item in enumerate(self.phases.items) + if item.label == crystal.data_name + ][0] phasesL.items.append(self.phases.items[idx]) phase_lists.append(phasesL) + profile, peak = _do_run( + self.model, self.polarized, this_x_array, crystal, phasesL + ) + profiles.append(profile) + peak_dat.append(peak) + # pool = mp.ProcessPool(num_crys) + # print("\n\nPOOL = " + str(pool)) + # result = pool.amap(functools.partial(_do_run, self.model, self.polarized, this_x_array), crystals, + # phase_lists) + # while not result.ready(): + # time.sleep(0.01) + # obtained = result.get() + # profiles, peak_dat = zip(*obtained) + # else: + # raise ArithmeticError + + # Do this for now + x_str = "ttheta" + if self.type == "powder1DTOF": + x_str = "time" + if self.polarized: + # TODO *REPLACE PLACEHOLDER FN* + dependents, additional_data = self.polarized_update( + lambda up, down: up + down, + crystals, + profiles, + peak_dat, + phase_scales, + x_str, + ) + else: + dependents, additional_data = self.nonPolarized_update( + crystals, profiles, peak_dat, phase_scales, x_str + ) + self.additional_data["phases"].update(additional_data) + self.additional_data["global_scale"] = scale + self.additional_data["background"] = bg + self.additional_data["ivar_run"] = this_x_array + self.additional_data["phase_names"] = list(additional_data.keys()) + self.additional_data["type"] = self.type + + # just the sum of all phases + dependent_output = scale * np.sum(dependents, axis=0) + bg + + scaled_dependents = [scale * dep for dep in dependents] + self.additional_data["components"] = scaled_dependents + self.additional_data["components"] = scaled_dependents - idx = [idx for idx, item in enumerate(self.model.items) if isinstance(item, cryspy.PhaseL)][0] - self.model.items[idx] = phase_lists[0] - - profile = self.model.calc_profile(this_x_array, crystals, True, False) - self.hkl_dict = { - 'time': np.array(self.model.d_internal_val['peak_' + crystal.data_name].time), - 'h': np.array(self.model.d_internal_val['peak_' + crystal.data_name].index_h), - 'k': np.array(self.model.d_internal_val['peak_' + crystal.data_name].index_k), - 'l': np.array(self.model.d_internal_val['peak_' + crystal.data_name].index_l), - } - res = scale * np.array(profile.intensity_total) + bg if borg.debug: - print(f"y_calc: {res}") - return res - + print(f"y_calc: {dependent_output}") + return ( + np.sum( + [s["profile"] for s in self.additional_data["phases"].values()], axis=0 + ) + + self.additional_data["background"] + ) + # return returned_deps def calculate(self, x_array: np.ndarray) -> np.ndarray: """ @@ -372,33 +413,128 @@ def calculate(self, x_array: np.ndarray) -> np.ndarray: :rtype: np.ndarray """ res = np.zeros_like(x_array) - if self.type == 'powder1DCW': + self.additional_data["ivar"] = res + if self.type == "powder1DCW": return self.powder_1d_calculate(x_array) - if self.type == 'powder1DTOF': + if self.type == "powder1DTOF": return self.powder_1d_tof_calculate(x_array) return res - def get_hkl(self, tth: np.array = None) -> dict: - - hkl_dict = self.hkl_dict - - if tth is not None: - # crystal = cryspy.Crystal.from_cif(self.cif_str) - # phase_list = cryspy.PhaseL() - # phase = cryspy.Phase(label=crystal.data_name, scale=1, igsize=0) - # phase_list.items.append(phase) - # setup = cryspy.Setup(wavelength=self.conditions['wavelength'], offset_ttheta=0) - # background = cryspy.PdBackgroundL() - # resolution = cryspy.PdInstrResolution(**self.conditions['resolution']) - # pd = cryspy.Pd(setup=setup, resolution=resolution, phase=phase_list, background=background) - crystal = self.storage[list(self.current_crystal.keys())[-1]] - _ = self.model.calc_profile(tth, [crystal], True, False) - - hkl_dict = { - 'ttheta': self.model.d_internal_val['peak_' + crystal.data_name].numpy_ttheta, - 'h': self.model.d_internal_val['peak_' + crystal.data_name].numpy_index_h, - 'k': self.model.d_internal_val['peak_' + crystal.data_name].numpy_index_k, - 'l': self.model.d_internal_val['peak_' + crystal.data_name].numpy_index_l, - } - - return hkl_dict + def get_phase_components(self, phase_name): + data = None + if phase_name in self.additional_data["phase_names"]: + data = self.additional_data["phases"][phase_name].copy() + return data + + def get_calculated_y_for_phase(self, phase_idx: int) -> list: + """ + For a given phase index, return the calculated y + :param phase_idx: index of the phase + :type phase_idx: int + :return: calculated y + :rtype: np.ndarray + """ + if phase_idx > len(self.additional_data["components"]): + raise KeyError(f"phase_index incorrect: {phase_idx}") + return list(self.additional_data["phases"].values())[phase_idx]["profile"] + + def get_total_y_for_phases(self) -> Tuple[np.ndarray, np.ndarray]: + x_values = self.additional_data["ivar_run"] + y_values = ( + np.sum( + [s["profile"] for s in self.additional_data["phases"].values()], axis=0 + ) + + self.additional_data["background"] + ) + return x_values, y_values + + def get_hkl(self, idx: int = 0, phase_name=None, encoded_name=False) -> dict: + # Collate and return + if phase_name is not None: + if encoded_name: + known_phases = [str(key) for key in self.current_crystal.keys()] + idx = known_phases.index(phase_name) + phase_name = list(self.current_crystal.values())[idx] + else: + known_phases = list(self.current_crystal.values()) + phase_name = known_phases[idx] + else: + phase_name = list(self.current_crystal.values())[idx] + return self.additional_data['phases'][phase_name]['hkl'] + + @staticmethod + def nonPolarized_update(crystals, profiles, peak_dat, scales, x_str): + dependent = np.array([profile.intensity_total for profile in profiles]) + + output = {} + for idx, profile in enumerate(profiles): + output.update( + { + crystals[idx].data_name: { + "hkl": { + x_str: getattr(peak_dat[idx], "numpy_" + x_str), + "h": peak_dat[idx].numpy_index_h, + "k": peak_dat[idx].numpy_index_k, + "l": peak_dat[idx].numpy_index_l, + }, + "profile": scales[idx] * dependent[idx, :] / normalization, + "components": {"total": dependent[idx, :]}, + "profile_scale": scales[idx], + } + } + ) + return dependent, output + + @staticmethod + def polarized_update(func, crystals, profiles, peak_dat, scales, x_str): + up = np.array([profile.intensity_up_total for profile in profiles]) + down = np.array([profile.intensity_down_total for profile in profiles]) + dependent = np.array([func(u, d) for u, d in zip(up, down)]) + + output = {} + for idx, profile in enumerate(profiles): + output.update( + { + crystals[idx].data_name: { + "hkl": { + x_str: getattr(peak_dat[idx], "numpy_" + x_str), + "h": peak_dat[idx].numpy_index_h, + "k": peak_dat[idx].numpy_index_k, + "l": peak_dat[idx].numpy_index_l, + }, + "profile": scales[idx] * dependent[idx, :] / normalization, + "components": { + "total": dependent[idx, :], + "up": up[idx, :], + "down": down[idx, :], + }, + "profile_scale": scales[idx], + "func": func, + } + } + ) + return dependent, output + + def get_phase_components(self, phase_name): + data = None + if phase_name in self.additional_data["phase_names"]: + data = self.additional_data[phase_name].copy() + return data + + +def _do_run( + model, + polarized, + x_array, + crystals, + phase_list, +): + idx = [ + idx for idx, item in enumerate(model.items) if isinstance(item, cryspy.PhaseL) + ][0] + model.items[idx] = phase_list + result1 = model.calc_profile( + x_array, [crystals], flag_internal=True, flag_polarized=polarized + ) + result2 = model.d_internal_val["peak_" + crystals.data_name] + return result1, result2 diff --git a/easyDiffractionLib/Interfaces/CFML.py b/easyDiffractionLib/Interfaces/CFML.py index a138e4e2..b592e3cd 100644 --- a/easyDiffractionLib/Interfaces/CFML.py +++ b/easyDiffractionLib/Interfaces/CFML.py @@ -1,9 +1,12 @@ __author__ = "github.com/wardsimon" __version__ = "0.0.2" +import os from easyCore import borg, np from easyCore.Objects.Inferface import ItemContainer -from easyDiffractionLib import Lattice, SpaceGroup, Site, Phases + +from easyDiffractionLib import Lattice, SpaceGroup, Site, Phases, Phase + from easyDiffractionLib.Interfaces.interfaceTemplate import InterfaceTemplate from easyDiffractionLib.Profiles.P1D import Instrument1DCWParameters, Powder1DParameters from easyDiffractionLib.Calculators.CFML import CFML as CFML_calc @@ -14,8 +17,7 @@ class CFML(InterfaceTemplate): A simple FILE interface using CrysFML """ - _sample_link = { - 'filename': 'filename'} + _sample_link = {"filename": "filename"} _crystal_link = { "length_a": "length_a", @@ -27,37 +29,32 @@ class CFML(InterfaceTemplate): } _instrument_link = { - 'resolution_u': 'u_resolution', - 'resolution_v': 'v_resolution', - 'resolution_w': 'w_resolution', - 'resolution_x': 'x_resolution', - 'resolution_y': 'y_resolution', - 'wavelength': 'lamb' + "resolution_u": "u_resolution", + "resolution_v": "v_resolution", + "resolution_w": "w_resolution", + "resolution_x": "x_resolution", + "resolution_y": "y_resolution", + "wavelength": "lamb", } _atom_link = { - 'label': 'label', - 'specie': 'specie', - 'fract_x': 'fract_x', - 'fract_y': 'fract_y', - 'fract_z': 'fract_z', - 'occupancy': 'occupancy', - 'adp_type': 'adp_type', - 'Uiso': 'Uiso', - 'Biso': 'Biso', - 'Uani': 'Uani', - 'Bani': 'Bani' - } - _pattern_link = { - 'scale': 'scale', - 'x_offset': 'x_offset' + "label": "label", + "specie": "specie", + "fract_x": "fract_x", + "fract_y": "fract_y", + "fract_z": "fract_z", + "occupancy": "occupancy", + "adp_type": "adp_type", + "Uiso": "Uiso", + "Biso": "Biso", + "Uani": "Uani", + "Bani": "Bani", } + _pattern_link = {"scale": "scale", "x_offset": "x_offset"} - feature_available = { - 'Npowder1DCW': True - } + feature_available = {"Npowder1DCW": True} - name = 'CrysFML' + name = "CrysFML" def __init__(self): self.calculator = CFML_calc() @@ -65,52 +62,67 @@ def __init__(self): self._filename = None @staticmethod - def feature_checker(radiation='N', exp_type='CW', sample_type='powder', dimensionality='1D', test_str=None): - return InterfaceTemplate.features(radiation=radiation, exp_type=exp_type, sample_type=sample_type, - dimensionality=dimensionality, test_str=test_str, - FEATURES=CFML.feature_available) + def feature_checker( + radiation="N", + exp_type="CW", + sample_type="powder", + dimensionality="1D", + test_str=None, + ): + return InterfaceTemplate.features( + radiation=radiation, + exp_type=exp_type, + sample_type=sample_type, + dimensionality=dimensionality, + test_str=test_str, + FEATURES=CFML.feature_available, + ) def create(self, model): from easyDiffractionLib.sample import Sample + r_list = [] t_ = type(model) model_key = self.__identify(model) if issubclass(t_, Instrument1DCWParameters): # These parameters are linked to the Resolution and Setup CFML objects. Note that we can set the job type! - self.calculator.createConditions(job_type='N') + self.calculator.createConditions(job_type="N") keys = self._instrument_link.copy() r_list.append( - ItemContainer(model_key, keys, - self.calculator.conditionsReturn, - self.calculator.conditionsUpdate) + ItemContainer( + model_key, + keys, + self.calculator.conditionsReturn, + self.calculator.conditionsUpdate, + ) ) elif issubclass(t_, Powder1DParameters): # These parameters do not link directly to CFML objects. self.calculator.pattern = model elif issubclass(t_, Lattice): keys = self._crystal_link.copy() - r_list.append( - ItemContainer(model_key, keys, - self.get_value, - self.dump_cif) - ) + r_list.append(ItemContainer(model_key, keys, self.get_value, self.dump_cif)) elif issubclass(t_, SpaceGroup): - keys = {'_space_group_HM_name': '_space_group_HM_name'} - r_list.append( - ItemContainer(model_key, keys, - self.get_value, - self.dump_cif) - ) + keys = {"_space_group_HM_name": "_space_group_HM_name"} + r_list.append(ItemContainer(model_key, keys, self.get_value, self.dump_cif)) elif issubclass(t_, Site): keys = self._atom_link.copy() - r_list.append(ItemContainer(model_key, keys, - self.get_value, - self.dump_cif)) + r_list.append(ItemContainer(model_key, keys, self.get_value, self.dump_cif)) elif issubclass(t_, Phases): self._phase = model + elif issubclass(t_, Phase): + r_list.append( + ItemContainer( + model_key, + {"scale": "scale"}, + self.calculator.getPhaseScale, + self.calculator.setPhaseScale, + ) + ) + self.calculator.add_phase(str(model_key), model.name) elif issubclass(t_, Sample): self.__createModel(model) - elif t_.__name__ in ['Powder1DCW', 'powder1DCW', 'Npowder1DCW']: + elif t_.__name__ in ["Powder1DCW", "powder1DCW", "Npowder1DCW"]: self.__createModel(model) else: if self._borg.debug: @@ -124,10 +136,12 @@ def remove_atom(self, crystal_obj, atom): pass def add_phase(self, phases_obj, phase_obj): - pass + ident = str(self.__identify(phase_obj)) + self.calculator.add_phase(ident, phase_obj.name) def remove_phase(self, phases_obj, phase_obj): - pass + ident = str(self.__identify(phase_obj)) + self.calculator.remove_phase(ident) def fit_func(self, x_array: np.ndarray) -> np.ndarray: """ @@ -139,14 +153,20 @@ def fit_func(self, x_array: np.ndarray) -> np.ndarray: """ return self.calculator.calculate(x_array) - def get_hkl(self, x_array: np.ndarray = None, idx=None) -> dict: + def get_hkl(self, x_array: np.ndarray = None, idx=None, phase_name=None, encoded_name=False) -> dict: return self.calculator.get_hkl(x_array) - + def dump_cif(self, *args, **kwargs): if self._filename is None: return - with open(self._filename, 'w') as fid: + with open(self._filename, "w") as fid: fid.write(str(self._phase.cif)) + base, file = os.path.split(self._filename) + ext = file[-3:] + file = file[:-4] + for idx, phase in enumerate(self._phase): + with open(f"{os.path.join(base, file)}_{idx}.{ext}", "w") as fid: + fid.write(str(phase.cif)) def __createModel(self, model): self._filename = model.filename @@ -155,10 +175,19 @@ def __createModel(self, model): def get_value(self, key, item_key): item = borg.map.get_item_by_key(key) - if item_key in ['Uiso', 'Uani', 'Biso', 'Bani']: - return getattr(getattr(item, 'adp'), item_key).raw_value + if item_key in ["Uiso", "Uani", "Biso", "Bani"]: + return getattr(getattr(item, "adp"), item_key).raw_value return getattr(item, item_key).raw_value + def get_phase_components(self, phase_name): + return None + + def get_calculated_y_for_phase(self, phase_idx: int) -> list: + return self.calculator.get_calculated_y_for_phase(phase_idx) + + def get_total_y_for_phases(self) -> list: + return self.calculator.get_total_y_for_phases() + @staticmethod def __identify(obj): return borg.map.convert_id_to_key(obj) diff --git a/easyDiffractionLib/Interfaces/GSASII.py b/easyDiffractionLib/Interfaces/GSASII.py index 777dc3bf..2ed6d3a5 100644 --- a/easyDiffractionLib/Interfaces/GSASII.py +++ b/easyDiffractionLib/Interfaces/GSASII.py @@ -140,7 +140,8 @@ def fit_func(self, x_array: np.ndarray) -> np.ndarray: """ return self.calculator.calculate(x_array) - def get_hkl(self, x_array: np.ndarray = None, idx=None) -> dict: + + def get_hkl(self, x_array: np.ndarray = None, idx=None, phase_name=None, encoded_name=False) -> dict: return self.calculator.get_hkl(x_array) def dump_cif(self, *args, **kwargs): @@ -160,6 +161,9 @@ def __createModel(self, model): self.calculator.filename = model.filename self.dump_cif() + def get_phase_components(self, phase_name): + return None + @staticmethod def __identify(obj): return borg.map.convert_id_to_key(obj) diff --git a/easyDiffractionLib/Interfaces/cryspy.py b/easyDiffractionLib/Interfaces/cryspy.py index 2e70a8ce..19db19c5 100644 --- a/easyDiffractionLib/Interfaces/cryspy.py +++ b/easyDiffractionLib/Interfaces/cryspy.py @@ -5,7 +5,11 @@ from easyCore import borg, np from easyCore.Objects.Inferface import ItemContainer from easyDiffractionLib import Lattice, SpaceGroup, Site, Phase, Phases -from easyDiffractionLib.Profiles.P1D import Instrument1DCWParameters, Instrument1DTOFParameters, Powder1DParameters +from easyDiffractionLib.Profiles.P1D import ( + Instrument1DCWParameters, + Instrument1DTOFParameters, + Powder1DParameters, +) from easyDiffractionLib.Interfaces.interfaceTemplate import InterfaceTemplate from easyDiffractionLib.Calculators.cryspy import Cryspy as Cryspy_calc @@ -15,8 +19,7 @@ class Cryspy(InterfaceTemplate): A simple example interface using Cryspy """ - _sample_link = { - 'cif_str': 'cif_str'} + _sample_link = {"cif_str": "cif_str"} _crystal_link = { "length_a": "length_a", @@ -28,91 +31,118 @@ class Cryspy(InterfaceTemplate): } _atom_link = { - 'label': 'label', - 'specie': 'type_symbol', - 'fract_x': 'fract_x', - 'fract_y': 'fract_y', - 'fract_z': 'fract_z', - 'occupancy': 'occupancy', - 'adp_type': 'adp_type', - 'Uiso': 'u_iso_or_equiv', - 'Biso': 'b_iso_or_equiv', - 'Uani': 'u_iso_or_equiv', - 'Bani': 'b_iso_or_equiv' + "label": "label", + "specie": "type_symbol", + "fract_x": "fract_x", + "fract_y": "fract_y", + "fract_z": "fract_z", + "occupancy": "occupancy", + "adp_type": "adp_type", + "Uiso": "u_iso_or_equiv", + "Biso": "b_iso_or_equiv", + "Uani": "u_iso_or_equiv", + "Bani": "b_iso_or_equiv", } _instrument_link = { - 'resolution_u': 'u', - 'resolution_v': 'v', - 'resolution_w': 'w', - 'resolution_x': 'x', - 'resolution_y': 'y', - 'wavelength': 'wavelength' + "resolution_u": "u", + "resolution_v": "v", + "resolution_w": "w", + "resolution_x": "x", + "resolution_y": "y", + "wavelength": "wavelength", } - _instrument_tof_link = {k:k for k in Instrument1DTOFParameters._defaults.keys()} + _instrument_tof_link = {k: k for k in Instrument1DTOFParameters._defaults.keys()} - name = 'CrysPy' + name = "CrysPy" - feature_available = { - 'Npowder1DCW': True, - 'Npowder1DTOF': True - } + feature_available = {"Npowder1DCW": True, "Npowder1DTOF": True} def __init__(self): self.calculator = Cryspy_calc() @staticmethod - def feature_checker(radiation='N', exp_type='CW', sample_type='powder', dimensionality='1D', test_str=None): - return InterfaceTemplate.features(radiation=radiation, exp_type=exp_type, sample_type=sample_type, - dimensionality=dimensionality, test_str=test_str, - FEATURES=Cryspy.feature_available) + def feature_checker( + radiation="N", + exp_type="CW", + sample_type="powder", + dimensionality="1D", + test_str=None, + ): + return InterfaceTemplate.features( + radiation=radiation, + exp_type=exp_type, + sample_type=sample_type, + dimensionality=dimensionality, + test_str=test_str, + FEATURES=Cryspy.feature_available, + ) def create(self, model): r_list = [] t_ = type(model) model_key = self.__identify(model) if issubclass(t_, Instrument1DCWParameters): - self.calculator.createModel(model_key, 'powder1DCW') + self.calculator.createModel(model_key, "powder1DCW") # These parameters are linked to the Resolution and Setup cryspy objects res_key = self.calculator.createResolution() setup_key = self.calculator.createSetup() keys = self._instrument_link.copy() - keys.pop('wavelength') + keys.pop("wavelength") r_list.append( - ItemContainer(res_key, keys, - self.calculator.genericReturn, - self.calculator.genericUpdate) + ItemContainer( + res_key, + keys, + self.calculator.genericReturn, + self.calculator.genericUpdate, + ) ) r_list.append( - ItemContainer(setup_key, {'wavelength': self._instrument_link['wavelength']}, - self.calculator.genericReturn, - self.calculator.genericUpdate) + ItemContainer( + setup_key, + {"wavelength": self._instrument_link["wavelength"]}, + self.calculator.genericReturn, + self.calculator.genericUpdate, + ) ) if issubclass(t_, Instrument1DTOFParameters): - self.calculator.createModel(model_key, 'powder1DTOF') + self.calculator.createModel(model_key, "powder1DTOF") # These parameters are linked to the Resolution and Setup cryspy objects - res_key = self.calculator.createResolution(cls_type='powder1DTOF') - setup_key = self.calculator.createSetup(cls_type='powder1DTOF') + res_key = self.calculator.createResolution(cls_type="powder1DTOF") + setup_key = self.calculator.createSetup(cls_type="powder1DTOF") keys = self._instrument_tof_link.copy() - setup_keys = { - k: keys[k] for k in ['ttheta_bank', 'dtt1', 'dtt2'] - } + setup_keys = {k: keys[k] for k in ["ttheta_bank", "dtt1", "dtt2"]} res_keys = { - k: keys[k] for k in ['sigma0', 'sigma1', 'sigma2', - 'gamma0', 'gamma1', 'gamma2', - 'alpha0', 'alpha1', - 'beta0', 'beta1'] + k: keys[k] + for k in [ + "sigma0", + "sigma1", + "sigma2", + "gamma0", + "gamma1", + "gamma2", + "alpha0", + "alpha1", + "beta0", + "beta1", + ] } r_list.append( - ItemContainer(res_key, res_keys, - self.calculator.genericReturn, - self.calculator.genericUpdate) + ItemContainer( + res_key, + res_keys, + self.calculator.genericReturn, + self.calculator.genericUpdate, + ) ) r_list.append( - ItemContainer(setup_key, setup_keys, - self.calculator.genericReturn, - self.calculator.genericUpdate) + ItemContainer( + setup_key, + setup_keys, + self.calculator.genericReturn, + self.calculator.genericUpdate, + ) ) elif issubclass(t_, Powder1DParameters): # These parameters do not link directly to cryspy objects. @@ -121,50 +151,72 @@ def create(self, model): l_key = self.calculator.createCell(model_key) keys = self._crystal_link.copy() r_list.append( - ItemContainer(l_key, keys, - self.calculator.genericReturn, - self.calculator.genericUpdate) + ItemContainer( + l_key, + keys, + self.calculator.genericReturn, + self.calculator.genericUpdate, + ) ) elif issubclass(t_, SpaceGroup): - s_key = self.calculator.createSpaceGroup(key=model_key, name_hm_alt='P 1') - keys = {'_space_group_HM_name': 'name_hm_alt'} + s_key = self.calculator.createSpaceGroup(key=model_key, name_hm_alt="P 1") + keys = {"_space_group_HM_name": "name_hm_alt"} r_list.append( - ItemContainer(s_key, keys, - self.calculator.getSpaceGroupSymbol, - self.calculator.updateSpacegroup) + ItemContainer( + s_key, + keys, + self.calculator.getSpaceGroupSymbol, + self.calculator.updateSpacegroup, + ) ) elif issubclass(t_, Site): a_key = self.calculator.createAtom(model_key) keys = self._atom_link.copy() - r_list.append(ItemContainer(a_key, keys, - lambda x, y: self.calculator.genericReturn(a_key, y), - lambda x, **y: self.calculator.genericUpdate(a_key, **y))) + r_list.append( + ItemContainer( + a_key, + keys, + lambda x, y: self.calculator.genericReturn(a_key, y), + lambda x, **y: self.calculator.genericUpdate(a_key, **y), + ) + ) elif issubclass(t_, Phase): - ident = str(model_key) + '_phase' + ident = str(model_key) + "_phase" self.calculator.createPhase(ident) crystal_name = self.calculator.createEmptyCrystal(model.name, key=model_key) self.calculator.assignCell_toCrystal(self.__identify(model.cell), model_key) - self.calculator.assignSpaceGroup_toCrystal(self.__identify(model._spacegroup), model_key) + self.calculator.assignSpaceGroup_toCrystal( + self.__identify(model._spacegroup), model_key + ) + self.calculator.setPhaseScale(str(model_key), scale=model.scale.raw_value) + r_list.append( + ItemContainer( + model_key, + {"scale": "scale"}, + self.calculator.getPhaseScale, + self.calculator.setPhaseScale, + ) + ) for atom in model.atoms: self.calculator.assignAtom_toCrystal(self.__identify(atom), model_key) elif issubclass(t_, Phases): # self.calculator.createModel(model_key, 'powder1D') for phase in model: - ident = str(self.__identify(phase)) + '_phase' + ident = str(self.__identify(phase)) + "_phase" self.calculator.assignPhase(model_key, ident) - elif t_.__name__ in ['Powder1DCW', 'powder1DCW', 'Npowder1DCW']: - # #TODO Check to see if parameters and pattern should be initialized here. - self.__createModel(model_key, 'powder1DCW') - elif t_.__name__ in ['Powder1DTOF', 'powder1DTOF', 'Npowder1DTOF']: - # #TODO Check to see if parameters and pattern should be initialized here. - self.__createModel(model_key, 'powder1DTOF') - elif t_.__name__ == 'Sample': # This is legacy mode. Boo + elif t_.__name__ in ["Powder1DCW", "powder1DCW", "Npowder1DCW"]: + # #TODO Check to see if parameters and pattern should be initialized here. + self.__createModel(model_key, "powder1DCW") + elif t_.__name__ in ["Powder1DTOF", "powder1DTOF", "Npowder1DTOF"]: + # #TODO Check to see if parameters and pattern should be initialized here. + self.__createModel(model_key, "powder1DTOF") + elif t_.__name__ == "Sample": # This is legacy mode. Boo if issubclass(type(model.parameters), Instrument1DCWParameters): - self.__createModel(model_key, 'powder1DCW') + self.__createModel(model_key, "powder1DCW") elif issubclass(type(model.parameters), Instrument1DTOFParameters): - self.__createModel(model_key, 'powder1DTOF') + self.__createModel(model_key, "powder1DTOF") else: - raise AttributeError('Unknown EXP type') + raise AttributeError("Unknown EXP type") else: if self._borg.debug: print(f"I'm a: {type(model)}") @@ -179,11 +231,14 @@ def remove_atom(self, crystal_obj, atom): self.calculator.removeAtom_fromCrystal(self.__identify(atom), crystal_name) def add_phase(self, phases_obj, phase_obj): - ident = str(self.__identify(phase_obj)) + '_phase' + ident = str(self.__identify(phase_obj)) + "_phase" self.calculator.assignPhase(self.__identify(phases_obj), ident) + self.calculator.setPhaseScale( + self.__identify(phase_obj), scale=phase_obj.scale.raw_value + ) def remove_phase(self, phases_obj, phase_obj): - ident = str(self.__identify(phase_obj)) + '_phase' + ident = str(self.__identify(phase_obj)) + "_phase" self.calculator.removePhase(self.__identify(phases_obj), ident) def fit_func(self, x_array: np.ndarray) -> np.ndarray: @@ -196,12 +251,22 @@ def fit_func(self, x_array: np.ndarray) -> np.ndarray: """ return self.calculator.calculate(x_array) - def get_hkl(self, x_array: np.ndarray = None, idx=None) -> dict: - return self.calculator.get_hkl(x_array) + def get_hkl(self, x_array: np.ndarray = None, idx=None, phase_name=None, encoded_name=False) -> dict: + return self.calculator.get_hkl(idx, phase_name, encoded_name) + + def get_phase_components(self, phase_name): + data = self.calculator.get_phase_components(phase_name) + return data def __createModel(self, model, model_type): self.calculator.createModel(model, model_type) + def get_calculated_y_for_phase(self, phase_idx: int) -> list: + return self.calculator.get_calculated_y_for_phase(phase_idx) + + def get_total_y_for_phases(self) -> list: + return self.calculator.get_total_y_for_phases() + @staticmethod def __identify(obj): return borg.map.convert_id_to_key(obj) diff --git a/easyDiffractionLib/Interfaces/interfaceTemplate.py b/easyDiffractionLib/Interfaces/interfaceTemplate.py index 4ce4fed8..b640b0e9 100644 --- a/easyDiffractionLib/Interfaces/interfaceTemplate.py +++ b/easyDiffractionLib/Interfaces/interfaceTemplate.py @@ -128,4 +128,11 @@ def fit_func(self, x_array: np.ndarray) -> np.ndarray: @abstractmethod def get_hkl(self, x_array: np.ndarray = None, idx=None) -> dict: pass - \ No newline at end of file + + @abstractmethod + def get_calculated_y_for_phase(self, idx=None) -> list: + pass + + @abstractmethod + def get_total_y_for_phases(self) -> list: + pass diff --git a/easyDiffractionLib/Profiles/P1D.py b/easyDiffractionLib/Profiles/P1D.py index 29a72254..59117fb6 100644 --- a/easyDiffractionLib/Profiles/P1D.py +++ b/easyDiffractionLib/Profiles/P1D.py @@ -1,5 +1,5 @@ -__author__ = 'github.com/wardsimon' -__version__ = '0.0.1' +__author__ = "github.com/wardsimon" +__version__ = "0.0.1" from typing import TypeVar, List @@ -11,14 +11,14 @@ from easyDiffractionLib.Profiles.common import JobSetup, _DataClassBase _decoder = MontyDecoder() -T = TypeVar('T') +T = TypeVar("T") class Powder1DSim(_DataClassBase): def __init__(self, dataset): super(Powder1DSim, self).__init__(dataset) - self._simulation_prefix = 'sim_' - self.name = '' + self._simulation_prefix = "sim_" + self.name = "" def add_simulation(self, simulation_name, simulation): self._dataset[self._simulation_prefix + simulation_name] = simulation @@ -50,9 +50,11 @@ def experiments(self) -> xr.Dataset: @property def experiment_names(self) -> List[str]: - exps = [a for a in self._dataset.variables.keys() - if not a.startswith(self.simulation_prefix) and - not a in self._dataset.dims] + exps = [ + a + for a in self._dataset.variables.keys() + if not a.startswith(self.simulation_prefix) and not a in self._dataset.dims + ] return exps @@ -67,61 +69,69 @@ def __init__(self, dataset, simulation_prefix): class Powder1DParameters(BaseObj): - _name = '1DPowderProfile' + _name = "1DPowderProfile" _defaults = { - 'zero_shift': { - '@module': 'easyCore.Objects.Base', - '@class': 'Parameter', - '@version': '0.0.1', - 'name': 'zero_shift', - 'units': 'degree', - 'value': 0.0, - 'fixed': True + "zero_shift": { + "@module": "easyCore.Objects.Base", + "@class": "Parameter", + "@version": "0.0.1", + "name": "zero_shift", + "units": "degree", + "value": 0.0, + "fixed": True, }, - 'scale': { - '@module': 'easyCore.Objects.Base', - '@class': 'Parameter', - '@version': '0.0.1', - 'name': 'scale', - 'value': 1, - 'fixed': True + "scale": { + "@module": "easyCore.Objects.Base", + "@class": "Parameter", + "@version": "0.0.1", + "name": "scale", + "value": 1, + "fixed": True, + "enabled": False, + }, + "backgrounds": { + "@module": "easyDiffractionLib.Elements.Backgrounds.Background", + "@class": "BackgroundContainer", + "@version": "0.0.1", + "data": [], }, - 'backgrounds': { - '@module': 'easyDiffractionLib.Elements.Backgrounds.Background', - '@class': 'BackgroundContainer', - '@version': '0.0.1', - 'data': [], - } } - def __init__(self, - zero_shift: Parameter, scale: Parameter, - backgrounds: BackgroundContainer, - interface=None): - super().__init__(self.__class__.__name__, - zero_shift=zero_shift, scale=scale, - backgrounds=backgrounds) + def __init__( + self, + zero_shift: Parameter, + scale: Parameter, + backgrounds: BackgroundContainer, + interface=None, + ): + super().__init__( + self.__class__.__name__, + zero_shift=zero_shift, + scale=scale, + backgrounds=backgrounds, + ) self.name = self._name self.interface = interface @classmethod - def from_pars(cls, - zero_shift: float = _defaults['zero_shift']['value'], - scale: float = _defaults['scale']['value'] - ): + def from_pars( + cls, + zero_shift: float = _defaults["zero_shift"]["value"], + scale: float = _defaults["scale"]["value"], + ): defaults = deepcopy(cls._defaults) - defaults['zero_shift']['value'] = zero_shift - zero_shift = _decoder.process_decoded(defaults['zero_shift']) - defaults['scale']['value'] = scale - scale = _decoder.process_decoded(defaults['scale']) + defaults["zero_shift"]["value"] = zero_shift + zero_shift = _decoder.process_decoded(defaults["zero_shift"]) + defaults["scale"]["value"] = scale + scale = _decoder.process_decoded(defaults["scale"]) backgrounds = BackgroundContainer() return cls(zero_shift=zero_shift, scale=scale, backgrounds=backgrounds) @classmethod def default(cls): defaults = deepcopy(cls._defaults) - zero_shift = _decoder.process_decoded(defaults['zero_shift']) - scale = _decoder.process_decoded(defaults['scale']) + zero_shift = _decoder.process_decoded(defaults["zero_shift"]) + scale = _decoder.process_decoded(defaults["scale"]) backgrounds = BackgroundContainer() return cls(zero_shift=zero_shift, scale=scale, backgrounds=backgrounds) @@ -132,331 +142,386 @@ class PolPowder1DParameters(Powder1DParameters): class Instrument1DCWParameters(BaseObj): - _name = 'InstrumentalParameters' + _name = "InstrumentalParameters" _defaults = { - 'wavelength': { - '@module': 'easyCore.Objects.Base', - '@class': 'Parameter', - '@version': '0.0.1', - 'name': 'wavelength', - 'units': 'angstrom', - 'value': 1.54056, - 'fixed': True + "wavelength": { + "@module": "easyCore.Objects.Base", + "@class": "Parameter", + "@version": "0.0.1", + "name": "wavelength", + "units": "angstrom", + "value": 1.54056, + "fixed": True, }, - 'resolution_u': { - '@module': 'easyCore.Objects.Base', - '@class': 'Parameter', - '@version': '0.0.1', - 'name': 'resolution_u', - 'value': 0.0002, - 'fixed': True + "resolution_u": { + "@module": "easyCore.Objects.Base", + "@class": "Parameter", + "@version": "0.0.1", + "name": "resolution_u", + "value": 0.0002, + "fixed": True, }, - 'resolution_v': { - '@module': 'easyCore.Objects.Base', - '@class': 'Parameter', - '@version': '0.0.1', - 'name': 'resolution_v', - 'value': -0.0002, - 'fixed': True - + "resolution_v": { + "@module": "easyCore.Objects.Base", + "@class": "Parameter", + "@version": "0.0.1", + "name": "resolution_v", + "value": -0.0002, + "fixed": True, }, - 'resolution_w': { - '@module': 'easyCore.Objects.Base', - '@class': 'Parameter', - '@version': '0.0.1', - 'name': 'resolution_w', - 'value': 0.012, - 'fixed': True - + "resolution_w": { + "@module": "easyCore.Objects.Base", + "@class": "Parameter", + "@version": "0.0.1", + "name": "resolution_w", + "value": 0.012, + "fixed": True, }, - 'resolution_x': { - '@module': 'easyCore.Objects.Base', - '@class': 'Parameter', - '@version': '0.0.1', - 'name': 'resolution_x', - 'value': 0.0, - 'fixed': True + "resolution_x": { + "@module": "easyCore.Objects.Base", + "@class": "Parameter", + "@version": "0.0.1", + "name": "resolution_x", + "value": 0.0, + "fixed": True, + }, + "resolution_y": { + "@module": "easyCore.Objects.Base", + "@class": "Parameter", + "@version": "0.0.1", + "name": "resolution_y", + "value": 0.0, + "fixed": True, }, - 'resolution_y': { - '@module': 'easyCore.Objects.Base', - '@class': 'Parameter', - '@version': '0.0.1', - 'name': 'resolution_y', - 'value': 0.0, - 'fixed': True - } } - def __init__(self, - wavelength: Parameter, - resolution_u: Parameter, resolution_v: Parameter, resolution_w: Parameter, - resolution_x: Parameter, resolution_y: Parameter, - interface=None): - super().__init__(self.__class__.__name__, - wavelength=wavelength, - resolution_u=resolution_u, resolution_v=resolution_v, resolution_w=resolution_w, - resolution_x=resolution_x, resolution_y=resolution_y) + def __init__( + self, + wavelength: Parameter, + resolution_u: Parameter, + resolution_v: Parameter, + resolution_w: Parameter, + resolution_x: Parameter, + resolution_y: Parameter, + interface=None, + ): + super().__init__( + self.__class__.__name__, + wavelength=wavelength, + resolution_u=resolution_u, + resolution_v=resolution_v, + resolution_w=resolution_w, + resolution_x=resolution_x, + resolution_y=resolution_y, + ) self.name = self._name self.interface = interface @classmethod - def from_pars(cls, - wavelength: float = _defaults['wavelength']['value'], - resolution_u: float = _defaults['resolution_u']['value'], - resolution_v: float = _defaults['resolution_v']['value'], - resolution_w: float = _defaults['resolution_w']['value'], - resolution_x: float = _defaults['resolution_x']['value'], - resolution_y: float = _defaults['resolution_y']['value'] - ): + def from_pars( + cls, + wavelength: float = _defaults["wavelength"]["value"], + resolution_u: float = _defaults["resolution_u"]["value"], + resolution_v: float = _defaults["resolution_v"]["value"], + resolution_w: float = _defaults["resolution_w"]["value"], + resolution_x: float = _defaults["resolution_x"]["value"], + resolution_y: float = _defaults["resolution_y"]["value"], + ): defaults = deepcopy(cls._defaults) - defaults['wavelength']['value'] = wavelength - wavelength = _decoder.process_decoded(defaults['wavelength']) - defaults['resolution_u']['value'] = resolution_u - resolution_u = _decoder.process_decoded(defaults['resolution_u']) - defaults['resolution_v']['value'] = resolution_v - resolution_v = _decoder.process_decoded(defaults['resolution_v']) - defaults['resolution_w']['value'] = resolution_w - resolution_w = _decoder.process_decoded(defaults['resolution_w']) - defaults['resolution_x']['value'] = resolution_x - resolution_x = _decoder.process_decoded(defaults['resolution_x']) - defaults['resolution_y']['value'] = resolution_y - resolution_y = _decoder.process_decoded(defaults['resolution_y']) - return cls(wavelength=wavelength, - resolution_u=resolution_u, resolution_v=resolution_v, resolution_w=resolution_w, - resolution_x=resolution_x, resolution_y=resolution_y) + defaults["wavelength"]["value"] = wavelength + wavelength = _decoder.process_decoded(defaults["wavelength"]) + defaults["resolution_u"]["value"] = resolution_u + resolution_u = _decoder.process_decoded(defaults["resolution_u"]) + defaults["resolution_v"]["value"] = resolution_v + resolution_v = _decoder.process_decoded(defaults["resolution_v"]) + defaults["resolution_w"]["value"] = resolution_w + resolution_w = _decoder.process_decoded(defaults["resolution_w"]) + defaults["resolution_x"]["value"] = resolution_x + resolution_x = _decoder.process_decoded(defaults["resolution_x"]) + defaults["resolution_y"]["value"] = resolution_y + resolution_y = _decoder.process_decoded(defaults["resolution_y"]) + return cls( + wavelength=wavelength, + resolution_u=resolution_u, + resolution_v=resolution_v, + resolution_w=resolution_w, + resolution_x=resolution_x, + resolution_y=resolution_y, + ) @classmethod def default(cls): defaults = deepcopy(cls._defaults) - wavelength = _decoder.process_decoded(defaults['wavelength']) - resolution_u = _decoder.process_decoded(defaults['resolution_u']) - resolution_v = _decoder.process_decoded(defaults['resolution_v']) - resolution_w = _decoder.process_decoded(defaults['resolution_w']) - resolution_x = _decoder.process_decoded(defaults['resolution_x']) - resolution_y = _decoder.process_decoded(defaults['resolution_y']) - return cls(wavelength=wavelength, - resolution_u=resolution_u, resolution_v=resolution_v, resolution_w=resolution_w, - resolution_x=resolution_x, resolution_y=resolution_y) + wavelength = _decoder.process_decoded(defaults["wavelength"]) + resolution_u = _decoder.process_decoded(defaults["resolution_u"]) + resolution_v = _decoder.process_decoded(defaults["resolution_v"]) + resolution_w = _decoder.process_decoded(defaults["resolution_w"]) + resolution_x = _decoder.process_decoded(defaults["resolution_x"]) + resolution_y = _decoder.process_decoded(defaults["resolution_y"]) + return cls( + wavelength=wavelength, + resolution_u=resolution_u, + resolution_v=resolution_v, + resolution_w=resolution_w, + resolution_x=resolution_x, + resolution_y=resolution_y, + ) class Instrument1DTOFParameters(BaseObj): - _name = 'InstrumentalParameters' + _name = "InstrumentalParameters" _defaults = { - 'ttheta_bank': { - '@module': 'easyCore.Objects.Base', - '@class': 'Parameter', - '@version': '0.0.1', - 'name': 'ttheta_bank', - 'units': 'deg', - 'value': 145.00, - 'fixed': True + "ttheta_bank": { + "@module": "easyCore.Objects.Base", + "@class": "Parameter", + "@version": "0.0.1", + "name": "ttheta_bank", + "units": "deg", + "value": 145.00, + "fixed": True, }, - 'dtt1': { - '@module': 'easyCore.Objects.Base', - '@class': 'Parameter', - '@version': '0.0.1', - 'name': 'dtt1', - 'units': 'deg', - 'value': 6167.24700, - 'fixed': True + "dtt1": { + "@module": "easyCore.Objects.Base", + "@class": "Parameter", + "@version": "0.0.1", + "name": "dtt1", + "units": "deg", + "value": 6167.24700, + "fixed": True, }, - 'dtt2': { - '@module': 'easyCore.Objects.Base', - '@class': 'Parameter', - '@version': '0.0.1', - 'name': 'dtt2', - 'units': 'deg', - 'value': -2.28000, - 'fixed': True + "dtt2": { + "@module": "easyCore.Objects.Base", + "@class": "Parameter", + "@version": "0.0.1", + "name": "dtt2", + "units": "deg", + "value": -2.28000, + "fixed": True, }, - 'sigma0': { - '@module': 'easyCore.Objects.Base', - '@class': 'Parameter', - '@version': '0.0.1', - 'name': 'sigma0', - 'value': 0.409, - 'fixed': True + "sigma0": { + "@module": "easyCore.Objects.Base", + "@class": "Parameter", + "@version": "0.0.1", + "name": "sigma0", + "value": 0.409, + "fixed": True, }, - 'sigma1': { - '@module': 'easyCore.Objects.Base', - '@class': 'Parameter', - '@version': '0.0.1', - 'name': 'sigma1', - 'value': 8.118, - 'fixed': True - + "sigma1": { + "@module": "easyCore.Objects.Base", + "@class": "Parameter", + "@version": "0.0.1", + "name": "sigma1", + "value": 8.118, + "fixed": True, + }, + "sigma2": { + "@module": "easyCore.Objects.Base", + "@class": "Parameter", + "@version": "0.0.1", + "name": "sigma2", + "value": 0.0, + "fixed": True, + "enabled": False, }, - 'sigma2': { - '@module': 'easyCore.Objects.Base', - '@class': 'Parameter', - '@version': '0.0.1', - 'name': 'sigma2', - 'value': 0.0, - 'fixed': True, - 'enabled': False + "gamma0": { + "@module": "easyCore.Objects.Base", + "@class": "Parameter", + "@version": "0.0.1", + "name": "gamma0", + "value": 0.0, + "fixed": True, + "enabled": False, }, - 'gamma0': { - '@module': 'easyCore.Objects.Base', - '@class': 'Parameter', - '@version': '0.0.1', - 'name': 'gamma0', - 'value': 0.0, - 'fixed': True, - 'enabled': False + "gamma1": { + "@module": "easyCore.Objects.Base", + "@class": "Parameter", + "@version": "0.0.1", + "name": "gamma1", + "value": 0.0, + "fixed": True, + "enabled": False, }, - 'gamma1': { - '@module': 'easyCore.Objects.Base', - '@class': 'Parameter', - '@version': '0.0.1', - 'name': 'gamma1', - 'value': 0.0, - 'fixed': True, - 'enabled': False + "gamma2": { + "@module": "easyCore.Objects.Base", + "@class": "Parameter", + "@version": "0.0.1", + "name": "gamma2", + "value": 0.0, + "fixed": True, + "enabled": False, }, - 'gamma2': { - '@module': 'easyCore.Objects.Base', - '@class': 'Parameter', - '@version': '0.0.1', - 'name': 'gamma2', - 'value': 0.0, - 'fixed': True, - 'enabled': False + "alpha0": { + "@module": "easyCore.Objects.Base", + "@class": "Parameter", + "@version": "0.0.1", + "name": "alpha0", + "value": 0.0, + "fixed": True, }, - 'alpha0': { - '@module': 'easyCore.Objects.Base', - '@class': 'Parameter', - '@version': '0.0.1', - 'name': 'alpha0', - 'value': 0.0, - 'fixed': True + "alpha1": { + "@module": "easyCore.Objects.Base", + "@class": "Parameter", + "@version": "0.0.1", + "name": "alpha1", + "value": 0.29710, + "fixed": True, }, - 'alpha1': { - '@module': 'easyCore.Objects.Base', - '@class': 'Parameter', - '@version': '0.0.1', - 'name': 'alpha1', - 'value': 0.29710, - 'fixed': True + "beta0": { + "@module": "easyCore.Objects.Base", + "@class": "Parameter", + "@version": "0.0.1", + "name": "beta0", + "value": 0.04182, + "fixed": True, }, - 'beta0': { - '@module': 'easyCore.Objects.Base', - '@class': 'Parameter', - '@version': '0.0.1', - 'name': 'beta0', - 'value': 0.04182, - 'fixed': True + "beta1": { + "@module": "easyCore.Objects.Base", + "@class": "Parameter", + "@version": "0.0.1", + "name": "beta1", + "value": 0.00224, + "fixed": True, }, - 'beta1': { - '@module': 'easyCore.Objects.Base', - '@class': 'Parameter', - '@version': '0.0.1', - 'name': 'beta1', - 'value': 0.00224, - 'fixed': True - } } - def __init__(self, - ttheta_bank: Parameter, - dtt1: Parameter, dtt2: Parameter, - sigma0: Parameter, sigma1: Parameter, sigma2: Parameter, - gamma0: Parameter, gamma1: Parameter, gamma2: Parameter, - alpha0: Parameter, alpha1: Parameter, - beta0: Parameter, beta1: Parameter, - interface=None): - super().__init__(self.__class__.__name__, - ttheta_bank=ttheta_bank, - dtt1=dtt1, dtt2=dtt2, - sigma0=sigma0, sigma1=sigma1, sigma2=sigma2, - gamma0=gamma0, gamma1=gamma1, gamma2=gamma2, - alpha0=alpha0, alpha1=alpha1, - beta0=beta0, beta1=beta1) + def __init__( + self, + ttheta_bank: Parameter, + dtt1: Parameter, + dtt2: Parameter, + sigma0: Parameter, + sigma1: Parameter, + sigma2: Parameter, + gamma0: Parameter, + gamma1: Parameter, + gamma2: Parameter, + alpha0: Parameter, + alpha1: Parameter, + beta0: Parameter, + beta1: Parameter, + interface=None, + ): + super().__init__( + self.__class__.__name__, + ttheta_bank=ttheta_bank, + dtt1=dtt1, + dtt2=dtt2, + sigma0=sigma0, + sigma1=sigma1, + sigma2=sigma2, + gamma0=gamma0, + gamma1=gamma1, + gamma2=gamma2, + alpha0=alpha0, + alpha1=alpha1, + beta0=beta0, + beta1=beta1, + ) self.name = self._name self.interface = interface @classmethod - def from_pars(cls, - ttheta_bank: float = _defaults['ttheta_bank']['value'], - dtt1: float = _defaults['dtt1']['value'], - dtt2: float = _defaults['dtt2']['value'], - sigma0: float = _defaults['sigma0']['value'], - sigma1: float = _defaults['sigma1']['value'], - sigma2: float = _defaults['sigma2']['value'], - gamma0: float = _defaults['gamma0']['value'], - gamma1: float = _defaults['gamma1']['value'], - gamma2: float = _defaults['gamma2']['value'], - alpha0: float = _defaults['alpha0']['value'], - alpha1: float = _defaults['alpha1']['value'], - beta0: float = _defaults['beta0']['value'], - beta1: float = _defaults['beta1']['value'], - ): + def from_pars( + cls, + ttheta_bank: float = _defaults["ttheta_bank"]["value"], + dtt1: float = _defaults["dtt1"]["value"], + dtt2: float = _defaults["dtt2"]["value"], + sigma0: float = _defaults["sigma0"]["value"], + sigma1: float = _defaults["sigma1"]["value"], + sigma2: float = _defaults["sigma2"]["value"], + gamma0: float = _defaults["gamma0"]["value"], + gamma1: float = _defaults["gamma1"]["value"], + gamma2: float = _defaults["gamma2"]["value"], + alpha0: float = _defaults["alpha0"]["value"], + alpha1: float = _defaults["alpha1"]["value"], + beta0: float = _defaults["beta0"]["value"], + beta1: float = _defaults["beta1"]["value"], + ): defaults = deepcopy(cls._defaults) - defaults['ttheta_bank']['value'] = ttheta_bank - ttheta_bank = _decoder.process_decoded(defaults['ttheta_bank']) - defaults['dtt1']['value'] = dtt1 - dtt1 = _decoder.process_decoded(defaults['dtt1']) - defaults['dtt2']['value'] = dtt2 - dtt2 = _decoder.process_decoded(defaults['dtt2']) - defaults['sigma0']['value'] = sigma0 - sigma0 = _decoder.process_decoded(defaults['sigma0']) - defaults['sigma1']['value'] = sigma1 - sigma1 = _decoder.process_decoded(defaults['sigma1']) - defaults['sigma2']['value'] = sigma2 - sigma2 = _decoder.process_decoded(defaults['sigma2']) - defaults['gamma0']['value'] = gamma0 - gamma0 = _decoder.process_decoded(defaults['gamma0']) - defaults['gamma1']['value'] = gamma1 - gamma1 = _decoder.process_decoded(defaults['gamma1']) - defaults['gamma2']['value'] = gamma2 - gamma2 = _decoder.process_decoded(defaults['gamma2']) - defaults['alpha0']['value'] = alpha0 - alpha0 = _decoder.process_decoded(defaults['alpha0']) - defaults['alpha1']['value'] = alpha1 - alpha1 = _decoder.process_decoded(defaults['alpha1']) - defaults['beta0']['value'] = beta0 - beta0 = _decoder.process_decoded(defaults['beta0']) - defaults['beta1']['value'] = beta1 - beta1 = _decoder.process_decoded(defaults['beta1']) - - return cls(ttheta_bank=ttheta_bank, - dtt1=dtt1, dtt2=dtt2, - sigma0=sigma0, sigma1=sigma1, sigma2=sigma2, - gamma0=gamma0, gamma1=gamma1, gamma2=gamma2, - alpha0=alpha0, alpha1=alpha1, - beta0=beta0, beta1=beta1) + defaults["ttheta_bank"]["value"] = ttheta_bank + ttheta_bank = _decoder.process_decoded(defaults["ttheta_bank"]) + defaults["dtt1"]["value"] = dtt1 + dtt1 = _decoder.process_decoded(defaults["dtt1"]) + defaults["dtt2"]["value"] = dtt2 + dtt2 = _decoder.process_decoded(defaults["dtt2"]) + defaults["sigma0"]["value"] = sigma0 + sigma0 = _decoder.process_decoded(defaults["sigma0"]) + defaults["sigma1"]["value"] = sigma1 + sigma1 = _decoder.process_decoded(defaults["sigma1"]) + defaults["sigma2"]["value"] = sigma2 + sigma2 = _decoder.process_decoded(defaults["sigma2"]) + defaults["gamma0"]["value"] = gamma0 + gamma0 = _decoder.process_decoded(defaults["gamma0"]) + defaults["gamma1"]["value"] = gamma1 + gamma1 = _decoder.process_decoded(defaults["gamma1"]) + defaults["gamma2"]["value"] = gamma2 + gamma2 = _decoder.process_decoded(defaults["gamma2"]) + defaults["alpha0"]["value"] = alpha0 + alpha0 = _decoder.process_decoded(defaults["alpha0"]) + defaults["alpha1"]["value"] = alpha1 + alpha1 = _decoder.process_decoded(defaults["alpha1"]) + defaults["beta0"]["value"] = beta0 + beta0 = _decoder.process_decoded(defaults["beta0"]) + defaults["beta1"]["value"] = beta1 + beta1 = _decoder.process_decoded(defaults["beta1"]) + + return cls( + ttheta_bank=ttheta_bank, + dtt1=dtt1, + dtt2=dtt2, + sigma0=sigma0, + sigma1=sigma1, + sigma2=sigma2, + gamma0=gamma0, + gamma1=gamma1, + gamma2=gamma2, + alpha0=alpha0, + alpha1=alpha1, + beta0=beta0, + beta1=beta1, + ) @classmethod def default(cls): defaults = deepcopy(cls._defaults) - ttheta_bank = _decoder.process_decoded(defaults['ttheta_bank']) - dtt1 = _decoder.process_decoded(defaults['dtt1']) - dtt2 = _decoder.process_decoded(defaults['dtt2']) - sigma0 = _decoder.process_decoded(defaults['sigma0']) - sigma1 = _decoder.process_decoded(defaults['sigma1']) - sigma2 = _decoder.process_decoded(defaults['sigma2']) - gamma0 = _decoder.process_decoded(defaults['gamma0']) - gamma1 = _decoder.process_decoded(defaults['gamma1']) - gamma2 = _decoder.process_decoded(defaults['gamma2']) - alpha0 = _decoder.process_decoded(defaults['alpha0']) - alpha1 = _decoder.process_decoded(defaults['alpha1']) - beta0 = _decoder.process_decoded(defaults['beta0']) - beta1 = _decoder.process_decoded(defaults['beta1']) - return cls(ttheta_bank=ttheta_bank, - dtt1=dtt1, dtt2=dtt2, - sigma0=sigma0, sigma1=sigma1, sigma2=sigma2, - gamma0=gamma0, gamma1=gamma1, gamma2=gamma2, - alpha0=alpha0, alpha1=alpha1, - beta0=beta0, beta1=beta1) + ttheta_bank = _decoder.process_decoded(defaults["ttheta_bank"]) + dtt1 = _decoder.process_decoded(defaults["dtt1"]) + dtt2 = _decoder.process_decoded(defaults["dtt2"]) + sigma0 = _decoder.process_decoded(defaults["sigma0"]) + sigma1 = _decoder.process_decoded(defaults["sigma1"]) + sigma2 = _decoder.process_decoded(defaults["sigma2"]) + gamma0 = _decoder.process_decoded(defaults["gamma0"]) + gamma1 = _decoder.process_decoded(defaults["gamma1"]) + gamma2 = _decoder.process_decoded(defaults["gamma2"]) + alpha0 = _decoder.process_decoded(defaults["alpha0"]) + alpha1 = _decoder.process_decoded(defaults["alpha1"]) + beta0 = _decoder.process_decoded(defaults["beta0"]) + beta1 = _decoder.process_decoded(defaults["beta1"]) + return cls( + ttheta_bank=ttheta_bank, + dtt1=dtt1, + dtt2=dtt2, + sigma0=sigma0, + sigma1=sigma1, + sigma2=sigma2, + gamma0=gamma0, + gamma1=gamma1, + gamma2=gamma2, + alpha0=alpha0, + alpha1=alpha1, + beta0=beta0, + beta1=beta1, + ) class Instrument1DCWPolParameters(Instrument1DCWParameters): pass -Unpolarized1DClasses = JobSetup([Powder1DSim, Powder1DExp], - Powder1DParameters, - Instrument1DCWParameters) +Unpolarized1DClasses = JobSetup( + [Powder1DSim, Powder1DExp], Powder1DParameters, Instrument1DCWParameters +) -Unpolarized1DTOFClasses = JobSetup([Powder1DSim, Powder1DExp], - Powder1DParameters, - Instrument1DTOFParameters) \ No newline at end of file +Unpolarized1DTOFClasses = JobSetup( + [Powder1DSim, Powder1DExp], Powder1DParameters, Instrument1DTOFParameters +) diff --git a/easyDiffractionLib/__init__.py b/easyDiffractionLib/__init__.py index b22bddec..55124598 100644 --- a/easyDiffractionLib/__init__.py +++ b/easyDiffractionLib/__init__.py @@ -2,7 +2,7 @@ __version__ = '0.0.1' -from easyCore.Elements.HigherLevel.Phase import Phases, Atoms, Site, SpaceGroup, Lattice, Phase +from easyCrystallography.Structures.Phase import Phases, Atoms, Site, SpaceGroup, Lattice, Phase """ This is a horrendous monkey patch of the Phase and Phases class so that adding and removing communicates diff --git a/easyDiffractionLib/interface.py b/easyDiffractionLib/interface.py index 546c7917..c860048c 100644 --- a/easyDiffractionLib/interface.py +++ b/easyDiffractionLib/interface.py @@ -11,8 +11,17 @@ class InterfaceFactory(InterfaceFactoryTemplate): def __init__(self, *args, **kwargs): super(InterfaceFactory, self).__init__(InterfaceTemplate._interfaces, *args, **kwargs) - def get_hkl(self, x_array=None, idx=None) -> dict: - return self().get_hkl(x_array) + def get_hkl(self, x_array=None, idx=None, phase_name=None, encoded_name=False) -> dict: + return self().get_hkl(x_array, idx=idx, phase_name=phase_name, encoded_name=encoded_name) + + def get_total_y_for_phases(self) -> list: + return self().get_total_y_for_phases() + + def get_calculated_y_for_phase(self, idx=None) -> list: + return self().get_calculated_y_for_phase(idx) + + def get_phase_components(self, phase_name): + return self().get_phase_components(phase_name) def interface_compatability(self, check_str: str) -> List[str]: compatible_interfaces = [] diff --git a/examples/3T2@LLB.xye b/examples/3T2@LLB.xye new file mode 100644 index 00000000..923d1b7f --- /dev/null +++ b/examples/3T2@LLB.xye @@ -0,0 +1,2401 @@ + 5.00000 193.0000 13.8924 + 5.05000 207.0000 14.3875 + 5.10000 180.0000 13.4164 + 5.15000 189.0000 13.7477 + 5.20000 202.0000 14.2127 + 5.25000 192.0000 13.8564 + 5.30000 190.0000 13.7840 + 5.35000 182.0000 13.4907 + 5.40000 196.0000 14.0000 + 5.45000 192.0000 13.8564 + 5.50000 180.0000 13.4164 + 5.55000 188.0000 13.7113 + 5.60000 192.0000 13.8564 + 5.65000 200.0000 14.1421 + 5.70000 185.0000 13.6015 + 5.75000 173.0000 13.1529 + 5.80000 177.0000 13.3041 + 5.85000 180.0000 13.4164 + 5.90000 173.0000 13.1529 + 5.95000 175.0000 13.2288 + 6.00000 169.0000 13.0000 + 6.05000 182.0000 13.4907 + 6.10000 189.0000 13.7477 + 6.15000 178.0000 13.3417 + 6.20000 188.0000 13.7113 + 6.25000 172.0000 13.1149 + 6.30000 171.0000 13.0767 + 6.35000 173.0000 13.1529 + 6.40000 185.0000 13.6015 + 6.45000 175.0000 13.2288 + 6.50000 192.0000 13.8564 + 6.55000 187.0000 13.6748 + 6.60000 172.0000 13.1149 + 6.65000 180.0000 13.4164 + 6.70000 185.0000 13.6015 + 6.75000 160.0000 12.6491 + 6.80000 171.0000 13.0767 + 6.85000 183.0000 13.5277 + 6.90000 168.0000 12.9615 + 6.95000 181.0000 13.4536 + 7.00000 173.0000 13.1529 + 7.05000 163.0000 12.7671 + 7.10000 168.0000 12.9615 + 7.15000 179.0000 13.3791 + 7.20000 163.0000 12.7671 + 7.25000 157.0000 12.5300 + 7.30000 165.0000 12.8452 + 7.35000 166.0000 12.8841 + 7.40000 165.0000 12.8452 + 7.45000 181.0000 13.4536 + 7.50000 157.0000 12.5300 + 7.55000 167.0000 12.9228 + 7.60000 174.0000 13.1909 + 7.65000 170.0000 13.0384 + 7.70000 166.0000 12.8841 + 7.75000 168.0000 12.9615 + 7.80000 174.0000 13.1909 + 7.85000 166.0000 12.8841 + 7.90000 176.0000 13.2665 + 7.95000 173.0000 13.1529 + 8.00000 156.0000 12.4900 + 8.05000 176.0000 13.2665 + 8.10000 182.0000 13.4907 + 8.15000 169.0000 13.0000 + 8.20000 159.0000 12.6095 + 8.25000 162.0000 12.7279 + 8.30000 156.0000 12.4900 + 8.35000 158.0000 12.5698 + 8.40000 172.0000 13.1149 + 8.45000 160.0000 12.6491 + 8.50000 160.0000 12.6491 + 8.55000 153.0000 12.3693 + 8.60000 165.0000 12.8452 + 8.65000 162.0000 12.7279 + 8.70000 165.0000 12.8452 + 8.75000 161.0000 12.6886 + 8.80000 162.0000 12.7279 + 8.85000 146.0000 12.0830 + 8.90000 162.0000 12.7279 + 8.95000 161.0000 12.6886 + 9.00000 161.0000 12.6886 + 9.05000 152.0000 12.3288 + 9.10000 160.0000 12.6491 + 9.15000 160.0000 12.6491 + 9.20000 147.0000 12.1244 + 9.25000 154.0000 12.4097 + 9.30000 148.0000 12.1655 + 9.35000 154.0000 12.4097 + 9.40000 166.0000 12.8841 + 9.45000 165.0000 12.8452 + 9.50000 160.0000 12.6491 + 9.55000 164.0000 12.8062 + 9.60000 156.0000 12.4900 + 9.65000 160.0000 12.6491 + 9.70000 163.0000 12.7671 + 9.75000 169.0000 13.0000 + 9.80000 176.0000 13.2665 + 9.85000 176.0000 13.2665 + 9.90000 178.0000 13.3417 + 9.95000 176.0000 13.2665 +10.00000 182.0000 13.4907 +10.05000 179.0000 13.3791 +10.10000 187.0000 13.6748 +10.15000 203.0000 14.2478 +10.20000 200.0000 14.1421 +10.25000 216.0000 14.6969 +10.30000 213.0000 14.5945 +10.35000 241.0000 15.5242 +10.40000 252.0000 15.8745 +10.45000 253.0000 15.9060 +10.50000 240.0000 15.4919 +10.55000 229.0000 15.1327 +10.60000 228.0000 15.0997 +10.65000 214.0000 14.6287 +10.70000 209.0000 14.4568 +10.75000 196.0000 14.0000 +10.80000 175.0000 13.2288 +10.85000 175.0000 13.2288 +10.90000 168.0000 12.9615 +10.95000 162.0000 12.7279 +11.00000 161.0000 12.6886 +11.05000 158.0000 12.5698 +11.10000 148.0000 12.1655 +11.15000 160.0000 12.6491 +11.20000 154.0000 12.4097 +11.25000 150.0000 12.2474 +11.30000 146.0000 12.0830 +11.35000 149.0000 12.2066 +11.40000 152.0000 12.3288 +11.45000 145.0000 12.0416 +11.50000 160.0000 12.6491 +11.55000 149.0000 12.2066 +11.60000 152.0000 12.3288 +11.65000 156.0000 12.4900 +11.70000 149.0000 12.2066 +11.75000 154.0000 12.4097 +11.80000 160.0000 12.6491 +11.85000 153.0000 12.3693 +11.90000 156.0000 12.4900 +11.95000 160.0000 12.6491 +12.00000 154.0000 12.4097 +12.05000 145.0000 12.0416 +12.10000 148.0000 12.1655 +12.15000 156.0000 12.4900 +12.20000 154.0000 12.4097 +12.25000 158.0000 12.5698 +12.30000 150.0000 12.2474 +12.35000 153.0000 12.3693 +12.40000 154.0000 12.4097 +12.45000 146.0000 12.0830 +12.50000 152.0000 12.3288 +12.55000 149.0000 12.2066 +12.60000 142.0000 11.9164 +12.65000 161.0000 12.6886 +12.70000 153.0000 12.3693 +12.75000 145.0000 12.0416 +12.80000 150.0000 12.2474 +12.85000 154.0000 12.4097 +12.90000 146.0000 12.0830 +12.95000 144.0000 12.0000 +13.00000 144.0000 12.0000 +13.05000 144.0000 12.0000 +13.10000 143.0000 11.9583 +13.15000 142.0000 11.9164 +13.20000 145.0000 12.0416 +13.25000 147.0000 12.1244 +13.30000 146.0000 12.0830 +13.35000 157.0000 12.5300 +13.40000 145.0000 12.0416 +13.45000 154.0000 12.4097 +13.50000 158.0000 12.5698 +13.55000 150.0000 12.2474 +13.60000 147.0000 12.1244 +13.65000 159.0000 12.6095 +13.70000 152.0000 12.3288 +13.75000 155.0000 12.4499 +13.80000 147.0000 12.1244 +13.85000 144.0000 12.0000 +13.90000 155.0000 12.4499 +13.95000 148.0000 12.1655 +14.00000 157.0000 12.5300 +14.05000 145.0000 12.0416 +14.10000 151.0000 12.2882 +14.15000 153.0000 12.3693 +14.20000 145.0000 12.0416 +14.25000 153.0000 12.3693 +14.30000 144.0000 12.0000 +14.35000 148.0000 12.1655 +14.40000 148.0000 12.1655 +14.45000 152.0000 12.3288 +14.50000 147.0000 12.1244 +14.55000 157.0000 12.5300 +14.60000 152.0000 12.3288 +14.65000 152.0000 12.3288 +14.70000 156.0000 12.4900 +14.75000 153.0000 12.3693 +14.80000 147.0000 12.1244 +14.85000 146.0000 12.0830 +14.90000 152.0000 12.3288 +14.95000 152.0000 12.3288 +15.00000 137.0000 11.7047 +15.05000 146.0000 12.0830 +15.10000 149.0000 12.2066 +15.15000 147.0000 12.1244 +15.20000 154.0000 12.4097 +15.25000 153.0000 12.3693 +15.30000 153.0000 12.3693 +15.35000 157.0000 12.5300 +15.40000 156.0000 12.4900 +15.45000 157.0000 12.5300 +15.50000 153.0000 12.3693 +15.55000 160.0000 12.6491 +15.60000 176.0000 13.2665 +15.65000 173.0000 13.1529 +15.70000 184.0000 13.5647 +15.75000 192.0000 13.8564 +15.80000 205.0000 14.3178 +15.85000 222.0000 14.8997 +15.90000 242.0000 15.5563 +15.95000 285.0000 16.8819 +16.00000 313.0000 17.6918 +16.05000 368.0000 19.1833 +16.10000 428.0000 20.6882 +16.15000 508.0000 22.5389 +16.20000 568.0000 23.8328 +16.25000 615.0000 24.7992 +16.30000 640.0000 25.2982 +16.35000 644.0000 25.3772 +16.40000 616.0000 24.8193 +16.45000 565.0000 23.7697 +16.50000 481.0000 21.9317 +16.55000 397.0000 19.9249 +16.60000 320.0000 17.8885 +16.65000 268.0000 16.3707 +16.70000 222.0000 14.8997 +16.75000 189.0000 13.7477 +16.80000 166.0000 12.8841 +16.85000 165.0000 12.8452 +16.90000 163.0000 12.7671 +16.95000 158.0000 12.5698 +17.00000 152.0000 12.3288 +17.05000 146.0000 12.0830 +17.10000 153.0000 12.3693 +17.15000 155.0000 12.4499 +17.20000 154.0000 12.4097 +17.25000 146.0000 12.0830 +17.30000 146.0000 12.0830 +17.35000 154.0000 12.4097 +17.40000 153.0000 12.3693 +17.45000 148.0000 12.1655 +17.50000 152.0000 12.3288 +17.55000 156.0000 12.4900 +17.60000 168.0000 12.9615 +17.65000 171.0000 13.0767 +17.70000 170.0000 13.0384 +17.75000 186.0000 13.6382 +17.80000 206.0000 14.3527 +17.85000 215.0000 14.6629 +17.90000 251.0000 15.8430 +17.95000 286.0000 16.9115 +18.00000 324.0000 18.0000 +18.05000 340.0000 18.4391 +18.10000 382.0000 19.5448 +18.15000 382.0000 19.5448 +18.20000 385.0000 19.6214 +18.25000 366.0000 19.1311 +18.30000 344.0000 18.5472 +18.35000 319.0000 17.8606 +18.40000 275.0000 16.5831 +18.45000 234.0000 15.2971 +18.50000 216.0000 14.6969 +18.55000 199.0000 14.1067 +18.60000 188.0000 13.7113 +18.65000 171.0000 13.0767 +18.70000 163.0000 12.7671 +18.75000 157.0000 12.5300 +18.80000 154.0000 12.4097 +18.85000 157.0000 12.5300 +18.90000 152.0000 12.3288 +18.95000 143.0000 11.9583 +19.00000 150.0000 12.2474 +19.05000 153.0000 12.3693 +19.10000 141.0000 11.8743 +19.15000 150.0000 12.2474 +19.20000 143.0000 11.9583 +19.25000 144.0000 12.0000 +19.30000 144.0000 12.0000 +19.35000 148.0000 12.1655 +19.40000 135.0000 11.6190 +19.45000 145.0000 12.0416 +19.50000 142.0000 11.9164 +19.55000 141.0000 11.8743 +19.60000 146.0000 12.0830 +19.65000 146.0000 12.0830 +19.70000 140.0000 11.8322 +19.75000 146.0000 12.0830 +19.80000 146.0000 12.0830 +19.85000 156.0000 12.4900 +19.90000 153.0000 12.3693 +19.95000 139.0000 11.7898 +20.00000 135.0000 11.6190 +20.05000 141.0000 11.8743 +20.10000 146.0000 12.0830 +20.15000 142.0000 11.9164 +20.20000 144.0000 12.0000 +20.25000 151.0000 12.2882 +20.30000 151.0000 12.2882 +20.35000 150.0000 12.2474 +20.40000 139.0000 11.7898 +20.45000 150.0000 12.2474 +20.50000 164.0000 12.8062 +20.55000 168.0000 12.9615 +20.60000 175.0000 13.2288 +20.65000 180.0000 13.4164 +20.70000 198.0000 14.0712 +20.75000 222.0000 14.8997 +20.80000 250.0000 15.8114 +20.85000 280.0000 16.7332 +20.90000 303.0000 17.4069 +20.95000 333.0000 18.2483 +21.00000 344.0000 18.5472 +21.05000 339.0000 18.4120 +21.10000 330.0000 18.1659 +21.15000 323.0000 17.9722 +21.20000 306.0000 17.4929 +21.25000 266.0000 16.3095 +21.30000 259.0000 16.0935 +21.35000 257.0000 16.0312 +21.40000 237.0000 15.3948 +21.45000 234.0000 15.2971 +21.50000 226.0000 15.0333 +21.55000 201.0000 14.1774 +21.60000 197.0000 14.0357 +21.65000 180.0000 13.4164 +21.70000 169.0000 13.0000 +21.75000 166.0000 12.8841 +21.80000 151.0000 12.2882 +21.85000 150.0000 12.2474 +21.90000 150.0000 12.2474 +21.95000 142.0000 11.9164 +22.00000 147.0000 12.1244 +22.05000 141.0000 11.8743 +22.10000 139.0000 11.7898 +22.15000 149.0000 12.2066 +22.20000 138.0000 11.7473 +22.25000 142.0000 11.9164 +22.30000 141.0000 11.8743 +22.35000 143.0000 11.9583 +22.40000 146.0000 12.0830 +22.45000 148.0000 12.1655 +22.50000 149.0000 12.2066 +22.55000 144.0000 12.0000 +22.60000 145.0000 12.0416 +22.65000 139.0000 11.7898 +22.70000 149.0000 12.2066 +22.75000 146.0000 12.0830 +22.80000 141.0000 11.8743 +22.85000 146.0000 12.0830 +22.90000 137.0000 11.7047 +22.95000 141.0000 11.8743 +23.00000 147.0000 12.1244 +23.05000 141.0000 11.8743 +23.10000 140.0000 11.8322 +23.15000 145.0000 12.0416 +23.20000 149.0000 12.2066 +23.25000 140.0000 11.8322 +23.30000 135.0000 11.6190 +23.35000 142.0000 11.9164 +23.40000 140.0000 11.8322 +23.45000 135.0000 11.6190 +23.50000 147.0000 12.1244 +23.55000 145.0000 12.0416 +23.60000 139.0000 11.7898 +23.65000 143.0000 11.9583 +23.70000 147.0000 12.1244 +23.75000 145.0000 12.0416 +23.80000 154.0000 12.4097 +23.85000 154.0000 12.4097 +23.90000 151.0000 12.2882 +23.95000 160.0000 12.6491 +24.00000 175.0000 13.2288 +24.05000 190.0000 13.7840 +24.10000 207.0000 14.3875 +24.15000 242.0000 15.5563 +24.20000 293.0000 17.1172 +24.25000 354.0000 18.8149 +24.30000 417.0000 20.4206 +24.35000 525.0000 22.9129 +24.40000 621.0000 24.9199 +24.45000 718.0000 26.7955 +24.50000 800.0000 28.2843 +24.55000 813.0000 28.5132 +24.60000 767.0000 27.6948 +24.65000 699.0000 26.4386 +24.70000 584.0000 24.1661 +24.75000 465.0000 21.5639 +24.80000 356.0000 18.8680 +24.85000 286.0000 16.9115 +24.90000 232.0000 15.2315 +24.95000 216.0000 14.6969 +25.00000 196.0000 14.0000 +25.05000 192.0000 13.8564 +25.10000 198.0000 14.0712 +25.15000 187.0000 13.6748 +25.20000 199.0000 14.1067 +25.25000 193.0000 13.8924 +25.30000 176.0000 13.2665 +25.35000 176.0000 13.2665 +25.40000 163.0000 12.7671 +25.45000 155.0000 12.4499 +25.50000 154.0000 12.4097 +25.55000 160.0000 12.6491 +25.60000 146.0000 12.0830 +25.65000 149.0000 12.2066 +25.70000 151.0000 12.2882 +25.75000 146.0000 12.0830 +25.80000 148.0000 12.1655 +25.85000 150.0000 12.2474 +25.90000 139.0000 11.7898 +25.95000 152.0000 12.3288 +26.00000 148.0000 12.1655 +26.05000 146.0000 12.0830 +26.10000 142.0000 11.9164 +26.15000 153.0000 12.3693 +26.20000 156.0000 12.4900 +26.25000 155.0000 12.4499 +26.30000 160.0000 12.6491 +26.35000 167.0000 12.9228 +26.40000 175.0000 13.2288 +26.45000 187.0000 13.6748 +26.50000 203.0000 14.2478 +26.55000 206.0000 14.3527 +26.60000 214.0000 14.6287 +26.65000 224.0000 14.9666 +26.70000 210.0000 14.4914 +26.75000 211.0000 14.5258 +26.80000 204.0000 14.2829 +26.85000 200.0000 14.1421 +26.90000 195.0000 13.9642 +26.95000 219.0000 14.7986 +27.00000 240.0000 15.4919 +27.05000 261.0000 16.1555 +27.10000 316.0000 17.7764 +27.15000 385.0000 19.6214 +27.20000 456.0000 21.3542 +27.25000 529.0000 23.0000 +27.30000 570.0000 23.8747 +27.35000 569.0000 23.8537 +27.40000 556.0000 23.5797 +27.45000 506.0000 22.4944 +27.50000 453.0000 21.2838 +27.55000 416.0000 20.3961 +27.60000 390.0000 19.7484 +27.65000 408.0000 20.1990 +27.70000 447.0000 21.1424 +27.75000 529.0000 23.0000 +27.80000 612.0000 24.7386 +27.85000 719.0000 26.8142 +27.90000 777.0000 27.8747 +27.95000 793.0000 28.1603 +28.00000 747.0000 27.3313 +28.05000 655.0000 25.5930 +28.10000 546.0000 23.3666 +28.15000 439.0000 20.9523 +28.20000 353.0000 18.7883 +28.25000 289.0000 17.0000 +28.30000 244.0000 15.6205 +28.35000 223.0000 14.9332 +28.40000 215.0000 14.6629 +28.45000 219.0000 14.7986 +28.50000 205.0000 14.3178 +28.55000 200.0000 14.1421 +28.60000 191.0000 13.8203 +28.65000 172.0000 13.1149 +28.70000 173.0000 13.1529 +28.75000 165.0000 12.8452 +28.80000 152.0000 12.3288 +28.85000 151.0000 12.2882 +28.90000 147.0000 12.1244 +28.95000 150.0000 12.2474 +29.00000 156.0000 12.4900 +29.05000 145.0000 12.0416 +29.10000 149.0000 12.2066 +29.15000 149.0000 12.2066 +29.20000 146.0000 12.0830 +29.25000 146.0000 12.0830 +29.30000 141.0000 11.8743 +29.35000 145.0000 12.0416 +29.40000 149.0000 12.2066 +29.45000 146.0000 12.0830 +29.50000 151.0000 12.2882 +29.55000 149.0000 12.2066 +29.60000 153.0000 12.3693 +29.65000 149.0000 12.2066 +29.70000 144.0000 12.0000 +29.75000 156.0000 12.4900 +29.80000 150.0000 12.2474 +29.85000 152.0000 12.3288 +29.90000 157.0000 12.5300 +29.95000 154.0000 12.4097 +30.00000 145.0000 12.0416 +30.05000 158.0000 12.5698 +30.10000 162.0000 12.7279 +30.15000 158.0000 12.5698 +30.20000 168.0000 12.9615 +30.25000 176.0000 13.2665 +30.30000 193.0000 13.8924 +30.35000 212.0000 14.5602 +30.40000 234.0000 15.2971 +30.45000 275.0000 16.5831 +30.50000 331.0000 18.1934 +30.55000 389.0000 19.7231 +30.60000 478.0000 21.8632 +30.65000 544.0000 23.3238 +30.70000 608.0000 24.6577 +30.75000 650.0000 25.4951 +30.80000 692.0000 26.3059 +30.85000 719.0000 26.8142 +30.90000 793.0000 28.1603 +30.95000 921.0000 30.3480 +31.00000 1123.0000 33.5112 +31.05000 1432.0000 37.8418 +31.10000 1784.0000 42.2374 +31.15000 2178.0000 46.6690 +31.20000 2444.0000 49.4368 +31.25000 2521.0000 50.2096 +31.30000 2409.0000 49.0816 +31.35000 2143.0000 46.2925 +31.40000 1833.0000 42.8135 +31.45000 1537.0000 39.2046 +31.50000 1388.0000 37.2559 +31.55000 1417.0000 37.6431 +31.60000 1566.0000 39.5727 +31.65000 1826.0000 42.7317 +31.70000 2096.0000 45.7821 +31.75000 2267.0000 47.6130 +31.80000 2263.0000 47.5710 +31.85000 2046.0000 45.2327 +31.90000 1716.0000 41.4246 +31.95000 1329.0000 36.4555 +32.00000 964.0000 31.0483 +32.05000 687.0000 26.2107 +32.10000 510.0000 22.5832 +32.15000 394.0000 19.8494 +32.20000 352.0000 18.7617 +32.25000 345.0000 18.5742 +32.30000 367.0000 19.1572 +32.35000 363.0000 19.0526 +32.40000 355.0000 18.8414 +32.45000 353.0000 18.7883 +32.50000 327.0000 18.0831 +32.55000 303.0000 17.4069 +32.60000 269.0000 16.4012 +32.65000 239.0000 15.4596 +32.70000 224.0000 14.9666 +32.75000 214.0000 14.6287 +32.80000 205.0000 14.3178 +32.85000 206.0000 14.3527 +32.90000 218.0000 14.7648 +32.95000 217.0000 14.7309 +33.00000 224.0000 14.9666 +33.05000 235.0000 15.3297 +33.10000 222.0000 14.8997 +33.15000 217.0000 14.7309 +33.20000 205.0000 14.3178 +33.25000 192.0000 13.8564 +33.30000 180.0000 13.4164 +33.35000 174.0000 13.1909 +33.40000 164.0000 12.8062 +33.45000 155.0000 12.4499 +33.50000 151.0000 12.2882 +33.55000 153.0000 12.3693 +33.60000 154.0000 12.4097 +33.65000 150.0000 12.2474 +33.70000 147.0000 12.1244 +33.75000 154.0000 12.4097 +33.80000 155.0000 12.4499 +33.85000 164.0000 12.8062 +33.90000 166.0000 12.8841 +33.95000 167.0000 12.9228 +34.00000 186.0000 13.6382 +34.05000 200.0000 14.1421 +34.10000 223.0000 14.9332 +34.15000 248.0000 15.7480 +34.20000 271.0000 16.4621 +34.25000 281.0000 16.7631 +34.30000 273.0000 16.5227 +34.35000 267.0000 16.3401 +34.40000 242.0000 15.5563 +34.45000 226.0000 15.0333 +34.50000 196.0000 14.0000 +34.55000 172.0000 13.1149 +34.60000 156.0000 12.4900 +34.65000 150.0000 12.2474 +34.70000 157.0000 12.5300 +34.75000 144.0000 12.0000 +34.80000 142.0000 11.9164 +34.85000 149.0000 12.2066 +34.90000 149.0000 12.2066 +34.95000 147.0000 12.1244 +35.00000 141.0000 11.8743 +35.05000 140.0000 11.8322 +35.10000 140.0000 11.8322 +35.15000 143.0000 11.9583 +35.20000 140.0000 11.8322 +35.25000 143.0000 11.9583 +35.30000 138.0000 11.7473 +35.35000 136.0000 11.6619 +35.40000 137.0000 11.7047 +35.45000 139.0000 11.7898 +35.50000 139.0000 11.7898 +35.55000 137.0000 11.7047 +35.60000 146.0000 12.0830 +35.65000 139.0000 11.7898 +35.70000 135.0000 11.6190 +35.75000 139.0000 11.7898 +35.80000 134.0000 11.5758 +35.85000 139.0000 11.7898 +35.90000 142.0000 11.9164 +35.95000 139.0000 11.7898 +36.00000 142.0000 11.9164 +36.05000 135.0000 11.6190 +36.10000 140.0000 11.8322 +36.15000 141.0000 11.8743 +36.20000 140.0000 11.8322 +36.25000 145.0000 12.0416 +36.30000 143.0000 11.9583 +36.35000 138.0000 11.7473 +36.40000 143.0000 11.9583 +36.45000 142.0000 11.9164 +36.50000 144.0000 12.0000 +36.55000 147.0000 12.1244 +36.60000 148.0000 12.1655 +36.65000 158.0000 12.5698 +36.70000 168.0000 12.9615 +36.75000 173.0000 13.1529 +36.80000 178.0000 13.3417 +36.85000 174.0000 13.1909 +36.90000 172.0000 13.1149 +36.95000 168.0000 12.9615 +37.00000 168.0000 12.9615 +37.05000 163.0000 12.7671 +37.10000 153.0000 12.3693 +37.15000 154.0000 12.4097 +37.20000 153.0000 12.3693 +37.25000 149.0000 12.2066 +37.30000 149.0000 12.2066 +37.35000 152.0000 12.3288 +37.40000 159.0000 12.6095 +37.45000 165.0000 12.8452 +37.50000 172.0000 13.1149 +37.55000 187.0000 13.6748 +37.60000 209.0000 14.4568 +37.65000 237.0000 15.3948 +37.70000 279.0000 16.7033 +37.75000 343.0000 18.5203 +37.80000 406.0000 20.1494 +37.85000 463.0000 21.5174 +37.90000 537.0000 23.1733 +37.95000 579.0000 24.0624 +38.00000 568.0000 23.8328 +38.05000 525.0000 22.9129 +38.10000 465.0000 21.5639 +38.15000 391.0000 19.7737 +38.20000 332.0000 18.2209 +38.25000 310.0000 17.6068 +38.30000 303.0000 17.4069 +38.35000 326.0000 18.0555 +38.40000 324.0000 18.0000 +38.45000 318.0000 17.8326 +38.50000 297.0000 17.2337 +38.55000 262.0000 16.1864 +38.60000 232.0000 15.2315 +38.65000 202.0000 14.2127 +38.70000 185.0000 13.6015 +38.75000 164.0000 12.8062 +38.80000 162.0000 12.7279 +38.85000 160.0000 12.6491 +38.90000 159.0000 12.6095 +38.95000 157.0000 12.5300 +39.00000 166.0000 12.8841 +39.05000 174.0000 13.1909 +39.10000 171.0000 13.0767 +39.15000 184.0000 13.5647 +39.20000 181.0000 13.4536 +39.25000 187.0000 13.6748 +39.30000 192.0000 13.8564 +39.35000 192.0000 13.8564 +39.40000 199.0000 14.1067 +39.45000 218.0000 14.7648 +39.50000 249.0000 15.7797 +39.55000 283.0000 16.8226 +39.60000 339.0000 18.4120 +39.65000 372.0000 19.2873 +39.70000 379.0000 19.4679 +39.75000 372.0000 19.2873 +39.80000 338.0000 18.3848 +39.85000 287.0000 16.9411 +39.90000 239.0000 15.4596 +39.95000 203.0000 14.2478 +40.00000 185.0000 13.6015 +40.05000 164.0000 12.8062 +40.10000 170.0000 13.0384 +40.15000 171.0000 13.0767 +40.20000 172.0000 13.1149 +40.25000 184.0000 13.5647 +40.30000 196.0000 14.0000 +40.35000 224.0000 14.9666 +40.40000 264.0000 16.2481 +40.45000 295.0000 17.1756 +40.50000 329.0000 18.1384 +40.55000 351.0000 18.7350 +40.60000 344.0000 18.5472 +40.65000 323.0000 17.9722 +40.70000 285.0000 16.8819 +40.75000 247.0000 15.7162 +40.80000 227.0000 15.0665 +40.85000 198.0000 14.0712 +40.90000 187.0000 13.6748 +40.95000 187.0000 13.6748 +41.00000 174.0000 13.1909 +41.05000 174.0000 13.1909 +41.10000 161.0000 12.6886 +41.15000 149.0000 12.2066 +41.20000 150.0000 12.2474 +41.25000 152.0000 12.3288 +41.30000 150.0000 12.2474 +41.35000 145.0000 12.0416 +41.40000 144.0000 12.0000 +41.45000 146.0000 12.0830 +41.50000 141.0000 11.8743 +41.55000 145.0000 12.0416 +41.60000 140.0000 11.8322 +41.65000 137.0000 11.7047 +41.70000 134.0000 11.5758 +41.75000 138.0000 11.7473 +41.80000 140.0000 11.8322 +41.85000 142.0000 11.9164 +41.90000 141.0000 11.8743 +41.95000 139.0000 11.7898 +42.00000 140.0000 11.8322 +42.05000 139.0000 11.7898 +42.10000 138.0000 11.7473 +42.15000 136.0000 11.6619 +42.20000 135.0000 11.6190 +42.25000 134.0000 11.5758 +42.30000 139.0000 11.7898 +42.35000 140.0000 11.8322 +42.40000 145.0000 12.0416 +42.45000 144.0000 12.0000 +42.50000 146.0000 12.0830 +42.55000 141.0000 11.8743 +42.60000 139.0000 11.7898 +42.65000 140.0000 11.8322 +42.70000 141.0000 11.8743 +42.75000 142.0000 11.9164 +42.80000 145.0000 12.0416 +42.85000 145.0000 12.0416 +42.90000 138.0000 11.7473 +42.95000 139.0000 11.7898 +43.00000 135.0000 11.6190 +43.05000 143.0000 11.9583 +43.10000 141.0000 11.8743 +43.15000 135.0000 11.6190 +43.20000 136.0000 11.6619 +43.25000 138.0000 11.7473 +43.30000 137.0000 11.7047 +43.35000 137.0000 11.7047 +43.40000 135.0000 11.6190 +43.45000 143.0000 11.9583 +43.50000 138.0000 11.7473 +43.55000 139.0000 11.7898 +43.60000 145.0000 12.0416 +43.65000 147.0000 12.1244 +43.70000 146.0000 12.0830 +43.75000 149.0000 12.2066 +43.80000 153.0000 12.3693 +43.85000 157.0000 12.5300 +43.90000 165.0000 12.8452 +43.95000 168.0000 12.9615 +44.00000 162.0000 12.7279 +44.05000 165.0000 12.8452 +44.10000 165.0000 12.8452 +44.15000 155.0000 12.4499 +44.20000 161.0000 12.6886 +44.25000 163.0000 12.7671 +44.30000 160.0000 12.6491 +44.35000 161.0000 12.6886 +44.40000 167.0000 12.9228 +44.45000 180.0000 13.4164 +44.50000 200.0000 14.1421 +44.55000 220.0000 14.8324 +44.60000 260.0000 16.1245 +44.65000 305.0000 17.4642 +44.70000 351.0000 18.7350 +44.75000 405.0000 20.1246 +44.80000 449.0000 21.1896 +44.85000 514.0000 22.6716 +44.90000 612.0000 24.7386 +44.95000 756.0000 27.4955 +45.00000 986.0000 31.4006 +45.05000 1269.0000 35.6230 +45.10000 1548.0000 39.3446 +45.15000 1704.0000 41.2795 +45.20000 1696.0000 41.1825 +45.25000 1544.0000 39.2938 +45.30000 1252.0000 35.3836 +45.35000 934.0000 30.5614 +45.40000 668.0000 25.8457 +45.45000 476.0000 21.8174 +45.50000 360.0000 18.9737 +45.55000 285.0000 16.8819 +45.60000 240.0000 15.4919 +45.65000 216.0000 14.6969 +45.70000 198.0000 14.0712 +45.75000 187.0000 13.6748 +45.80000 172.0000 13.1149 +45.85000 168.0000 12.9615 +45.90000 161.0000 12.6886 +45.95000 163.0000 12.7671 +46.00000 160.0000 12.6491 +46.05000 153.0000 12.3693 +46.10000 155.0000 12.4499 +46.15000 155.0000 12.4499 +46.20000 153.0000 12.3693 +46.25000 153.0000 12.3693 +46.30000 154.0000 12.4097 +46.35000 149.0000 12.2066 +46.40000 155.0000 12.4499 +46.45000 155.0000 12.4499 +46.50000 160.0000 12.6491 +46.55000 169.0000 13.0000 +46.60000 175.0000 13.2288 +46.65000 193.0000 13.8924 +46.70000 217.0000 14.7309 +46.75000 250.0000 15.8114 +46.80000 288.0000 16.9706 +46.85000 305.0000 17.4642 +46.90000 304.0000 17.4356 +46.95000 288.0000 16.9706 +47.00000 262.0000 16.1864 +47.05000 226.0000 15.0333 +47.10000 197.0000 14.0357 +47.15000 177.0000 13.3041 +47.20000 161.0000 12.6886 +47.25000 157.0000 12.5300 +47.30000 156.0000 12.4900 +47.35000 157.0000 12.5300 +47.40000 153.0000 12.3693 +47.45000 160.0000 12.6491 +47.50000 160.0000 12.6491 +47.55000 169.0000 13.0000 +47.60000 181.0000 13.4536 +47.65000 195.0000 13.9642 +47.70000 224.0000 14.9666 +47.75000 259.0000 16.0935 +47.80000 294.0000 17.1464 +47.85000 323.0000 17.9722 +47.90000 362.0000 19.0263 +47.95000 377.0000 19.4165 +48.00000 364.0000 19.0788 +48.05000 331.0000 18.1934 +48.10000 293.0000 17.1172 +48.15000 256.0000 16.0000 +48.20000 222.0000 14.8997 +48.25000 212.0000 14.5602 +48.30000 211.0000 14.5258 +48.35000 232.0000 15.2315 +48.40000 262.0000 16.1864 +48.45000 333.0000 18.2483 +48.50000 448.0000 21.1660 +48.55000 600.0000 24.4949 +48.60000 788.0000 28.0713 +48.65000 975.0000 31.2250 +48.70000 1085.0000 32.9393 +48.75000 1073.0000 32.7567 +48.80000 971.0000 31.1609 +48.85000 775.0000 27.8388 +48.90000 570.0000 23.8747 +48.95000 406.0000 20.1494 +49.00000 304.0000 17.4356 +49.05000 252.0000 15.8745 +49.10000 214.0000 14.6287 +49.15000 196.0000 14.0000 +49.20000 198.0000 14.0712 +49.25000 204.0000 14.2829 +49.30000 220.0000 14.8324 +49.35000 232.0000 15.2315 +49.40000 244.0000 15.6205 +49.45000 256.0000 16.0000 +49.50000 249.0000 15.7797 +49.55000 241.0000 15.5242 +49.60000 219.0000 14.7986 +49.65000 213.0000 14.5945 +49.70000 215.0000 14.6629 +49.75000 223.0000 14.9332 +49.80000 233.0000 15.2643 +49.85000 230.0000 15.1658 +49.90000 228.0000 15.0997 +49.95000 217.0000 14.7309 +50.00000 206.0000 14.3527 +50.05000 199.0000 14.1067 +50.10000 200.0000 14.1421 +50.15000 201.0000 14.1774 +50.20000 219.0000 14.7986 +50.25000 236.0000 15.3623 +50.30000 260.0000 16.1245 +50.35000 290.0000 17.0294 +50.40000 327.0000 18.0831 +50.45000 349.0000 18.6815 +50.50000 342.0000 18.4932 +50.55000 325.0000 18.0278 +50.60000 294.0000 17.1464 +50.65000 253.0000 15.9060 +50.70000 214.0000 14.6287 +50.75000 186.0000 13.6382 +50.80000 175.0000 13.2288 +50.85000 171.0000 13.0767 +50.90000 173.0000 13.1529 +50.95000 182.0000 13.4907 +51.00000 206.0000 14.3527 +51.05000 230.0000 15.1658 +51.10000 257.0000 16.0312 +51.15000 285.0000 16.8819 +51.20000 300.0000 17.3205 +51.25000 297.0000 17.2337 +51.30000 290.0000 17.0294 +51.35000 276.0000 16.6132 +51.40000 280.0000 16.7332 +51.45000 301.0000 17.3494 +51.50000 366.0000 19.1311 +51.55000 472.0000 21.7256 +51.60000 610.0000 24.6982 +51.65000 712.0000 26.6833 +51.70000 783.0000 27.9821 +51.75000 764.0000 27.6405 +51.80000 664.0000 25.7682 +51.85000 526.0000 22.9347 +51.90000 394.0000 19.8494 +51.95000 297.0000 17.2337 +52.00000 239.0000 15.4596 +52.05000 203.0000 14.2478 +52.10000 188.0000 13.7113 +52.15000 173.0000 13.1529 +52.20000 173.0000 13.1529 +52.25000 166.0000 12.8841 +52.30000 165.0000 12.8452 +52.35000 164.0000 12.8062 +52.40000 164.0000 12.8062 +52.45000 156.0000 12.4900 +52.50000 162.0000 12.7279 +52.55000 164.0000 12.8062 +52.60000 167.0000 12.9228 +52.65000 180.0000 13.4164 +52.70000 196.0000 14.0000 +52.75000 225.0000 15.0000 +52.80000 255.0000 15.9687 +52.85000 294.0000 17.1464 +52.90000 321.0000 17.9165 +52.95000 314.0000 17.7200 +53.00000 292.0000 17.0880 +53.05000 260.0000 16.1245 +53.10000 228.0000 15.0997 +53.15000 201.0000 14.1774 +53.20000 187.0000 13.6748 +53.25000 179.0000 13.3791 +53.30000 177.0000 13.3041 +53.35000 186.0000 13.6382 +53.40000 186.0000 13.6382 +53.45000 198.0000 14.0712 +53.50000 216.0000 14.6969 +53.55000 239.0000 15.4596 +53.60000 276.0000 16.6132 +53.65000 345.0000 18.5742 +53.70000 450.0000 21.2132 +53.75000 622.0000 24.9399 +53.80000 880.0000 29.6648 +53.85000 1192.0000 34.5254 +53.90000 1461.0000 38.2230 +53.95000 1567.0000 39.5854 +54.00000 1503.0000 38.7685 +54.05000 1304.0000 36.1109 +54.10000 1008.0000 31.7490 +54.15000 742.0000 27.2397 +54.20000 573.0000 23.9374 +54.25000 473.0000 21.7486 +54.30000 438.0000 20.9284 +54.35000 415.0000 20.3715 +54.40000 408.0000 20.1990 +54.45000 377.0000 19.4165 +54.50000 349.0000 18.6815 +54.55000 307.0000 17.5214 +54.60000 271.0000 16.4621 +54.65000 257.0000 16.0312 +54.70000 247.0000 15.7162 +54.75000 228.0000 15.0997 +54.80000 236.0000 15.3623 +54.85000 237.0000 15.3948 +54.90000 245.0000 15.6525 +54.95000 268.0000 16.3707 +55.00000 310.0000 17.6068 +55.05000 364.0000 19.0788 +55.10000 461.0000 21.4709 +55.15000 605.0000 24.5967 +55.20000 755.0000 27.4773 +55.25000 833.0000 28.8617 +55.30000 853.0000 29.2062 +55.35000 769.0000 27.7308 +55.40000 634.0000 25.1794 +55.45000 488.0000 22.0907 +55.50000 379.0000 19.4679 +55.55000 306.0000 17.4929 +55.60000 267.0000 16.3401 +55.65000 245.0000 15.6525 +55.70000 246.0000 15.6844 +55.75000 247.0000 15.7162 +55.80000 261.0000 16.1555 +55.85000 281.0000 16.7631 +55.90000 321.0000 17.9165 +55.95000 392.0000 19.7990 +56.00000 497.0000 22.2935 +56.05000 690.0000 26.2679 +56.10000 995.0000 31.5436 +56.15000 1420.0000 37.6829 +56.20000 1870.0000 43.2435 +56.25000 2199.0000 46.8935 +56.30000 2331.0000 48.2804 +56.35000 2212.0000 47.0319 +56.40000 1957.0000 44.2380 +56.45000 1687.0000 41.0731 +56.50000 1546.0000 39.3192 +56.55000 1512.0000 38.8844 +56.60000 1474.0000 38.3927 +56.65000 1394.0000 37.3363 +56.70000 1194.0000 34.5543 +56.75000 958.0000 30.9516 +56.80000 749.0000 27.3679 +56.85000 552.0000 23.4947 +56.90000 444.0000 21.0713 +56.95000 359.0000 18.9473 +57.00000 301.0000 17.3494 +57.05000 267.0000 16.3401 +57.10000 236.0000 15.3623 +57.15000 214.0000 14.6287 +57.20000 207.0000 14.3875 +57.25000 194.0000 13.9284 +57.30000 193.0000 13.8924 +57.35000 187.0000 13.6748 +57.40000 184.0000 13.5647 +57.45000 185.0000 13.6015 +57.50000 191.0000 13.8203 +57.55000 198.0000 14.0712 +57.60000 206.0000 14.3527 +57.65000 224.0000 14.9666 +57.70000 257.0000 16.0312 +57.75000 264.0000 16.2481 +57.80000 275.0000 16.5831 +57.85000 268.0000 16.3707 +57.90000 251.0000 15.8430 +57.95000 224.0000 14.9666 +58.00000 202.0000 14.2127 +58.05000 193.0000 13.8924 +58.10000 178.0000 13.3417 +58.15000 181.0000 13.4536 +58.20000 179.0000 13.3791 +58.25000 185.0000 13.6015 +58.30000 192.0000 13.8564 +58.35000 201.0000 14.1774 +58.40000 220.0000 14.8324 +58.45000 248.0000 15.7480 +58.50000 278.0000 16.6733 +58.55000 325.0000 18.0278 +58.60000 391.0000 19.7737 +58.65000 440.0000 20.9762 +58.70000 471.0000 21.7025 +58.75000 447.0000 21.1424 +58.80000 396.0000 19.8997 +58.85000 337.0000 18.3576 +58.90000 278.0000 16.6733 +58.95000 251.0000 15.8430 +59.00000 232.0000 15.2315 +59.05000 230.0000 15.1658 +59.10000 251.0000 15.8430 +59.15000 294.0000 17.1464 +59.20000 347.0000 18.6279 +59.25000 413.0000 20.3224 +59.30000 472.0000 21.7256 +59.35000 496.0000 22.2711 +59.40000 492.0000 22.1811 +59.45000 438.0000 20.9284 +59.50000 381.0000 19.5192 +59.55000 351.0000 18.7350 +59.60000 357.0000 18.8944 +59.65000 406.0000 20.1494 +59.70000 476.0000 21.8174 +59.75000 546.0000 23.3666 +59.80000 572.0000 23.9165 +59.85000 548.0000 23.4094 +59.90000 469.0000 21.6564 +59.95000 374.0000 19.3391 +60.00000 297.0000 17.2337 +60.05000 241.0000 15.5242 +60.10000 214.0000 14.6287 +60.15000 206.0000 14.3527 +60.20000 195.0000 13.9642 +60.25000 197.0000 14.0357 +60.30000 200.0000 14.1421 +60.35000 202.0000 14.2127 +60.40000 219.0000 14.7986 +60.45000 240.0000 15.4919 +60.50000 276.0000 16.6132 +60.55000 338.0000 18.3848 +60.60000 422.0000 20.5426 +60.65000 528.0000 22.9783 +60.70000 621.0000 24.9199 +60.75000 673.0000 25.9422 +60.80000 648.0000 25.4558 +60.85000 580.0000 24.0832 +60.90000 500.0000 22.3607 +60.95000 427.0000 20.6640 +61.00000 387.0000 19.6723 +61.05000 374.0000 19.3391 +61.10000 354.0000 18.8149 +61.15000 325.0000 18.0278 +61.20000 299.0000 17.2916 +61.25000 278.0000 16.6733 +61.30000 270.0000 16.4317 +61.35000 259.0000 16.0935 +61.40000 267.0000 16.3401 +61.45000 271.0000 16.4621 +61.50000 267.0000 16.3401 +61.55000 265.0000 16.2788 +61.60000 274.0000 16.5529 +61.65000 300.0000 17.3205 +61.70000 349.0000 18.6815 +61.75000 433.0000 20.8087 +61.80000 599.0000 24.4745 +61.85000 823.0000 28.6880 +61.90000 1079.0000 32.8481 +61.95000 1265.0000 35.5668 +62.00000 1312.0000 36.2215 +62.05000 1217.0000 34.8855 +62.10000 983.0000 31.3528 +62.15000 721.0000 26.8514 +62.20000 521.0000 22.8254 +62.25000 401.0000 20.0250 +62.30000 351.0000 18.7350 +62.35000 348.0000 18.6548 +62.40000 393.0000 19.8242 +62.45000 476.0000 21.8174 +62.50000 598.0000 24.4540 +62.55000 725.0000 26.9258 +62.60000 798.0000 28.2489 +62.65000 811.0000 28.4781 +62.70000 727.0000 26.9629 +62.75000 606.0000 24.6171 +62.80000 505.0000 22.4722 +62.85000 444.0000 21.0713 +62.90000 404.0000 20.0998 +62.95000 375.0000 19.3649 +63.00000 346.0000 18.6011 +63.05000 290.0000 17.0294 +63.10000 244.0000 15.6205 +63.15000 214.0000 14.6287 +63.20000 195.0000 13.9642 +63.25000 183.0000 13.5277 +63.30000 180.0000 13.4164 +63.35000 174.0000 13.1909 +63.40000 170.0000 13.0384 +63.45000 175.0000 13.2288 +63.50000 170.0000 13.0384 +63.55000 164.0000 12.8062 +63.60000 169.0000 13.0000 +63.65000 177.0000 13.3041 +63.70000 179.0000 13.3791 +63.75000 199.0000 14.1067 +63.80000 232.0000 15.2315 +63.85000 276.0000 16.6132 +63.90000 325.0000 18.0278 +63.95000 367.0000 19.1572 +64.00000 396.0000 19.8997 +64.05000 397.0000 19.9249 +64.10000 364.0000 19.0788 +64.15000 325.0000 18.0278 +64.20000 278.0000 16.6733 +64.25000 242.0000 15.5563 +64.30000 205.0000 14.3178 +64.35000 191.0000 13.8203 +64.40000 181.0000 13.4536 +64.45000 178.0000 13.3417 +64.50000 174.0000 13.1909 +64.55000 176.0000 13.2665 +64.60000 175.0000 13.2288 +64.65000 180.0000 13.4164 +64.70000 182.0000 13.4907 +64.75000 186.0000 13.6382 +64.80000 191.0000 13.8203 +64.85000 192.0000 13.8564 +64.90000 199.0000 14.1067 +64.95000 203.0000 14.2478 +65.00000 225.0000 15.0000 +65.05000 255.0000 15.9687 +65.10000 281.0000 16.7631 +65.15000 313.0000 17.6918 +65.20000 309.0000 17.5784 +65.25000 293.0000 17.1172 +65.30000 258.0000 16.0624 +65.35000 222.0000 14.8997 +65.40000 191.0000 13.8203 +65.45000 180.0000 13.4164 +65.50000 170.0000 13.0384 +65.55000 172.0000 13.1149 +65.60000 161.0000 12.6886 +65.65000 161.0000 12.6886 +65.70000 162.0000 12.7279 +65.75000 164.0000 12.8062 +65.80000 169.0000 13.0000 +65.85000 173.0000 13.1529 +65.90000 183.0000 13.5277 +65.95000 197.0000 14.0357 +66.00000 222.0000 14.8997 +66.05000 269.0000 16.4012 +66.10000 333.0000 18.2483 +66.15000 404.0000 20.0998 +66.20000 471.0000 21.7025 +66.25000 532.0000 23.0651 +66.30000 566.0000 23.7908 +66.35000 565.0000 23.7697 +66.40000 530.0000 23.0217 +66.45000 467.0000 21.6102 +66.50000 389.0000 19.7231 +66.55000 315.0000 17.7482 +66.60000 251.0000 15.8430 +66.65000 211.0000 14.5258 +66.70000 193.0000 13.8924 +66.75000 183.0000 13.5277 +66.80000 180.0000 13.4164 +66.85000 180.0000 13.4164 +66.90000 191.0000 13.8203 +66.95000 207.0000 14.3875 +67.00000 239.0000 15.4596 +67.05000 275.0000 16.5831 +67.10000 299.0000 17.2916 +67.15000 292.0000 17.0880 +67.20000 271.0000 16.4621 +67.25000 249.0000 15.7797 +67.30000 212.0000 14.5602 +67.35000 190.0000 13.7840 +67.40000 171.0000 13.0767 +67.45000 163.0000 12.7671 +67.50000 160.0000 12.6491 +67.55000 161.0000 12.6886 +67.60000 165.0000 12.8452 +67.65000 163.0000 12.7671 +67.70000 173.0000 13.1529 +67.75000 183.0000 13.5277 +67.80000 188.0000 13.7113 +67.85000 193.0000 13.8924 +67.90000 199.0000 14.1067 +67.95000 191.0000 13.8203 +68.00000 185.0000 13.6015 +68.05000 177.0000 13.3041 +68.10000 170.0000 13.0384 +68.15000 176.0000 13.2665 +68.20000 183.0000 13.5277 +68.25000 183.0000 13.5277 +68.30000 191.0000 13.8203 +68.35000 187.0000 13.6748 +68.40000 179.0000 13.3791 +68.45000 173.0000 13.1529 +68.50000 170.0000 13.0384 +68.55000 172.0000 13.1149 +68.60000 174.0000 13.1909 +68.65000 190.0000 13.7840 +68.70000 208.0000 14.4222 +68.75000 243.0000 15.5885 +68.80000 284.0000 16.8523 +68.85000 319.0000 17.8606 +68.90000 340.0000 18.4391 +68.95000 336.0000 18.3303 +69.00000 298.0000 17.2627 +69.05000 257.0000 16.0312 +69.10000 230.0000 15.1658 +69.15000 218.0000 14.7648 +69.20000 228.0000 15.0997 +69.25000 253.0000 15.9060 +69.30000 279.0000 16.7033 +69.35000 314.0000 17.7200 +69.40000 353.0000 18.7883 +69.45000 371.0000 19.2614 +69.50000 371.0000 19.2614 +69.55000 341.0000 18.4662 +69.60000 293.0000 17.1172 +69.65000 243.0000 15.5885 +69.70000 207.0000 14.3875 +69.75000 184.0000 13.5647 +69.80000 175.0000 13.2288 +69.85000 167.0000 12.9228 +69.90000 169.0000 13.0000 +69.95000 180.0000 13.4164 +70.00000 190.0000 13.7840 +70.05000 217.0000 14.7309 +70.10000 237.0000 15.3948 +70.15000 250.0000 15.8114 +70.20000 249.0000 15.7797 +70.25000 237.0000 15.3948 +70.30000 216.0000 14.6969 +70.35000 192.0000 13.8564 +70.40000 174.0000 13.1909 +70.45000 165.0000 12.8452 +70.50000 155.0000 12.4499 +70.55000 151.0000 12.2882 +70.60000 154.0000 12.4097 +70.65000 152.0000 12.3288 +70.70000 151.0000 12.2882 +70.75000 156.0000 12.4900 +70.80000 157.0000 12.5300 +70.85000 166.0000 12.8841 +70.90000 168.0000 12.9615 +70.95000 172.0000 13.1149 +71.00000 171.0000 13.0767 +71.05000 174.0000 13.1909 +71.10000 191.0000 13.8203 +71.15000 204.0000 14.2829 +71.20000 232.0000 15.2315 +71.25000 278.0000 16.6733 +71.30000 311.0000 17.6352 +71.35000 328.0000 18.1108 +71.40000 328.0000 18.1108 +71.45000 307.0000 17.5214 +71.50000 273.0000 16.5227 +71.55000 243.0000 15.5885 +71.60000 221.0000 14.8661 +71.65000 207.0000 14.3875 +71.70000 200.0000 14.1421 +71.75000 190.0000 13.7840 +71.80000 186.0000 13.6382 +71.85000 184.0000 13.5647 +71.90000 184.0000 13.5647 +71.95000 197.0000 14.0357 +72.00000 210.0000 14.4914 +72.05000 239.0000 15.4596 +72.10000 280.0000 16.7332 +72.15000 353.0000 18.7883 +72.20000 432.0000 20.7846 +72.25000 499.0000 22.3383 +72.30000 564.0000 23.7487 +72.35000 563.0000 23.7276 +72.40000 512.0000 22.6274 +72.45000 433.0000 20.8087 +72.50000 349.0000 18.6815 +72.55000 274.0000 16.5529 +72.60000 227.0000 15.0665 +72.65000 203.0000 14.2478 +72.70000 190.0000 13.7840 +72.75000 186.0000 13.6382 +72.80000 185.0000 13.6015 +72.85000 183.0000 13.5277 +72.90000 186.0000 13.6382 +72.95000 203.0000 14.2478 +73.00000 236.0000 15.3623 +73.05000 274.0000 16.5529 +73.10000 335.0000 18.3030 +73.15000 395.0000 19.8746 +73.20000 411.0000 20.2731 +73.25000 405.0000 20.1246 +73.30000 376.0000 19.3907 +73.35000 333.0000 18.2483 +73.40000 313.0000 17.6918 +73.45000 310.0000 17.6068 +73.50000 306.0000 17.4929 +73.55000 281.0000 16.7631 +73.60000 262.0000 16.1864 +73.65000 237.0000 15.3948 +73.70000 207.0000 14.3875 +73.75000 188.0000 13.7113 +73.80000 180.0000 13.4164 +73.85000 176.0000 13.2665 +73.90000 178.0000 13.3417 +73.95000 181.0000 13.4536 +74.00000 185.0000 13.6015 +74.05000 201.0000 14.1774 +74.10000 220.0000 14.8324 +74.15000 269.0000 16.4012 +74.20000 327.0000 18.0831 +74.25000 403.0000 20.0749 +74.30000 465.0000 21.5639 +74.35000 483.0000 21.9773 +74.40000 459.0000 21.4243 +74.45000 397.0000 19.9249 +74.50000 321.0000 17.9165 +74.55000 258.0000 16.0624 +74.60000 224.0000 14.9666 +74.65000 208.0000 14.4222 +74.70000 202.0000 14.2127 +74.75000 210.0000 14.4914 +74.80000 221.0000 14.8661 +74.85000 247.0000 15.7162 +74.90000 264.0000 16.2481 +74.95000 280.0000 16.7332 +75.00000 303.0000 17.4069 +75.05000 333.0000 18.2483 +75.10000 371.0000 19.2614 +75.15000 400.0000 20.0000 +75.20000 415.0000 20.3715 +75.25000 395.0000 19.8746 +75.30000 351.0000 18.7350 +75.35000 289.0000 17.0000 +75.40000 237.0000 15.3948 +75.45000 206.0000 14.3527 +75.50000 186.0000 13.6382 +75.55000 174.0000 13.1909 +75.60000 168.0000 12.9615 +75.65000 166.0000 12.8841 +75.70000 159.0000 12.6095 +75.75000 151.0000 12.2882 +75.80000 153.0000 12.3693 +75.85000 153.0000 12.3693 +75.90000 151.0000 12.2882 +75.95000 156.0000 12.4900 +76.00000 155.0000 12.4499 +76.05000 153.0000 12.3693 +76.10000 156.0000 12.4900 +76.15000 153.0000 12.3693 +76.20000 154.0000 12.4097 +76.25000 159.0000 12.6095 +76.30000 161.0000 12.6886 +76.35000 161.0000 12.6886 +76.40000 162.0000 12.7279 +76.45000 154.0000 12.4097 +76.50000 152.0000 12.3288 +76.55000 155.0000 12.4499 +76.60000 147.0000 12.1244 +76.65000 149.0000 12.2066 +76.70000 144.0000 12.0000 +76.75000 142.0000 11.9164 +76.80000 143.0000 11.9583 +76.85000 145.0000 12.0416 +76.90000 144.0000 12.0000 +76.95000 142.0000 11.9164 +77.00000 140.0000 11.8322 +77.05000 146.0000 12.0830 +77.10000 141.0000 11.8743 +77.15000 139.0000 11.7898 +77.20000 143.0000 11.9583 +77.25000 139.0000 11.7898 +77.30000 143.0000 11.9583 +77.35000 143.0000 11.9583 +77.40000 143.0000 11.9583 +77.45000 144.0000 12.0000 +77.50000 141.0000 11.8743 +77.55000 140.0000 11.8322 +77.60000 137.0000 11.7047 +77.65000 140.0000 11.8322 +77.70000 144.0000 12.0000 +77.75000 145.0000 12.0416 +77.80000 142.0000 11.9164 +77.85000 141.0000 11.8743 +77.90000 147.0000 12.1244 +77.95000 144.0000 12.0000 +78.00000 149.0000 12.2066 +78.05000 159.0000 12.6095 +78.10000 156.0000 12.4900 +78.15000 171.0000 13.0767 +78.20000 178.0000 13.3417 +78.25000 187.0000 13.6748 +78.30000 198.0000 14.0712 +78.35000 211.0000 14.5258 +78.40000 215.0000 14.6629 +78.45000 206.0000 14.3527 +78.50000 196.0000 14.0000 +78.55000 184.0000 13.5647 +78.60000 170.0000 13.0384 +78.65000 158.0000 12.5698 +78.70000 153.0000 12.3693 +78.75000 153.0000 12.3693 +78.80000 156.0000 12.4900 +78.85000 156.0000 12.4900 +78.90000 156.0000 12.4900 +78.95000 160.0000 12.6491 +79.00000 171.0000 13.0767 +79.05000 176.0000 13.2665 +79.10000 179.0000 13.3791 +79.15000 184.0000 13.5647 +79.20000 186.0000 13.6382 +79.25000 189.0000 13.7477 +79.30000 195.0000 13.9642 +79.35000 199.0000 14.1067 +79.40000 203.0000 14.2478 +79.45000 206.0000 14.3527 +79.50000 216.0000 14.6969 +79.55000 220.0000 14.8324 +79.60000 229.0000 15.1327 +79.65000 235.0000 15.3297 +79.70000 253.0000 15.9060 +79.75000 269.0000 16.4012 +79.80000 284.0000 16.8523 +79.85000 295.0000 17.1756 +79.90000 320.0000 17.8885 +79.95000 364.0000 19.0788 +80.00000 451.0000 21.2368 +80.05000 588.0000 24.2487 +80.10000 775.0000 27.8388 +80.15000 965.0000 31.0644 +80.20000 1079.0000 32.8481 +80.25000 1059.0000 32.5423 +80.30000 928.0000 30.4631 +80.35000 741.0000 27.2213 +80.40000 568.0000 23.8328 +80.45000 440.0000 20.9762 +80.50000 382.0000 19.5448 +80.55000 363.0000 19.0526 +80.60000 370.0000 19.2354 +80.65000 404.0000 20.0998 +80.70000 467.0000 21.6102 +80.75000 518.0000 22.7596 +80.80000 529.0000 23.0000 +80.85000 487.0000 22.0681 +80.90000 429.0000 20.7123 +80.95000 375.0000 19.3649 +81.00000 336.0000 18.3303 +81.05000 333.0000 18.2483 +81.10000 339.0000 18.4120 +81.15000 361.0000 19.0000 +81.20000 364.0000 19.0788 +81.25000 351.0000 18.7350 +81.30000 314.0000 17.7200 +81.35000 285.0000 16.8819 +81.40000 254.0000 15.9374 +81.45000 240.0000 15.4919 +81.50000 227.0000 15.0665 +81.55000 215.0000 14.6629 +81.60000 208.0000 14.4222 +81.65000 213.0000 14.5945 +81.70000 208.0000 14.4222 +81.75000 205.0000 14.3178 +81.80000 216.0000 14.6969 +81.85000 218.0000 14.7648 +81.90000 226.0000 15.0333 +81.95000 244.0000 15.6205 +82.00000 254.0000 15.9374 +82.05000 273.0000 16.5227 +82.10000 280.0000 16.7332 +82.15000 308.0000 17.5499 +82.20000 344.0000 18.5472 +82.25000 368.0000 19.1833 +82.30000 379.0000 19.4679 +82.35000 373.0000 19.3132 +82.40000 331.0000 18.1934 +82.45000 281.0000 16.7631 +82.50000 240.0000 15.4919 +82.55000 207.0000 14.3875 +82.60000 198.0000 14.0712 +82.65000 190.0000 13.7840 +82.70000 180.0000 13.4164 +82.75000 173.0000 13.1529 +82.80000 170.0000 13.0384 +82.85000 165.0000 12.8452 +82.90000 161.0000 12.6886 +82.95000 158.0000 12.5698 +83.00000 160.0000 12.6491 +83.05000 160.0000 12.6491 +83.10000 157.0000 12.5300 +83.15000 157.0000 12.5300 +83.20000 165.0000 12.8452 +83.25000 161.0000 12.6886 +83.30000 166.0000 12.8841 +83.35000 173.0000 13.1529 +83.40000 183.0000 13.5277 +83.45000 196.0000 14.0000 +83.50000 223.0000 14.9332 +83.55000 252.0000 15.8745 +83.60000 283.0000 16.8226 +83.65000 309.0000 17.5784 +83.70000 338.0000 18.3848 +83.75000 359.0000 18.9473 +83.80000 379.0000 19.4679 +83.85000 420.0000 20.4939 +83.90000 478.0000 21.8632 +83.95000 519.0000 22.7816 +84.00000 539.0000 23.2164 +84.05000 525.0000 22.9129 +84.10000 481.0000 21.9317 +84.15000 425.0000 20.6155 +84.20000 371.0000 19.2614 +84.25000 344.0000 18.5472 +84.30000 323.0000 17.9722 +84.35000 352.0000 18.7617 +84.40000 412.0000 20.2978 +84.45000 503.0000 22.4277 +84.50000 602.0000 24.5357 +84.55000 697.0000 26.4008 +84.60000 750.0000 27.3861 +84.65000 742.0000 27.2397 +84.70000 732.0000 27.0555 +84.75000 722.0000 26.8701 +84.80000 737.0000 27.1477 +84.85000 749.0000 27.3679 +84.90000 740.0000 27.2029 +84.95000 681.0000 26.0960 +85.00000 567.0000 23.8118 +85.05000 450.0000 21.2132 +85.10000 347.0000 18.6279 +85.15000 283.0000 16.8226 +85.20000 248.0000 15.7480 +85.25000 228.0000 15.0997 +85.30000 221.0000 14.8661 +85.35000 210.0000 14.4914 +85.40000 206.0000 14.3527 +85.45000 218.0000 14.7648 +85.50000 215.0000 14.6629 +85.55000 208.0000 14.4222 +85.60000 208.0000 14.4222 +85.65000 199.0000 14.1067 +85.70000 188.0000 13.7113 +85.75000 185.0000 13.6015 +85.80000 191.0000 13.8203 +85.85000 191.0000 13.8203 +85.90000 200.0000 14.1421 +85.95000 208.0000 14.4222 +86.00000 206.0000 14.3527 +86.05000 209.0000 14.4568 +86.10000 206.0000 14.3527 +86.15000 208.0000 14.4222 +86.20000 203.0000 14.2478 +86.25000 205.0000 14.3178 +86.30000 206.0000 14.3527 +86.35000 210.0000 14.4914 +86.40000 212.0000 14.5602 +86.45000 210.0000 14.4914 +86.50000 204.0000 14.2829 +86.55000 206.0000 14.3527 +86.60000 214.0000 14.6287 +86.65000 228.0000 15.0997 +86.70000 236.0000 15.3623 +86.75000 245.0000 15.6525 +86.80000 259.0000 16.0935 +86.85000 272.0000 16.4924 +86.90000 294.0000 17.1464 +86.95000 319.0000 17.8606 +87.00000 350.0000 18.7083 +87.05000 368.0000 19.1833 +87.10000 385.0000 19.6214 +87.15000 379.0000 19.4679 +87.20000 347.0000 18.6279 +87.25000 305.0000 17.4642 +87.30000 265.0000 16.2788 +87.35000 246.0000 15.6844 +87.40000 246.0000 15.6844 +87.45000 253.0000 15.9060 +87.50000 290.0000 17.0294 +87.55000 351.0000 18.7350 +87.60000 444.0000 21.0713 +87.65000 552.0000 23.4947 +87.70000 654.0000 25.5734 +87.75000 713.0000 26.7021 +87.80000 717.0000 26.7769 +87.85000 633.0000 25.1595 +87.90000 522.0000 22.8473 +87.95000 422.0000 20.5426 +88.00000 338.0000 18.3848 +88.05000 282.0000 16.7929 +88.10000 247.0000 15.7162 +88.15000 239.0000 15.4596 +88.20000 243.0000 15.5885 +88.25000 257.0000 16.0312 +88.30000 285.0000 16.8819 +88.35000 321.0000 17.9165 +88.40000 347.0000 18.6279 +88.45000 362.0000 19.0263 +88.50000 361.0000 19.0000 +88.55000 338.0000 18.3848 +88.60000 307.0000 17.5214 +88.65000 297.0000 17.2337 +88.70000 295.0000 17.1756 +88.75000 299.0000 17.2916 +88.80000 315.0000 17.7482 +88.85000 309.0000 17.5784 +88.90000 308.0000 17.5499 +88.95000 285.0000 16.8819 +89.00000 252.0000 15.8745 +89.05000 235.0000 15.3297 +89.10000 230.0000 15.1658 +89.15000 215.0000 14.6629 +89.20000 216.0000 14.6969 +89.25000 220.0000 14.8324 +89.30000 215.0000 14.6629 +89.35000 219.0000 14.7986 +89.40000 213.0000 14.5945 +89.45000 213.0000 14.5945 +89.50000 213.0000 14.5945 +89.55000 210.0000 14.4914 +89.60000 211.0000 14.5258 +89.65000 223.0000 14.9332 +89.70000 228.0000 15.0997 +89.75000 241.0000 15.5242 +89.80000 240.0000 15.4919 +89.85000 230.0000 15.1658 +89.90000 225.0000 15.0000 +89.95000 215.0000 14.6629 +90.00000 207.0000 14.3875 +90.05000 207.0000 14.3875 +90.10000 215.0000 14.6629 +90.15000 221.0000 14.8661 +90.20000 243.0000 15.5885 +90.25000 259.0000 16.0935 +90.30000 287.0000 16.9411 +90.35000 295.0000 17.1756 +90.40000 288.0000 16.9706 +90.45000 285.0000 16.8819 +90.50000 284.0000 16.8523 +90.55000 277.0000 16.6433 +90.60000 274.0000 16.5529 +90.65000 284.0000 16.8523 +90.70000 294.0000 17.1464 +90.75000 310.0000 17.6068 +90.80000 324.0000 18.0000 +90.85000 348.0000 18.6548 +90.90000 360.0000 18.9737 +90.95000 348.0000 18.6548 +91.00000 328.0000 18.1108 +91.05000 300.0000 17.3205 +91.10000 265.0000 16.2788 +91.15000 243.0000 15.5885 +91.20000 236.0000 15.3623 +91.25000 234.0000 15.2971 +91.30000 242.0000 15.5563 +91.35000 262.0000 16.1864 +91.40000 301.0000 17.3494 +91.45000 366.0000 19.1311 +91.50000 454.0000 21.3073 +91.55000 575.0000 23.9792 +91.60000 722.0000 26.8701 +91.65000 846.0000 29.0861 +91.70000 914.0000 30.2324 +91.75000 903.0000 30.0500 +91.80000 805.0000 28.3725 +91.85000 687.0000 26.2107 +91.90000 543.0000 23.3024 +91.95000 443.0000 21.0476 +92.00000 377.0000 19.4165 +92.05000 349.0000 18.6815 +92.10000 358.0000 18.9209 +92.15000 387.0000 19.6723 +92.20000 430.0000 20.7364 +92.25000 471.0000 21.7025 +92.30000 505.0000 22.4722 +92.35000 562.0000 23.7065 +92.40000 623.0000 24.9600 +92.45000 681.0000 26.0960 +92.50000 732.0000 27.0555 +92.55000 773.0000 27.8029 +92.60000 776.0000 27.8568 +92.65000 757.0000 27.5136 +92.70000 735.0000 27.1109 +92.75000 727.0000 26.9629 +92.80000 686.0000 26.1916 +92.85000 665.0000 25.7876 +92.90000 639.0000 25.2784 +92.95000 613.0000 24.7588 +93.00000 608.0000 24.6577 +93.05000 624.0000 24.9800 +93.10000 669.0000 25.8650 +93.15000 703.0000 26.5141 +93.20000 697.0000 26.4008 +93.25000 668.0000 25.8457 +93.30000 599.0000 24.4745 +93.35000 529.0000 23.0000 +93.40000 465.0000 21.5639 +93.45000 416.0000 20.3961 +93.50000 378.0000 19.4422 +93.55000 339.0000 18.4120 +93.60000 307.0000 17.5214 +93.65000 275.0000 16.5831 +93.70000 244.0000 15.6205 +93.75000 227.0000 15.0665 +93.80000 216.0000 14.6969 +93.85000 212.0000 14.5602 +93.90000 216.0000 14.6969 +93.95000 217.0000 14.7309 +94.00000 219.0000 14.7986 +94.05000 235.0000 15.3297 +94.10000 242.0000 15.5563 +94.15000 237.0000 15.3948 +94.20000 235.0000 15.3297 +94.25000 237.0000 15.3948 +94.30000 224.0000 14.9666 +94.35000 218.0000 14.7648 +94.40000 224.0000 14.9666 +94.45000 229.0000 15.1327 +94.50000 239.0000 15.4596 +94.55000 243.0000 15.5885 +94.60000 250.0000 15.8114 +94.65000 236.0000 15.3623 +94.70000 223.0000 14.9332 +94.75000 210.0000 14.4914 +94.80000 207.0000 14.3875 +94.85000 196.0000 14.0000 +94.90000 192.0000 13.8564 +94.95000 194.0000 13.9284 +95.00000 206.0000 14.3527 +95.05000 213.0000 14.5945 +95.10000 212.0000 14.5602 +95.15000 229.0000 15.1327 +95.20000 234.0000 15.2971 +95.25000 243.0000 15.5885 +95.30000 267.0000 16.3401 +95.35000 291.0000 17.0587 +95.40000 313.0000 17.6918 +95.45000 350.0000 18.7083 +95.50000 384.0000 19.5959 +95.55000 381.0000 19.5192 +95.60000 368.0000 19.1833 +95.65000 336.0000 18.3303 +95.70000 317.0000 17.8045 +95.75000 282.0000 16.7929 +95.80000 256.0000 16.0000 +95.85000 243.0000 15.5885 +95.90000 242.0000 15.5563 +95.95000 236.0000 15.3623 +96.00000 250.0000 15.8114 +96.05000 270.0000 16.4317 +96.10000 298.0000 17.2627 +96.15000 345.0000 18.5742 +96.20000 402.0000 20.0499 +96.25000 470.0000 21.6795 +96.30000 513.0000 22.6495 +96.35000 522.0000 22.8473 +96.40000 506.0000 22.4944 +96.45000 474.0000 21.7715 +96.50000 430.0000 20.7364 +96.55000 378.0000 19.4422 +96.60000 321.0000 17.9165 +96.65000 305.0000 17.4642 +96.70000 284.0000 16.8523 +96.75000 264.0000 16.2481 +96.80000 253.0000 15.9060 +96.85000 245.0000 15.6525 +96.90000 242.0000 15.5563 +96.95000 249.0000 15.7797 +97.00000 245.0000 15.6525 +97.05000 238.0000 15.4272 +97.10000 244.0000 15.6205 +97.15000 244.0000 15.6205 +97.20000 233.0000 15.2643 +97.25000 228.0000 15.0997 +97.30000 229.0000 15.1327 +97.35000 231.0000 15.1987 +97.40000 226.0000 15.0333 +97.45000 218.0000 14.7648 +97.50000 214.0000 14.6287 +97.55000 210.0000 14.4914 +97.60000 212.0000 14.5602 +97.65000 215.0000 14.6629 +97.70000 215.0000 14.6629 +97.75000 233.0000 15.2643 +97.80000 255.0000 15.9687 +97.85000 276.0000 16.6132 +97.90000 316.0000 17.7764 +97.95000 354.0000 18.8149 +98.00000 382.0000 19.5448 +98.05000 390.0000 19.7484 +98.10000 423.0000 20.5670 +98.15000 436.0000 20.8806 +98.20000 437.0000 20.9045 +98.25000 437.0000 20.9045 +98.30000 421.0000 20.5183 +98.35000 390.0000 19.7484 +98.40000 370.0000 19.2354 +98.45000 325.0000 18.0278 +98.50000 271.0000 16.4621 +98.55000 253.0000 15.9060 +98.60000 231.0000 15.1987 +98.65000 216.0000 14.6969 +98.70000 202.0000 14.2127 +98.75000 201.0000 14.1774 +98.80000 206.0000 14.3527 +98.85000 206.0000 14.3527 +98.90000 210.0000 14.4914 +98.95000 223.0000 14.9332 +99.00000 241.0000 15.5242 +99.05000 261.0000 16.1555 +99.10000 283.0000 16.8226 +99.15000 327.0000 18.0831 +99.20000 340.0000 18.4391 +99.25000 367.0000 19.1572 +99.30000 376.0000 19.3907 +99.35000 359.0000 18.9473 +99.40000 362.0000 19.0263 +99.45000 329.0000 18.1384 +99.50000 304.0000 17.4356 +99.55000 305.0000 17.4642 +99.60000 289.0000 17.0000 +99.65000 291.0000 17.0587 +99.70000 308.0000 17.5499 +99.75000 335.0000 18.3030 +99.80000 378.0000 19.4422 +99.85000 402.0000 20.0499 +99.90000 412.0000 20.2978 +99.95000 409.0000 20.2237 +100.00000 388.0000 19.6977 +100.05000 357.0000 18.8944 +100.10000 335.0000 18.3030 +100.15000 324.0000 18.0000 +100.20000 311.0000 17.6352 +100.25000 318.0000 17.8326 +100.30000 322.0000 17.9444 +100.35000 328.0000 18.1108 +100.40000 314.0000 17.7200 +100.45000 299.0000 17.2916 +100.50000 277.0000 16.6433 +100.55000 243.0000 15.5885 +100.60000 239.0000 15.4596 +100.65000 224.0000 14.9666 +100.70000 220.0000 14.8324 +100.75000 214.0000 14.6287 +100.80000 204.0000 14.2829 +100.85000 211.0000 14.5258 +100.90000 220.0000 14.8324 +100.95000 228.0000 15.0997 +101.00000 241.0000 15.5242 +101.05000 254.0000 15.9374 +101.10000 269.0000 16.4012 +101.15000 300.0000 17.3205 +101.20000 323.0000 17.9722 +101.25000 344.0000 18.5472 +101.30000 363.0000 19.0526 +101.35000 379.0000 19.4679 +101.40000 388.0000 19.6977 +101.45000 400.0000 20.0000 +101.50000 413.0000 20.3224 +101.55000 462.0000 21.4942 +101.60000 524.0000 22.8910 +101.65000 606.0000 24.6171 +101.70000 736.0000 27.1293 +101.75000 832.0000 28.8444 +101.80000 891.0000 29.8496 +101.85000 940.0000 30.6594 +101.90000 927.0000 30.4467 +101.95000 888.0000 29.7993 +102.00000 813.0000 28.5132 +102.05000 730.0000 27.0185 +102.10000 670.0000 25.8844 +102.15000 614.0000 24.7790 +102.20000 548.0000 23.4094 +102.25000 504.0000 22.4499 +102.30000 458.0000 21.4009 +102.35000 416.0000 20.3961 +102.40000 379.0000 19.4679 +102.45000 351.0000 18.7350 +102.50000 328.0000 18.1108 +102.55000 302.0000 17.3781 +102.60000 283.0000 16.8226 +102.65000 255.0000 15.9687 +102.70000 240.0000 15.4919 +102.75000 233.0000 15.2643 +102.80000 215.0000 14.6629 +102.85000 219.0000 14.7986 +102.90000 214.0000 14.6287 +102.95000 211.0000 14.5258 +103.00000 218.0000 14.7648 +103.05000 226.0000 15.0333 +103.10000 246.0000 15.6844 +103.15000 254.0000 15.9374 +103.20000 275.0000 16.5831 +103.25000 288.0000 16.9706 +103.30000 293.0000 17.1172 +103.35000 301.0000 17.3494 +103.40000 308.0000 17.5499 +103.45000 301.0000 17.3494 +103.50000 304.0000 17.4356 +103.55000 317.0000 17.8045 +103.60000 339.0000 18.4120 +103.65000 356.0000 18.8680 +103.70000 398.0000 19.9499 +103.75000 414.0000 20.3470 +103.80000 446.0000 21.1187 +103.85000 475.0000 21.7945 +103.90000 478.0000 21.8632 +103.95000 480.0000 21.9089 +104.00000 492.0000 22.1811 +104.05000 475.0000 21.7945 +104.10000 471.0000 21.7025 +104.15000 511.0000 22.6053 +104.20000 527.0000 22.9565 +104.25000 532.0000 23.0651 +104.30000 537.0000 23.1733 +104.35000 520.0000 22.8035 +104.40000 477.0000 21.8403 +104.45000 429.0000 20.7123 +104.50000 382.0000 19.5448 +104.55000 334.0000 18.2757 +104.60000 302.0000 17.3781 +104.65000 276.0000 16.6132 +104.70000 251.0000 15.8430 +104.75000 230.0000 15.1658 +104.80000 223.0000 14.9332 +104.85000 203.0000 14.2478 +104.90000 208.0000 14.4222 +104.95000 207.0000 14.3875 +105.00000 204.0000 14.2829 +105.05000 211.0000 14.5258 +105.10000 229.0000 15.1327 +105.15000 235.0000 15.3297 +105.20000 244.0000 15.6205 +105.25000 261.0000 16.1555 +105.30000 273.0000 16.5227 +105.35000 276.0000 16.6132 +105.40000 282.0000 16.7929 +105.45000 289.0000 17.0000 +105.50000 278.0000 16.6733 +105.55000 272.0000 16.4924 +105.60000 273.0000 16.5227 +105.65000 264.0000 16.2481 +105.70000 251.0000 15.8430 +105.75000 250.0000 15.8114 +105.80000 251.0000 15.8430 +105.85000 240.0000 15.4919 +105.90000 239.0000 15.4596 +105.95000 238.0000 15.4272 +106.00000 246.0000 15.6844 +106.05000 250.0000 15.8114 +106.10000 262.0000 16.1864 +106.15000 278.0000 16.6733 +106.20000 295.0000 17.1756 +106.25000 302.0000 17.3781 +106.30000 311.0000 17.6352 +106.35000 306.0000 17.4929 +106.40000 298.0000 17.2627 +106.45000 291.0000 17.0587 +106.50000 286.0000 16.9115 +106.55000 276.0000 16.6132 +106.60000 273.0000 16.5227 +106.65000 275.0000 16.5831 +106.70000 278.0000 16.6733 +106.75000 288.0000 16.9706 +106.80000 294.0000 17.1464 +106.85000 286.0000 16.9115 +106.90000 276.0000 16.6132 +106.95000 259.0000 16.0935 +107.00000 250.0000 15.8114 +107.05000 227.0000 15.0665 +107.10000 216.0000 14.6969 +107.15000 207.0000 14.3875 +107.20000 196.0000 14.0000 +107.25000 184.0000 13.5647 +107.30000 187.0000 13.6748 +107.35000 187.0000 13.6748 +107.40000 183.0000 13.5277 +107.45000 185.0000 13.6015 +107.50000 183.0000 13.5277 +107.55000 192.0000 13.8564 +107.60000 198.0000 14.0712 +107.65000 206.0000 14.3527 +107.70000 209.0000 14.4568 +107.75000 228.0000 15.0997 +107.80000 246.0000 15.6844 +107.85000 264.0000 16.2481 +107.90000 297.0000 17.2337 +107.95000 315.0000 17.7482 +108.00000 344.0000 18.5472 +108.05000 371.0000 19.2614 +108.10000 386.0000 19.6469 +108.15000 391.0000 19.7737 +108.20000 405.0000 20.1246 +108.25000 392.0000 19.7990 +108.30000 380.0000 19.4936 +108.35000 386.0000 19.6469 +108.40000 365.0000 19.1050 +108.45000 339.0000 18.4120 +108.50000 320.0000 17.8885 +108.55000 303.0000 17.4069 +108.60000 288.0000 16.9706 +108.65000 283.0000 16.8226 +108.70000 274.0000 16.5529 +108.75000 263.0000 16.2173 +108.80000 265.0000 16.2788 +108.85000 276.0000 16.6132 +108.90000 281.0000 16.7631 +108.95000 286.0000 16.9115 +109.00000 303.0000 17.4069 +109.05000 316.0000 17.7764 +109.10000 332.0000 18.2209 +109.15000 341.0000 18.4662 +109.20000 355.0000 18.8414 +109.25000 358.0000 18.9209 +109.30000 345.0000 18.5742 +109.35000 326.0000 18.0555 +109.40000 323.0000 17.9722 +109.45000 289.0000 17.0000 +109.50000 274.0000 16.5529 +109.55000 275.0000 16.5831 +109.60000 253.0000 15.9060 +109.65000 250.0000 15.8114 +109.70000 261.0000 16.1555 +109.75000 257.0000 16.0312 +109.80000 263.0000 16.2173 +109.85000 253.0000 15.9060 +109.90000 251.0000 15.8430 +109.95000 257.0000 16.0312 +110.00000 251.0000 15.8430 +110.05000 251.0000 15.8430 +110.10000 245.0000 15.6525 +110.15000 237.0000 15.3948 +110.20000 239.0000 15.4596 +110.25000 232.0000 15.2315 +110.30000 232.0000 15.2315 +110.35000 226.0000 15.0333 +110.40000 221.0000 14.8661 +110.45000 227.0000 15.0665 +110.50000 220.0000 14.8324 +110.55000 216.0000 14.6969 +110.60000 205.0000 14.3178 +110.65000 205.0000 14.3178 +110.70000 195.0000 13.9642 +110.75000 190.0000 13.7840 +110.80000 187.0000 13.6748 +110.85000 181.0000 13.4536 +110.90000 195.0000 13.9642 +110.95000 194.0000 13.9284 +111.00000 193.0000 13.8924 +111.05000 195.0000 13.9642 +111.10000 191.0000 13.8203 +111.15000 197.0000 14.0357 +111.20000 200.0000 14.1421 +111.25000 202.0000 14.2127 +111.30000 191.0000 13.8203 +111.35000 189.0000 13.7477 +111.40000 192.0000 13.8564 +111.45000 182.0000 13.4907 +111.50000 187.0000 13.6748 +111.55000 198.0000 14.0712 +111.60000 215.0000 14.6629 +111.65000 217.0000 14.7309 +111.70000 218.0000 14.7648 +111.75000 220.0000 14.8324 +111.80000 222.0000 14.8997 +111.85000 218.0000 14.7648 +111.90000 214.0000 14.6287 +111.95000 215.0000 14.6629 +112.00000 214.0000 14.6287 +112.05000 205.0000 14.3178 +112.10000 199.0000 14.1067 +112.15000 204.0000 14.2829 +112.20000 201.0000 14.1774 +112.25000 189.0000 13.7477 +112.30000 195.0000 13.9642 +112.35000 203.0000 14.2478 +112.40000 204.0000 14.2829 +112.45000 204.0000 14.2829 +112.50000 210.0000 14.4914 +112.55000 204.0000 14.2829 +112.60000 197.0000 14.0357 +112.65000 192.0000 13.8564 +112.70000 200.0000 14.1421 +112.75000 205.0000 14.3178 +112.80000 203.0000 14.2478 +112.85000 213.0000 14.5945 +112.90000 226.0000 15.0333 +112.95000 235.0000 15.3297 +113.00000 250.0000 15.8114 +113.05000 267.0000 16.3401 +113.10000 295.0000 17.1756 +113.15000 338.0000 18.3848 +113.20000 370.0000 19.2354 +113.25000 410.0000 20.2485 +113.30000 427.0000 20.6640 +113.35000 433.0000 20.8087 +113.40000 449.0000 21.1896 +113.45000 431.0000 20.7605 +113.50000 415.0000 20.3715 +113.55000 402.0000 20.0499 +113.60000 376.0000 19.3907 +113.65000 340.0000 18.4391 +113.70000 316.0000 17.7764 +113.75000 289.0000 17.0000 +113.80000 283.0000 16.8226 +113.85000 299.0000 17.2916 +113.90000 300.0000 17.3205 +113.95000 301.0000 17.3494 +114.00000 310.0000 17.6068 +114.05000 329.0000 18.1384 +114.10000 342.0000 18.4932 +114.15000 354.0000 18.8149 +114.20000 360.0000 18.9737 +114.25000 359.0000 18.9473 +114.30000 355.0000 18.8414 +114.35000 333.0000 18.2483 +114.40000 322.0000 17.9444 +114.45000 294.0000 17.1464 +114.50000 264.0000 16.2481 +114.55000 270.0000 16.4317 +114.60000 259.0000 16.0935 +114.65000 244.0000 15.6205 +114.70000 242.0000 15.5563 +114.75000 229.0000 15.1327 +114.80000 234.0000 15.2971 +114.85000 250.0000 15.8114 +114.90000 261.0000 16.1555 +114.95000 263.0000 16.2173 +115.00000 283.0000 16.8226 +115.05000 307.0000 17.5214 +115.10000 339.0000 18.4120 +115.15000 360.0000 18.9737 +115.20000 387.0000 19.6723 +115.25000 437.0000 20.9045 +115.30000 449.0000 21.1896 +115.35000 472.0000 21.7256 +115.40000 477.0000 21.8403 +115.45000 472.0000 21.7256 +115.50000 463.0000 21.5174 +115.55000 452.0000 21.2603 +115.60000 433.0000 20.8087 +115.65000 402.0000 20.0499 +115.70000 364.0000 19.0788 +115.75000 313.0000 17.6918 +115.80000 308.0000 17.5499 +115.85000 285.0000 16.8819 +115.90000 264.0000 16.2481 +115.95000 253.0000 15.9060 +116.00000 253.0000 15.9060 +116.05000 264.0000 16.2481 +116.10000 264.0000 16.2481 +116.15000 265.0000 16.2788 +116.20000 263.0000 16.2173 +116.25000 269.0000 16.4012 +116.30000 284.0000 16.8523 +116.35000 284.0000 16.8523 +116.40000 288.0000 16.9706 +116.45000 275.0000 16.5831 +116.50000 273.0000 16.5227 +116.55000 266.0000 16.3095 +116.60000 252.0000 15.8745 +116.65000 249.0000 15.7797 +116.70000 234.0000 15.2971 +116.75000 232.0000 15.2315 +116.80000 218.0000 14.7648 +116.85000 224.0000 14.9666 +116.90000 244.0000 15.6205 +116.95000 240.0000 15.4919 +117.00000 233.0000 15.2643 +117.05000 244.0000 15.6205 +117.10000 250.0000 15.8114 +117.15000 270.0000 16.4317 +117.20000 270.0000 16.4317 +117.25000 274.0000 16.5529 +117.30000 291.0000 17.0587 +117.35000 274.0000 16.5529 +117.40000 268.0000 16.3707 +117.45000 259.0000 16.0935 +117.50000 271.0000 16.4621 +117.55000 268.0000 16.3707 +117.60000 264.0000 16.2481 +117.65000 261.0000 16.1555 +117.70000 258.0000 16.0624 +117.75000 249.0000 15.7797 +117.80000 250.0000 15.8114 +117.85000 255.0000 15.9687 +117.90000 268.0000 16.3707 +117.95000 284.0000 16.8523 +118.00000 283.0000 16.8226 +118.05000 275.0000 16.5831 +118.10000 297.0000 17.2337 +118.15000 313.0000 17.6918 +118.20000 334.0000 18.2757 +118.25000 339.0000 18.4120 +118.30000 338.0000 18.3848 +118.35000 353.0000 18.7883 +118.40000 377.0000 19.4165 +118.45000 405.0000 20.1246 +118.50000 412.0000 20.2978 +118.55000 427.0000 20.6640 +118.60000 439.0000 20.9523 +118.65000 435.0000 20.8567 +118.70000 447.0000 21.1424 +118.75000 429.0000 20.7123 +118.80000 414.0000 20.3470 +118.85000 381.0000 19.5192 +118.90000 364.0000 19.0788 +118.95000 345.0000 18.5742 +119.00000 335.0000 18.3030 +119.05000 305.0000 17.4642 +119.10000 298.0000 17.2627 +119.15000 292.0000 17.0880 +119.20000 286.0000 16.9115 +119.25000 276.0000 16.6132 +119.30000 301.0000 17.3494 +119.35000 309.0000 17.5784 +119.40000 328.0000 18.1108 +119.45000 347.0000 18.6279 +119.50000 358.0000 18.9209 +119.55000 364.0000 19.0788 +119.60000 383.0000 19.5704 +119.65000 373.0000 19.3132 +119.70000 396.0000 19.8997 +119.75000 385.0000 19.6214 +119.80000 387.0000 19.6723 +119.85000 370.0000 19.2354 +119.90000 376.0000 19.3907 +119.95000 354.0000 18.8149 +120.00000 340.0000 18.4391 +120.05000 338.0000 18.3848 +120.10000 349.0000 18.6815 +120.15000 354.0000 18.8149 +120.20000 338.0000 18.3848 +120.25000 334.0000 18.2757 +120.30000 329.0000 18.1384 +120.35000 331.0000 18.1934 +120.40000 338.0000 18.3848 +120.45000 335.0000 18.3030 +120.50000 318.0000 17.8326 +120.55000 315.0000 17.7482 +120.60000 314.0000 17.7200 +120.65000 288.0000 16.9706 +120.70000 294.0000 17.1464 +120.75000 270.0000 16.4317 +120.80000 252.0000 15.8745 +120.85000 271.0000 16.4621 +120.90000 277.0000 16.6433 +120.95000 282.0000 16.7929 +121.00000 285.0000 16.8819 +121.05000 292.0000 17.0880 +121.10000 308.0000 17.5499 +121.15000 299.0000 17.2916 +121.20000 294.0000 17.1464 +121.25000 293.0000 17.1172 +121.30000 296.0000 17.2047 +121.35000 308.0000 17.5499 +121.40000 287.0000 16.9411 +121.45000 295.0000 17.1756 +121.50000 312.0000 17.6635 +121.55000 304.0000 17.4356 +121.60000 313.0000 17.6918 +121.65000 314.0000 17.7200 +121.70000 309.0000 17.5784 +121.75000 320.0000 17.8885 +121.80000 312.0000 17.6635 +121.85000 322.0000 17.9444 +121.90000 340.0000 18.4391 +121.95000 340.0000 18.4391 +122.00000 329.0000 18.1384 +122.05000 333.0000 18.2483 +122.10000 341.0000 18.4662 +122.15000 345.0000 18.5742 +122.20000 340.0000 18.4391 +122.25000 351.0000 18.7350 +122.30000 355.0000 18.8414 +122.35000 364.0000 19.0788 +122.40000 374.0000 19.3391 +122.45000 380.0000 19.4936 +122.50000 401.0000 20.0250 +122.55000 407.0000 20.1742 +122.60000 429.0000 20.7123 +122.65000 438.0000 20.9284 +122.70000 458.0000 21.4009 +122.75000 455.0000 21.3307 +122.80000 450.0000 21.2132 +122.85000 448.0000 21.1660 +122.90000 456.0000 21.3542 +122.95000 450.0000 21.2132 +123.00000 432.0000 20.7846 +123.05000 436.0000 20.8806 +123.10000 439.0000 20.9523 +123.15000 443.0000 21.0476 +123.20000 389.0000 19.7231 +123.25000 408.0000 20.1990 +123.30000 369.0000 19.2094 +123.35000 372.0000 19.2873 +123.40000 354.0000 18.8149 +123.45000 332.0000 18.2209 +123.50000 314.0000 17.7200 +123.55000 278.0000 16.6733 +123.60000 274.0000 16.5529 +123.65000 256.0000 16.0000 +123.70000 237.0000 15.3948 +123.75000 236.0000 15.3623 +123.80000 206.0000 14.3527 +123.85000 204.0000 14.2829 +123.90000 207.0000 14.3875 +123.95000 202.0000 14.2127 +124.00000 199.0000 14.1067 +124.05000 214.0000 14.6287 +124.10000 224.0000 14.9666 +124.15000 206.0000 14.3527 +124.20000 237.0000 15.3948 +124.25000 221.0000 14.8661 +124.30000 216.0000 14.6969 +124.35000 254.0000 15.9374 +124.40000 240.0000 15.4919 +124.45000 279.0000 16.7033 +124.50000 281.0000 16.7631 +124.55000 291.0000 17.0587 +124.60000 314.0000 17.7200 +124.65000 313.0000 17.6918 +124.70000 319.0000 17.8606 +124.75000 335.0000 18.3030 +124.80000 333.0000 18.2483 +124.85000 337.0000 18.3576 +124.90000 351.0000 18.7350 +124.95000 349.0000 18.6815 +125.00000 329.0000 18.1384 diff --git a/examples/Fitting_multiphase.ipynb b/examples/Fitting_multiphase.ipynb new file mode 100644 index 00000000..0de056a9 --- /dev/null +++ b/examples/Fitting_multiphase.ipynb @@ -0,0 +1,526 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Working with multiple phases" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This notebook will explain how to load, access and fit multiple phases" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Import Python packages" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# esyScience, technique-independent\n", + "from easyCore import np\n", + "from easyCore.Fitting.Fitting import Fitter\n", + "\n", + "# esyScience, diffraction\n", + "from easyDiffractionLib import Phases\n", + "from easyDiffractionLib.sample import Sample as Job\n", + "from easyDiffractionLib.interface import InterfaceFactory as Calculator\n", + "from easyDiffractionLib.Elements.Experiments.Pattern import Pattern1D\n", + "from easyDiffractionLib.Elements.Backgrounds.Point import PointBackground, BackgroundPoint\n", + "from easyDiffractionLib.Profiles.P1D import Instrument1DCWParameters as CWParams\n", + "\n", + "# Vizualization\n", + "import py3Dmol\n", + "import matplotlib.pyplot as plt" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## --- Sample ---" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Show a CIF file content" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "cif_fname = 'multiphase.cif'\n", + "\n", + "with open(cif_fname, 'r') as f:\n", + " content = f.read()\n", + " \n", + "print(content)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + " This cif file contains two phases of Si3N4: `alpha` and `beta`." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Load structure from a CIF file" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "phases = Phases.from_cif_file(cif_fname)\n", + "phase_alpha = phases[0]\n", + "phase_beta = phases[1]\n", + "\n", + "print(phases)\n", + "print(phase_alpha)\n", + "print(phase_beta)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Visualise the first phase" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "structure = py3Dmol.view()\n", + "structure.addModel(phase_alpha.to_cif_str(), 'cif')\n", + "structure.setStyle({'sphere':{'colorscheme':'Jmol','scale':.2},'stick':{'colorscheme':'Jmol','radius': 0.1}})\n", + "structure.addUnitCell()\n", + "structure.replicateUnitCell(2,2,1)\n", + "structure.zoomTo()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Visualise the second phase" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "structure_2 = py3Dmol.view()\n", + "structure_2.addModel(phase_beta.to_cif_str(), 'cif')\n", + "structure_2.setStyle({'sphere':{'colorscheme':'Jmol','scale':.2},'stick':{'colorscheme':'Jmol','radius': 0.1}})\n", + "structure_2.addUnitCell()\n", + "structure_2.replicateUnitCell(2,2,1)\n", + "structure_2.zoomTo()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## --- Experiment ---" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Load the measured data" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "meas_fname = '3T2@LLB.xye'\n", + "meas_x, meas_y, meas_e = np.loadtxt(meas_fname, unpack=True)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Visualize the measured data" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "scrolled": true + }, + "outputs": [], + "source": [ + "%matplotlib widget\n", + "plt.plot(meas_x, meas_y, label='Imeas')\n", + "plt.legend()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## --- Analysis ---" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Create job with default parameters for the 1D powder neutron diffraction experiment with constant wavelength " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "calculator = Calculator(interface_name='CrysPy')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "print(f\"Current calculator engine: {calculator.current_interface_name}\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "job = Job(phases=phases, parameters=CWParams.default(), calculator=calculator)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Generate the calculated data" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Note**: *Calculated data corresponds to the sum of all phases*" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "calc_y_cryspy = calculator.fit_func(meas_x)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Visualize both the measured and calculated data" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "scrolled": false + }, + "outputs": [], + "source": [ + "%matplotlib widget\n", + "plt.plot(meas_x, meas_y, label='Imeas')\n", + "plt.plot(meas_x, calc_y_cryspy, label='Icalc (CrysPy)')\n", + "plt.legend()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### We can also view separate phases contributions" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "y_phase_1 = calculator.get_calculated_y_for_phase(0)\n", + "y_phase_2 = calculator.get_calculated_y_for_phase(1)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "%matplotlib widget\n", + "plt.plot(meas_x, y_phase_1, label='Si3N4 alpha')\n", + "plt.plot(meas_x, y_phase_2, label='Si3N4 beta')\n", + "plt.legend()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Set scale manually, for each phase separately" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "phases[0].scale = 92.\n", + "phases[1].scale = 28.6" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Set wavelength manually" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "job.parameters.wavelength = 1.2251" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "calc_y_cryspy = calculator.fit_func(meas_x)\n", + "\n", + "calc_y_cryspy = calculator.get_total_y_for_phases()[1]\n", + "calc_y_cryspy = calculator.get_calculated_y_for_phase(1)\n", + "%matplotlib widget\n", + "plt.plot(meas_x, meas_y, label='Imeas')\n", + "plt.plot(meas_x, calc_y_cryspy, label='Icalc (CrysPy)')\n", + "plt.legend()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Set background points manually" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "bkg = PointBackground(linked_experiment='PbSO4')\n", + "\n", + "bkg.append(BackgroundPoint.from_pars(meas_x[0], 200))\n", + "bkg.append(BackgroundPoint.from_pars(meas_x[-1], 250))\n", + "\n", + "job.set_background(bkg)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "calc_y_cryspy = calculator.fit_func(meas_x)\n", + "\n", + "%matplotlib widget\n", + "plt.plot(meas_x, meas_y, label='Imeas')\n", + "plt.plot(meas_x, calc_y_cryspy, label='Icalc (CrysPy)')\n", + "plt.legend()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Define parameters to optimize" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "job.phases[0].scale.fixed = False\n", + "job.phases[1].scale.fixed = False\n", + "job.pattern.zero_shift.fixed = False\n", + "job.parameters.resolution_u.fixed = False\n", + "job.parameters.resolution_v.fixed = False\n", + "job.parameters.resolution_w.fixed = False\n", + "job.backgrounds[0][0].y.fixed = False\n", + "job.backgrounds[0][1].y.fixed = False" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "print(job.phases[0].scale)\n", + "print(job.phases[1].scale)\n", + "print(job.pattern.zero_shift)\n", + "print(job.parameters.resolution_u)\n", + "print(job.parameters.resolution_v)\n", + "print(job.parameters.resolution_w)\n", + "print(job.backgrounds[0][0])\n", + "print(job.backgrounds[0][1])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "#### Initalize the fitting engine and perform the fit" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "fitter = Fitter(job, calculator.fit_func)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "print(f\"Available minimizers: {fitter.available_engines}\")\n", + "print(f\"Current minimizer: {fitter.current_engine.name}\")\n", + "print(f\"Available methods of current minimizers: {fitter.available_methods()}\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "result = fitter.fit(meas_x, meas_y, weights=1/meas_e, \n", + " method='least_squares', minimizer_kwargs={'diff_step': 1e-5})" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "print(\"The fit has been successful: {}\".format(result.success))\n", + "if result.success: \n", + " print(\"The gooodness of fit (chi2) is: {}\".format(result.reduced_chi))\n", + " print(job.pattern.scale)\n", + " print(job.pattern.zero_shift)\n", + " print(job.parameters.resolution_u)\n", + " print(job.parameters.resolution_v)\n", + " print(job.parameters.resolution_w)\n", + " print(job.backgrounds[0][0])\n", + " print(job.backgrounds[0][1])" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "calc_y_cryspy = calculator.fit_func(meas_x)\n", + "\n", + "%matplotlib widget\n", + "plt.plot(meas_x, meas_y, label='Imeas')\n", + "plt.plot(meas_x, calc_y_cryspy, label='Icalc (CrysPy)')\n", + "plt.plot(meas_x, meas_y-calc_y_cryspy, label='Imeas - Icalc (CrysPy)')\n", + "plt.legend()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.10" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/examples/multiphase.cif b/examples/multiphase.cif new file mode 100644 index 00000000..72e2f82a --- /dev/null +++ b/examples/multiphase.cif @@ -0,0 +1,53 @@ +data_Si3N4_alpha + +_space_group_name_H-M_alt 'P 3 1 c' + +_cell_length_a 7.751856 +_cell_length_b 7.751856 +_cell_length_c 5.619506 +_cell_angle_alpha 90.0 +_cell_angle_beta 90.0 +_cell_angle_gamma 120.0 + +loop_ + _atom_site_label + _atom_site_type_symbol + _atom_site_occupancy + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_adp_type + _atom_site_U_iso_or_equiv + Si1 Si 1.0 0.08185 0.51180 0.65958 Uiso 0.01 + Si2 Si 1.0 0.25323 0.16763 0.45090 Uiso 0.01 + N1 N 1.0 0.65512 0.61058 0.43269 Uiso 0.01 + N2 N 1.0 0.31514 0.31865 0.69801 Uiso 0.01 + N3 N 1.0 0.33333 0.66667 0.60394 Uiso 0.01 + N4 N 1.0 0.00000 0.00000 0.45292 Uiso 0.01 + +data_Si3N4_beta + +_space_group_name_H-M_alt 'P 63/m' + +_cell_length_a 7.605376 +_cell_length_b 7.605376 +_cell_length_c 2.907065 +_cell_angle_alpha 90.0 +_cell_angle_beta 90.0 +_cell_angle_gamma 120.0 + +loop_ + _atom_site_label + _atom_site_type_symbol + _atom_site_occupancy + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_adp_type + _atom_site_U_iso_or_equiv + Si Si 1.0 0.17522 0.76977 0.25000 Uiso 0.01 + N1 N 1.0 0.33131 0.03120 0.25000 Uiso 0.01 + N2 N 1.0 0.33333 0.66667 0.25000 Uiso 0.01 + + + diff --git a/pyproject.toml b/pyproject.toml index 4bd942a5..b7fd6ab4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,7 @@ repo = 'easyDiffractionLib' [tool.poetry] name = "easyDiffraction" -version = "0.0.2" +version = "0.0.3" description = 'Making diffraction data analysis and modelling easy.' license = "BSD-3-Clause" authors = ["Simon Ward", "Andrew Sazonov"] @@ -32,10 +32,11 @@ packages = [ { include = "easyDiffractionLib" } ] [tool.poetry.dependencies] python = "^3.7, <3.9" -easyScienceCore = '>=0.1.1a0' cryspy = { git = 'https://github.com/ikibalin/cryspy.git', rev = 'bravis_type_fix' } CFML = '^0.0.1' GSASII = '^0.0.1' +easyScienceCore = '>=0.2.0' +easyCrystallography = { git = 'https://github.com/easyScience/easyCrystallography.git', rev = 'develop' } [tool.poetry.dev-dependencies] pytest = "^5.2" diff --git a/requirements.txt b/requirements.txt index 365b5513..3df56d3c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,6 @@ cryspy @ git+https://github.com/ikibalin/cryspy.git@bravis_type_fix --extra-index-url https://easyscience.github.io/pypi -easysciencecore>=0.1.1a0 +easysciencecore @ git+https://github.com/easyScience/easyCore.git@easyCrystallography_Split +easycrystallography @ git+https://github.com/easyScience/easyCrystallography.git@develop cfml==0.0.1 gsasii==0.0.1 diff --git a/tests/integration_tests/FittingData_CFML.ipynb b/tests/integration_tests/FittingData_CFML.ipynb index 9435a430..54b1a351 100644 --- a/tests/integration_tests/FittingData_CFML.ipynb +++ b/tests/integration_tests/FittingData_CFML.ipynb @@ -27,13 +27,23 @@ }, { "cell_type": "code", - "execution_count": 36, + "execution_count": 1, "metadata": { "pycharm": { "name": "#%%\n" } }, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Warning: CrysFML is not installed\n", + "GSAS-II binary directory: /home/simonward/.cache/pypoetry/virtualenvs/easydiffractionlib-jQmFKVli-py3.7/lib/python3.7/site-packages/GSASII/bindist\n", + "ImportError for wx/mpl in GSASIIctrlGUI: ignore if docs build\n" + ] + } + ], "source": [ "# Import all the packages\n", "from easyCore import np\n", @@ -72,7 +82,7 @@ }, { "cell_type": "code", - "execution_count": 39, + "execution_count": 2, "metadata": { "pycharm": { "name": "#%%\n" @@ -80,18 +90,10 @@ }, "outputs": [ { - "ename": "AttributeError", - "evalue": "", - "output_type": "error", - "traceback": [ - "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[1;31mAttributeError\u001b[0m Traceback (most recent call last)", - "\u001b[1;32m~\\AppData\\Local\\Temp/ipykernel_7764/985772624.py\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[0mcalculator\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mCalculator\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 2\u001b[1;33m \u001b[0mc\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mPhases\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mfrom_cif_file\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'PbSO4.cif'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 3\u001b[0m \u001b[0mS\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mSample\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mphases\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mc\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mparameters\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mInstrument1DCWParameters\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mdefault\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mcalculator\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mcalculator\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", - "\u001b[1;32m~\\projects\\easyscience\\easyCore\\easyCore\\Elements\\HigherLevel\\Phase.py\u001b[0m in \u001b[0;36mfrom_cif_file\u001b[1;34m(cls, file_path)\u001b[0m\n\u001b[0;32m 360\u001b[0m \u001b[1;33m@\u001b[0m\u001b[0mclassmethod\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 361\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0mfrom_cif_file\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mcls\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mfile_path\u001b[0m\u001b[1;33m:\u001b[0m \u001b[0mPath\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 362\u001b[1;33m \u001b[0m_\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mcrystals\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mcls\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_from_external\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mCifIO\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mfrom_file\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mfile_path\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 363\u001b[0m \u001b[1;32mreturn\u001b[0m \u001b[0mcls\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"Phases\"\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m*\u001b[0m\u001b[0mcrystals\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 364\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n", - "\u001b[1;32m~\\projects\\easyscience\\easyCore\\easyCore\\Elements\\HigherLevel\\Phase.py\u001b[0m in \u001b[0;36m_from_external\u001b[1;34m(constructor, *args)\u001b[0m\n\u001b[0;32m 369\u001b[0m \u001b[0mcrystals\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;33m[\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 370\u001b[0m \u001b[1;32mfor\u001b[0m \u001b[0mcif_index\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mrange\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mcif\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_parser\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mnumber_of_cifs\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 371\u001b[1;33m \u001b[0mname\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mkwargs\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mcif\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mto_crystal_form\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mcif_index\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mcif_index\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 372\u001b[0m \u001b[0mcrystals\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mPhase\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mname\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 373\u001b[0m \u001b[1;32mreturn\u001b[0m \u001b[0mname\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mcrystals\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", - "\u001b[1;32m~\\projects\\easyscience\\easyCore\\easyCore\\Utils\\io\\cif.py\u001b[0m in \u001b[0;36mto_crystal_form\u001b[1;34m(self, cif_index)\u001b[0m\n\u001b[0;32m 89\u001b[0m \u001b[1;34m'cell'\u001b[0m\u001b[1;33m:\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_parser\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mget_lattice\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mcif_index\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mcif_index\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 90\u001b[0m \u001b[1;34m'spacegroup'\u001b[0m\u001b[1;33m:\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_parser\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mget_symmetry\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mcif_index\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mcif_index\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 91\u001b[1;33m \u001b[1;34m'atoms'\u001b[0m\u001b[1;33m:\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_parser\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mget_atoms\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mcif_index\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mcif_index\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 92\u001b[0m }\n\u001b[0;32m 93\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n", - "\u001b[1;32m~\\projects\\easyscience\\easyCore\\easyCore\\Utils\\io\\cif.py\u001b[0m in \u001b[0;36mget_atoms\u001b[1;34m(self, cif_index)\u001b[0m\n\u001b[0;32m 448\u001b[0m \u001b[1;32mbreak\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 449\u001b[0m \u001b[1;32mif\u001b[0m \u001b[1;32mnot\u001b[0m \u001b[0mfound\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 450\u001b[1;33m \u001b[1;32mraise\u001b[0m \u001b[0mAttributeError\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 451\u001b[0m \u001b[1;31m# Now look for atomic displacement\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 452\u001b[0m fields = ['atom_site_U_iso_or_equiv', 'atom_site_aniso_U_11',\n", - "\u001b[1;31mAttributeError\u001b[0m: " + "name": "stdout", + "output_type": "stream", + "text": [ + "Temp CIF: /tmp/easydiffraction_temp.cif\n" ] } ], @@ -114,28 +116,13 @@ }, { "cell_type": "code", - "execution_count": 38, + "execution_count": 3, "metadata": { "pycharm": { "name": "#%%\n" } }, - "outputs": [ - { - "ename": "OSError", - "evalue": "PbSO4_xrays_short.xye not found.", - "output_type": "error", - "traceback": [ - "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[1;31mOSError\u001b[0m Traceback (most recent call last)", - "\u001b[1;32m~\\AppData\\Local\\Temp/ipykernel_7764/2085124697.py\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mdata_x\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mdata_y\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mdata_e\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mnp\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mloadtxt\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'PbSO4_xrays_short.xye'\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0munpack\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;32mTrue\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 2\u001b[0m \u001b[0mdata_y\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mdata_y\u001b[0m\u001b[1;33m/\u001b[0m\u001b[1;36m100.0\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", - "\u001b[1;32mc:\\anaconda3\\envs\\easy\\lib\\site-packages\\numpy\\lib\\npyio.py\u001b[0m in \u001b[0;36mloadtxt\u001b[1;34m(fname, dtype, comments, delimiter, converters, skiprows, usecols, unpack, ndmin, encoding, max_rows, like)\u001b[0m\n\u001b[0;32m 1065\u001b[0m \u001b[0mfname\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mos_fspath\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mfname\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 1066\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0m_is_string_like\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mfname\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 1067\u001b[1;33m \u001b[0mfh\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mnp\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mlib\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_datasource\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mopen\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mfname\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m'rt'\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mencoding\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mencoding\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 1068\u001b[0m \u001b[0mfencoding\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mgetattr\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mfh\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m'encoding'\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m'latin1'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 1069\u001b[0m \u001b[0mfh\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0miter\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mfh\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", - "\u001b[1;32mc:\\anaconda3\\envs\\easy\\lib\\site-packages\\numpy\\lib\\_datasource.py\u001b[0m in \u001b[0;36mopen\u001b[1;34m(path, mode, destpath, encoding, newline)\u001b[0m\n\u001b[0;32m 191\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 192\u001b[0m \u001b[0mds\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mDataSource\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mdestpath\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 193\u001b[1;33m \u001b[1;32mreturn\u001b[0m \u001b[0mds\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mopen\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mpath\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mmode\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mencoding\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mencoding\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mnewline\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mnewline\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 194\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 195\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n", - "\u001b[1;32mc:\\anaconda3\\envs\\easy\\lib\\site-packages\\numpy\\lib\\_datasource.py\u001b[0m in \u001b[0;36mopen\u001b[1;34m(self, path, mode, encoding, newline)\u001b[0m\n\u001b[0;32m 531\u001b[0m encoding=encoding, newline=newline)\n\u001b[0;32m 532\u001b[0m \u001b[1;32melse\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 533\u001b[1;33m \u001b[1;32mraise\u001b[0m \u001b[0mIOError\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"%s not found.\"\u001b[0m \u001b[1;33m%\u001b[0m \u001b[0mpath\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 534\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 535\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n", - "\u001b[1;31mOSError\u001b[0m: PbSO4_xrays_short.xye not found." - ] - } - ], + "outputs": [], "source": [ "data_x, data_y, data_e = np.loadtxt('PbSO4_xrays_short.xye', unpack=True)\n", "data_y = data_y/100.0" @@ -150,13 +137,25 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "metadata": { "pycharm": { "name": "#%%\n" } }, - "outputs": [], + "outputs": [ + { + "ename": "NameError", + "evalue": "name 'interface' is not defined", + "output_type": "error", + "traceback": [ + "\u001B[0;31m---------------------------------------------------------------------------\u001B[0m", + "\u001B[0;31mNameError\u001B[0m Traceback (most recent call last)", + "\u001B[0;32m/tmp/ipykernel_1919065/4195641480.py\u001B[0m in \u001B[0;36m\u001B[0;34m\u001B[0m\n\u001B[0;32m----> 1\u001B[0;31m \u001B[0msim_y_data\u001B[0m \u001B[0;34m=\u001B[0m \u001B[0minterface\u001B[0m\u001B[0;34m.\u001B[0m\u001B[0mfit_func\u001B[0m\u001B[0;34m(\u001B[0m\u001B[0mdata_x\u001B[0m\u001B[0;34m)\u001B[0m\u001B[0;34m\u001B[0m\u001B[0;34m\u001B[0m\u001B[0m\n\u001B[0m\u001B[1;32m 2\u001B[0m \u001B[0;34m\u001B[0m\u001B[0m\n", + "\u001B[0;31mNameError\u001B[0m: name 'interface' is not defined" + ] + } + ], "source": [ "sim_y_data = interface.fit_func(data_x)" ]