Note: The package requires Python 3.10+, but the standalone
mergeqfilesscript is compatible with Python 3.7+ for deployment on legacy systems (e.g., MicroRider instruments).
Python tools for manipulating Rockland Scientific's Q-files as generated by the ISDP data logger.
- Q-file to NetCDF Conversion: Convert binary Q-files to CF-1.8 compliant NetCDF format
- Header Parsing: Extract metadata, sensor configurations, and timing information
- Data Extraction: Read scalar channels and frequency spectra from binary records
- File Manipulation: Merge, reduce, and inspect Q-files
- Configuration Generation: Create syntactically correct
isdp.cfgfiles - Format Support: Handles Q-file versions 1.2 and 1.3
- Sensor Mapping: Built-in support for 200+ sensor identifier codes
q2netcdf- Translate Q-files into CF-1.8 compliant NetCDF filesQFile- Dump header and data records from Q-filesQHeader- Display header record informationQReduce- Reduce Q-file size by removing recordsmergeqfiles- Merge multiple Q-files (designed for MicroRider/Slocum Glider integration)mkISDPcfg- Generate syntactically correctisdp.cfgconfiguration files
# Display Q-file header information
QHeader data.q
# Convert Q-file to NetCDF
q2netcdf data.q --nc output.nc
# Dump all records from Q-file
QFile data.q --logLevel INFOThe command-line scripts in this package may be installed using pipx:
python3 -m pipx install git+https://github.com/mousebrains/q2netcdfTo update to the latest version:
python3 -m pipx install --force git+https://github.com/mousebrains/q2netcdfgit clone git@github.com:mousebrains/q2netcdf.git
cd q2netcdf
pip install -e .git clone git@github.com:mousebrains/q2netcdf.git
cd q2netcdf
pip install -e ".[dev]"
pytest # Run testsFor deployment on Rockland Scientific MicroRider instruments:
- Transfer src/q2netcdf/mergeqfiles.py and src/q2netcdf/mergeqfiles.cfg to the MicroRider's data directory.
- Dismount the data directory on your host computer.
- Connect to the MicroRider via a serial connection using your favorite terminal emulator at 115,200 baud.
ls datato verify the files are present. This will cause the MicroRider to unmount data from being read-only to the MicroRider and then remount it as read-write. This will typically cause the serial connection to drop then be reestablished. You might have to restart your terminal emulator's connection.mv data/mergeqfiles.py /usr/local/bin/mergeqfilesto install the script as mergeqfiles.- Test with
mergeqfiles --helpto make sure the installation was successful. - You can disconnect the MicroRider's serial connection.
- You should now run a simulation on the Slocum glider to verify Q-files are being uploaded to the science computer's storage as .mri files.
- Diagnostic information is written into the data/mergeqfiles.log file on the MicroRider.
- You can modify data/mergeqfiles.cfg to adjust the information included in the .mri file sent to the glider.
This is designed for integration with TWR's Slocum Glider uRider proglet.
q2netcdf data.q --nc output.nc# Show full header with channel and spectra names
QHeader data.q
# Show condensed header
QHeader data.q --nothing
# Show only configuration
QHeader data.q --channels --spectra --frequencies# Dump all records
QFile data.q
# Limit number of records displayed
QFile data.q --n 10mergeqfiles -o merged.q file1.q file2.q file3.qmkISDPcfg --helpQ-files are binary files containing oceanographic data from Rockland Scientific instruments. The format is documented in Rockland Technical Note TN-054.
- Header Record (0x1729): File version, timestamp, channel/spectra identifiers, frequencies, configuration
- Data Records (0x1657): Timestamped measurements with scalar channels and frequency spectra
- v1.2: Original format with full metadata in each data record
- v1.3: Optimized format with reduced redundancy
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
git clone git@github.com:mousebrains/q2netcdf.git
cd q2netcdf
pip install -e ".[dev]"
pytest # Run tests
ruff check src/ tests/ # Lint
mypy src/ # Type checkTo run a module for testing python3 -m src.q2netcdf.QHeader --help
- CHANGELOG.md - Version history and changes
- CONTRIBUTING.md - Contributor guidelines and development setup
- SECURITY.md - Security policy and vulnerability reporting
- IMPROVEMENTS_APPLIED.md - Recent improvements and updates
- CLAUDE.md - AI assistant guidance for working with this codebase
- Development Documentation - Internal development notes and analysis
See LICENSE file for details.
Pat Welch Email: pat@mousebrains.com
Developed for use with Rockland Scientific oceanographic instruments and the ISDP data logger.