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
#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
#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
#17
RE: OSCAR import of Dreem 2 CSV data
While they don't yet, I'm hoping Dreem in time will export the position data. 

Here's info on the somnopose format that OSCAR supports, for possible future reference (though yes, ideally, at some point OSCAR supports importing Dreem CSV directly).

http://www.proximalbox.com/somnopose/help/export.html

To quote key part about the columns:

Quote:The data columns are as follows:
  1. Timestamp: Time and date of the data sample (as seconds since the first instant of 1 January 2001, GMT)
  2. Orientation: Sleep position, represented by side-to-side angle of the device in degrees, -180 to 180. Zero for face up, positive values for facing right, negative values for facing left.
  3. Inclination: Upright angle of the device (and user) in degrees, 0 to 180. Zero for an upright position (e.g., user standing), 90 for a horizonal position (user lying down), 180 for the unlikely upside-down situation.
  4. Time_of_day: Time of the data sample as hours, minutes, and seconds, derived from the Timestamp value, using the device's time zone setting. It gives no additional information, but is provided in a human-readable format for convenient reference.
  5. Date: Date of the data sample as year, month and day, derived from the Timestamp value. It gives no additional information, but is provided in a human-readable format for convenient reference. To reduce file size, this is not included in every row.
Post Reply Post Reply
#18
RE: OSCAR import of Dreem 2 CSV data
I am new to using OSCAR.  I had a CPAP, and used SleepyHead.  Anyway, that's not why I am here. I have a Dreem2, have the original CSV data, and the script to change it to the dreem csv to oscar zeo, but how do I get the program to import that data?  I did see the "Data" at the top and tried to Import Zeo Data but it didn't do anything.  Is there something I am missing?  Do I need to import some old CPAP data first?

Using Windows 10, OSCAR  v1.0.1-r-1 (is there a newer update?)
Post Reply Post Reply
#19
RE: OSCAR import of Dreem 2 CSV data
Sorry if a dumb question, but did you actually convert the csv data before importing?
Post Reply Post Reply
#20
RE: OSCAR import of Dreem 2 CSV data
Np!  Yes. After learning where to put the conversion file and the csv file so it would convert. Then a second file showed up with the new file name. Even opened and they do look different.
Post Reply Post Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  OSCAR SpO2 CSV import ST Dog 22 3,049 04-14-2024, 01:49 PM
Last Post: ElectricalPaul
  Oscar "No Supported Data Found" Resmed Airsense 11 cpapmj 3 74 04-13-2024, 10:21 PM
Last Post: Crimson Nape
  Fitbit import to OSCAR ExtremeDeepSleep 4 133 04-11-2024, 07:34 AM
Last Post: ExtremeDeepSleep
  OSCAR import of Viatom/Wellue data - DST time base SleeperAwake21 5 917 03-30-2024, 02:21 PM
Last Post: dfunk
  OSCAR not recognising SD card data from BMC alid 7 262 03-30-2024, 12:44 AM
Last Post: alid
Question OK TO IMPORT SLEEP DATA FROM OLD SD CARD INTO OSCAR W/O MESSING UP CURRENT DATA? Plmnb 3 233 03-29-2024, 11:02 AM
Last Post: Plmnb
  Uploading Wellue O2 Ring Data to Oscar ggs5 9 880 03-29-2024, 08:52 AM
Last Post: StuartC


New Posts   Today's Posts


About Apnea Board

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