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

Improve code in wl_convert_units.hyperSpec() #70

Open
GegznaV opened this issue Dec 14, 2021 · 1 comment
Open

Improve code in wl_convert_units.hyperSpec() #70

GegznaV opened this issue Dec 14, 2021 · 1 comment

Comments

@GegznaV
Copy link
Member

GegznaV commented Dec 14, 2021

  • switch sentence in the wl_convert_units.hyperSpec() may be replaced with with wl_create_label_from_units(to, on_failure = "pass as-is")

Basing on the lines from R/wl_convert_units.R (see this comment ), this switch sentence:

  x@label$.wavelength <-
    switch(.wl_fix_unit_name(to),
       nm    = expression("Wavelength, nm"),
      invcm = expression(tilde(nu) / cm^-1),
      ev    = expression("Energy / eV"),
      freq  = expression(nu / THz),
      raman = expression(Raman ~ shift / cm^-1),
      to
    )

Could be replaced with:

x@label$.wavelength <- wl_create_label_from_units(to, on_failure = "pass as-is")

The issue is that the default labels would change too.

Related: #69

@bryanhanson
Copy link
Contributor

Spam

@bryanhanson bryanhanson reopened this Feb 14, 2022
@r-hyperspec r-hyperspec deleted a comment Aug 6, 2022
@r-hyperspec r-hyperspec deleted a comment Aug 6, 2022
@GegznaV GegznaV added this to the After 1.0 release milestone Aug 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants