SkillAgentSearch skills...

Fireworks2023

Exploring optical spectra of fireworks, this project employed a telescope, spectral grating, high-speed camera. Aimed at identifying elements and their environmental impacts. The experiment, set in Prague, tested measurement methods, identified challenges, and proposed future enhancements.

Install / Use

/learn @AstroMeters/Fireworks2023

README

Project: Measurement of optical spectras from fireworks

[!NOTE] The first measerument was conducted during the New Year's Eve 2023. Project is currently in early stage of data analysis.

Introduction

Fireworks, while visually stunning, pose significant risks to the environment and human health. They release various chemicals, including heavy metals that can be toxic. This exposure can lead to health issues like respiratory problems and long-term health impacts.

In addition to health risks, fireworks negatively impact air quality. High levels of airborne particles in the air are often recorded after fireworks shows, highlighting their significant effect. Unlike emissions from industrial processes or vehicles, the control over these emissions is limited.

EOSR0916_s

For more details on this issue, refer to these articles:

[!NOTE] This experiment was conducted based on a long-standing interest in the issue of New Year's fireworks in the Europe. It builds on previous measurements of dust particles in the vertical atmospheric profile using ThunderFly drones, the development of the TF-ATMON system for atmospheric measurements, and discussions with meteorologists from CHMI and scientists from the Czech Academy of Sciences.

[!TIP] If you want to view the measured spectra directly, you can view them in this PDF document or separate page in the form of a Fireworks gallery. The results from the analysis will be placed here.

Experiment

Our experiment conducted on New Year's Eve 2023 in Prague aimed to identify elements in fireworks using spectral analysis. The following goal of this experiment was to validate whether optical spectra of fireworks can be measured using this method, we also wanted to know what is needed for such measurements and what kind of results we might expect. Additionally, we wanted identify any issues inherent in this approach and propose potential improvements for future measurements.

The setup was strategically placed in higher floors of tower-building in Prague housing estate for optimal viewing and data capture. We conducted capturing diverse spectra representing different chemical elements used in the publicly-availible fireworks.

Used aparature

EOSR0971

The setup was assembled using equipment available to us, allowing to conduct measurement without the need for purchasing expensive gear. This setup was chosen as "the best", with the idea that it could be simplified for futhure measurement based on this experiences (check observed problems at end of this document).

  • 80/500 ED Telescope: An optical device with an 80 mm lens diameter and 500 mm focal length, optimized for capturing clear, detailed images.
  • Spectral Grating 100 lines/millimeter: Separates light into individual spectral lines for chemical element identification (SA-100).
  • Monochromatic High-Speed Camera: Records 1000-800 frames per second, important for capturing fast-moving pyrotechnic events (Chronos 1.4 monochrome).
  • Tripod: A sturdy tripod under the telescope allowing for quick aiming of the setup.
  • Finder Scope: A device for quickly aiming the telescope.
  • Computer with sufficient storage capacity: The camera produces a large amount of data; a 6-second recording is approximately 7 GB. Data was immediately uploaded via network to the connected computer.

The following images shows the attaching of a diffraction grating to the camera. Grating was screwed to the end of a C-mount to 1.25" barrel adapter. It ensures constant sensor-grating distance within the optical system.

<img src="https://github.com/roman-dvorak/Fireworks2023/assets/5196729/c4ff3cd2-e0c2-44e5-9d8e-66ef24d8ffd8" height="200pt"/> <img src="https://github.com/roman-dvorak/Fireworks2023/assets/5196729/514a96e6-aef7-419b-b3b0-fe0772c6c94e" height="200pt"/>

RAW data availability

The RAW data, totaling around 110GB, are available upon request due to their large size. This data includes complete spectral information captured during the experiment.

You can also view (comprimed) video recordins in this YouTube playlist. .

Data processing

Data

The high-speed Chronos camera, offering various data outputs, was used for the measurements. Most data were saved in RAW12 format, efficiently containing values of two nighbourght pixels in three bytes, minimizing unused space and network data flow. Recordings were immediately stored on a connected computer via NFS, using this efficient RAW format to optimize data storage and transfer time.

Data structure of 12RAW format

[8-bits 1st pixel],[last 4 bits of 1st pixel, first 4 bits of 2nd pixel], [last 8 bits of 2nd pixel]

Images from RAW12 were converted to 16-bit TIFF images using a Python script, making them compatible with many editors like ImageJ. The command used was /pyraw2dng.py -M -w 1280 -l 1024 -p $raw_file $dng_files.

These images were converted to preview videos using FFMPEG (ffmpeg -framerate 60 -i ${VID}/_%06d.tiff -vf "curves=all='0/0 0.1/0.3 1/1'" -codec:v libx264 -crf 18 -pix_fmt yuv420p ${VID}_export.mp4) for fast and seamless viewing of videos. Output of ffmpeg is avialible in the mentioned youtube playlist. During the conversion of RAW frames to video, dark parts of the video were highligted using curves in ffmpeg. Therefore, these videos are not suitable for further analysis.

The RAW 16-bit TIFF images were subsequently used for more precise analysis and processing using Python 3 and the Jupyter Notebook environment.

Processing steps

1. Selecting good frame

The first step in the process involves manually selecting interesting frames. This is done by reviewing the preview videos and finding the corresponding frame in the form of a 16-bit TIFF image exported from the RAW12 format. During this selection, the visibility of individual spectra, their distinctness, correct brightness, and lack of overlap with other spectra or particles are assessed. The focus of the video is also a important aspect to consider.

2. Importing intu jupyter notebook project

The selected frame is then imported into a Jupyter Notebook by providing the absolute path to the image file and asseting this filename into filename variable.

3. Selecting interesting spectrum

Subsequently, interactive sliders are used to select the spectrum of interest. These sliders adjust the position and direction of the line along which the spectrum is calculated. Settings include the starting point (x1, y1) of the line, its angle against the pixel matrix, length of the line, and the width of the area over which the sum of pixel values is calculated in the normal direction to the selected profile.

The selected line is then dynamically visualized over image, including the display of intensity along the chosen profile. obrazek

4. Selecting source position

Next step is to local position of spectra source in frame.

Next interactive slider is utilized to select the position of the zero pixel (the actual source of the spectrum) in the image. The selected position is immediately displayed above the intensity profile as a vertical line, allowing for precise and fast alignment of the spectrum's origin in the image. obrazek

5. Spectrum calculation

In the next step, the pixel position is converted into a wavelength using a predefined calibration. This process results in two graphs. The first graph displays the entire profile with the wavelength in the first order of the spectrum (note that the second order of the spectrum is also visible in the screenshot). The second graph shows only visible part of the spectrum, which is identical across all profiles. obrazek

6. PDF analysis report

In the final step, the exported graphs are saved as .png images, and a PDF report is created, which can be seen in the following image. obrazek

What does the PDF report contain? The title includes the name (including the full path) of the file that was analyzed. The line below it contains the

View on GitHub
GitHub Stars5
CategoryProduct
Updated2y ago
Forks0

Languages

Jupyter Notebook

Security Score

60/100

Audited on Jan 13, 2024

No findings