1 {-# LANGUAGE FlexibleInstances #-}
3 {-# LANGUAGE UnicodeSyntax #-}
6 ( ToPyFAICalibArg
(..) ) where
8 import Data
.Text
(unpack
)
9 import Numeric
.Units
.Dimensional
.Prelude
((/~
), nano
, meter
)
11 import Hkl
.Types
( WaveLength
)
12 import Hkl
.Detector
( Detector
)
13 import Hkl
.PyFAI
.Calibrant
( Calibrant
)
14 import Hkl
.PyFAI
.Detector
( toPyFAI
)
16 class ToPyFAICalibArg a
where
17 toPyFAICalibArg ∷ a →
String
19 instance ToPyFAICalibArg
FilePath where
22 instance ToPyFAICalibArg
(Detector a
) where
23 toPyFAICalibArg d
= "-D" ++ unpack
(toPyFAI d
)
25 instance ToPyFAICalibArg Calibrant
where
26 toPyFAICalibArg c
= "-c " ++ show c
28 instance ToPyFAICalibArg WaveLength
where
29 toPyFAICalibArg w
= "-w " ++ show ((w
/~ nano meter
) * 10)