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

any example files for OSCAR CSV import
#1
any example files for OSCAR CSV import
I've tried to import some CSV sleep state data to OSCAR (though dreem and other apps). It doesn't seem to do anything,
I suspect there's something about the format.

I have a .CSV file with POSIXct timestamps Date HH:MM:SS in one column, and state in another.

Does someone have an example CSV file/template that works? Does it just import and automatically add a panel to OSCAR?
Post Reply Post Reply
#2
RE: any example files for OSCAR CSV import
What is the brand name and model of your device? In case you are not familiar with a CSV (Comma Separated Variables), means that each data field is separated by a comma and nothing any further. There isn't any specification as to the type and order of the data. Each manufacturer determines what and how their data is reported. Unless your device matches another manufacturer's format, you will need to reformat your data or write a loader to be included into OSCAR.

- Red
Crimson Nape
Apnea Board Moderator
Project Manager for OSCAR - Open Source CPAP Analysis Reporter
www.ApneaBoard.com
___________________________________
Useful Links -or- When All Else Fails:
The Guide to Understanding OSCAR
OSCAR Chart Organization
Attaching Images and Files on Apnea Board
Apnea Helpful Tips

INFORMATION ON APNEA BOARD FORUMS OR ON APNEABOARD.COM SHOULD NOT BE CONSIDERED AS MEDICAL ADVICE. ALWAYS SEEK THE ADVICE OF A PHYSICIAN BEFORE SEEKING TREATMENT FOR MEDICAL CONDITIONS, INCLUDING SLEEP APNEA. INFORMATION POSTED ON THE APNEA BOARD WEB SITE AND FORUMS ARE PERSONAL OPINION ONLY AND NOT NECESSARILY A STATEMENT OF FACT.
Post Reply Post Reply
#3
RE: any example files for OSCAR CSV import
Device is Apple Watch 8, not that it matters, I process the data myself. My problem is I can't find what OSCAR expects those .CSV formats to be in or include.
I write the .CSV file with one column as I said, POSIXct DateTime as the index and the other the measurement variable, no header. It is the standard CSV format for time series.
I don't know what information those other apps provide (dreem, Zeo, Omni, somnopose) for importing but they request CSV. If I had an example, I could modify the CSV file to match.
Unfortunately, OSCAR does not provide vanilla CSV time series import (index, data), that I can find.
Post Reply Post Reply
#4
RE: any example files for OSCAR CSV import
Look at the loader code for each device that is in OSCAR. It is open source and can be downloaded by anyone. Here is the link to download it: https://gitlab.com/pholy/OSCAR-code

- Red
Crimson Nape
Apnea Board Moderator
Project Manager for OSCAR - Open Source CPAP Analysis Reporter
www.ApneaBoard.com
___________________________________
Useful Links -or- When All Else Fails:
The Guide to Understanding OSCAR
OSCAR Chart Organization
Attaching Images and Files on Apnea Board
Apnea Helpful Tips

INFORMATION ON APNEA BOARD FORUMS OR ON APNEABOARD.COM SHOULD NOT BE CONSIDERED AS MEDICAL ADVICE. ALWAYS SEEK THE ADVICE OF A PHYSICIAN BEFORE SEEKING TREATMENT FOR MEDICAL CONDITIONS, INCLUDING SLEEP APNEA. INFORMATION POSTED ON THE APNEA BOARD WEB SITE AND FORUMS ARE PERSONAL OPINION ONLY AND NOT NECESSARILY A STATEMENT OF FACT.
Post Reply Post Reply
#5
RE: any example files for OSCAR CSV import
   

In case it helps anyone,
1) I've found quite a few older threads asking about this and they didn't have 100% answer, so I know there is interest.
2) I'm not planning to go modify the source code, I don't have a lot of experience with those libraries and development.
3) It is indeed possible to do exactly what I envisioned, which is find an exact csv template that is acceptable to the existing downloader (e.g. somnopose).
4) Given a template or example, you have to follow the format precisely as the original template, but allowing for modifications like timestamps and values.
5) The huge downside, is you are forced to use the precise labels as well. So if you thought to trick it by adding your own sensor data, you are stuck with labels like
Orientation and Inclination.
Other than that though, you can add the plots in!

It would be nice if someone could add examples and templates for the other loaders (I don't see any on the github OSCAR site)
Post Reply Post Reply
#6
RE: any example files for OSCAR CSV import
There are EDF browsers that do what you are asking. EDF is a modified VSV format. The defining info is in the header, including the interval and name or label for the data., with the series following, this is how the ResMed data comes in, but is slightly modified. (EDF +).
Because this is a defined layout a generic loader could be developed, it differs from csv by having a defined header section. Csv has no header info, thus the need for a separate loader that knows the actual data structure.

The issue with EDF is that the data must be loaded in a specific manner.
Post Reply Post Reply
#7
RE: any example files for OSCAR CSV import
I can extract data from any edf and plot the data, it's just that it would have been much, much more convenient to just import a raw csv file with a time series including timestamps, values, and column labels directly into OSCAR's existing platform.

Looking at the OSCAR code, they specifically look for predefined labels and headers, I could probably alter the loader, but there are other areas like having to go inside preference/waveforms and alter them again.

BTW, I could also modify resmed edf to add in external sensor time series, but same with the cvs issue, OSCAR is expecting the series to be labeled a very fixed and limited way. Ultimately, the OSCAR code itself needs modifications to do this.

Another comment for those who are looking into importing .cvs, when the importer says successful and you see no change at all on the charts, it's not because they vanished somewhere, it's because the cvs format and or data is not exactly in the format OSCAR needs. Rather than throw some kind of flag, it says successful, meaning it only imported successfully, not that it imported and can integrate, plot, and align time series successfully with layout.
Post Reply Post Reply
#8
RE: any example files for OSCAR CSV import
"thus the need for a separate loader that knows the actual data structure."

Interesting thanks.

I can get FitBit heart rate data in CSV, and maybe the O2 data thru their API and was wondering what to do with it. Not sure the O2 data would be all that useful because I think the sampling frequency is low. But still.
Post Reply Post Reply
#9
RE: any example files for OSCAR CSV import
(09-21-2023, 02:08 AM)enigmatic Wrote: In case it helps anyone,
1) I've found quite a few older threads asking about this and they didn't have 100% answer, so I know there is interest.
2) I'm not planning to go modify the source code, I don't have a lot of experience with those libraries and development.
3) It is indeed possible to do exactly what I envisioned, which is find an exact csv template that is acceptable to the existing downloader (e.g. somnopose).
4) Given a template or example, you have to follow the format precisely as the original template, but allowing for modifications like timestamps and values.
5) The huge downside, is you are forced to use the precise labels as well. So if you thought to trick it by adding your own sensor data, you are stuck with labels like
Orientation and Inclination.
Other than that though, you can add the plots in!

It would be nice if someone could add examples and templates for the other loaders (I don't see any on the github OSCAR site)

Do you now have an example of a csv template that works --- even if it has to have the labels such as Orientation and Inclination? 
Thanks!
Post Reply Post Reply
#10
RE: any example files for OSCAR CSV import
I know this is an old post, but as I also had difficulty finding this information so I wanted to post an example dreem csv file, see below. Note this file has two lines, the header and the record.

PHP Code:
Start Time;Stop Time;Sleep Onset Duration;Light Sleep Duration;Deep Sleep Duration;REM Duration;Wake After Sleep Onset Duration;Number of awakenings;Sleep efficiency;Hypnogram
2024
-04-20T22:37:00.000;2024-04-21T07:30:30.000;08:53:00;04:38:00;00:59:00;01:26:00;01:50:00;24;96;[WAKE,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,REM,REM,REM,REM,REM,REM,REM,REM,REM,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,Light,Light,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,REM,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Deep,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,Light,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE,WAKE
Post Reply Post Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  O2 import DST > ST 1:14am happened twice dgconder 5 82 11-03-2024, 08:55 PM
Last Post: dgconder
  Oscar Crash to desktop on SP02 import WallyPepper 7 529 11-01-2024, 09:36 PM
Last Post: Crimson Nape
  O2 Insight Files to Oscar channeal 5 216 10-30-2024, 09:31 AM
Last Post: channeal
  Trouble understanding how to import O2 ring info into Oscar katbrat 6 399 10-26-2024, 08:25 PM
Last Post: katbrat
  OSCAR: Questions regarding a potential import for Garmin data littleyoda 2 175 10-19-2024, 10:37 AM
Last Post: littleyoda
Idea Generic import to OSCAR? Oscer? I Ardly Know Er 1 339 10-19-2024, 03:48 AM
Last Post: littleyoda
  Getting O2 Insight Pro files to OSCAR? SnoozeBest 23 1,327 10-02-2024, 10:30 AM
Last Post: rayfes


New Posts   Today's Posts


About Apnea Board

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