Skip to content

Commit

Permalink
Allow possible Nan wavenumber
Browse files Browse the repository at this point in the history
  • Loading branch information
T.Tian committed Oct 12, 2020
1 parent d847b74 commit 1b963f8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions renishawWiRE/utils.py
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("_")))

0 comments on commit 1b963f8

Please sign in to comment.