Package: npt
NEANIAS Planetary ToolsThis 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 fromsearchreduce: 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 duringreducePDS filesutils: misc utilities (data I/O, formatting, temp files support, etc.)pipelines: ADAM-DPS specific interfaceInstallInstalling the latest stable version on Pypi:$pipinstallnptInstalling a specific version from Github:bash
$ pip install https://github.com/chbrandt/npt/archive/refs/tags/v0.7.2.zipOr, fordevelopers, directly from a local copy of this repository:$gitclonehttps://github.com/chbrandt/npt.git
$cdnpt
$pipinstall-e.PythonWhat's for datasets?:>importnpt>help(npt.datasets)Helponpackagenpt.datasetsinnpt:NAMEnpt.datasets-DatasetsdynamicimportPACKAGECONTENTSFUNCTIONSdescriptors(dataset_id)Returndescriptorssetforgiven'dataset'filters(dataset_id)Returnfilterssetforgiven'dataset'list()Return(sorted)listofavailabledatasetsFILE/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:>importnpt>help(npt.search)Helponpackagenpt.searchinnpt:NAMEnpt.search-QueryUSGS/ODEAPIforimagedataproductsPACKAGECONTENTS_odeFUNCTIONSode(dataset:str,bbox:dict,match:str='intersect',bbox_ref:str='C0')ReturnGeoDataFramewithfounddataproductsasfeaturesInput:-dataset:nameofthedataset(see`npt.datasets`)-bbox:bounding-boxtoqueryoverlappingproducts.Dictionarykeys:minlat,maxlat,westlon,eastlon;Latitude/longitudevaluesrange:(-90:90,-180:180)-match:howtoconsideroverlappingmatchingfootprints.Optionsare:'intersect','contain'-bbox_ref:if'C0'(default),'bbox'longitudesarecenteredat0(-180:180),if'C180','bbox'longitudesarecenteredat180(0:360).DATAlog=<Loggernpt(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():11productsfound>># Print search results>gdfidmissioninst...image_kbyteslabel_urlbrowse_url0PSP_007361_1800_REDMROHIRISE...454599https://hirise.lpl.arizona.edu/PDS/RDR/PSP/ORB...https://hirise.lpl.arizona.edu/PDS/EXTRAS/RDR/...1ESP_023672_1805_REDMROHIRISE...519022https://hirise.lpl.arizona.edu/PDS/RDR/ESP/ORB...https://hirise.lpl.arizona.edu/PDS/EXTRAS/RDR/...2ESP_023817_1800_REDMROHIRISE...219534https://hirise.lpl.arizona.edu/PDS/RDR/ESP/ORB...https://hirise.lpl.arizona.edu/PDS/EXTRAS/RDR/...3ESP_026507_1815_REDMROHIRISE...750494https://hirise.lpl.arizona.edu/PDS/RDR/ESP/ORB...https://hirise.lpl.arizona.edu/PDS/EXTRAS/RDR/...4ESP_029962_1800_REDMROHIRISE...193796https://hirise.lpl.arizona.edu/PDS/RDR/ESP/ORB...https://hirise.lpl.arizona.edu/PDS/EXTRAS/RDR/...5ESP_030463_1800_REDMROHIRISE...799775https://hirise.lpl.arizona.edu/PDS/RDR/ESP/ORB...https://hirise.lpl.arizona.edu/PDS/EXTRAS/RDR/...6ESP_039562_1800_REDMROHIRISE...1400359https://hirise.lpl.arizona.edu/PDS/RDR/ESP/ORB...https://hirise.lpl.arizona.edu/PDS/EXTRAS/RDR/...7ESP_041909_1800_REDMROHIRISE...290510https://hirise.lpl.arizona.edu/PDS/RDR/ESP/ORB...https://hirise.lpl.arizona.edu/PDS/EXTRAS/RDR/...8ESP_042542_1790_REDMROHIRISE...420884https://hirise.lpl.arizona.edu/PDS/RDR/ESP/ORB...https://hirise.lpl.arizona.edu/PDS/EXTRAS/RDR/...9ESP_044876_1800_REDMROHIRISE...390014https://hirise.lpl.arizona.edu/PDS/RDR/ESP/ORB...https://hirise.lpl.arizona.edu/PDS/EXTRAS/RDR/...10ESP_055359_1800_REDMROHIRISE...319407https://hirise.lpl.arizona.edu/PDS/RDR/ESP/ORB...https://hirise.lpl.arizona.edu/PDS/EXTRAS/RDR/...>># Print out first record>gdf.iloc[0]idPSP_007361_1800_REDmissionMROinstHIRISEtypeRDRV11Target_nameMARSFootprints_cross_meridianTrueMap_scale0.5Center_latitude-0.0145Center_longitude0.0069Easternmost_longitude359.989Westernmost_longitude0.0249Minimum_latitude-0.2453Maximum_latitude0.2164Emission_angle0.172712Incidence_angle44.124317Phase_angle43.953009Solar_longitude34.80857Observation_time2008-02-21T00:58:55.081Product_creation_time2010-04-07T02:11:12.000UTC_start_time2008-02-21T00:58:50.835UTC_stop_time2008-02-21T00:58:59.328geometryPOLYGON((0.0797-0.2343,-0.011-0.2453,-0.0...image_urlhttps://hirise.lpl.arizona.edu/PDS/RDR/PSP/ORB...image_kbytes454599label_urlhttps://hirise.lpl.arizona.edu/PDS/RDR/PSP/ORB...browse_urlhttps://hirise.lpl.arizona.edu/PDS/EXTRAS/RDR/...Name:0,dtype:object>/.\