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

feat: Multi-polarization anisotropy in RSoXS module #2

Open
pbeaucage opened this issue Jan 30, 2021 · 1 comment · May be fixed by #96
Open

feat: Multi-polarization anisotropy in RSoXS module #2

pbeaucage opened this issue Jan 30, 2021 · 1 comment · May be fixed by #96
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@pbeaucage
Copy link
Collaborator

Implement handling of multiple polarizations... template following this code from Eliot, but is this the best way to do this? something something spherical harmonics?

// use the parallel and perpindicular waves to calculate A (anisotropy) for each polarization, then average as possible to create a single A

	if(waveexists(parah) &&waveexists(perph))
		make /o/n=1000 $cleanupname(basename+"_Ah",1), $cleanupname(basename+"_Ahx",1)
		wave Ah = $cleanupname(basename+"_Ah",1)
		wave Ahx = $cleanupname(basename+"_Ahx",1)
		minq=max(wavemin(parahx),wavemin(perphx))
		maxq = min(wavemax(parahx),wavemax(perphx))
		setscale /i x,minq,maxq, Ah, Ahx
		Ahx = x
		Ah = (interp(Ahx,parahx,parah) - interp(Ahx,perphx,perph))/(interp(Ahx,parahx,parah) + interp(Ahx,perphx,perph))
		duplicate /o Ah,  $cleanupname(basename+"_A",1)
		duplicate /o Ahx, $cleanupname(basename+"_Ax",1)
		wave A = $cleanupname(basename+"_A",1)
		wave Ax = $cleanupname(basename+"_Ax",1)
	endif
	if(waveexists(parav) && waveexists(perpv))
		make /o/n=1000 $cleanupname(basename+"_Av",1), $cleanupname(basename+"_Avx",1)
		wave Av = $cleanupname(basename+"_Av",1)
		wave Avx = $cleanupname(basename+"_Avx",1)
		minq=max(wavemin(paravx),wavemin(perpvx))
		maxq = min(wavemax(paravx),wavemax(perpvx))
		setscale /i x,minq,maxq, Av, Avx
		Avx = x
		Av = (interp(Avx,paravx,parav) - interp(Avx,perpvx,perpv))/(interp(Avx,paravx,parav) + interp(Avx,perpvx,perpv))
		if(waveexists(A))
			minq=min(wavemin(Avx),wavemin(Ahx))
			maxq=max(wavemax(Avx),wavemax(Ahx))
			setscale /i x,minq,maxq, A,Ax
			Ax=x
			A = x>=wavemin(Avx) && x<=wavemax(Avx) ? interp(x,Avx,Av) : 0
			A+=x>=wavemin(Ahx) && x<=wavemax(Ahx) ? interp(x,Ahx,Ah) : 0
			A /= x>=wavemin(Ahx) && x<=wavemax(Ahx) && x>=wavemin(Avx) && x<=wavemax(Avx) ? 2 : 1
		else
			duplicate /o Av,$cleanupname(basename+"_A",1)
			duplicate /o Avx,$cleanupname(basename+"_Ax",1)
			wave A = $cleanupname(basename+"_A",1)
			wave Ax = $cleanupname(basename+"_Ax",1)
		endif
	endif
@pbeaucage pbeaucage self-assigned this Jan 30, 2021
@pbeaucage
Copy link
Collaborator Author

pbeaucage commented Jul 16, 2021

This was partially addressed in 545558f

Needs that remain:

  • offer a canned option to normalize by the intensity at some known, non-resonant energy (for density scatter)
  • warn if one polarization is systematically lower/higher than the other
  • eventually, a spherical harmonics based approach would be really cool. (this is non-blocking).

pbeaucage added a commit that referenced this issue Jul 27, 2021
@pbeaucage pbeaucage added the documentation Improvements or additions to documentation label Jun 1, 2022
pbeaucage pushed a commit that referenced this issue May 6, 2024
Modify GIWAXS to PGGeneralIntegrator and restructure to use integrator machinery
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant