#!/usr/bin/env python """ CERN@school - LUCID map maker """ # Import the argument parser functionality. import argparse # ...for the colour scaling. from matplotlib import colorbar, colors # ...for the plotting. import matplotlib.pyplot as plt # ...for nice text. from matplotlib import rc # Uncomment to use LaTeX for the plot text. rc('font',**{'family':'serif','serif':['Computer Modern']}) rc('text', usetex=True) #... for the MATH. import numpy as np # Custom imports. from mapping import MapPoint, Map #from spectra import FluxSpectrum # # The main event! # if __name__ == "__main__": print("========================================") print(" CERN@school Map Maker (Python) ") print("========================================") dbg = True # Get the datafile paths from the command line. parser = argparse.ArgumentParser() parser.add_argument("coordFilePath", help="The path of the LUCID orbit coordinate file.") parser.add_argument("attFilePath", help="The path of the LUCID orbit attitude file.") parser.add_argument("eSpecFilePath", help="The path of the e flux spectra along the LUCID orbit.") parser.add_argument("pSpecFilePath", help="The path of the p flux spectra along the LUCID orbit.") parser.add_argument("outputPath", help="The path for the output files." ) args = parser.parse_args() # Process the input arguments. ## The full path of the SPENVIS-generated orbit coordinate file. coordfilepath = args.coordFilePath ## The full path of the SPENVIS-generated orbit attitude file. attfilepath = args.attFilePath ## The full path of the SPENVIS-generated file containing the e flux along the orbit. especfilepath = args.eSpecFilePath ## The full path of the SPENVIS-generated file containing the p flux along the orbit. pspecfilepath = args.pSpecFilePath ## The path to the directory for the output. outputpath = args.outputPath # Update the user. if dbg: print print("* The coordinate file is : '%s'" % (coordfilepath)) print("* The orbit attitude file is : '%s'" % (attfilepath)) print("* The e flux spectra file is : '%s'" % (especfilepath)) print("* The p flux spectra file is : '%s'" % (pspecfilepath)) # print("* The output is being written to: '%s'" % (outputpath)) mymap = Map(coordfilepath, attfilepath, especfilepath, pspecfilepath, 0.4, 7.0, 10.0, 400.0, outputpath, True) mymap.MakeCoordMap() mymap.MakeElectronFluxMap() mymap.MakeProtonFluxMap() mymap.MakeNumParticlesMap(0.25) # .25 s acquisition time, 4Hz. mymap.MakeSourceMacros(0.25, 1000000000)