Skip to main content

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

Installing the latest stable version on Pypi:

$ pip install npt

Installing a specific version from Github:

bash
$ pip install https://github.com/chbrandt/npt/archive/refs/tags/v0.7.2.zip

Or, for developers, directly from a local copy of this repository:

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

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

>

/.\

Metadata

Release files for npt 0.8.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for npt 0.8.1
File Size Uploaded
npt-0.8.1.tar.gz 50.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for npt 0.8.1
File Interpreter ABI Platform
npt-0.8.1-py3-none-any.whl Python 3 none any Details

Total release size: 88.8 kB

Release files / npt-0.8.1.tar.gz

Download URL npt-0.8.1.tar.gz
Size 50.2 kB
Tags Source
SHA-256 checksum
How to use checksums
dc16893e184cea17e9a62347e36fe7c7c0b23f08955419a94b91e003a44545c0
BLAKE2b-256 checksum
How to use checksums
c9483f334e770f32e998d4a45388d436c7332ea092eb92d42edede989355090e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.4

Release files / npt-0.8.1-py3-none-any.whl

Download URL npt-0.8.1-py3-none-any.whl
Size 38.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ba32f21211df9202c053e1b2bc1b3423eee01ba5c061b1b616aa393cfcebd53d
BLAKE2b-256 checksum
How to use checksums
9308ae2ab1babb4ca573844298d40e6dc218f28d2da210883bfce6ee4aef6e9c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.4

Release history Release notifications | RSS feed

This release

0.8.1 This release

2 release files

0.8

2 release files

0.7.2

2 release files

0.7.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page