<jupyter_start><jupyter_text>Instructions* pip install planetpyI wrote highly generalized PDS index readers, that wrap the Python Parameter Value Language module PVL (The syntax for Planetary Data System label files). Relevant functions are in https://github.com/michaelaye/planetpy/blob/master/planetpy/pdstools.pyBut possibly it's more efficient that you just quickly parse the specific data files yourself:Download cumulative RDR index and label file here: * http://hirise-pds.lpl.arizona.edu/PDS/INDEX/RDRCUMINDEX.LBL * http://hirise-pds.lpl.arizona.edu/PDS/INDEX/RDRCUMINDEX.TABThe label file has the column names for the .TAB file, but in PVL format.The .TAB file is a fixed format text file.You can read out the column names and the column specification (i.e. start and end byte for each column) below, in case you can feed them to a Ruby text parser.<jupyter_code>from planetpy import pdstools as pds<jupyter_output><empty_output><jupyter_text>replace local file names here:<jupyter_code>labelfname = '/Users/klay6683/Dropbox/data/hirise/index/RDRCUMINDEX.LBL'
tablefname = '/Users/klay6683/Dropbox/data/hirise/index/RDRCUMINDEX.TAB'
label = pds.IndexLabel(labelfname)
label.colnames
label.colspecs
label.index_path
df = label.read_index_data()
df.info()<jupyter_output><class 'pandas.core.frame.DataFrame'>
RangeIndex: 92758 entries, 0 to 92757
Data columns (total 54 columns):
VOLUME_ID                       92758 non-null object
FILE_NAME_SPECIFICATION         92758 non-null object
INSTRUMENT_HOST_ID              92758 non-null object
INSTRUMENT_ID                   92758 non-null object
OBSERVATION_ID                  92758 non-null object
PRODUCT_ID                      92758 non-null object
PRODUCT_VERSION_ID              92758 non-null int64
TARGET_NAME                     92758 non-null object
ORBIT_NUMBER                    92758 non-null int64
MISSION_PHASE_NAME              92758 non-null object
RATIONALE_DESC                  92758 non-null object
OBSERVATION_START_TIME          92758 non-null object
OBSERVATION_START_COUNT         92758 non-null object
START_TIME                      92758 non-null object
SPACECRAFT_CLOCK_START_COUNT    92758 non-null object
STOP_TIME                       92758 non-null object
SPACECRAFT_CLOCK_STOP_COUNT  [...]<jupyter_text>> I have never seen the data-item "SOUTH_AZIMUTH". Possibly, this was confused with the item called "SUB-SOLAR AZIMUTH"? I put that column in there for now.  example on how to filter for HiRISE obsids (i.e. Planet4 image_names)<jupyter_code>list_of_image_names = [
    'ESP_040246_0935',
    'ESP_039969_0935',
    'ESP_039824_0935',
    'ESP_039547_0935',
    'ESP_039468_0935',
    'ESP_038822_0935',
    'ESP_038625_0930',
    'ESP_038492_0935',
    'ESP_038215_0935',
    'ESP_038149_0935',
    'ESP_038110_0930',
    'ESP_037964_0935',
    'ESP_040311_0940',
    'ESP_040193_0940',
    'ESP_037977_0940',
    'ESP_037976_0940',
]
df.set_index('OBSERVATION_ID', inplace=True)
data = df.loc[list_of_image_names]
# second line for the fact that lots/all metadata exists for _RED and _COLOR channels
data = data[data.PRODUCT_ID.str.endswith('_COLOR')]
data.info()
# don't really have a center lat/lon in this index, so calculating a rough avg value
data['MEAN_LATITUDE'] = (data.MAXIMUM_LATITUDE + data.MINIMUM_LATITUDE) / 2
data['MEAN_LONGITUDE'] = (data.MAXIMUM_LONGITUDE + data.MINIMUM_LONGITUDE) / 2
translator = {
    'acquisition_date': 'START_TIME',
    'local_mars_time': 'LOCAL_TIME',
    'latitude': 'MEAN_LATITUDE',
    'longitude': 'MEAN_LONGITUDE',
    'range_to_target': 'TARGET_CENTER_DISTANCE',
    'original_image_scale': 'MAP_SCALE',
    'emission_angle': 'EMISSION_ANGLE',
    'phase_angle': 'PHASE_ANGLE',
    'solar_incidence': 'INCIDENCE_ANGLE',
    'solar_longitude': 'SOLAR_LONGITUDE',
    'north_azimuth': 'NORTH_AZIMUTH',
    'south_azimuth': 'SUB_SOLAR_AZIMUTH',
}
output = data[list(translator.values())]
output
output.to_csv('planet4_metadata.csv')
!open .<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.08896087714926489, 'fraction_numerical': 0.06703214552703712, 'mean_word_length': 3.901098901098901, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 14, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '381610', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 1588, 'n_tokens_neox': 1390, 'n_words': 332, 'path': 'notebooks/planet4_hirise_index_parsing.ipynb', 'repo_name': 'rhiannonlynne/planetpy', 'size': '4013'}