General library for magnetic file writing/reading in IDL