Skip to content

Instantly share code, notes, and snippets.

View msbentley's full-sized avatar

Mark S. Bentley msbentley

View GitHub Profile
@msbentley
msbentley / pds4_to_df.py
Last active October 24, 2017 07:28
Example to take PDS4 file and map columns to a pandas dataframe
# pick one table from the FITS file
sixs_x_spectra = sc_six_hk_atti_fit['SIXS-X SPECTRA']
# Get the meta-data (does NOT include arrays (GROUP objects etc.)
# find the field names of the table
cols = [col['name'] for col in sixs_x_spectra.meta_data['Record_Binary']['Field_Binary']]
# create an empty DataFrame with these columns
sixs_x_data = pd.DataFrame([], columns=cols)
@msbentley
msbentley / enex_attachment_test.ipynb
Created May 30, 2017 19:10
Example ENEX file, checking MD5 hashes in resources (attachments) and note body
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@msbentley
msbentley / psa_midas_aio.ipynb
Created October 27, 2016 11:12
A quick guide to accessing MIDAS data via the PSA AIO
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@msbentley
msbentley / xls2ics.py
Last active January 1, 2016 15:09
Convert a specific (Rosetta schedule) spreadsheet to a corresponding iCalendar (.ics) file
#! /usr/bin/env python
import pandas as pd
import datetime, pytz
import icalendar
def xls2ics(inputfile,outputfile):
"""Converts a Rosetta schedule spreadsheet into a corresponding ICS
calendar file."""