Skip to main content

A basic CLI to make mosaic vrts using ctx imagery

Project description

Making just ok CTX mosaics since 2018

Circ builds CTX mosaics by reading the CTX image metadata to select images that intersect the bounding box the user provides, and then does some basic filtering and stochastic image reduction to come up with a reasonably minimal list of images that cover the bbox and have low-ish emission angles.

The images used come from ASU Mars Space Flight Facility viewer.mars.asu.edu.

Installation

currently you must have gdal and wget installed and available in your PATH. then download or clone the repo and then run python setup.py install

Usage

Usage:       circ make-vrt MINX MINY MAXX MAXY [NAME] [EM_TOL] [DRY_RUN]
             circ make-vrt --minx MINX --miny MINY --maxx MAXX --maxy MAXY [--name NAME] [--em-tol EM_TOL] [--dry-run DRY_RUN]

Specify a minimum and maximum longitude (minx maxx) and a minimum and maximum latitude (miny maxy). By default the maximum emission angle allowed is 5.0, but this can be reduced to lower values without loosing much spatial coverage if any. Try using the –dry-run flag and different emission angle values to observe how the count in images changes for your bbox.

So to make a ctx mosaic around Gale Crater, after installation simply run:

circ make-vrt 136.0 -7.0 139.5 -3.5 --name gale --em_tol 1.0

This will create a folder called gale in which a bunch of ctx images will be downloaded. Also the emission angle tolerance has been lowered to 1.0 (less than or equal to) The bbox passed in here is a bit larger than is truly needed, so some extra images will be downloaded. If you are running this example it would be worth contracting it by a half to three quarters of a degree for each coordinate.

The VRT image created at the end can then be used directly in applications like QGIS or to construct a merged image (which would take less disk space) using other gdal command line tools like so:

gdal_translate -co COMPRESS=JPEG -co TILED=YES -co COPY_SRC_OVERVIEWS=YES gale.vrt gale_jpeg.tif
gdaladdo -r average --config COMPRESS_OVERVIEW JPEG --config JPEG_QUALITY_OVERVIEW 85 gale_jpeg.tif 2 4 8

To see that we actually saved space, here is the total space the gale folder takes:

du -sh ./gale
5.0G    ./gale

And this is the amount of space the final jpeg compressed tif version has:

du -sh ./gale_jpeg.tif
817M    ./gale

At this point you can delete the vrt and folder of tiffs to save disk space, and use other gdal commands to clip the mosaic to clip the mosaic to the bounding box.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

circ-0.0.1.tar.gz (8.5 MB view details)

Uploaded Source

Built Distribution

circ-0.0.1-py36-none-any.whl (8.7 MB view details)

Uploaded Python 3.6

File details

Details for the file circ-0.0.1.tar.gz.

File metadata

  • Download URL: circ-0.0.1.tar.gz
  • Upload date:
  • Size: 8.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for circ-0.0.1.tar.gz
Algorithm Hash digest
SHA256 6075e370efdac042eff2ecf4368b31ab18f1f4c7f757692b26b4e21b3843a9fc
MD5 af8ef1527c101d84a9719564998b429e
BLAKE2b-256 be3e99b140efe8fb16fef2249a570d63d9c4765e7bae1690489b07bdf50d46ac

See more details on using hashes here.

File details

Details for the file circ-0.0.1-py36-none-any.whl.

File metadata

File hashes

Hashes for circ-0.0.1-py36-none-any.whl
Algorithm Hash digest
SHA256 99c5d2abd6d18e36493ad8443a17391ed879a2c9db088539a7db87375c091fdf
MD5 5c9399053cc3d03b9ca16a350b6ab9b7
BLAKE2b-256 e399760733efc234c026599d44fc43958001e098463511f789eb0b294c648f14

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page