packages feed

hsignal 0.2.5 → 0.2.6

raw patch · 8 files changed

+34/−14 lines, 8 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

CHANGES view
@@ -121,3 +121,6 @@  0.2.5: 		added hmatrix-gsl dependency for new hmatrix 0.16++0.2.6:+		added BDF(..) export and loadBDFRaw to EEG.BDF
hsignal.cabal view
@@ -1,5 +1,5 @@ Name:               hsignal-Version:            0.2.5+Version:            0.2.6 License:            BSD3 License-file:       LICENSE Copyright:          (c) A.V.H. McPhail 2010, 2011, 2014
lib/Numeric/Signal.hs view
@@ -3,8 +3,8 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Numeric.Signal--- Copyright   :  (c) Alexander Vivian Hugh McPhail 2010--- License     :  GPL-style+-- Copyright   :  (c) Alexander Vivian Hugh McPhail 2010, 2014+-- License     :  BSD3 -- -- Maintainer  :  haskell.vivian.mcphail <at> gmail <dot> com -- Stability   :  provisional
lib/Numeric/Signal/EEG.hs view
@@ -1,8 +1,8 @@ -----------------------------------------------------------------------------
 -- |
 -- Module      :  Numeric.Signal.EEG
--- Copyright   :  (c) Alexander Vivian Hugh McPhail 2010
--- License     :  GPL-style
+-- Copyright   :  (c) Alexander Vivian Hugh McPhail 2010, 2014
+-- License     :  BSD3
 --
 -- Maintainer  :  haskell.vivian.mcphail <at> gmail <dot> com
 -- Stability   :  provisional
lib/Numeric/Signal/EEG/BDF.hs view
@@ -1,8 +1,8 @@ -----------------------------------------------------------------------------
 -- |
 -- Module      :  Numeric.Signal.EEG.BDF
--- Copyright   :  (c) Alexander Vivian Hugh McPhail 2010
--- License     :  GPL-style
+-- Copyright   :  (c) Alexander Vivian Hugh McPhail 2010, 2014
+-- License     :  BSD3
 --
 -- Maintainer  :  haskell.vivian.mcphail <at> gmail <dot> com
 -- Stability   :  provisional
@@ -13,7 +13,9 @@ -----------------------------------------------------------------------------
 
 module Numeric.Signal.EEG.BDF (
-                           loadBDF
+                               BDF(..)
+                              , loadBDFRaw
+                              , loadBDF
                           ) where
 
 import qualified Data.ByteString as BS
@@ -285,6 +287,21 @@              when (not (BS.null bs')) $ do
                   putStrLn "data remaining..."
              return m
+
+-- | Load a BDF data structure
+loadBDFRaw :: FilePath -> IO (Maybe BDF)
+loadBDFRaw fn = do
+  bs <- BS.readFile fn
+  (bdf,bs') <- runStateT readBDF bs
+  m <- case bdf of
+        Just b -> return (Just b)
+        _      -> do
+                  putStrLn "File not read"
+                  return Nothing
+  when (not (BS.null bs')) $ do
+    putStrLn "data remaining..."
+  return m
+
 
 {-
 getDPConversion :: BDF -> [Word32 -> Float]
lib/Numeric/Signal/Internal.hs view
@@ -4,8 +4,8 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Numeric.Signal.Internal--- Copyright   :  (c) Alexander Vivian Hugh McPhail 2010--- License     :  GPL-style+-- Copyright   :  (c) Alexander Vivian Hugh McPhail 2010, 2014+-- License     :  BSD3 -- -- Maintainer  :  haskell.vivian.mcphail <at> gmail <dot> com -- Stability   :  provisional
lib/Numeric/Signal/Multichannel.hs view
@@ -6,8 +6,8 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Numeric.Signal.Multichannel--- Copyright   :  (c) Alexander Vivian Hugh McPhail 2010--- License     :  GPL-style+-- Copyright   :  (c) Alexander Vivian Hugh McPhail 2010, 2014+-- License     :  BSD3 -- -- Maintainer  :  haskell.vivian.mcphail <at> gmail <dot> com -- Stability   :  provisional
lib/Numeric/Signal/Noise.hs view
@@ -6,8 +6,8 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Numeric.Signal.Noise--- Copyright   :  (c) Alexander Vivian Hugh McPhail 2010--- License     :  GPL-style+-- Copyright   :  (c) Alexander Vivian Hugh McPhail 2010, 2014+-- License     :  BSD3 -- -- Maintainer  :  haskell.vivian.mcphail <at> gmail <dot> com -- Stability   :  provisional