Changeset 4959 for trunk


Ignore:
Timestamp:
Jun 15, 2021 1:27:03 PM (3 months ago)
Author:
toby
Message:

add NIST spectrum kludge for incident beam mono

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIfpaGUI.py

    r4898 r4959  
    9090    ('mono_src_proj_mn',51,'Projection width of line-focus xray source on the monochromator along beam direction (microns), sets bandwidth'),
    9191    ('passband_shoulder',.087,'Width of transition region from flat top to tails, in units of the bandwidth'),
    92     ('two_theta_mono',27.27,'The full diffraction angle of the IBM crystal, e.g. double 2theta-Bragg for the mono (deg)')]
     92    ('two_theta_mono',27.27,'The full diffraction angle of the IBM crystal, e.g. double 2theta-Bragg for the mono (deg)'),
     93    ('mono_slit_attenuation',0.03,'Attenuation of Cu K alpha2 lines due to focal slit'),
     94    ]
    9395'''Additional FPA dict entries used in :func:`FillParmSizer`, needed for Incident Beam Monochromator
    9496'''
    9597   
    96 Citation = '''MH Mendenhall, K Mullen && JP Cline, 2015, J. Res. of NIST, 120, p223. DOI: 10.6028/jres.120.014
    97 
    98 Incident Beam Mono: MH Mendenhall, D. Black && JP Cline, J. Appl. Cryst., 2019, 52, p1087. DOI: 10.1107/S1600576719010951
     98Citation = '''MH Mendenhall, K Mullen && JP Cline (2015), J. Res. of NIST, 120, p223. DOI: 10.6028/jres.120.014
     99
     100For Incident Beam Mono model, also cite: MH Mendenhall, D. Black && JP Cline, J. Appl. Cryst. (2019), 52, p1087. DOI: 10.1107/S1600576719010951
    99101'''
    100102
     
    115117
    116118def SetCu6wave():
    117     '''Set the parameters to the NIST six-line (4 for incident beam mono)
    118     Cu K alpha spectrum
     119    '''Set the emission parameters to the NIST six-line Cu K alpha spectrum
    119120    '''
    120121    # values from Marcus Mendenhall from atan_windowed_FP_profile.py
     
    416417    source_wavelengths_m = 1.e-10 * np.array([InpParms['wave'][i] for i in keys])
    417418    la = [InpParms['int'][i] for i in keys]
    418     source_intensities = np.array(la)/max(la)
     419 
     420    if IBmono:  # kludge: apply mono_slit_attenuation since it is not part of NIST FPA code
     421        norm = [InpParms['mono_slit_attenuation'] if
     422                    (1.5443 < InpParms['wave'][i] < 1.5447) else 1.
     423                for i in keys]
     424        source_intensities = norm * np.array(la)/max(la)
     425    else:
     426        source_intensities = np.array(la)/max(la)
    419427    source_lor_widths_m = 1.e-10 * 1.e-3 * np.array([InpParms['lwidth'][i] for i in keys])
    420428    source_gauss_widths_m = 1.e-10 * 1.e-3 * np.array([0.001 for i in keys])
     
    614622        ints = list(NISTparms['emission']['emiss_intensities'])
    615623        Lam1 = NISTparms['emission']['emiss_wavelengths'][np.argmax(ints)]*1e10
    616         if len(ints) > 1:
     624        if 'two_theta_mono' in NISTparms['emission']: # is there an IBM?
     625            Lam2 = None   # Yes, ~monochromatic
     626        else:  # get lambda 2
    617627            ints[np.argmax(ints)] = -1
    618628            Lam2 = NISTparms['emission']['emiss_wavelengths'][np.argmax(ints)]*1e10
    619         else:
    620             Lam2 = None
    621629        histId = G2frame.AddSimulatedPowder(ttArr,intArr,
    622630                                       'NIST Fundamental Parameters simulation',
     
    706714    def SetButtonStatus(done=False):
    707715        OKbtn.Enable(bool(NISTparms))
    708         saveBtn.Enable(bool(NISTparms))
     716        #saveBtn.Enable(bool(NISTparms))
    709717        if done: _onOK(None)
    710718    def _onSetFPA(event):
     
    772780    btnsizer.Add(btn)
    773781    btn.Bind(wx.EVT_BUTTON,_onSetFPA)
    774     saveBtn = wx.Button(dlg, wx.ID_ANY,'Save FPA dict')
    775     btnsizer.Add(saveBtn)
    776     saveBtn.Bind(wx.EVT_BUTTON,_onSaveFPA)
     782    #saveBtn = wx.Button(dlg, wx.ID_ANY,'Save FPA dict')
     783    #btnsizer.Add(saveBtn)
     784    #saveBtn.Bind(wx.EVT_BUTTON,_onSaveFPA)
    777785    readBtn = wx.Button(dlg, wx.ID_ANY,'Read FPA dict')
    778786    btnsizer.Add(readBtn)
Note: See TracChangeset for help on using the changeset viewer.