Hello Guest, Welcome to Apnea Board !
As a guest, you are limited to certain areas of the board and there are some features you can't use.
To post a message, you must create a free account using a valid email address.

or Create an Account


New Posts   Today's Posts

OSCAR import of Dreem 2 CSV data
#11
RE: Zeo CSV format, hypnogram import
(10-10-2019, 06:51 AM)slowriter Wrote: It works, except they changed the format overnight. Integers are now self-explanatory text. Am asking them to confirm stability on this. Do we care whether integer or text?

Also, for the record, here's the zeo values:

Code:
0=null, 1=wake, 2=REM, 3=Light, 4=Deep

And result.

In my opinion, it wouldn't matter if they used integers or text, since the values themselves are not quantitative. I'm delighted to see them making changes - it's easy enough for us to accommodate, and certainly better than an unresponsive alternative. 

Great, glad to see it working. Thank you for sharing the screenshots, I was curious what the end result looked like. I'm not sure why my Daily/Overview/Statistics tabs in OSCAR are greyed out. 

Regarding the new values, we can do a map to perform the translation:
Code:
stage_map = {
   "wake": "1",
   "rem": "2",
   "light": "3",
   "deep": "4"
}
stages_in = filter(None, row.get("Hypnogram", "[]")[1:-1].split(','))
stages_out = [stage_map.get(stage.lower()) for stage in stages_in]

I updated the Gist to reflect the above change. I think we'll need to do a test to see the Dreem's behavior when there's no data. I've yet to see a null entry in the Hypnogram. I'm curious if it defaults to WAKE, null, last state, or some mysterious new value.
Post Reply Post Reply



Donate to Apnea Board  
#12
RE: Zeo CSV format, hypnogram import
(10-10-2019, 09:58 AM)fenchurch Wrote: I updated the Gist to reflect the above change. I think we'll need to do a test to see the Dreem's behavior when there's no data. I've yet to see a null entry in the Hypnogram. I'm curious if it defaults to WAKE, null, last state, or some mysterious new value.

My data has no empty values. Checking with the Dreem people and will update when I hear back.
Post Reply Post Reply
#13
RE: Zeo CSV format, hypnogram import
(10-10-2019, 10:11 AM)slowriter Wrote:
(10-10-2019, 09:58 AM)fenchurch Wrote: I updated the Gist to reflect the above change. I think we'll need to do a test to see the Dreem's behavior when there's no data. I've yet to see a null entry in the Hypnogram. I'm curious if it defaults to WAKE, null, last state, or some mysterious new value.

My data has no empty values. Checking with the Dreem people and will update when I hear back.

Answer: Hole?


Quote:by default it's not wake it's a hole if we have no data at all. 
Post Reply Post Reply
#14
RE: Zeo CSV format, hypnogram import
I think it's safe to assume "hole" means "empty" in the set, e.g. "[WAKE,,,,,,Light,...]". I think we can accommodate that by adding an empty string to the map:

Code:
def hypnogram_to_stages(hypnogram):
   stage_map = {
       "": "0",
       "wake": "1",
       "rem": "2",
       "light": "3",
       "deep": "4",
   }
   return [stage_map.get(value.lower()) for value in hypnogram[1:-1].split(',')]

Gist is updated. Interestingly, the app showed that I had gaps in my heart rate set last night, but the hypnograph shows no empty values. This could be explained by some sensors being more sensitive to placement than others, but probably worth confirming.
Post Reply Post Reply



Donate to Apnea Board  
#15
RE: Zeo CSV format, hypnogram import
(10-11-2019, 10:16 AM)fenchurch Wrote: ... Interestingly, the app showed that I had gaps in my heart rate set last night, but the hypnograph shows no empty values. This could be explained by some sensors being more sensitive to placement than others, but probably worth confirming.

I've seen the same thing, and assume as you do. 

Except I was assuming the pulse oximeter would be more straightforward to measure consistently, since it's just a single sensor, on the forehead (no hair to contend with, etc.)

You might check with their support; as you say, to confirm.
Post Reply Post Reply
#16
RE: OSCAR import of Dreem 2 CSV data
Just FYI, I asked a mod to change the title to reflect a broad focus here, so easier for others (including coders) to find this.
Post Reply Post Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  OSCAR Download Question SideSleeper 10 172 8 hours ago
Last Post: DeepBreathing
  Restoring data Oscar to CPAP Greg Schultz 3 62 10-13-2019, 10:28 PM
Last Post: DeepBreathing
  OSCAR data size kongjie 0 47 10-12-2019, 12:23 PM
Last Post: kongjie
  Building OSCAR happydreams 10 315 10-11-2019, 03:31 PM
Last Post: fredex
  Oscar on Ubuntu 18.04 fredex 5 99 10-11-2019, 11:07 AM
Last Post: happydreams
  Oscar Import larrygreg 2 90 10-08-2019, 07:36 AM
Last Post: DeepBreathing
  OSCAR -> InfluxDB -> Grafana omygolly 10 150 10-08-2019, 01:39 AM
Last Post: jaswilliams


New Posts   Today's Posts






About Apnea Board

Apnea Board is an educational web site designed to empower Sleep Apnea patients.