-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
T.Tian
committed
Oct 12, 2020
1 parent
d847b74
commit 1b963f8
Showing
1 changed file
with
5 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,18 @@ | ||
# Some tiny functions for converting things | ||
from numpy import nan | ||
|
||
|
||
def convert_wl(wn): | ||
"""Convert wavenumber (cm^-1) to nm | ||
""" | ||
wl = 1 / (wn * 1e2) / 1e-9 | ||
try: | ||
wl = 1 / (wn * 1e2) / 1e-9 | ||
except ZeroDivisionError: | ||
wl = nan | ||
return wl | ||
|
||
|
||
def convert_attr_name(s): | ||
"""Convert all underline in string name to space and capitalize | ||
""" | ||
return " ".join(map(str.capitalize, s.strip().split("_"))) | ||
|