import altiwx import subprocess altiwx.info("Processing NOAA APT data...") output_file = altiwx.filename + ".png" outflag = "" if altiwx.southbound: outflag = "f" command = "aptdec -e " + outflag + " '" + output_file + "' '" + altiwx.input_file + "'" altiwx.debug(command) subprocess.Popen([command], shell=1).wait() altiwx.info("Done processing NOAA APT data!") #Written and tested by Felix-OK9UWU #aptdec software by Xerbo https://github.com/Xerbo/aptdec # Discord #exec(open("scripts/discord.py").read()) #direction = "" #if altiwx.northbound: # direction = "Northbound" #if altiwx.southbound: # direction = "Southbound" #postToDiscord(altiwx.satellite_name + " " + altiwx.downlink_name, 65280, altiwx.elevation, direction, "AVHRR", altiwx.date + " UTC", altiwx.frequency, output_file)
import altiwx import subprocess import os from datetime import datetime # enhencements that should be calculated enh = ["MSA", "HVC", "HVC-precip", "HVCT", "HVCT-precip", "MCIR", "MCIR-precip"] # define tmporary directory to use while calculating - mind the slash at the end tempdir = "/var/ramfs/" gallerydir = "/home/pi/gallery/EasyGallery/photos/" altiwx.info("Processing NOAA APT data...(extended version)") file_name = str(os.path.split(os.path.abspath(altiwx.filename))[1]) altiwx.debug("'" + file_name + "'") # creating a dateobject from the file_name try: datetime_object = datetime.strptime(file_name, "%Y%m%dT%H%M%SZ") except: altiwx.debug("conversion failed") altiwx.debug(datetime_object.strftime("encording started at: %H:%M:%S")) output_file = os.path.split(os.path.abspath(altiwx.filename))[1] command = "cp '" + altiwx.input_file + "' " + tempdir altiwx.debug(command) subprocess.Popen([command], shell=1).wait() wavfile = tempdir + output_file + ".wav" outflag = " -N " if altiwx.southbound:
import altiwx import subprocess import os altiwx.info("Processing METEOR LRPT data...") temp_file = altiwx.filename + ".wav" command = "sox -t raw -e floating-point -b 32 -c 2 -r " + str(altiwx.samplerate) + " '" + altiwx.input_file + "' -t wav -e signed-integer -b 16 -c 2 -r " + str(altiwx.samplerate) + " '" + temp_file + "'" altiwx.debug(command) subprocess.Popen([command], shell=1).wait() lrpt_file = altiwx.filename + ".lrpt" command = "meteor_demod -q -B -s " + str(altiwx.samplerate) + " '" + temp_file + "' -o '" + lrpt_file + "'" altiwx.debug(command) subprocess.Popen([command], shell=1).wait() os.remove(temp_file) output_file = altiwx.filename + ".bmp" command = "medet '" + lrpt_file + "' '" + altiwx.filename + "' -r 65 -g 65 -b 64 > /dev/null" altiwx.debug(command) subprocess.Popen([command], shell=1).wait() corrected_file = altiwx.filename + "_corrected.png" command = "meteor_corrector -o '" + corrected_file + "' '" + output_file + "'" altiwx.debug(command) subprocess.Popen([command], shell=1).wait() corrected_file_png = altiwx.filename + ".png" rotation = "" if altiwx.northbound:
import altiwx import subprocess altiwx.info("Processing METEOR-M 2 LRPT data...") output_file = altiwx.filename + ".bmp" command = "medet '" + altiwx.input_file + "' '" + altiwx.filename + "' -r 65 -g 65 -b 64 > /dev/null" altiwx.debug(command) subprocess.Popen([command], shell=1).wait() altiwx.info("Done processing METEOR-M 2 LRPT data!")
import altiwx import subprocess import os altiwx.info("Processing METEOR-M 2 LRPT data...") output_file = altiwx.filename + ".bmp" output_file = output_file.replace(' ', '\ ') # workingdir = os.path.split(os.path.abspath(altiwx.input_file))[0] command = "medet '" + altiwx.input_file + \ "' '" + altiwx.filename + "' -cd > /dev/null" altiwx.debug(command) subprocess.Popen([command], shell=1).wait() altiwx.info("Done processing METEOR-M 2 LRPT data!") decoded_file = altiwx.filename + ".dec" if os.path.isfile(decoded_file): altiwx.info("File exist with decoded data - continue processing!") command = "medet '" + altiwx.input_file + ".dec' '" + \ altiwx.filename + "' -d -cn > /dev/null" altiwx.debug(command) subprocess.Popen([command], shell=1).wait() altiwx.info("Images created.") for bmpfile in os.listdir(workingdir): if bmpfile.endswith(".bmp"): command = "convert " + bmpfile + " " + \ bmpfile.replace(".bmp", ".png") altiwx.debug(command) subprocess.Popen([command], shell=1).wait() for pngfile in os.listdir(workingdir):