"""From peak energies to the Periodic Table"""

# AUTOGENERATED! DO NOT EDIT! File to edit: ../notebooks/03_moseley-law.ipynb.

# %% auto 0
__all__ = ['moseley_law']

# %% ../notebooks/03_moseley-law.ipynb 11
import numpy as np 

# %% ../notebooks/03_moseley-law.ipynb 12
def moseley_law(E_K_alpha_keV): 
    '''Square root form of Moseley's law. 
    
    Args: 
        E_K_alfa_keV (float or array of floats): K_alpha peak energy in keV 
        
    Example: 
        moseley_law(6.40)
        
    Returns: 
        Z (float or array of floats): predicted atomic number 
        
    ''' 
    Z = 1 + np.sqrt(1000 * E_K_alpha_keV / 10.2) 
    
    return Z 
