Skip to content

USE CASES - getmud module #181

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

Open
yucongalicechen opened this issue May 2, 2025 · 3 comments
Open

USE CASES - getmud module #181

yucongalicechen opened this issue May 2, 2025 · 3 comments

Comments

@yucongalicechen
Copy link
Collaborator

yucongalicechen commented May 2, 2025

Problem

(Replace #166, I'm starting from UC1 again for numbering)

UC1: Compute mu and diameter

  1. User specifies sample composition and energy.
  2. lpp.gm computes mu for a fully dense sample.
  3. lpp.gm returns mu and recommends diameter(s) (e.g., 1mm, 1.5mm, 2mm).

UC2: Compute diameter from target muD

  1. User has sample composition, energy, and packing fraction and a target muD in mind, and wants to check the diameter.
  2. User provides this information to lpp.gm.
  3. lpp.gm returns the target diameter.

UC3: Compute muD from zscan

  1. User has a zscan file, and wants to check muD.
  2. User uploads zscan file to lpp.gm.
  3. lpp.gm returns muD.

UC4: Compute muD theoretically

  1. User specifies sample composition, energy, sample mass density, and diameter.
  2. User provides this information to lpp.gm.
  3. lpp.gm returns muD.

We also need CLI and GUI interface for each UC. They might look like:

  1. labpdfproc getmud compute_mu_and_diameter -s <sample_composition> -e <energy>
  2. labpdfproc getmud compute_diameter_from_mud -s <sample_composition> -e <energy> -p <packing_fraction> -m <target_muD>
  3. labpdfproc getmud compute_mud_from_zscan -z <zscan_file>
  4. labpdfproc getmud compute_theoretical_mud -s <sample_composition> -e <energy> -m <mass_density> -d <diameter>
    (Check feat: getmud UC1 (get_diameter) #184 for a previous implementation of CLI. Check Regolith main.py)

Proposed solution

@yucongalicechen yucongalicechen added this to the 0.3.0 pre-release milestone May 2, 2025
@yucongalicechen yucongalicechen changed the title feat: getmuD UC3 feat: getmuD UC3-4 May 2, 2025
@sbillinge
Copy link
Contributor

sbillinge commented May 2, 2025

[simon edited comment after Yucong edits]: This looks good, though I am not a huge fan of the cli you propose as this is a huge amount of typing at the command line. Can we not decide the method to use at the back end based on the information provided? something like

labpdfproc getmud  -s NaCl -e Mo

NaCl with Mo Kalpha radiation will have a 
     packing fraction    mu
               1.0               0.80
                0.5              0.40
                0.3              0.24
You may consider an optimal capillary of diameter 2 mm, 1.5 mm or 1.0 mm.

or altrernatively

labpdfproc getmud  -z today-scan.xy

Based on your z-scan we compute a muD of 1.37
To obtain plots of the fits please rerun specifying -v for verbose

or altrernatively

labpdfproc getmud  -s NaCl -e 12.36 --mass-density 5.43

NaCl with radiation of energy 12.36 keV and a mass density of 5.43 g/cm3 
will have a   mu of 0.86.
You may consider an optimal capillary of diameter 1.5 mm or 1.0 mm.

We can work on the wording a bit, but something like that seems easier to use?

As well as suggestions for D given composition and energy, the users may want muD after they have loaded their capilllary. If they measured density they can use #2 above, but if they didn't we could offer them:

labpdfproc getmud  -s NaCl -e Mo -d 1

NaCl with Mo Kalpha radiation and a diameter of 1 mm will have
     packing fraction    muD
               1.0               0.80
                0.5              0.40
                0.3              0.24
If you don't know the packing fraction, a reasonable estimate may be 0.5 for a fine powder.

@yucongalicechen yucongalicechen changed the title feat: getmuD UC3-4 USE CASES - getmud module May 14, 2025
This was referenced May 14, 2025
@yucongalicechen
Copy link
Collaborator Author

@sbillinge Could you check the UCs I updated in the top comment based on our conversation today? Thanks. I have closed a few other issues as they were a bit outdated and confusing.

@sbillinge
Copy link
Contributor

One final thought. If it were me I would be a bit lazy and not want to run getmud to get the muD, then have to write it down or remember it and then have to run labpdfproc again to get my corrected data, so we may want to offer this to them:

labpdfproc correct --data-file nacl-100K.xy -s NaCl -e Mo -d 1

and have it compute mud and run the correction. It can assume a packing fraction of 0.5 but allow this to be overwritten?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants