Python Tools for Planetary Science
Project description
PlanetaryPy
This will become (part of) the core package of the PlanetaryPy organisation.
Current focus
- Enable finding PDS data by downloading and managing PDS3 index files
- Conversion of these index files to
pandas.DataFrames
for search and filtering
- Conversion of these index files to
- Downloading and local management of PDS3 data as identified via the index files or directly via data/product IDs.
- CTX and HiRISE specific tools
Install
pip install planetarypy
This will pull in these other dependencies and their dependencies:
tomlkit pandas pvl numpy python-dateutil tqdm lxml yarl hirise-tools kalasiris
PDS tools
Look at the Apps
docs to see what pds.apps
exist for easily getting PDS indexes.
The find_index
app is specifically useful when you don't know what index files exist.
So far, the following indexes are supported (but not necessarily all tested within PLPY):
- Cassini
- ISS (all)
- UVIS (all)
- MRO
- CTX EDR
- HiRISE
- EDR, RDR, DTM
- EDR index has a bug (as delivered by the team, reported), where I need to activate an existing fix for it.
- EDR, RDR, DTM
- LRO
- Diviner (DLRE)
- EDR, RDR
- LOLA
- EDR, RDR
- Diviner (DLRE)
More indexes
More indexes of other instruments can be easily added by following the existing structure of what has been copied into your config at ~/.planetarypy_config.toml
.
Please consider submitting a pull request for adding further PDS index files into the config file at its source: https://github.com/michaelaye/nbplanetary/blob/master/planetarypy/data/planetarypy_config.toml
Utils
Find something in Utils
for working with NASA timestamps and a well working URL download function url_retrieve
, among other stuff.
Experiment/Instrument Specific
So far, planetarypy
supports CTX EDR and HiRISE RGB.NOMAP data.
Look at the CTX
and HiRISE
pages for descriptions of classes for working with these data.
Bug reports
Please submit bug reports at https://github.com/michaelaye/nbplanetary/issues
How to use
Indexes
from planetarypy.pds.apps import get_index
ctrindex = get_index("mro.ctx.indexes.edr")
ctrindex.sample(5)
.dataframe tbody tr th {
vertical-align: top;
}
.dataframe thead th {
text-align: right;
}
</style>
VOLUME_ID | FILE_SPECIFICATION_NAME | ORIGINAL_PRODUCT_ID | PRODUCT_ID | IMAGE_TIME | INSTRUMENT_ID | INSTRUMENT_MODE_ID | LINE_SAMPLES | LINES | SPATIAL_SUMMING | ... | SUB_SOLAR_LATITUDE | SUB_SPACECRAFT_LONGITUDE | SUB_SPACECRAFT_LATITUDE | SOLAR_DISTANCE | SOLAR_LONGITUDE | LOCAL_TIME | IMAGE_SKEW_ANGLE | RATIONALE_DESC | DATA_QUALITY_DESC | ORBIT_NUMBER | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
75900 | MROX_2455 | DATA/F20_043687_1325_XN_47S294W.IMG | 4A_04_10DC014000 | F20_043687_1325_XN_47S294W | 2015-11-21 14:14:36.567 | CTX | NIFL | 5056 | 24576 | 1 | ... | 24.04 | 294.73 | -47.57 | 249238218.9 | 71.38 | 15.21 | 89.2 | Hellas Planitia | OK | 43687 |
40726 | MROX_1392 | DATA/G14_023794_1798_XN_00S092W.IMG | 4A_04_1076020900 | G14_023794_1798_XN_00S092W | 2011-08-24 13:13:49.110 | CTX | NIFL | 5056 | 43008 | 1 | ... | -4.36 | 91.79 | -0.23 | 229203270.8 | 349.83 | 14.16 | 90.4 | Terrain north of Tithonium Chasma | OK | 23794 |
5325 | MROX_0205 | DATA/P11_005346_1735_XI_06S063W.IMG | 4A_04_1019013500 | P11_005346_1735_XI_06S063W | 2007-09-17 00:20:29.319 | CTX | ITL | 5056 | 52224 | 1 | ... | -17.67 | 63.21 | -6.51 | 217090580.2 | 315.16 | 14.26 | 90.2 | West Juventae Chasma and Ophir Planum | OK | 5346 |
114845 | MROX_3635 | DATA/N05_064486_1481_XN_31S039W.IMG | 4A_04_1146024F00 | N05_064486_1481_XN_31S039W | 2020-04-29 06:06:04.787 | CTX | NIFL | 3776 | 8192 | 1 | ... | -5.07 | 39.72 | -32.00 | 215654598.6 | 191.85 | 15.94 | 90.1 | Crater north of Argyre | OK | 64486 |
44851 | MROX_1524 | DATA/G20_026030_1390_XN_41S290W.IMG | 4A_04_108201CF00 | G20_026030_1390_XN_41S290W | 2012-02-14 18:31:34.526 | CTX | NIFL | 3776 | 21504 | 1 | ... | 23.91 | 290.76 | -41.05 | 249226043.2 | 70.55 | 15.23 | 90.2 | Hellas Planitia | OK | 26030 |
5 rows × 51 columns
hirise_rdr = get_index("mro.hirise.indexes.rdr")
hirise_rdr.sample(5)
.dataframe tbody tr th {
vertical-align: top;
}
.dataframe thead th {
text-align: right;
}
</style>
VOLUME_ID | FILE_NAME_SPECIFICATION | INSTRUMENT_HOST_ID | INSTRUMENT_ID | OBSERVATION_ID | PRODUCT_ID | PRODUCT_VERSION_ID | TARGET_NAME | ORBIT_NUMBER | MISSION_PHASE_NAME | ... | LINE_PROJECTION_OFFSET | SAMPLE_PROJECTION_OFFSET | CORNER1_LATITUDE | CORNER1_LONGITUDE | CORNER2_LATITUDE | CORNER2_LONGITUDE | CORNER3_LATITUDE | CORNER3_LONGITUDE | CORNER4_LATITUDE | CORNER4_LONGITUDE | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
124314 | MROHR_0001 | RDR/ESP/ORB_062500_062599/ESP_062586_1840/ESP_... | MRO | HIRISE | ESP_062586_1840 | ESP_062586_1840_RED | 1 | MARS | 62586 | Extended Science Phase | ... | 493636.5 | -20081462.0 | 3.9142 | 349.5270 | 3.9017 | 349.4270 | 4.1513 | 349.3930 | 4.1640 | 349.4940 |
112358 | MROHR_0001 | RDR/ESP/ORB_056900_056999/ESP_056945_1090/ESP_... | MRO | HIRISE | ESP_056945_1090 | ESP_056945_1090_COLOR | 1 | MARS | 56945 | Extended Science Phase | ... | 405073.5 | 2258479.5 | -71.0468 | 280.3410 | -71.0497 | 280.2890 | -70.7174 | 280.1170 | -70.7146 | 280.1680 |
23249 | MROHR_0001 | RDR/ESP/ORB_015900_015999/ESP_015916_1640/ESP_... | MRO | HIRISE | ESP_015916_1640 | ESP_015916_1640_RED | 1 | MARS | 15916 | Extended Science Phase | ... | -3691490.0 | 24911000.0 | -15.9461 | 71.3223 | -15.9568 | 71.2317 | -15.5863 | 71.1847 | -15.5756 | 71.2753 |
126778 | MROHR_0001 | RDR/ESP/ORB_064500_064599/ESP_064551_1745/ESP_... | MRO | HIRISE | ESP_064551_1745 | ESP_064551_1745_RED | 1 | MARS | 64551 | Extended Science Phase | ... | -1267461.5 | -38647224.0 | -5.4864 | 343.7370 | -5.4974 | 343.6490 | -5.3569 | 343.6310 | -5.3460 | 343.7190 |
27793 | MROHR_0001 | RDR/ESP/ORB_017100_017199/ESP_017182_1380/ESP_... | MRO | HIRISE | ESP_017182_1380 | ESP_017182_1380_COLOR | 1 | MARS | 17182 | Extended Science Phase | ... | -4928590.0 | 9843080.0 | -42.0208 | 71.4254 | -42.0228 | 71.4017 | -41.6764 | 71.3470 | -41.6743 | 71.3705 |
5 rows × 54 columns
Instrument tools
CTX
from planetarypy.ctx import CTXEDR
pid = ctrindex.sample().squeeze().PRODUCT_ID
pid
'P15_007095_2017_XI_21N299W'
ctxedr = CTXEDR(pid)
ctxedr.local_path
PosixPath('/home/maye/big_drive/planetary_data/mro/ctx/edr/MROX_0403/P15_007095_2017_XI_21N299W/P15_007095_2017_XI_21N299W.IMG')
ctxedr
PRODUCT_ID: P15_007095_2017_XI_21N299W
URL: https://pds-imaging.jpl.nasa.gov/data/mro/mars_reconnaissance_orbiter/ctx/mrox_0403/data/P15_007095_2017_XI_21N299W.IMG
Local: /home/maye/big_drive/planetary_data/mro/ctx/edr/MROX_0403/P15_007095_2017_XI_21N299W/P15_007095_2017_XI_21N299W.IMG
Not downloaded yet.
ctxedr.download()
ctxedr
PRODUCT_ID: P15_007095_2017_XI_21N299W
URL: https://pds-imaging.jpl.nasa.gov/data/mro/mars_reconnaissance_orbiter/ctx/mrox_0403/data/P15_007095_2017_XI_21N299W.IMG
Local: /home/maye/big_drive/planetary_data/mro/ctx/edr/MROX_0403/P15_007095_2017_XI_21N299W/P15_007095_2017_XI_21N299W.IMG
Shape: (1, 35840, 5056)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for planetarypy-0.14.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1fcc17bcd2659fb26a65f4f29da87971181ae77905c0a6981b851650313b70f |
|
MD5 | 976288066c22625da2e66f4143b609e7 |
|
BLAKE2b-256 | 5f728d63b5950a12321e0f1b65146fd4ecf8ab543986f75db603143f96d4f881 |