Skip to content

Readable Stream Playground for ESS Neutron Data πŸš€πŸ’Ύ This repository is a sandbox for experimenting with **Readable Streams** in JavaScript. It focuses on processing **CSPEC sample data** from the **ESS Neutron Data Source**, specifically for use in the **DMSC (Data Management and Software Center)** at the **European Spallation Source (ESS)**. T

Notifications You must be signed in to change notification settings

garethcmurphy/Readable-Stream-Playground-for-ESS-CSPEC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Readable Stream Playground for ESS Neutron Data πŸš€πŸ’Ύ

This repository is a sandbox for experimenting with Readable Streams in JavaScript. It focuses on processing CSPEC sample data from the ESS Neutron Data Source, specifically for use in the DMSC (Data Management and Software Center) at the European Spallation Source (ESS). The sandbox includes functionality to stream data and write it to a database.


Features ✨

  • Readable Stream Testing: Experiment with JavaScript streams for handling neutron data.
  • CSPEC Sample Data Integration: Stream and process sample data from the ESS CSPEC instrument.
  • Database Writing: Store processed data in a database for further analysis.

Prerequisites πŸ› οΈ

  • Node.js (14+ recommended).
  • A running database instance (e.g., MongoDB or PostgreSQL).

Installation

  1. Clone the repository:
    git clone https://github.com/your-username/readable-stream-cspec.git
    cd readable-stream-cspec

  2. Install dependencies:
    npm install

  3. Configure database settings in config.js.


Usage πŸ”§

  1. Run the Stream Processor:
    Start the script to process CSPEC data:
    node stream_processor.js

  2. Simulate CSPEC Data:
    Use data_simulator.js to generate sample CSPEC neutron data for testing:
    node data_simulator.js

  3. Write to Database:
    Ensure database settings are correctly configured in config.js. Processed data will be automatically stored in the database.


File Structure πŸ“‚

  • stream_processor.js: Main script for processing CSPEC data using readable streams.
  • data_simulator.js: Simulates CSPEC sample data for testing.
  • config.js: Configuration file for database connections.
  • README.md: Documentation for the repository.

Example Commands

  • Process CSPEC Data:
    node stream_processor.js

  • Simulate Sample Data:
    node data_simulator.js


Customization πŸ”§

  1. Modify Data Simulation: Update data_simulator.js to generate data that matches your specific requirements.
  2. Change Database: Edit config.js to switch between MongoDB, PostgreSQL, or other databases.

Contributing 🀝

  1. Fork the repository.

  2. Create a new branch:
    git checkout -b feature/your-feature

  3. Commit your changes:
    git commit -m "Add your feature"

  4. Push the branch:
    git push origin feature/your-feature

  5. Open a pull request.


License πŸ“

This project is licensed under the MIT License. See the LICENSE file for details.


Experiment with streaming CSPEC neutron data and writing to databases seamlessly! πŸš€πŸ’Ύ

About

Readable Stream Playground for ESS Neutron Data πŸš€πŸ’Ύ This repository is a sandbox for experimenting with **Readable Streams** in JavaScript. It focuses on processing **CSPEC sample data** from the **ESS Neutron Data Source**, specifically for use in the **DMSC (Data Management and Software Center)** at the **European Spallation Source (ESS)**. T

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published