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 SPICE FITS files CSV catalog http://astro-sdc-db.uio.no/vol/spice/fits/spice_catalog.csv Return ------ pandas.DataFrame Table """ cat_file = Path(data_path) / "fits" / "spice_catalog.csv" if not cat_file.exists(): print(f'Error: Catalog file not available at {cat_file.as_posix()}') sys.exit(1) date_columns = ['DATE-BEG','DATE', 'TIMAQUTC'] df = pd.read_csv(cat_file, parse_dates=date_columns, date_parser=date_parser) return df