Skip to content

Add configurable PRINT card values to Struct2XAS.make_input_feff#606

Open
hcenge wants to merge 2 commits intoxraypy:masterfrom
hcenge:master
Open

Add configurable PRINT card values to Struct2XAS.make_input_feff#606
hcenge wants to merge 2 commits intoxraypy:masterfrom
hcenge:master

Conversation

@hcenge
Copy link

@hcenge hcenge commented Feb 5, 2026

Motivation

Using Struct2XAS to generate FEFF paths for EXAFS fitting requires the individual feffNNNN.dat files. This requires ff2chi=3 in the PRINT card, but it was hardcoded to 0 in the template file feff_exafs.tmpl.

structure2feff.py already defaults to ff2chi=3, so this change makes struct2xas.py consistent while letting users override if needed.

Changes

  • Added feff_print parameter to make_input_feff() (default [1,0,0,0,0,3])
  • Updated feff_exafs.tmpl to use placeholders for the feff PRINT output parameters
  • Added unit tests in tests/test_struct2xas_feff_print.py

Usage

mat.make_input_feff(radius=7)  # default now outputs feffNNNN.dat files
mat.make_input_feff(radius=7, feff_print=[1,0,0,0,0,0])  # old behavior

Old behavior is recoverable by passing feff_print=[1,0,0,0,0,0]

Add feff_print parameter to control FEFF output verbosity for each module
(pot, xsph, fms, paths, genfmt, ff2chi). Default [1,0,0,0,0,3] matches
structure2feff.py behavior. Backwards compatible - users can pass custom
values if needed.
Tests verify:
- Default feff_print produces [1,0,0,0,0,3] (ff2chi=3)
- Custom feff_print values are applied correctly
- Old behavior (ff2chi=0) is recoverable for backwards compatibility
@maurov
Copy link
Member

maurov commented Feb 5, 2026

@hcenge thanks for proposing this improvement. I may merge this, but we are moving all the FEFF/FDMNES input generation to a separate project, Larixite. I have created a task for it #607. In fact, structure2feff and struct2xas are DEPRECATED and will be removed soon from Larch.

Would you be interested in trying Larixite and contribute there?

If yes, please note that larixite.struct2xas, which is a mere copy of larch.xrd.struct2xas should not be used neither. In fact, the idea is to merge the existing code into a common one, as was done for the FDMNES input generation in Larixite. Unfortunately, I did not have the time to do it yet. See Larixite#4.

@newville
Copy link
Member

newville commented Feb 6, 2026

@hcenge @maurov Thanks - I think this would be a very nice addition, and probably best in Larixite.

@hcenge
Copy link
Author

hcenge commented Feb 6, 2026

@newville @maurov Thanks for the feedback and background information, I will have a go at implementing this in Larixite per Issue#4 there.

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

Successfully merging this pull request may close these issues.

3 participants