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 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 altiwx.info("Processing METEOR-M 2 LRPT data...") name = os.path.split(os.path.abspath(altiwx.filename))[1] output_file = altiwx.filename + ".bmp" outflag = " -rotate -180 " if altiwx.southbound: outflag = " " useir = "" command = "medet '" + altiwx.input_file + "' '/var/ramfs/" + name + "' -cn -cd " + useir + " > /dev/null" altiwx.debug(command) subprocess.Popen([command], shell=1).wait() command = "rm '" + altiwx.input_file + "'" altiwx.debug(command) subprocess.Popen([command], shell=1).wait() command = "convert /var/ramfs/" + name + ".bmp " + outflag + " /var/ramfs/" + name + ".png" altiwx.debug(command) subprocess.Popen([command], shell=1).wait() command = "rm /var/ramfs/" + name + ".bmp" altiwx.debug(command) subprocess.Popen([command], shell=1).wait() command = "rectify.py /var/ramfs/" + name + ".png /var/ramfs/" + name + "-rect.png" altiwx.debug(command) subprocess.Popen([command], shell=1).wait() command = "telegram-send -i '/var/ramfs/" + name + "-rect.png'"