import numpy as np
import re


def physical_constants():
    # No need to change this function 

    # Taken from http://www.astro.wisc.edu/~dolan/constants.html

    #--------------------- Physical Constants -------------------------

    Boltz_const_mag       = 1.380658          # Magnitude
    Boltz_const_pow_cgs   = -16               # Power in ergs / K
    Boltz_const_pow_si    = -23               # Power in J / K
    Boltz_const_cgs       = Boltz_const_mag * 10**Boltz_const_pow_cgs
    Boltz_const_si        = Boltz_const_mag * 10**Boltz_const_pow_si
    mass_proton_mag       = 1.6726231    # Magnitude In units of
    mass_proton_pow_cgs   = -24          # Power In units of 10^-24 gm
    mass_proton_pow_si    = -27          # Power In units of 10^-27 Kg
    mass_proton_cgs       = mass_proton_mag * 10**mass_proton_pow_cgs
    mass_proton_si        = mass_proton_mag * 10**mass_proton_pow_si
    mass_neutron_mag      = 1.6749286    # Magnitude In units of
    mass_neutron_pow_cgs  = -24          # Power In units of 10^-24 gm or 10^-27 Kg
    mass_neutron_pow_si   = -27          # Power In units of 10^-24 gm or 10^-27 Kg
    mass_neutron_cgs      = mass_neutron_mag * 10**mass_neutron_pow_cgs
    mass_neutron_si       = mass_neutron_mag * 10**mass_neutron_pow_si
    mass_electron_mag     = 9.1093897    # Magnitude In units of
    mass_electron_pow_cgs = -28          # Power In units of 10^-24 gm or 10^-27 Kg
    mass_electron_pow_si  = -31          # Power In units of 10^-24 gm or 10^-27 Kg
    mass_electron_cgs     = mass_electron_mag * 10**mass_electron_pow_cgs
    mass_electron_si      = mass_electron_mag * 10**mass_electron_pow_si

    h_planck_mag          = 6.6260755   # Magnitude of Planck's Constant
    h_planck_pow_cgs      = -27         # Power In units of 10^-27 erg s
    h_planck_pow_si       = -34         # Power In units of 10^-34 J s
    h_planck_cgs          = h_planck_mag * 10**h_planck_pow_cgs
    h_planck_si           = h_planck_mag * 10**h_planck_pow_si


    cp_by_cv        = 5.0 / 3.0         # Ratio of Specific Heats (Temperature - Internal Energy Conversion)
    mass_proton     = mass_proton_cgs   # In grams taken from http://www.astro.wisc.edu/~dolan/constants.html
    mass_neutron    = mass_neutron_cgs  # In grams taken from http://www.astro.wisc.edu/~dolan/constants.html
    mass_electron   = mass_electron_cgs # In grams taken from http://www.astro.wisc.edu/~dolan/constants.html
    Boltz_const     = Boltz_const_cgs   # In ergs / K taken from http://www.astro.wisc.edu/~dolan/constants.html
    h_planck        = h_planck_cgs      # In erg s taken from http://www.astro.wisc.edu/~dolan/constants.html

    #--------------------- Collect all parameters in phy_const dictonary -------------------------

    phy_const = vars()
    return phy_const
