Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define material data files from NIST #1606

Open
vribgar opened this issue May 9, 2024 · 3 comments
Open

Define material data files from NIST #1606

vribgar opened this issue May 9, 2024 · 3 comments

Comments

@vribgar
Copy link

vribgar commented May 9, 2024

We are trying to define material files from the NIST database, since we want to do simulations with materials and composites that you don't have in the library database.

According to this code:

else{fprintf(stderr,"Warning: %s: %s not found in header of %s, set to 1.\n",
the material files appear to be read using the Table_Read() function, which probably expects a table format where each column has a header that can be identified. The files should contain headers that correspond to the material properties, such as "Z", "A[r]", "rho", etc.

The problem is, when downloading the data directly from NIST, the header is not saved that way (I attach two files so you can compare: Ca.txt is the one from your database and Ca_v.txt was created by us), so it does not read it correctly. Do we have to manually modify the header? Or do you have a way to generate automatically the material files?

Ca.txt
Ca_v.txt

Thank you very much for your attention.

Regards,
Veronica.

@willend
Copy link
Contributor

willend commented May 9, 2024

Hi @vribgar,

As I remember the Unix shell script get_xray_db_data in mcxtrace-comps/data (and present in your ${MCXTRACE}/data folder) is meant for this purpose.

The tool silently assumes that bash is in /usr/bin and that that the dependencies wget and w3m are installed so you will get the best mileage on a Linux, e.g. Ubuntu, here exemplified with atom 18 Ar:

bash $MCXTRACE/data/get_xray_db_data 18
/tmp/get_xray.BZt
URL transformed to HTTPS due to an HSTS policy
--2024-05-09 20:48:46--  https://physics.nist.gov/cgi-bin/ffast/ffast.pl?Z=18&Formula=&gtype=4&range=S&lower=0&upper=500&density=&frames=noframes
Resolving physics.nist.gov (physics.nist.gov)... 129.6.13.19, 2610:20:6005:13::19
Connecting to physics.nist.gov (physics.nist.gov)|129.6.13.19|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘/tmp/get_xray.BZt’

/tmp/get_xray.BZt                                       [ <=>                                                                                                                ]  20.18K  --.-KB/s    in 0.1s    

2024-05-09 20:48:47 (199 KB/s) - ‘/tmp/get_xray.BZt’ saved [20664]

writing output to Ar.txt

The resulting file has a header:
Ar.txt

@willend
Copy link
Contributor

willend commented May 9, 2024

Admittedly a rewrite using e.g. Python would be better, platform independent and more user friendly....

@farhi
Copy link
Contributor

farhi commented Jul 18, 2024

And I would add that you may use the Fluorescence sample and the related Test_Absorption and Test_Fluorescence example to handle any compound via XRayLib. See my comment in #1620

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants