Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

scripts to parse and manipulate MAUD project.par files

License

NotificationsYou must be signed in to change notification settings

LaVoieDesert/pyMaud

Repository files navigation

scripts to parse and manipulate MAUD project.par files.

MAUD is an amazing tool to analyse diffraction data (and more), checkout here

but the manipulation off many files simultaneously is quite difficulte. I have seen many different solution from different people. I propose my scripts, under development, to help, as I have not found what I search around.

Example 01

extract the cell parameters of the different phases

#coding: utf-8#!/usr/bin/env pythonfrom maud_parser2 import maud_parserfrom maud_parse_value import parse_single_maud_value_nokeyword, get_valuefichier = "data/A01_texture.par"data = maud_parser(fichier, debug=False)compo = data['data_sample_Sample_x']['#subordinateObject_layer1']['_pd_phase_atom_%']    print(fichier)i = 0for key in data['data_sample_Sample_x']:    if "_pd_phase_name" in data['data_sample_Sample_x'][key]:        pname = data['data_sample_Sample_x'][key]["_pd_phase_name"]['v_words']['value']        _compo = parse_single_maud_value_nokeyword(compo[i])        print("   {:s}{}({:5.2f}%): {},{},{}".format(            pname,            ' '*(25-len(pname)),            get_value(_compo)*100,            get_value(data['data_sample_Sample_x'][key]["_cell_length_a"]),            get_value(data['data_sample_Sample_x'][key]["_cell_length_b"]),            get_value(data['data_sample_Sample_x'][key]["_cell_length_c"]),            ))        i += 1

will give as result

data/A01_texture.par    cementite                ( 3.36%): 4.511985,5.065079,6.7294774    gamma-Fe                 ( 9.03%): 3.5815272,3.5815272,3.5815272    martensite               (87.61%): 2.8529925,2.8529925,2.9219563

Example 02

quick overview of the project by analysing the 'par' file

#coding: utf-8#!/usr/bin/env pythonfrom maud_analyse_project import maud_project_analysisfichier = "data/A01_texture.par"maud_project_analysis(fichier)

will give as result

    --- Maud par file analysis ---data/A01_texture.parPut a title hereLast update Thu Feb 23 17:51:40 CET 2017Samples_ data_sample_Sample_x: Sample description    cementite                ( 3.36%): 4.511985,5.065079,6.7294774    gamma-Fe                 ( 9.03%): 3.5815272,3.5815272,3.5815272    martensite               (87.61%): 2.8529925,2.8529925,2.9219563

About

scripts to parse and manipulate MAUD project.par files

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp