Exporting SomnoPose Data

Beginning with SomnoPose version 1.2, the “raw” position data used to draw SomnoPose charts can be exported by email in CSV (comma-separated value) format, which can then be directly loaded into many spreadsheet, data analysis, and database applications.

To export data, go to the Charts screen and tap the chart to show the toolbar at the bottom:

Action button on chart toolbar

The leftmost (“action”) toolbar button will bring up a menu that includes two data-export options:

  • Email chart data - To export just the data for the currently-displayed chart
  • Email data for all charts - To export a single file containing all the chart data currently stored in SomnoPose

Data for one eight-hour chart will involve over 14,000 samples (about one every two seconds), so it may take a noticeable time for SomnoPose to prepare the data. Lengthy preparation will be indicated by a progress bar overlaid on the chart. You can cancel the email by swiping right over the progress-bar view and tapping the resulting “Cancel email” button. (The button can instead be dismissed by double-tapping the progress-bar view.)

Progress bar over chart

After SomnoPose has prepared the data, it will present an email composer showing the pre-filled message, with its attached data file. You will need to fill in the addressee(s), and you can edit the email subject and body (e.g., to add notes) before sending the message.

The exported CSV data files contain five columns, but all the essential data is in the first three columns, with the last two columns providing optional time and date information in a more human-readable form.

Here is a very short example of the beginning of a SomnoPose CSV file:

Timestamp,Orientation,Inclination,Time_of_day,Date
329027337.43,121.85,78.30,23:28:57,
329027339.44,114.51,84.75,23:28:59,
329027341.44,131.99,93.92,23:29:01,2011-06-05
329027343.45,118.25,80.36,23:29:03,
329027345.46,114.47,80.18,23:29:05,

The data rows are ordered chronologically, with the earliest samples first. Since samples are saved about every two seconds, a file for an eight-hour session will contain about 14,400 rows, with a file size of about 500 kilobytes. (Although most spreadsheet and database software should be able to load such files, some may have difficulty creating charts that use thousands of data values.)

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 long axis vertical with top end (of the SomnoPose display) up (e.g., user standing), 90 for long axis horizontal (user lying down), 180 for long axis vertical with top end down.
  4. Time_of_day: Time of the data sample as hours, minutes, and seconds, derived from the Timestamp value. 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.