pyValEIA.plots.swarm_diagnostic_plots ===================================== .. py:module:: pyValEIA.plots.swarm_diagnostic_plots .. autoapi-nested-parse:: Functions for plotting Swarm data and evaluating EIA detection. .. !! processed by numpydoc !! Functions --------- .. autoapisummary:: pyValEIA.plots.swarm_diagnostic_plots.swarm_panel pyValEIA.plots.swarm_diagnostic_plots.pyiri_model_swarm_plot pyValEIA.plots.swarm_diagnostic_plots.model_swarm_mapplot pyValEIA.plots.swarm_diagnostic_plots.model_swarm_single_plot Module Contents --------------- .. py:function:: swarm_panel(axs, stime, satellite, swarm_file_dir, MLat=30, swarm_filt='barrel_average', swarm_interpolate=1, swarm_envelope=True, swarm_barrel=3, swarm_window=2, fosi=14, scale=False, scale_by='num', scale_num=10**5) Plot a single Swarm panel without model data. :Parameters: **axs** : matplotlib axis axis for the data to be plotted onto **stime** : datetime object time of desired plot, nearest time within mlatitudinal window will be plotted **satellite: str** 'A', 'B', or 'C' for Swarm **swarm_file_dir** : str directory where swarm file can be found **MLat** : int magnetic latitude range +/-MLat (default=30) **swarm_filt** : str Desired Filter for swarm data (default='barrel_average') **swarm_interpolate** : int int that determines the number of data points in interpolation new length will be len(density) x interpolate; if 1 is specified there will not be any interpolation. (default=1) **swarm_envelope** : bool If True, barrel roll will include points inside an envelope and if False, no envelope will be used (default=True) **swarm_barrel** : double latitudinal radius of barrel for Swarm in degrees of magnetic latitude (default=3) **swarm_window** : float latitudinal width of moving window in degrees of magnetic latitude (default=2) **fosi** : int fontsize for the legend (default=14) **scale** : bool Specifies whether to scale the data, if True, or leave as-is, if False (default=False) **scale_by** : str If `scale` is True, scale the data by a number if 'num' is provided or scale the data by the maximum if 'max' is provided (default='num') **scale_num** : float If `scale` is True and `scale_by` is 'num', the density data will be divided by `scale_num` (default=10**5) :Returns: **axs** : matplotlib axis axis for the data to be plotted onto .. rubric:: Notes filt options include: 'barrel', 'average', 'median', 'barrel_average' 'barrel_median', 'average_barrel', and 'median_barrel' .. !! processed by numpydoc !! .. py:function:: pyiri_model_swarm_plot(sday, daily_dir, swarm_dir, model_name='NIMO', fig_on=True, fig_save_dir='', file_save_dir='', pyiri_filt='', pyiri_interpolate=2, pyiri_envelope=False, pyiri_barrel=3, pyiri_window=3, fosi=18) Create and plot a 1 day file for PyIRI, using output from another model. :Parameters: **sday: dt.datetime** Starting date with time-of-day information set to zero **daily_dir** : str Directory of daily files made for the other model-Swarm comparison. **swarm_dir** : str Swarm data directory to which data will be downloaded into an appropriate date/satellite directory structure **model_name** : str Name for the model against which PyIRI will be compared (default='NIMO') **file_save_dir** : str directory where file should be saved, (default='') **fig_on** : bool Set to true, plot will be made, if false, plot will not be made (default=True) **fig_save_dir** : str directory where figure should be saved (default='') **pyiri_filt** : str Desired Filter for the model data, '' is no filter (default='') **pyiri_interpolate** : int int that determines the number of data points in interpolation new length will be len(density) x interpolate, with one indicating no interpolation (default=2) **pyiri_envelope** : bool if True, barrel roll will include points inside an envelope, if false, no envelope will be used (default=False) **pyiri_barrel** : float latitudinal radius of barrel for Swarm in degrees of magnetic latitude (default=3) **pyiri_window** : float latitudinal width of moving window of degrees in magnetic latitude (default=3) **fosi** : int fontsize for plot, with the main title being 10 points larger and the legend being three points smaller (default=18) :Returns: **df** : mpl.Figure or NoneType Figure containing 2 panels for each pass between +/-MLat: Swarm and pyIRI or None if no data is available **daily_df** : pd.DataFrame or NoneType Daily file containing pyIRI information or None if no data is available .. !! processed by numpydoc !! .. py:function:: model_swarm_mapplot(start_day, swarm_file_dir, mod_file_dir, mod_name_format, model_name='NIMO', mod_load_func=io.load.load_nimo, MLat=30, file_dir='', fig_on=True, fig_dir='', swarm_filt='barrel_average', swarm_interpolate=1, swarm_envelope=True, swarm_barrel=3, swarm_window=2, mod_filt='', mod_interpolate=2, mod_envelope=False, mod_barrel=3, mod_window=3, fosi=18, ne_var='dene', lon_var='lon', lat_var='lat', alt_var='alt', hr_var='hour', min_var='minute', tec_var='tec', hmf2_var='hmf2', nmf2_var='nmf2', mod_cadence=15, max_tdif=15, offset=0) Plot Swarm and model data for 1 day and create file of EIA info. :Parameters: **start_day** : datetime day starting at 0,0 **swarm_file_dir** : str directory where swarm file can be found **mod_file_dir** : str directory where model file can be found **mod_name_format** : str prefix of the desired model NetCDF file including date format before the .nc extention, e.g., 'NIMO_AQ_%Y%j' **mod_load_func** : function Function for loading the model data (default=`io.load.load_nimo`) **MLat: int** Absolute value of the desired maximum magnetic latitude range, e.g., +/- MLat (default=30) **file_dir** : str Directory for daily files (default='') **fig_on** : bool Make plots if True, or don't if False (default=True) **fig_dir** : str Directory for figures (default='') **swarm_filt** : str Desired Filter for swarm data (default='barrel_average') **swarm_interpolate** : int Multiple of data points to increase density by through interpolation, new length will be len(density) x `swarm_interpolate` (default=1) **swarm_envelope** : bool if True, barrel roll will include points inside an envelope, if False, no envelope will be used (default=True) **swarm_barrel** : float latitudinal radius of barrel for swarm (default=3) **swarm_window** : float latitudinal width of moving window (default=2) **mod_filt** : str Desired Filter for model data (default='') **mod_interpolate** : int int that determines the number of data points in interpolation new length will be len(density) x interpolate (default=2) **mod_envelope** : bool if True, barrel roll will include points inside an envelope, if false, no envelope will be used (default=False) **mod_barrel** : float latitudinal radius of barrel for swarm (default=3) **mod_window** : float latitudinal width of moving window (default=3) **fosi** : int Fontsize for plot, with super title equal to `fosi` + 10 and the legend text being `fosi` - 3 (default=18) **ne_var** : str Electron denstiy variable in the model file (default='dene') **lon_var** : str Longitude variable in the model file (default='lon') **lat_var** : str Latitude variable in the model file (default='lat') **alt_var** : str Altitude variable in the model file (default='alt') **hr_var** : str Hour of day variable in the model file (default='hour') **min_var** : str Minute of hour variable in the model file (default='minute') **tec_var** : str TEC variable in the model file (default='tec') **hmf2_var** : str hmF2 variable in the model file (default='hmf2') **nmf2_var** : str NmF2 variable in the model file (default='nmf2') **mod_cadence** : int Time cadence of Model data in minutes (default=15) **max_tdif** : float Maximum allowed time in minutes between a model and Swarm conjunction (default=15) **offset** : int Number of days to offset Swarm data from model data to test the model reliability (default=0) :Returns: **df** : pd.DataFrame dataframe of info that went into daily file .. !! processed by numpydoc !! .. py:function:: model_swarm_single_plot(stime, satellite, swarm_file_dir, mod_file_dir, mod_name_format, model_name='NIMO', mod_load_func=io.load.load_nimo, MLat=30, swarm_filt='barrel_average', swarm_interpolate=1, swarm_envelope=True, swarm_barrel=3, swarm_window=2, mod_filt='', mod_interpolate=2, mod_envelope=False, mod_barrel=3, mod_window=3, fosi=18, plot_dir='', ne_var='dene', lon_var='lon', lat_var='lat', alt_var='alt', hr_var='hour', min_var='minute', tec_var='tec', hmf2_var='hmf2', nmf2_var='nmf2', mod_cadence=15) Plot and save a single model/Swarm EIA type plot. :Parameters: **stime** : datetime object time of desired plot, nearest time within mlatitudinal window will be plotted **satellite** : str 'A', 'B', or 'C' for Swarm **swarm_file_dir** : str directory where swarm file can be found **mod_file_dir** : str directory where nimo file can be found **mod_name_format** : str Prefix of model file including date format before the .nc extension, e.g., 'NIMO_AQ_%Y%j' **model_name** : str Model name (default='NIMO') **mod_load_func** : function Function for loading the model data (default=`io.load.load_nimo`) **MLat** : int magnetic latitude range +/-MLat (default=30) **swarm_filt** : str kwarg Desired Filter for swarm data (default='barrel_average') **swarm_interpolate** : int int that determines the number of data points in interpolation new length will be len(density) x interpolate (default=1) **swarm_envelope** : bool if True, barrel roll will include points inside an envelope, if False, no envelope will be used (default=True) **swarm_barrel** : float latitudinal radius of barrel for swarm (default=3) **swarm_window** : float latitudinal width of moving window (default=2) **mod_filt** : str Desired Filter for nimo data (default='') **mod_interpolate** : int int that determines the number of data points in interpolation new length will be len(density) x interpolate (default=2) **mod_envelope** : bool if True, barrel roll will include points inside an envelope, if False, no envelope will be used (default=False) **mod_barrel** : float latitudinal radius of barrel for swarm (default=3) **mod_window** : float latitudinal width of moving window (default=3) **fosi** : int fontsize for plot, with super title equal to `fosi` + 10 and the legend text equal to `fosi` - 3 (default=18) **plot_dir** : str output folder for plot, or '' to not save output. If saved, an additional date directory will be created: `plot_dir`/{%Y%m%d}/fig.jpg (default='') **ne_var** : str Electron denstiy variable in the model file (default='dene') **lon_var** : str Longitude variable in the model file (default='lon') **lat_var** : str Latitude variable in the model file (default='lat') **alt_var** : str Altitude variable in the model file (default='alt') **hr_var** : str Hour of day variable in the model file (default='hour') **min_var** : str Minute of hour variable in the model file (default='minute') **tec_var** : str TEC variable in the model file (default='tec') **hmf2_var** : str hmF2 variable in the model file (default='hmf2') **nmf2_var** : str NmF2 variable in the model file (default='nmf2') **mod_cadence: int** Time cadence of model data in minutes (default=15) :Returns: **fig** : matplotlib.Figure Figure handle .. rubric:: Notes filt options include: 'barrel', 'average', 'median', 'barrel_average' 'barrel_median', 'average_barrel', and 'median_barrel' .. !! processed by numpydoc !!