<commit_before>#!/usr/bin/env python
#
#   Meteor Decoder Processor
#   <NAME> <<EMAIL>> 2017-09-01
#
#   This script processes soft-bit recordings from wherever satnogs_lrpt_demod puts them,
#   then places them in the satnogs recorded data directory to be uploaded (eventually)
#
#   It is suggested that this script is run with a post-observation script.
#
from glob import glob
import subprocess
import os
import shutil
from time import sleep

# What wildcard string to use when searching for new soft-bit files.
SOURCE_PATH = "/tmp/data*.s"

# Where to place the complete images.
DESTINATION_DIR = "/tmp/.satnogs/data/"
# Where to put the soft-bit files.
RAW_DESTINATION_DIR = "/tmp/.satnogs/data/complete/"

# Locations for temporary files
TEMP_DIR = "/tmp/"
TEMP_FILENAME = "meteor_image_temp"

# Paths to binaries we need. If these binaries are not on $PATH, change the paths below to point to the appropriate place.
MEDET_PATH = "medet_arm"
CONVERT_PATH = "convert"

# medet arguments to produce a composite image, and also each individual channel.
MEDET_ARGS = ['-q', '-S', '-r', '66', '-g', '65', '-b', '64']

# Wait for a bit before processing, to avoid clashing with waterfall processing and running out of RAM.
WAIT_TIME = 120


def cleanup_data(source_file = None):
    """
    Cleanup any temporary files we have created, and optionally the source file.
    """

    # Find temporary files.
    _temp_files = glob(TEMP_DIR + TEMP_FILENAME + "*")
    # Delete them.
    for _file in _temp_files:
        os.remove(_file)

    # Delete the source soft-bit file if we have been passed it.<commit_msg>Switch to only producing composite image. Need to work out how to produce Thermal IR as well...<commit_after>#!/usr/bin/env python
#
#   Meteor Decoder Processor
#   <NAME> <<EMAIL>> 2017-09-01
#
#   This script processes soft-bit recordings from wherever satnogs_lrpt_demod puts them,
#   then places them in the satnogs recorded data directory to be uploaded (eventually)
#
#   It is suggested that this script is run with a post-observation script.
#
from glob import glob
import subprocess
import os
import shutil
from time import sleep

# What wildcard string to use when searching for new soft-bit files.
SOURCE_PATH = "/tmp/data*.s"

# Where to place the complete images.
DESTINATION_DIR = "/tmp/.satnogs/data/"
# Where to put the soft-bit files.
RAW_DESTINATION_DIR = "/tmp/.satnogs/data/complete/"

# Locations for temporary files
TEMP_DIR = "/tmp/"
TEMP_FILENAME = "meteor_image_temp"

# Paths to binaries we need. If these binaries are not on $PATH, change the paths below to point to the appropriate place.
MEDET_PATH = "medet_arm"
CONVERT_PATH = "convert"

# medet arguments to produce a composite image, and also each individual channel.
MEDET_ARGS = ['-q', '-r', '65', '-g', '65', '-b', '64']

# Wait for a bit before processing, to avoid clashing with waterfall processing and running out of RAM.
WAIT_TIME = 120


def cleanup_data(source_file = None):
    """
    Cleanup any temporary files we have created, and optionally the source file.
    """

    # Find temporary files.
    _temp_files = glob(TEMP_DIR + TEMP_FILENAME + "*")
    # Delete them.
    for _file in _temp_files:
        os.remove(_file)

    # Delete the source soft-bit file if we have been passed it.
{'fraction_non_alphanumeric': 0.09206541490006057, 'fraction_numerical': 0.01029678982434888, 'mean_word_length': 3.7662337662337664, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2941596', 'n_tokens_mistral': 1049, 'n_tokens_neox': 997, 'n_words': 412}