Skip to main content

NEANIAS Planetary Tools

Project description

NEANIAS Planetary Tools

This Python library provides the data/metadata processing tools running in NEANIAS/MEEO backend planetary data store. We are handling data provided by NASA/USGS Planetary Data System (PDS).

Main tools:

  • search: query PDS' Orbital Data Explorer (ODE) using a bounding-box or a Product-ID.
  • download: download data and metadata files from search
  • reduce: process data from ODE to our data storing level (science-ready, GeoTIFF)
  • mosaic: provide different functions for spatial mosaic'ing (GDAL, Rasterio, xarray)

General tools:

  • isis: ISIS utilities, primarily used during reduce PDS files
  • utils: misc utilities (data I/O, formatting, temp files support, etc.)
  • pipelines: ADAM-DPS specific interface

Install

You can a package URL with pip, the latest NPT release for instance. Installing version 0.6.3:

$ pip install https://github.com/chbrandt/npt/archive/refs/tags/v0.6.3.tar.gz

Python

  • What's for datasets?:
> import npt
> help(npt.datasets)

Help on package npt.datasets in npt:

NAME
    npt.datasets - Datasets dynamic import

PACKAGE CONTENTS


FUNCTIONS
    descriptors(dataset_id)
        Return descriptors set for given 'dataset'

    filters(dataset_id)
        Return filters set for given 'dataset'

    list()
        Return (sorted) list of available datasets

FILE
    /home/chbrandt/lib/npt/npt/datasets/__init__.py

>
  • List the available datasets:
> npt.datasets.list()

['mars/mex/hrsc/rdrv3',
 'mars/mex/hrsc/refdr3',
 'mars/mro/ctx/edr',
 'mars/mro/hirise/rdrv11']
>
  • How to search for data products for a given dataset:
> import npt
> help(npt.search)

Help on package npt.search in npt:

NAME
    npt.search - Query USGS/ODE API for image data products

PACKAGE CONTENTS
    _ode

FUNCTIONS
    ode(dataset: str, bbox: dict, match: str = 'intersect', bbox_ref: str = 'C0')
        Return GeoDataFrame with found data products as features

        Input:
        - dataset: name of the dataset (see `npt.datasets`)
        - bbox: bounding-box to query overlapping products.
                Dictionary keys: minlat, maxlat, westlon, eastlon;
                Latitude/longitude values range: (-90:90, -180:180)
        - match: how to consider overlapping matching footprints.
                 Options are: 'intersect', 'contain'
        - bbox_ref: if 'C0' (default), 'bbox' longitudes are centered at 0 (-180:180),
                    if 'C180', 'bbox' longitudes are centered at 180 (0:360).

DATA
    log = <Logger npt (INFO)>

FILE
    /home/chbrandt/lib/npt/npt/search/__init__.py

>
  • Search HiRISE, for example:
> # Define the dataset and region to query for images
> dataset = 'mars/mro/hirise/rdrv11'
> bbox = dict(
    westlon = -1,
    eastlon = 1,
    minlat = -1,
    maxlat = 1
  )
> # Search ODE
> gdf = npt.search.ode(dataset, bbox)
INFO:_ode.parse(): 11 products found
>
> # Print search results
> gdf
id mission    inst  ... image_kbytes                                          label_url                                         browse_url
0   PSP_007361_1800_RED     MRO  HIRISE  ...       454599  https://hirise.lpl.arizona.edu/PDS/RDR/PSP/ORB...  https://hirise.lpl.arizona.edu/PDS/EXTRAS/RDR/...
1   ESP_023672_1805_RED     MRO  HIRISE  ...       519022  https://hirise.lpl.arizona.edu/PDS/RDR/ESP/ORB...  https://hirise.lpl.arizona.edu/PDS/EXTRAS/RDR/...
2   ESP_023817_1800_RED     MRO  HIRISE  ...       219534  https://hirise.lpl.arizona.edu/PDS/RDR/ESP/ORB...  https://hirise.lpl.arizona.edu/PDS/EXTRAS/RDR/...
3   ESP_026507_1815_RED     MRO  HIRISE  ...       750494  https://hirise.lpl.arizona.edu/PDS/RDR/ESP/ORB...  https://hirise.lpl.arizona.edu/PDS/EXTRAS/RDR/...
4   ESP_029962_1800_RED     MRO  HIRISE  ...       193796  https://hirise.lpl.arizona.edu/PDS/RDR/ESP/ORB...  https://hirise.lpl.arizona.edu/PDS/EXTRAS/RDR/...
5   ESP_030463_1800_RED     MRO  HIRISE  ...       799775  https://hirise.lpl.arizona.edu/PDS/RDR/ESP/ORB...  https://hirise.lpl.arizona.edu/PDS/EXTRAS/RDR/...
6   ESP_039562_1800_RED     MRO  HIRISE  ...      1400359  https://hirise.lpl.arizona.edu/PDS/RDR/ESP/ORB...  https://hirise.lpl.arizona.edu/PDS/EXTRAS/RDR/...
7   ESP_041909_1800_RED     MRO  HIRISE  ...       290510  https://hirise.lpl.arizona.edu/PDS/RDR/ESP/ORB...  https://hirise.lpl.arizona.edu/PDS/EXTRAS/RDR/...
8   ESP_042542_1790_RED     MRO  HIRISE  ...       420884  https://hirise.lpl.arizona.edu/PDS/RDR/ESP/ORB...  https://hirise.lpl.arizona.edu/PDS/EXTRAS/RDR/...
9   ESP_044876_1800_RED     MRO  HIRISE  ...       390014  https://hirise.lpl.arizona.edu/PDS/RDR/ESP/ORB...  https://hirise.lpl.arizona.edu/PDS/EXTRAS/RDR/...
10  ESP_055359_1800_RED     MRO  HIRISE  ...       319407  https://hirise.lpl.arizona.edu/PDS/RDR/ESP/ORB...  https://hirise.lpl.arizona.edu/PDS/EXTRAS/RDR/...
>
> # Print out first record
> gdf.iloc[0]
id                                                         PSP_007361_1800_RED
mission                                                                    MRO
inst                                                                    HIRISE
type                                                                    RDRV11
Target_name                                                               MARS
Footprints_cross_meridian                                                 True
Map_scale                                                                  0.5
Center_latitude                                                        -0.0145
Center_longitude                                                        0.0069
Easternmost_longitude                                                  359.989
Westernmost_longitude                                                   0.0249
Minimum_latitude                                                       -0.2453
Maximum_latitude                                                        0.2164
Emission_angle                                                        0.172712
Incidence_angle                                                      44.124317
Phase_angle                                                          43.953009
Solar_longitude                                                       34.80857
Observation_time                                       2008-02-21T00:58:55.081
Product_creation_time                                  2010-04-07T02:11:12.000
UTC_start_time                                         2008-02-21T00:58:50.835
UTC_stop_time                                          2008-02-21T00:58:59.328
geometry                     POLYGON ((0.0797 -0.2343, -0.011 -0.2453, -0.0...
image_url                    https://hirise.lpl.arizona.edu/PDS/RDR/PSP/ORB...
image_kbytes                                                            454599
label_url                    https://hirise.lpl.arizona.edu/PDS/RDR/PSP/ORB...
browse_url                   https://hirise.lpl.arizona.edu/PDS/EXTRAS/RDR/...
Name: 0, dtype: object

>

Developers

To install NPT in devel mode:

$ git clone https://github.com/chbrandt/npt.git
$ cd npt
$ pip install -e .

/.\

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

npt-0.7.2.tar.gz (50.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

npt-0.7.2-py3-none-any.whl (38.2 kB view details)

Uploaded Python 3

File details

Details for the file npt-0.7.2.tar.gz.

File metadata

  • Download URL: npt-0.7.2.tar.gz
  • Upload date:
  • Size: 50.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for npt-0.7.2.tar.gz
Algorithm Hash digest
SHA256 145b13f7bae51671e2e3047672205fdc58db119f70d7766098dc4d1a876bf4c7
MD5 eda7eb7553ad83c32616289e5adb8a3f
BLAKE2b-256 bf39e692673bffe54106f27363eb8207bb2368ec6f92e689574835fab2f272c3

See more details on using hashes here.

File details

Details for the file npt-0.7.2-py3-none-any.whl.

File metadata

  • Download URL: npt-0.7.2-py3-none-any.whl
  • Upload date:
  • Size: 38.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for npt-0.7.2-py3-none-any.whl
Algorithm Hash digest
SHA256 98e77d53a29f0b9686cc291676116daed96546230ff9e21e403e2fac4a89eedb
MD5 ed1bd3eec0effc752a996dacdfa71b25
BLAKE2b-256 8f377759d2d011d8f741a2b06cc4742c4636c692b9b247e47d10a2d2ecdf7ff2

See more details on using hashes here.

Supported by

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