SENSE_CSV(1)

πŸ“¦
version 1.2 Β· 2 versions
, in ubuntu jammy, ubuntu noble

πŸ’– sense_csv β€” the Sense HAT CSV glow-up tool πŸ’–

okay bestie, so this is sense_csv(1) from the sense-emu manual, and it's literally the tool that turns your Sense HAT recording into a CSV file. Why? For debugging or analysis, obviously. It's giving "let me actually look at my data" energy and we're obsessed. πŸŽ€


✨ NAME ✨

sense_csv β€” the Sense HAT CSV conversion tool.

Converts a Sense HAT recording to CSV format, for the purposes of debugging or analysis. no cap, that's the whole job and she does it beautifully πŸ’…


🌸 SYNOPSIS 🌸

sense_csv [-h] [--version] [-q] [-v] [-l FILE] [-P]
          [--timestamp-format TIMESTAMP_FORMAT] [--header] input output

πŸ¦‹ DESCRIPTION πŸ¦‹

Here's the full rundown of every flag, bestie β€” don't skip a single one, they all matter:

  • -h, --help β€” shows this help message and dips out. iconic.
  • --version β€” shows this program's version number and then exits. hello, who are you?
  • -q, --quiet β€” produce less console output. shhh 🀫
  • -v, --verbose β€” produce more console output. tell me EVERYTHING πŸ—£οΈ
  • -l FILE, --log-file FILE β€” log messages go to the file you specify. your receipts, saved.
  • -P, --pdb β€” run under PDB, aka debug mode. main character debugging arc πŸ”₯
  • --timestamp-format FMT β€” the format to use when outputting the record timestamp. default is ISO8601 format, which is "%Y-%m-%dT%H:%M:%S.%f". see strftime(3) for info on valid format parameters. yes, FMT is the placeholder β€” swap in your own vibe.
  • --header β€” if specified, output column headers at the start of the output. name your columns, slay.

🌈 EXAMPLES 🌈

✨ the basic conversion ✨

To convert a recording to CSV, simply run sense_csv with the recorded file as the first filename, and the output CSV file as the second:

$ sense_csv experiment.hat experiment.csv

By default, only the data is output, with the columns defined as follows:

  1. Timestamp β€” the moment in time at which the readings were taken (note that as the Pi lacks a real-time clock, this is likely to be inaccurate unless the clock has been set with NTP). lowkey a little chaotic of the Pi ngl 😭
  2. Pressure β€” the reading from the pressure sensor in hectopascals (hPa).
  3. Temperature β€” the temperature reading from the pressure sensor in degrees celsius (Β°C).
  4. Humidity β€” the reading from the humidity sensor in % humidity.
  5. Temperature β€” the temperature reading from the humidity sensor in degrees celsius (Β°C).
  6. Accelerometer X-axis β€” the acceleration reading along the X-axis of the HAT in g.
  7. Accelerometer Y-axis.
  8. Accelerometer Z-axis.
  9. Gyroscope X-axis β€” the angular rate of change around the X-axis of the HAT in degrees per second.
  10. Gyroscope Y-axis.
  11. Gyroscope Z-axis.
  12. Compass X-axis β€” the magnetometer reading along the X-axis in micro-teslas.
  13. Compass Y-axis.
  14. Compass Z-axis.
  15. Orientation X-axis β€” the computed orientation of the HAT as radians rotation (-Ο€ to +Ο€) about the X-axis.
  16. Orientation Y-axis.
  17. Orientation Z-axis.

πŸŽ€ headers, because we love labels πŸŽ€

If you wish to include column headers as the first row of data, simply specify the --header option:

$ sense_csv --header experiment.hat experiment.csv

πŸ’œ piping, the crossover episode πŸ’œ

If - is specified for either filename, sense_csv will read from stdin, or write to stdout. This can be used in conjunction with other standard command line utilities for all sorts of effects. For example, to produce a CSV file containing only the timestamps, humidity, and accelerometer readings:

$ sense_csv --header experiment.hat - | cut -d, -f1,4,6-8 > experiment.csv
fr fr, that - trick is the moment. chef's kiss 🫢

πŸ‘‘ AUTHOR πŸ‘‘

Raspberry Pi Foundation


2016-2021 Raspberry Pi Foundation


and that's the whole page, bestie πŸ’– this was sense_csv(1), version 1.2, dated Sep 02, 2021 β€” go forth and convert, you absolute icon 🌟

πŸ“¦ where this page comes from