from pathlib import Path import pandas as pd # SPICE data tree path, to be changed to your SPICE data mirror data_path = "/archive/SOLAR-ORBITER/SPICE" # example for IAS computing servers def date_parser(string): try: return pd.Timestamp(string) except ValueError: return pd.NaT def read_uio_cat(): """ Read UiO text table SPICE FITS files catalog http://astro-sdc-db.uio.no/vol/spice/fits/spice_catalog.txt Return ------ pandas.DataFrame Table """ cat_file = Path(data_path) / "fits" / "spice_catalog.txt" if not cat_file.exists(): print(f'Error: Catalog file not available at {cat_file.as_posix()}') sys.exit(1) columns = list(pd.read_csv(cat_file, nrows=0).keys()) date_columns = ['DATE-BEG','DATE', 'TIMAQUTC'] df = pd.read_table(cat_file, skiprows=1, names=columns, parse_dates=date_columns, date_parser=date_parser, low_memory=False) return df