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
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
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


Possibly Related Threads...
Thread Author Replies Views Last Post
Question OK TO IMPORT SLEEP DATA FROM OLD SD CARD INTO OSCAR W/O MESSING UP CURRENT DATA? Plmnb 1 79 Today, 01:07 AM
Last Post: Ibrumley
  Rescan app [doesn't see data import] kerm007 3 145 03-24-2024, 10:59 PM
Last Post: srlevine1
  Cannot import data from ResMed Astral 150 to ResScan or OSCAR BreatheEZ 8 2,338 03-16-2024, 10:18 PM
Last Post: PappaJoe
  OSCAR SpO2 CSV import ST Dog 20 2,732 03-15-2024, 05:09 PM
Last Post: capman
  Data Files in an upgrade AlanR 2 86 03-10-2024, 06:45 PM
Last Post: AlanR
  import data from Philips Alice NightOne into OSCAR FHTC 6 267 03-09-2024, 08:36 AM
Last Post: Crimson Nape
  Getting O2 Insight Pro files to OSCAR? SnoozeBest 7 244 02-26-2024, 10:23 PM
Last Post: SnoozeBest


New Posts   Today's Posts


About Apnea Board

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