ConnectTool
 All Classes Namespaces Files Functions Variables Pages
Classes | Functions | Variables
module_plot Namespace Reference

Specific Connect tool plot routine. More...

Classes

class  AnyObject
 
class  MyHandler_marker
 
class  MyHandler_line
 

Functions

def make_legend_marker
 
def make_legend_line
 
def init_figure
 
def init_figure_nomargin
 
def make_title
 Make title for connectivity images. More...
 
def make_legend_scraft
 Make legend for a Sc/Planet Display Sc/Planet subpoint and Connectivity point (measured or slow/fast) More...
 
def make_legend_hcs
 Make legend for the HCS. More...
 
def make_legend_vd
 Make legend for the scraft's visible disk. More...
 
def make_axis
 Make axis. More...
 
def plot_hcs
 Compute HCS line contour from Map2D or Cube3D object and plot it. More...
 
def plot_visible_disk
 
def plot_connectivitymap
 
def plot_flare
 
def plot_xflare
 
def plot_cme
 
def plot_chole
 
def add_scatter_legend
 
def empty_plot
 Create an empty layer (with text inside) Text placed at the center of the plot. More...
 
def box_crossed
 
def circle_proj
 
def spherical_projection
 

Variables

int fig_id = 55
 
tuple fig_size = (12.5,6)
 
tuple plot_size = (9,4.98)
 
int fig_resolution = 100
 
int box_margin_left = 84
 
int box_margin_bot = 48
 
int box_width = 900
 
int box_height = 498
 
int title_size = 12
 
string title_color = 'k'
 
string axis_name_y = 'Latitude'
 
string axis_name_x = 'Carrington Longitude'
 
int axis_size = 10
 
string axis_color = 'k'
 
int dphi = 20
 
list xtick_loc = [ i*dphi for i in range(0,int(360./dphi)+1) ]
 
list xtick_label = [ str(int(xtick_loc[i])) for i in range(0,len(xtick_loc)) ]
 
list ytick_loc = [ -90,-80,-60,-40,-20,0,20,40,60,80,90 ]
 
list ytick_label = [ str(int(ytick_loc[i])) for i in range(0,len(ytick_loc)) ]
 
int legend_size = 8
 
int legend_markersize = 10
 
string legend_marker_sc = 'X'
 
string legend_marker_connectivity = '.'
 
float legend_height_sc = 0.74
 
int legend_width_sc = 1
 
dictionary legend_height_sc_all = {}
 
dictionary legend_width_sc_all = {}
 
float legend_height_vd = 0.08
 
float legend_height_hcs = 0.02
 
int legend_width_vd = 1
 
int legend_width_hcs = 1
 
float legend_height_chole = 0.02
 
float legend_height_cme = 0.08
 
float legend_height_flare = 0.14
 
float legend_height_xflare = 0.14
 
float legend_width_chole = 1.15
 
float legend_width_cme = 1.15
 
int legend_width_flare = 1
 
float legend_width_xflare = 1.15
 
int text_size = 10
 
string cyan = '#00ffff'
 
string darkTurquoise = '#00ced1'
 
string royalBlue = '#4169e1'
 
string mediumBlue = '#0000cd'
 
string dodgerBlue = '#1e90ff'
 
string gold = '#ffd700'
 
string darkOrange = '#ff8c00'
 
string coral = '#ff7f50'
 
string fireBrick = '#b22222'
 
string seaGreen = '#2e8b57'
 
string yellowGreen = '#9acd32'
 
string chartreuse = '#7fff00'
 
string mediumPurple = '#9370db'
 
string violetRed = '#d02090'
 
dictionary color_sc = {}
 
dictionary color_connectivity = {}
 
string color_hcs = 'red'
 
string color_vd = 'black'
 
dictionary colormaps
 
string message_error = 'No data available'
 
string message_empty_all = 'No SC among (EARTH,STA,PSP,SOLO) was available'
 

Detailed Description

Specific Connect tool plot routine.

Other plot routine (map2D...) are in the SW Database.

Todo:
Create layer (svg?) instead of png image.

Function Documentation

def module_plot.add_scatter_legend (   label,
  sub,
  scatters,
  x,
  y,
  location 
)
Add legend for a multiple scatter plot with alpha coefficient.
Add legend only for scatter point which has the higer alpha.
If directly use plt.scatter(...,label=''), pb with multiple legend...
If use plt.legend(scatters[0]), plot in legend point with alpha attenuation...
Input:
  * label: text for legend
  * sub: an existant Axis or SubplotBase object
  * scatters: list of plt.scatter(point)
  * x,y: position of legend
  * location: 'center left' or ...
Output:
  * add legend to figure
def module_plot.box_crossed (   subplot,
  x0,
  y0,
  color 
)
Plot a box crossed centered on (x0,y0)
def module_plot.circle_proj (   subplot,
  x0,
  y0,
  r 
)
Project a circle center on (x0,y0) on a sphere

Here is the call graph for this function:

def module_plot.empty_plot (   sub,
  message 
)

Create an empty layer (with text inside) Text placed at the center of the plot.

def module_plot.init_figure ( )
Init figure and subplot.
def module_plot.init_figure_nomargin ( )
Init figure and subplot without any margin.
def module_plot.make_axis (   sub)

Make axis.

def module_plot.make_legend_hcs (   sub)

Make legend for the HCS.

Here is the call graph for this function:

def module_plot.make_legend_line (   sub,
  label,
  fontsize = 5,
  color = 'r',
  linestyle = 'solid',
  x = 1,
  y = 0.5,
  loc = 'center left' 
)

Here is the caller graph for this function:

def module_plot.make_legend_marker (   sub,
  label,
  fontsize = 5,
  color = 'r',
  marker = 'x',
  markersize = 2,
  x = 1,
  y = 0.5,
  loc = 'center left' 
)

Here is the caller graph for this function:

def module_plot.make_legend_scraft (   sub,
  scraft,
  x,
  y,
  insitu,
  vhelio,
  vhelio_min,
  vhelio_max 
)

Make legend for a Sc/Planet Display Sc/Planet subpoint and Connectivity point (measured or slow/fast)

Here is the call graph for this function:

def module_plot.make_legend_vd (   sub,
  scraft 
)

Make legend for the scraft's visible disk.

Here is the call graph for this function:

def module_plot.make_title (   fig,
  sub,
  scraft,
  reftime,
  magtype,
  time_in,
  time_surf 
)

Make title for connectivity images.

def module_plot.plot_chole (   sub,
  choles 
)

Here is the call graph for this function:

def module_plot.plot_cme (   sub,
  db_list 
)

Here is the call graph for this function:

def module_plot.plot_connectivitymap (   sub,
  densitymap,
  color 
)

Here is the call graph for this function:

def module_plot.plot_flare (   sub,
  db_list 
)

Here is the call graph for this function:

def module_plot.plot_hcs (   sub,
  mag_object,
  levels,
  labels,
  color,
  linestyle = 'dashed' 
)

Compute HCS line contour from Map2D or Cube3D object and plot it.

Parameters
[in]sub: an existant Axis or SubplotBase object
[in]mag_object: Map2D or Cube3D object containing radial magnetic field data
[in]levels: list of float (1..n) levels to be plot
[in]labels: list of strings (1..n) labels in legend
[in]color: color plot
[in]linestyle: dashed (default) or solid
[out]points: list of nlevel list
[out]points[ilevel]: list of module_timespace.Coordinate objects. R = Rsun.
def module_plot.plot_visible_disk (   sub,
  position,
  levels,
  labels,
  color 
)
Compute visible disk from a point (on a unit sphere?).
Plot it on an existant Axis or SubplotBase object.
Grid for plotting:
phi=[0:360]
the=[90:-90]
Input:
  * sub: an existant Axis or SubplotBase object
  * position: module_timespace.Coordinate object
  * levels: list of float (1..n) levels to be plot
  * labels: list of strings (1..n) labels in legend
  * color: color for contour lines
Output:
  * cs: Artist Contour object
def module_plot.plot_xflare (   sub,
  db_list 
)

Here is the call graph for this function:

def module_plot.spherical_projection (   lon,
  lat,
  azimuth,
  maxdist = None 
)
Shooter Function
Original javascript on http://williams.best.vwh.net/gccalc.htm
Translated to python by Thomas Lecocq

Here is the caller graph for this function:

Variable Documentation

string module_plot.axis_color = 'k'
string module_plot.axis_name_x = 'Carrington Longitude'
string module_plot.axis_name_y = 'Latitude'
int module_plot.axis_size = 10
int module_plot.box_height = 498
int module_plot.box_margin_bot = 48
int module_plot.box_margin_left = 84
int module_plot.box_width = 900
string module_plot.chartreuse = '#7fff00'
dictionary module_plot.color_connectivity = {}
string module_plot.color_hcs = 'red'
dictionary module_plot.color_sc = {}
string module_plot.color_vd = 'black'
dictionary module_plot.colormaps
Initial value:
1 = {
2 'SDO171' : 'sdoaia171',
3 'SDO193' : 'sdoaia193',
4 'SDOHMI' : 'hmimag',
5 'SOHO171': 'sohoeit171',
6 'SOHO195': 'sohoeit195',
7 'ADAPT' : 'Greys_r',
8 'WSO' : 'Greys_r',
9 'NSO' : 'Greys_r',
10 }
string module_plot.coral = '#ff7f50'
string module_plot.cyan = '#00ffff'
string module_plot.darkOrange = '#ff8c00'
string module_plot.darkTurquoise = '#00ced1'
string module_plot.dodgerBlue = '#1e90ff'
int module_plot.dphi = 20
int module_plot.fig_id = 55
int module_plot.fig_resolution = 100
tuple module_plot.fig_size = (12.5,6)
string module_plot.fireBrick = '#b22222'
string module_plot.gold = '#ffd700'
float module_plot.legend_height_chole = 0.02
float module_plot.legend_height_cme = 0.08
float module_plot.legend_height_flare = 0.14
float module_plot.legend_height_hcs = 0.02
float module_plot.legend_height_sc = 0.74
dictionary module_plot.legend_height_sc_all = {}
float module_plot.legend_height_vd = 0.08
float module_plot.legend_height_xflare = 0.14
string module_plot.legend_marker_connectivity = '.'
string module_plot.legend_marker_sc = 'X'
int module_plot.legend_markersize = 10
int module_plot.legend_size = 8
float module_plot.legend_width_chole = 1.15
float module_plot.legend_width_cme = 1.15
int module_plot.legend_width_flare = 1
int module_plot.legend_width_hcs = 1
int module_plot.legend_width_sc = 1
dictionary module_plot.legend_width_sc_all = {}
int module_plot.legend_width_vd = 1
float module_plot.legend_width_xflare = 1.15
string module_plot.mediumBlue = '#0000cd'
string module_plot.mediumPurple = '#9370db'
string module_plot.message_empty_all = 'No SC among (EARTH,STA,PSP,SOLO) was available'
string module_plot.message_error = 'No data available'
tuple module_plot.plot_size = (9,4.98)
string module_plot.royalBlue = '#4169e1'
string module_plot.seaGreen = '#2e8b57'
int module_plot.text_size = 10
string module_plot.title_color = 'k'
int module_plot.title_size = 12
string module_plot.violetRed = '#d02090'
list module_plot.xtick_label = [ str(int(xtick_loc[i])) for i in range(0,len(xtick_loc)) ]
list module_plot.xtick_loc = [ i*dphi for i in range(0,int(360./dphi)+1) ]
string module_plot.yellowGreen = '#9acd32'
list module_plot.ytick_label = [ str(int(ytick_loc[i])) for i in range(0,len(ytick_loc)) ]
list module_plot.ytick_loc = [ -90,-80,-60,-40,-20,0,20,40,60,80,90 ]