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

WIP - Chi-factor for CO2 #533

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open

WIP - Chi-factor for CO2 #533

wants to merge 5 commits into from

Conversation

erwanp
Copy link
Member

@erwanp erwanp commented Dec 28, 2022

Description

This pull request is to address ...

Fixes #

Comment on lines 1992 to 1995
wV_ij = olivero_1977(wG[l], wL[m]) # FWHM
lineshape = voigt_lineshape(
wbroad_centered, wL[m] / 2, wV_ij / 2, jit=jit
) # FWHM > HWHM
#lineshape = voigt_lineshape(wbroad_centered, wL[m] / 2, wV_ij / 2, jit=jit) # FWHM > HWHM
lineshape = voigt_lineshape_xiFactor(wbroad_centered, wL[m] / 2, wV_ij / 2, xi_factor, jit=jit) # with xi_factor
line_profile_LDM[l][m] = lineshape
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pgokulak It might be possible to avoid rewriting existing code such as voigt_lineshape
For instance :

lineshape = voigt_lineshape(...) # keep the default
lineshape *= self.add_chi_factor(self.input.molecule)  

Where most of the new code is added in add_chi_factor:

def add_chi_factor(molecule, w_centered, wv):
     """molecule, wavenumber array, voigt width"""
    if molecule == 'CO2':
        pressure_mbar = self.input.pressure_mbar
        mole_fraction = self.input.mole_fraction  # note, might be a dictionary if mulitple molecules ? check later
        Tgas = self.input.Tgas
        Tref = self.input.Tref

        xi_factor = get_xiFactor(pressure_mbar*1e-3, mole_fraction, Tgas, Tref)

     # xi_factor correction for pseudo-Lorentzian of Westlye et al.(2022)
        gamma_v = wv/2 # Voigt half-width
        alpha_xi = xi_factor*np.sin(np.pi/xi_factor)/(2*np.pi*gamma_v) # see see Westlye et al. (2022); Eqn(6)
        lineshape_correction = alpha_xi / (1 + abs(w_centered/gamma_v)**xi_factor) # see see Westlye et al. (2022); Eqn(5)

        return lineshape_correction
    else:
        raise NotImplementedError

This would make it easier to maintain the codebase

@erwanp erwanp added the physics involves the physics label Dec 28, 2022
@erwanp erwanp added this to the 0.15 milestone Dec 28, 2022
@erwanp
Copy link
Member Author

erwanp commented Mar 21, 2023

@pgokulak can we proceed towards merging these new additions ?

@pgokulak
Copy link

pgokulak commented Mar 21, 2023 via email

@erwanp erwanp self-assigned this Jul 30, 2023
@@ -1570,7 +1677,12 @@ def _init_w_axis(w_dat, log_p):
lineshape = voigt_lineshape(
wbroad_centered, wL[m] / 2, wV_ij / 2, jit=jit
) # FWHM > HWHM

if self.params.chi_correction == True:
lineshape *= self._add_CO2_chiCorrection(self.input.molecule, wbroad_centered, wV_ij / 2) # CO2 chi-correction
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should add this only if the molecule is CO2.

I can take this one if you want @pgokulak

@minouHub minouHub modified the milestones: 0.15, long term Mar 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
physics involves the physics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants