Skip to content

Commit

Permalink
Merge pull request #44 from aerospaceresearch/Vladyslav_dev
Browse files Browse the repository at this point in the history
Visualization update
  • Loading branch information
7andahalf committed Jun 12, 2019
2 parents f9d32e3 + 9403d29 commit 874ce75
Show file tree
Hide file tree
Showing 301 changed files with 1,030 additions and 598 deletions.
14 changes: 12 additions & 2 deletions directdemod/constants.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
###### Variable settings

import os
import directdemod as demod

MODULE_PATH = os.path.abspath(os.path.join(list(demod.__path__)[0], os.pardir))

## IQ.wav settings
IQ_FREQOFFSET = 30000
IQ_SDRSAMPRATE = 2.048e6
Expand Down Expand Up @@ -28,10 +33,15 @@

## Georeferencer settings
TEMP_TIFF_FILE = "_temp.tif"
TEMP_VRT_FILE = "_vrt.vrt"
DEFAULT_RS = "EPSG:4326"

TLE_NOAA = "../tle/noaa18_June_14_2018.txt"
BORDERS = "../samples/shapes/borders.shp" # should be used in directdemod directory
TLE_NOAA = MODULE_PATH + "/tle/noaa18_June_14_2018.txt"
BORDERS = MODULE_PATH + "/misc/shapes/borders.shp" # should be used in directdemod directory

## MAP
MAP_TEMPLATE = MODULE_PATH + "/misc/map.html"
GLOBE_TEMPLATE = MODULE_PATH + "/misc/globe.html"

###### Do not change these

Expand Down
2 changes: 1 addition & 1 deletion directdemod/decode_noaa.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def angleFromCoordinate(lat1, long1, lat2, long2):
orb = Orbital(satellite, tle_file=tleFile)

im = self.getImageA
im = im[:,85:995]
im = im[:, 85:995]
oim = im[:]

tdelta = int(im.shape[0]/16)
Expand Down
24 changes: 24 additions & 0 deletions directdemod/generate_map.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import os
import argparse

from shutil import copyfile
from directdemod import constants


def main():
"""CLI interface for generating maps for noaa images"""

parser = argparse.ArgumentParser(description="Map generator for NOAA images using gdal2tiles.py")
parser.add_argument("-r", "--raster", required=True, help="Raster for visualization.")
parser.add_argument("-t", "--tms", default="tms", required=False, help="Tms directory name.")

args = parser.parse_args()

os.system("gdal2tiles.py --profile=mercator -z 1-6 -w none " + args.raster + " " + args.tms)

copyfile(constants.MAP_TEMPLATE, args.tms + "/map.html")
copyfile(constants.GLOBE_TEMPLATE, args.tms + "/globe.html")


if __name__ == "__main__":
main()

0 comments on commit 874ce75

Please sign in to comment.