def __init__ (self): # ================== '''Define and initialize class attributes''' with open(COSMO_CONF_DATA) as infile: conf = json.load(infile) #COSMO_CONF_PATH = conf['COSMO_CONF_PATH'] COSMO_CONF_NAME = conf['COSMO_CONF_NAME'] COSMO_CONF = COSMO_CONF_PATH + COSMO_CONF_NAME + os.sep self.FILECONF = COSMO_CONF + 'dot.conf' self.SHOW = tk.BooleanVar() self.SIZE = tk.DoubleVar() self.SYMBOL = tk.StringVar() self.COLOR = tk.StringVar() self.ALPHA = tk.DoubleVar() self.HA = tk.StringVar() self.VA = tk.StringVar() self.WRAP = tk.BooleanVar() self.TCOLOR = tk.StringVar() self.STYLE = tk.StringVar() self.WEIGHT = tk.StringVar() self.ZORDER = tk.IntVar() self.TSIZE = tk.DoubleVar() # Default attribute values: # self.SHOW.set(True) self.SIZE.set(1.5) self.SYMBOL.set('o') self.COLOR.set('black') self.ALPHA.set(1.0) self.HA.set('left') self.VA.set('baseline') self.WRAP.set(True) self.TCOLOR.set('black') self.STYLE.set('normal') self.WEIGHT.set('bold') self.ZORDER.set(1) self.TSIZE.set(10) # If configuration file exists, it is read and # the default values are overrided. If the configuration # file does not exist, it is created using the default values. # if exists(self.FILECONF): try: print('Loading DOT configuration') self.load(self.FILECONF) except: print('Error: Saving default DOT configuration') self.save(self.FILECONF) else: print('Saving default DOT configuration') self.save(self.FILECONF)
def __init__(self): # ================== '''Define and initialize class attributes''' with open(COSMO_CONF_DATA) as infile: conf = json.load(infile) #COSMO_CONF_PATH = conf['COSMO_CONF_PATH'] COSMO_CONF_NAME = conf['COSMO_CONF_NAME'] COSMO_CONF = COSMO_CONF_PATH + COSMO_CONF_NAME + os.sep self.FILECONF = COSMO_CONF + 'dot.conf' self.SHOW = tk.BooleanVar() self.SIZE = tk.DoubleVar() self.SYMBOL = tk.StringVar() self.COLOR = tk.StringVar() self.ALPHA = tk.DoubleVar() self.HA = tk.StringVar() self.VA = tk.StringVar() self.WRAP = tk.BooleanVar() self.TCOLOR = tk.StringVar() self.STYLE = tk.StringVar() self.WEIGHT = tk.StringVar() self.ZORDER = tk.IntVar() self.TSIZE = tk.DoubleVar() # Default attribute values: # self.SHOW.set(True) self.SIZE.set(1.5) self.SYMBOL.set('o') self.COLOR.set('black') self.ALPHA.set(1.0) self.HA.set('left') self.VA.set('baseline') self.WRAP.set(True) self.TCOLOR.set('black') self.STYLE.set('normal') self.WEIGHT.set('bold') self.ZORDER.set(1) self.TSIZE.set(10) # If configuration file exists, it is read and # the default values are overrided. If the configuration # file does not exist, it is created using the default values. # if exists(self.FILECONF): try: print('Loading DOT configuration') self.load(self.FILECONF) except: print('Error: Saving default DOT configuration') self.save(self.FILECONF) else: print('Saving default DOT configuration') self.save(self.FILECONF)
def __init__(self): # ================== '''Define and initialize the class attributes''' self.MESSAGE = "\nELLIPSE class:\n" with open(COSMO_CONF_DATA) as infile: conf = json.load(infile) COSMO_CONF_NAME = conf['COSMO_CONF_NAME'] COSMO_CONF = COSMO_CONF_PATH + COSMO_CONF_NAME + os.sep self.FILECONF = COSMO_CONF + 'ellipse.conf' self.scale = tk.DoubleVar() self.LINE_COLOR = tk.StringVar() self.LINE_STYLE = tk.StringVar() self.LINE_WIDTH = tk.DoubleVar() self.ADD_ROTATION = tk.BooleanVar() self.SHOW_MAJOR = tk.BooleanVar() self.SHOW_CENTER = tk.BooleanVar() self.ALPHA = tk.DoubleVar() # 0=Transparent, 1=Opaque self.ZORDER = tk.IntVar() # Default attribute values''' # self.scale.set(1.0) self.LINE_COLOR.set('black') self.LINE_STYLE.set('-') self.LINE_WIDTH.set(1.0) self.ADD_ROTATION.set(True) self.SHOW_MAJOR.set(True) self.SHOW_CENTER.set(True) self.ALPHA.set(1.0) self.ZORDER.set(2) # If configuration file exists, it is read and # the default values are overrided. If the configuration # file does not exist, it is created using the default values. if exists(self.FILECONF): self.MESSAGE += 'Reading CONTOUR configuration from ' + self.FILECONF try: self.load(self.FILECONF) except: self.MESSAGE += '\nError: Saving default CONTOUR configuration' self.save(self.FILECONF) else: self.MESSAGE += '\nSaving CONTOUR configuration' self.save(self.FILECONF)
def __init__ (self): # ================== '''Define and initialize the class attributes''' with open(COSMO_CONF_DATA) as infile: conf = json.load(infile) #COSMO_CONF_PATH = conf['COSMO_CONF_PATH'] COSMO_CONF_NAME = conf['COSMO_CONF_NAME'] COSMO_CONF = COSMO_CONF_PATH + COSMO_CONF_NAME + os.sep self.FILECONF = COSMO_CONF + 'contour.conf' self.DATA_MIN = tk.DoubleVar() self.DATA_MAX = tk.DoubleVar() self.CONTOUR_MODE = tk.IntVar() # 0=Contour, 1=Shades self.CONTOUR_LOG = tk.BooleanVar() self.CONTOUR_MIN = tk.DoubleVar() self.CONTOUR_MAX = tk.DoubleVar() self.CONTOUR_INTERVAL = tk.DoubleVar() self.CONTOUR_WIDTH = tk.DoubleVar() self.CONTOUR_DASHEDNEG = tk.BooleanVar() self.CONTOUR_LINEMODE = tk.StringVar() # 'C'=One color,'M'=colormap self.CONTOUR_COLOR = tk.StringVar() self.CONTOUR_COLORMAP = tk.StringVar() self.CONTOUR_REVERSE = tk.BooleanVar() self.ALPHA = tk.DoubleVar() # 0=Transparent, 1=Opaque self.COLORBAR_SHOW = tk.BooleanVar() self.COLORBAR_LOCATION = tk.StringVar() self.COLORBAR_PAD = tk.DoubleVar() self.COLORBAR_LABEL = tk.StringVar() self.COLORBAR_LABELPAD = tk.IntVar() self.COLORBAR_SIZE = tk.StringVar() self.COLORBAR_LABELSIZE= tk.IntVar() self.COLORBAR_TICKSIZE = tk.IntVar() self.COLORBAR_SHRINK = tk.DoubleVar() self.LABEL_SHOW = tk.BooleanVar() self.LABEL_SET = tk.StringVar() # 'A'=All, 'V'=Selected Values self.LABEL_SIZE = tk.IntVar() self.LABEL_VALUES = tk.StringVar() # Default attribute values''' # self.CONTOUR_MODE.set(0) # Default: Line contours self.CONTOUR_LOG.set(False) self.CONTOUR_WIDTH.set(1) # Default: Line width = 1 self.CONTOUR_DASHEDNEG.set(True) # Default: Dashed negative values self.CONTOUR_LINEMODE.set('M') # Default: Map color contours self.CONTOUR_COLOR.set('black') # Default: Black contour lines self.CONTOUR_COLORMAP.set('jet') # Default: Jet colormap self.CONTOUR_REVERSE.set(False) # Default: Standard colormap self.ALPHA.set(1) # Default: Transparency = Opaque self.COLORBAR_SHOW.set(True) # Default: Show colorbar on the right self.COLORBAR_LOCATION.set('right') # Default: Show colorbar on the right self.COLORBAR_PAD.set(8) # Default: Show colorbar on the right self.COLORBAR_LABEL.set('') # Default: Show no colorbar title self.COLORBAR_LABELPAD.set(5) # Default: Show no colorbar title self.COLORBAR_SIZE.set('5%') self.COLORBAR_LABELSIZE.set(14) self.COLORBAR_TICKSIZE.set(12) self.LABEL_SHOW.set(True) # Default: Show contour labels self.LABEL_SET.set('A') # Default: Show All contour labels self.LABEL_SIZE.set(12) # Default: Label character size self.LABEL_VALUES.set('') # Default: Label character size # If configuration file exists, it is read and # the default values are overrided. If the configuration # file does not exist, it is created using the default values. if exists(self.FILECONF): print('Reading CONTOUR configuration from ',self.FILECONF) try: self.load(self.FILECONF) except: print('Error: Saving default CONTOUR configuration') self.save(self.FILECONF) else: print('Saving CONTOUR configuration') self.save(self.FILECONF)
def __init__(self): # ================== ''' Define and initialize class attributes''' self.MESSAGE = "" with open(COSMO_CONF_DATA) as infile: conf = json.load(infile) COSMO_CONF_NAME = conf['COSMO_CONF_NAME'] COSMO_CONF = COSMO_CONF_PATH + COSMO_CONF_NAME + os.sep self.FILECONF = COSMO_CONF + 'vector.conf' self.DRAWING_MODE = tk.IntVar() self.GRID_MODE = tk.IntVar() self.CURRENT_DX = tk.IntVar() self.CURRENT_DY = tk.IntVar() self.CURRENT_NX = tk.IntVar() self.CURRENT_NY = tk.IntVar() self.CURRENT_SCALE = tk.DoubleVar() self.CURRENT_WIDTH = tk.DoubleVar() self.CURRENT_HEADLENGTH = tk.IntVar() self.CURRENT_HEADWIDTH = tk.IntVar() self.CURRENT_COLOR = tk.StringVar() self.BARB_LENGTH = tk.IntVar() self.BARB_PIVOT = tk.StringVar() self.BARB_BARBCOLOR = tk.StringVar() self.BARB_FLAGCOLOR = tk.StringVar() self.BARB_SPACING = tk.DoubleVar() self.BARB_HEIGHT = tk.DoubleVar() self.BARB_WIDTH = tk.DoubleVar() self.BARB_EMPTYBARB = tk.DoubleVar() self.BARB_HALF = tk.DoubleVar() self.BARB_FULL = tk.DoubleVar() self.BARB_FLAG = tk.DoubleVar() self.BARB_LINEWIDTH = tk.DoubleVar() self.BARB_SCALE = tk.DoubleVar() self.STREAM_DENSITY = tk.DoubleVar() self.STREAM_WIDTH = tk.DoubleVar() self.STREAM_COLOR = tk.StringVar() self.ALPHA = tk.DoubleVar() self.ZORDER = tk.IntVar() self.COLOR_BY_SPEED = tk.BooleanVar() self.KEY_SHOW = tk.BooleanVar() self.KEY_LABEL = tk.StringVar() self.KEY_X = tk.DoubleVar() self.KEY_Y = tk.DoubleVar() self.KEY_VALUE = tk.DoubleVar() self.KEY_POS = tk.StringVar() self.KEY_COLOR = tk.StringVar() self.KEY_SIZE = tk.IntVar() self.KEY_GETXY = False self.KEY_OBJ = None self.ARAKAWA = tk.StringVar() # Defautl attribute values # self.DRAWING_MODE.set(0) # 0 - Vector, 1 - Barb, 2 - Streamplot self.GRID_MODE.set(0) self.CURRENT_DX.set(4) self.CURRENT_DY.set(4) self.CURRENT_NX.set(41) self.CURRENT_NY.set(41) self.CURRENT_SCALE.set(20) self.CURRENT_WIDTH.set(0.002) self.CURRENT_HEADLENGTH.set(5) self.CURRENT_HEADWIDTH.set(3) self.CURRENT_COLOR.set('black') self.ALPHA.set(1.0) self.ZORDER.set(3) self.BARB_PIVOT.set('middle') self.BARB_LENGTH.set(7) self.BARB_BARBCOLOR.set('black') self.BARB_FLAGCOLOR.set('black') self.BARB_LINEWIDTH.set(1.0) self.BARB_SCALE.set(1.9438445) self.BARB_HALF.set(5) self.BARB_FULL.set(10) self.BARB_FLAG.set(50) self.BARB_SPACING.set(0.125) self.BARB_HEIGHT.set(0.40) self.BARB_WIDTH.set(0.25) self.BARB_EMPTYBARB.set(0.15) self.STREAM_DENSITY.set(1) self.STREAM_WIDTH.set(2) self.STREAM_DENSITY.set(1) self.STREAM_COLOR.set('black') self.COLOR_BY_SPEED.set(False) self.KEY_SHOW.set(True) self.KEY_VALUE.set(1) self.KEY_LABEL.set('m/s') self.KEY_X.set(0.85) self.KEY_Y.set(0.10) self.KEY_POS.set('E') self.KEY_COLOR.set('black') self.KEY_SIZE.set(12) self.ARAKAWA.set('A') # If configuration file exists, it is read and # the default values are overrided. If the configuration # file does not exist, it is created using the default values. # if exists(self.FILECONF): try: self.MESSAGE += '\nVECTORPLOT: Loading VECTOR configuration file ' + self.FILECONF self.load(self.FILECONF) except: self.MESSAGE += '\nVECTORPLOT: Error: Saving default DOT configuration ' + self.FILECONF self.save(self.FILECONF) else: self.MESSAGE += '\nVECTORPLOT: Saving default DOT configuration ' + self.FILECONF self.save(self.FILECONF)
def __init__ (self): # ================== '''Define and initialize class attributes''' with open(COSMO_CONF_DATA) as infile: conf = json.load(infile) #COSMO_CONF_PATH = conf['COSMO_CONF_PATH'] COSMO_CONF_NAME = conf['COSMO_CONF_NAME'] COSMO_CONF = COSMO_CONF_PATH + COSMO_CONF_NAME + os.sep self.FILECONF = COSMO_CONF + 'line.conf' self.LINE_SHOW = tk.BooleanVar() self.LINE_STYLE = tk.StringVar() self.LINE_WIDTH = tk.DoubleVar() self.LINE_COLOR = tk.StringVar() self.MARKER_SHOW = tk.BooleanVar() self.MARKER_STYLE = tk.StringVar() self.MARKER_SIZE = tk.DoubleVar() self.MARKER_COLOR = tk.StringVar() self.INITIAL_SHOW = tk.BooleanVar() self.INITIAL_STYLE = tk.StringVar() self.INITIAL_SIZE = tk.IntVar() self.INITIAL_COLOR = tk.StringVar() self.ONMAP_SHOW = tk.BooleanVar() self.ONMAP_STYLE = tk.StringVar() self.ONMAP_SIZE = tk.IntVar() self.ONMAP_COLOR = tk.StringVar() # Default attribute values # self.LINE_SHOW.set(True) self.LINE_WIDTH.set(1.5) self.LINE_COLOR.set('blue') self.LINE_STYLE.set('-') self.MARKER_SHOW.set(False) self.MARKER_STYLE.set('o') self.MARKER_COLOR.set('blue') self.MARKER_SIZE.set(3) self.INITIAL_SHOW.set(True) self.INITIAL_STYLE.set('o') self.INITIAL_COLOR.set('red') self.INITIAL_SIZE.set(4) self.ONMAP_SHOW.set(False) self.ONMAP_STYLE.set('o') self.ONMAP_COLOR.set('red') self.ONMAP_SIZE.set(4) # If configuration file exists, it is read and # the default values are overrided. If the configuration # file does not exist, it is created using the default values. # if exists(self.FILECONF): try: print('Loading LINE configuration') self.load(self.FILECONF) except: print('Error: Saving default LINE configuration') self.save(self.FILECONF) else: print('Saving default LINE configuration') self.save(self.FILECONF)
def __init__(self): # ================== '''Define and initialize the class attributes''' with open(COSMO_CONF_DATA) as infile: conf = json.load(infile) #COSMO_CONF_PATH = conf['COSMO_CONF_PATH'] COSMO_CONF_NAME = conf['COSMO_CONF_NAME'] COSMO_CONF = COSMO_CONF_PATH + COSMO_CONF_NAME + os.sep self.FILECONF = COSMO_CONF + 'contour.conf' self.DATA_MIN = tk.DoubleVar() self.DATA_MAX = tk.DoubleVar() self.CONTOUR_MODE = tk.IntVar() # 0=Contour, 1=Shades self.CONTOUR_LOG = tk.BooleanVar() self.CONTOUR_MIN = tk.DoubleVar() self.CONTOUR_MAX = tk.DoubleVar() self.CONTOUR_INTERVAL = tk.DoubleVar() self.CONTOUR_WIDTH = tk.DoubleVar() self.CONTOUR_DASHEDNEG = tk.BooleanVar() self.CONTOUR_LINEMODE = tk.StringVar() # 'C'=One color,'M'=colormap self.CONTOUR_COLOR = tk.StringVar() self.CONTOUR_COLORMAP = tk.StringVar() self.CONTOUR_REVERSE = tk.BooleanVar() self.ALPHA = tk.DoubleVar() # 0=Transparent, 1=Opaque self.COLORBAR_SHOW = tk.BooleanVar() self.COLORBAR_LOCATION = tk.StringVar() self.COLORBAR_PAD = tk.DoubleVar() self.COLORBAR_LABEL = tk.StringVar() self.COLORBAR_LABELPAD = tk.IntVar() self.COLORBAR_SIZE = tk.StringVar() self.COLORBAR_LABELSIZE = tk.IntVar() self.COLORBAR_TICKSIZE = tk.IntVar() self.COLORBAR_SHRINK = tk.DoubleVar() self.LABEL_SHOW = tk.BooleanVar() self.LABEL_SET = tk.StringVar() # 'A'=All, 'V'=Selected Values self.LABEL_SIZE = tk.IntVar() self.LABEL_VALUES = tk.StringVar() # Default attribute values''' # self.CONTOUR_MODE.set(2) # Default: Line contours self.CONTOUR_LOG.set(False) self.CONTOUR_WIDTH.set(1) # Default: Line width = 1 self.CONTOUR_DASHEDNEG.set(True) # Default: Dashed negative values self.CONTOUR_LINEMODE.set('M') # Default: Map color contours self.CONTOUR_COLOR.set('black') # Default: Black contour lines self.CONTOUR_COLORMAP.set('jet') # Default: Jet colormap self.CONTOUR_REVERSE.set(False) # Default: Standard colormap self.ALPHA.set(1) # Default: Transparency = Opaque self.COLORBAR_SHOW.set(True) # Default: Show colorbar on the right self.COLORBAR_LOCATION.set( 'right') # Default: Show colorbar on the right self.COLORBAR_PAD.set(8) # Default: Show colorbar on the right self.COLORBAR_LABEL.set('') # Default: Show no colorbar title self.COLORBAR_LABELPAD.set(5) # Default: Show no colorbar title self.COLORBAR_SIZE.set('5%') self.COLORBAR_LABELSIZE.set(14) self.COLORBAR_TICKSIZE.set(12) self.LABEL_SHOW.set(True) # Default: Show contour labels self.LABEL_SET.set('A') # Default: Show All contour labels self.LABEL_SIZE.set(12) # Default: Label character size self.LABEL_VALUES.set('') # Default: Label character size # If configuration file exists, it is read and # the default values are overrided. If the configuration # file does not exist, it is created using the default values. if exists(self.FILECONF): print('Reading CONTOUR configuration from ', self.FILECONF) try: self.load(self.FILECONF) except: print('Error: Saving default CONTOUR configuration') self.save(self.FILECONF) else: print('Saving CONTOUR configuration') self.save(self.FILECONF)
def __init__ (self): # ================== ''' Define and initialize class attributes''' with open(COSMO_CONF_DATA) as infile: conf = json.load(infile) #COSMO_CONF_PATH = conf['COSMO_CONF_PATH'] COSMO_CONF_NAME = conf['COSMO_CONF_NAME'] COSMO_CONF = COSMO_CONF_PATH + COSMO_CONF_NAME + os.sep self.FILECONF = COSMO_CONF + 'vector.conf' self.DRAWING_MODE = tk.IntVar() self.GRID_MODE = tk.IntVar() self.CURRENT_DX = tk.IntVar() self.CURRENT_DY = tk.IntVar() self.CURRENT_NX = tk.IntVar() self.CURRENT_NY = tk.IntVar() self.CURRENT_SCALE = tk.DoubleVar() self.CURRENT_WIDTH = tk.DoubleVar() self.CURRENT_HEADLENGTH= tk.IntVar() self.CURRENT_HEADWIDTH = tk.IntVar() self.CURRENT_COLOR = tk.StringVar() self.CURRENT_ALPHA = tk.DoubleVar() self.CURRENT_ZORDER = tk.IntVar() self.BARB_LENGTH = tk.IntVar() self.BARB_PIVOT = tk.StringVar() self.BARB_BARBCOLOR = tk.StringVar() self.BARB_FLAGCOLOR = tk.StringVar() self.BARB_SPACING = tk.DoubleVar() self.BARB_HEIGHT = tk.DoubleVar() self.BARB_WIDTH = tk.DoubleVar() self.BARB_EMPTYBARB = tk.DoubleVar() self.BARB_HALF = tk.IntVar() self.BARB_FULL = tk.IntVar() self.BARB_FLAG = tk.IntVar() self.BARB_ALPHA = tk.DoubleVar() self.BARB_LINEWIDTH = tk.DoubleVar() self.BARB_ZORDER = tk.IntVar() self.BARB_SCALE = tk.DoubleVar() self.STREAM_DENSITY = tk.DoubleVar() self.STREAM_WIDTH = tk.DoubleVar() self.STREAM_COLOR = tk.StringVar() self.STREAM_ZORDER = tk.IntVar() self.COLOR_BY_SPEED = tk.BooleanVar() self.KEY_SHOW = tk.BooleanVar() self.KEY_LABEL = tk.StringVar() self.KEY_X = tk.DoubleVar() self.KEY_Y = tk.DoubleVar() self.KEY_VALUE = tk.DoubleVar() self.KEY_POS = tk.StringVar() self.KEY_COLOR = tk.StringVar() self.KEY_SIZE = tk.IntVar() self.KEY_GETXY = False self.KEY_OBJ = None # Defautl attribute values # self.DRAWING_MODE.set(0) # 0 - Vector, 1 - Barb, 2 - Streamplot self.GRID_MODE.set(1) self.CURRENT_DX.set(4) self.CURRENT_DY.set(4) self.CURRENT_NX.set(41) self.CURRENT_NY.set(41) self.CURRENT_SCALE.set(20) self.CURRENT_WIDTH.set(0.002) self.CURRENT_HEADLENGTH.set(5) self.CURRENT_HEADWIDTH.set(3) self.CURRENT_COLOR.set('black') self.CURRENT_ALPHA.set(1.0) self.CURRENT_ZORDER.set(1) self.BARB_PIVOT.set('middle') self.BARB_LENGTH.set(7) self.BARB_BARBCOLOR.set('black') self.BARB_FLAGCOLOR.set('black') self.BARB_LINEWIDTH.set(1.0) self.BARB_ALPHA.set(1.0) self.BARB_ZORDER.set(2) self.BARB_SCALE.set(1.9438445) self.BARB_HALF.set(5) self.BARB_FULL.set(10) self.BARB_FLAG.set(50) self.BARB_SPACING.set(0.125) self.BARB_HEIGHT.set(0.40) self.BARB_WIDTH.set(0.25) self.BARB_EMPTYBARB.set(0.15) self.STREAM_WIDTH.set(2) self.STREAM_COLOR.set('black') self.STREAM_ZORDER.set(1) self.COLOR_BY_SPEED.set(False) self.KEY_SHOW.set(True) self.KEY_VALUE.set(1) self.KEY_LABEL.set('m/s') self.KEY_X.set(0.85) self.KEY_Y.set(0.12) self.KEY_POS.set('E') self.KEY_COLOR.set('black') self.KEY_SIZE.set(12) # If configuration file exists, it is read and # the default values are overrided. If the configuration # file does not exist, it is created using the default values. # if exists(self.FILECONF): try: print('Loading VECTOR configuration file '+self.FILECONF) self.load(self.FILECONF) except: print('Error: Saving default DOT configuration '+self.FILECONF) self.save(self.FILECONF) else: print('Saving default DOT configuration '+self.FILECONF) self.save(self.FILECONF)
def __init__(self): # ================= '''Define and initialize class attributes''' self.MESSAGE = "" with open(COSMO_CONF_DATA) as infile: conf = json.load(infile) COSMO_CONF_NAME = conf['COSMO_CONF_NAME'] COSMO_CONF = COSMO_CONF_PATH + COSMO_CONF_NAME + os.sep self.FILECONF = COSMO_CONF + 'legend.conf' self.SHOW = tk.BooleanVar() self.LOC = tk.IntVar() self.MODE = tk.IntVar() self.NCOL = tk.IntVar() self.FONTSIZE = tk.IntVar() self.FANCYBOX = tk.BooleanVar() self.FRAMEON = tk.BooleanVar() self.SHADOW = tk.BooleanVar() self.TITLE = tk.StringVar() self.ALPHA = tk.DoubleVar() self.COLOR = tk.StringVar() self.EDGECOLOR = tk.StringVar() self.MARKERSCALE = tk.DoubleVar() self.LABELSPACING = tk.DoubleVar() self.BORDERPAD = tk.DoubleVar() self.HANDLETEXTPAD = tk.DoubleVar() self.BORDERAXESPAD = tk.DoubleVar() self.TITLEFONT = FontProperties().copy() self.USE_BB = tk.BooleanVar() self.BBx = tk.DoubleVar() self.BBy = tk.DoubleVar() self.GET_XY = False # Default values: self.SHOW.set(True) self.LOC.set(0) self.MODE.set(0) self.NCOL.set(1) self.FONTSIZE.set(12) self.FANCYBOX.set(True) self.FRAMEON.set(True) self.SHADOW.set(True) self.TITLE.set('Legend') self.ALPHA.set(1) self.COLOR.set('white') self.EDGECOLOR.set(None) self.USE_BB.set(False) self.MARKERSCALE.set(matplotlib.rcParams['legend.markerscale']) self.LABELSPACING.set(matplotlib.rcParams['legend.labelspacing']) self.BORDERPAD.set(matplotlib.rcParams['legend.borderpad']) self.HANDLETEXTPAD.set(matplotlib.rcParams['legend.handletextpad']) self.BORDERAXESPAD.set(matplotlib.rcParams['legend.borderaxespad']) self.TITLEFONT.set_weight('bold') # If configuration file exists, it is read and # the default values are overrided. If the configuration # file does not exist, it is created using the default values. # if exists(self.FILECONF): try: self.MESSAGE += "Loading LEGEND configuration" self.load(self.FILECONF) except: self.MESSAGE += "Error: Saving default LEGEND configuration" self.save(self.FILECONF) else: self.MESSAGE += "Saving default LEGEND configuration" self.save(self.FILECONF)
def __init__(self): with open(COSMO_CONF_DATA) as infile: conf = json.load(infile) #COSMO_CONF_PATH = conf['COSMO_CONF_PATH'] COSMO_CONF_NAME = conf['COSMO_CONF_NAME'] COSMO_CONF = COSMO_CONF_PATH + COSMO_CONF_NAME + os.sep self.FILECONF = os.path.join(COSMO_CONF,'blm.conf') self.PATH = tk.StringVar() self.BIN = tk.StringVar() self.VEC = [] self.UINDEX = 0 self.VINDEX = None self.TINDEX = None self.UFILE = tk.StringVar() self.Ux = tk.StringVar() self.Uy = tk.StringVar() self.Uz = tk.StringVar() self.Ut = tk.StringVar() self.Uu = tk.StringVar() self.VFILE = tk.StringVar() self.Vx = tk.StringVar() self.Vy = tk.StringVar() self.Vz = tk.StringVar() self.Vt = tk.StringVar() self.Vv = tk.StringVar() self.TFILE = tk.StringVar() self.Tx = tk.StringVar() self.Ty = tk.StringVar() self.Tz = tk.StringVar() self.Tt = tk.StringVar() self.Tvname = tk.StringVar() self.INI_USE = tk.BooleanVar() self.INI = tk.StringVar() self.FIN = tk.StringVar() self.TRAJECTORY = tk.StringVar() self.INI_USE.set(False) self.xo = tk.DoubleVar() self.yo = tk.DoubleVar() self.to = tk.DoubleVar() self.do = tk.StringVar() self.to_use = tk.BooleanVar() self.reverse = tk.BooleanVar() self.stationary = tk.BooleanVar() self.record_use = tk.BooleanVar() self.record = tk.IntVar() self.idt = tk.IntVar() self.edt = tk.IntVar() self.seed = tk.IntVar() self.nfloats = tk.IntVar() self.Rx = tk.DoubleVar() self.Ry = tk.DoubleVar() self.Rt = tk.DoubleVar() # Default "Manufacturer" parameters: # self.PATH.set(os.path.join(COSMO_ROOT,'bin/')) self.BIN.set('blm') self.TRAJECTORY.set('blm.nc') self.INI.set('') self.FIN.set('blm.end') self.xo.set(None) self.yo.set(None) self.to.set(0.0) self.do.set('') self.record.set(None) self.stationary.set(False) self.edt.set(None) self.idt.set(1200) self.to_use.set(True) self.record_use.set(False) self.seed.set(None) self.nfloats.set(10) self.Rx.set(0.10) self.Ry.set(0.10) self.Rt.set(0) if exists(self.FILECONF): print('Reading BLM configuration') self.load(self.FILECONF) else: print('Saving BLM configuration') self.save(self.FILECONF)
def __init__(self): # ================== '''Define and initialize class attributes''' self.MESSAGE = '' with open(COSMO_CONF_DATA) as infile: conf = json.load(infile) COSMO_CONF_NAME = conf['COSMO_CONF_NAME'] COSMO_CONF = COSMO_CONF_PATH + COSMO_CONF_NAME + os.sep self.FILECONF = COSMO_CONF + 'geo.conf' self.SHOW = tk.BooleanVar() self.SIZE = tk.DoubleVar() self.SYMBOL = tk.StringVar() self.COLOR = tk.StringVar() self.EDGECOLOR = tk.StringVar() self.FACECOLOR = tk.StringVar() self.LINEWIDTH = tk.DoubleVar() self.LINESTYLE = tk.StringVar() self.ALPHA = tk.DoubleVar() self.HA = tk.StringVar() self.VA = tk.StringVar() self.WRAP = tk.BooleanVar() self.TCOLOR = tk.StringVar() self.STYLE = tk.StringVar() self.WEIGHT = tk.StringVar() self.ZORDER = tk.IntVar() self.TSIZE = tk.DoubleVar() self.ANGLE = tk.DoubleVar() self.XPAD = tk.DoubleVar() self.YPAD = tk.DoubleVar() self.BBOX = tk.BooleanVar() self.BBOX_FACECOLOR = tk.StringVar() self.BBOX_ALPHA = tk.DoubleVar() self.FILLED = tk.BooleanVar() # Default attribute values: # self.SHOW.set(True) self.SIZE.set(1.5) self.SYMBOL.set('o') self.COLOR.set('black') self.ALPHA.set(1.0) self.EDGECOLOR.set('blue') self.FACECOLOR.set('aqua') self.LINEWIDTH.set(1.0) self.LINESTYLE.set('-') self.HA.set('left') self.VA.set('baseline') self.WRAP.set(True) self.TCOLOR.set('black') self.STYLE.set('normal') self.WEIGHT.set('bold') self.ZORDER.set(1) self.TSIZE.set(10) self.ANGLE.set(0) self.XPAD.set(0.1) self.YPAD.set(0) self.BBOX.set(False) self.BBOX_FACECOLOR.set('white') self.BBOX_ALPHA.set(0.5) self.FILLED.set(False) # If configuration file exists, it is read and # the default values are overrided. If the configuration # file does not exist, it is created using the default values. # if exists(self.FILECONF): try: self.MESSAGE += 'Loading GEO configuration' #print('Loading GEO configuration') self.load(self.FILECONF) except: self.MESSAGE += 'Error: Saving default GEO configuration' #print('Error: Saving default GEO configuration') self.save(self.FILECONF) else: self.MESSAGE += 'Saving default GEO configuration' #print('Saving default GEO configuration') self.save(self.FILECONF)
def __init__(self): self.MESSAGE = "\n" with open(COSMO_CONF_DATA) as infile: conf = json.load(infile) COSMO_CONF_NAME = conf['COSMO_CONF_NAME'] COSMO_CONF = COSMO_CONF_PATH + COSMO_CONF_NAME + os.sep self.FILECONF = os.path.join(COSMO_CONF,'mlm.conf') self.PATH = tk.StringVar() self.BIN = tk.StringVar() self.VEC = [] self.UINDEX = 0 self.VINDEX = None self.TINDEX = None self.UFILE = tk.StringVar() self.Ux = tk.StringVar() self.Uy = tk.StringVar() self.Uz = tk.StringVar() self.Ut = tk.StringVar() self.Uu = tk.StringVar() self.VFILE = tk.StringVar() self.Vx = tk.StringVar() self.Vy = tk.StringVar() self.Vz = tk.StringVar() self.Vt = tk.StringVar() self.Vv = tk.StringVar() self.TFILE = tk.StringVar() self.Tx = tk.StringVar() self.Ty = tk.StringVar() self.Tz = tk.StringVar() self.Tt = tk.StringVar() self.Tvname = tk.StringVar() self.INI_USE = tk.BooleanVar() self.INI = tk.StringVar() self.FIN = tk.StringVar() self.TRAJECTORY = tk.StringVar() self.INI_USE.set(False) self.xo = tk.DoubleVar() self.yo = tk.DoubleVar() self.to = tk.DoubleVar() self.time_sim = tk.DoubleVar() #self.do = tk.StringVar() #self.to_use = tk.BooleanVar() #self.to_use.set(False) self.reverse = tk.BooleanVar() self.stationary = tk.BooleanVar() self.record_use = tk.BooleanVar() self.record = tk.IntVar() self.idt = tk.IntVar() #self.edt = tk.IntVar() #self.record_use.set(False) self.seed = tk.IntVar() self.nfloats = tk.IntVar() self.Rx = tk.DoubleVar() self.Ry = tk.DoubleVar() self.Rt = tk.DoubleVar() # Default "Manufacturer" parameters: # self.PATH.set(os.path.join(COSMO_ROOT,'bin/')) self.BIN.set('mlm') self.TRAJECTORY.set('mlm.nc') self.INI.set('') self.FIN.set('mlm.end') self.xo.set(None) self.yo.set(None) self.to.set(None) #self.do.set('') #self.record.set(None) self.stationary.set(False) #self.edt.set(None) self.idt.set(1200) self.seed.set(None) self.nfloats.set(10) self.Rx.set(0.10) self.Ry.set(0.10) self.Rt.set(0) if exists(self.FILECONF): self.MESSAGE += 'Reading MLM configuration' self.load(self.FILECONF) else: self.MESSAGE += 'Saving MLM configuration' self.save(self.FILECONF)
def __init__(self): # ================== '''Define and initialize class attributes''' self.MESSAGE = "" with open(COSMO_CONF_DATA) as infile: conf = json.load(infile) COSMO_CONF_NAME = conf['COSMO_CONF_NAME'] COSMO_CONF = COSMO_CONF_PATH + COSMO_CONF_NAME + os.sep self.FILECONF = COSMO_CONF + 'line.conf' self.LINE_SHOW = tk.BooleanVar() self.LINE_STYLE = tk.StringVar() self.LINE_WIDTH = tk.DoubleVar() self.LINE_COLOR = tk.StringVar() self.MARKER_SHOW = tk.BooleanVar() self.MARKER_STYLE = tk.StringVar() self.MARKER_SIZE = tk.DoubleVar() self.MARKER_COLOR = tk.StringVar() self.INITIAL_SHOW = tk.BooleanVar() self.INITIAL_STYLE = tk.StringVar() self.INITIAL_SIZE = tk.DoubleVar() self.INITIAL_COLOR = tk.StringVar() self.ONMAP_SHOW = tk.BooleanVar() self.ONMAP_STYLE = tk.StringVar() self.ONMAP_SIZE = tk.IntVar() self.ONMAP_COLOR = tk.StringVar() self.ZORDER = tk.IntVar() self.ALPHA = tk.DoubleVar() # Default attribute values # self.LINE_SHOW.set(True) self.LINE_WIDTH.set(1.5) self.LINE_COLOR.set('blue') self.LINE_STYLE.set('-') self.MARKER_SHOW.set(False) self.MARKER_STYLE.set('o') self.MARKER_COLOR.set('blue') self.MARKER_SIZE.set(3) self.INITIAL_SHOW.set(True) self.INITIAL_STYLE.set('o') self.INITIAL_COLOR.set('red') self.INITIAL_SIZE.set(4) self.ONMAP_SHOW.set(False) self.ONMAP_STYLE.set('o') self.ONMAP_COLOR.set('red') self.ONMAP_SIZE.set(4) self.ZORDER.set(4) self.ALPHA.set(1.0) # If configuration file exists, it is read and # the default values are overrided. If the configuration # file does not exist, it is created using the default values. # if exists(self.FILECONF): try: self.MESSAGE += 'Loading LINE configuration' #print('Loading LINE configuration') self.load(self.FILECONF) except: self.MESSAGE += 'Error: Saving default LINE configuration' #print('Error: Saving default LINE configuration') self.save(self.FILECONF) else: self.MESSAGE += 'Saving default LINE configuration' #print('Saving default LINE configuration') self.save(self.FILECONF)
def __init__(self): # ================= '''Define and initialize class attributes''' with open(COSMO_CONF_DATA) as infile: conf = json.load(infile) #COSMO_CONF_PATH = conf['COSMO_CONF_PATH'] COSMO_CONF_NAME = conf['COSMO_CONF_NAME'] COSMO_CONF = COSMO_CONF_PATH + COSMO_CONF_NAME + os.sep self.FILECONF = COSMO_CONF + 'legend.conf' self.SHOW = tk.BooleanVar() self.LOC = tk.IntVar() self.MODE = tk.IntVar() self.NCOL = tk.IntVar() self.FONTSIZE = tk.IntVar() self.FANCYBOX = tk.BooleanVar() self.FRAMEON = tk.BooleanVar() self.SHADOW = tk.BooleanVar() self.TITLE = tk.StringVar() self.ALPHA = tk.DoubleVar() self.COLOR = tk.StringVar() self.EDGECOLOR = tk.StringVar() self.MARKERSCALE = tk.DoubleVar() self.LABELSPACING = tk.DoubleVar() self.BORDERPAD = tk.DoubleVar() self.HANDLETEXTPAD = tk.DoubleVar() self.BORDERAXESPAD = tk.DoubleVar() self.TITLEFONT = FontProperties().copy() # Default values: self.SHOW.set(True) self.LOC.set(0) self.MODE.set(0) self.NCOL.set(1) self.FONTSIZE.set(12) self.FANCYBOX.set(True) self.FRAMEON.set(True) self.SHADOW.set(True) self.TITLE.set('') self.ALPHA.set(1) self.COLOR.set('white') self.EDGECOLOR.set(None) self.MARKERSCALE.set(matplotlib.rcParams['legend.markerscale']) self.LABELSPACING.set(matplotlib.rcParams['legend.labelspacing']) self.BORDERPAD.set(matplotlib.rcParams['legend.borderpad']) self.HANDLETEXTPAD.set(matplotlib.rcParams['legend.handletextpad']) self.BORDERAXESPAD.set(matplotlib.rcParams['legend.borderaxespad']) self.TITLEFONT.set_weight('bold') # If configuration file exists, it is read and # the default values are overrided. If the configuration # file does not exist, it is created using the default values. # if exists(self.FILECONF): try: print('Loading LEGEND configuration') self.load(self.FILECONF) except: print('Error: Saving default LEGEND configuration') self.save(self.FILECONF) else: print('Saving default LEGEND configuration') self.save(self.FILECONF)
def __init__(self): with open(COSMO_CONF_DATA) as infile: conf = json.load(infile) COSMO_CONF_NAME = conf['COSMO_CONF_NAME'] COSMO_CONF = COSMO_CONF_PATH + COSMO_CONF_NAME + os.sep self.FILECONF = os.path.join(COSMO_CONF, 'clm.conf') self.PATH = tk.StringVar() self.BIN = tk.StringVar() self.VEC = [] self.UINDEX = 0 self.VINDEX = 0 self.UFILE = tk.StringVar() self.Ux = tk.StringVar() self.Uy = tk.StringVar() self.Uz = tk.StringVar() self.Ut = tk.StringVar() self.Uu = tk.StringVar() self.VFILE = tk.StringVar() self.Vx = tk.StringVar() self.Vy = tk.StringVar() self.Vz = tk.StringVar() self.Vt = tk.StringVar() self.Vv = tk.StringVar() self.INI_USE = tk.BooleanVar() self.INI = tk.StringVar() self.FIN = tk.StringVar() self.TRAJECTORY = tk.StringVar() self.SFILE = tk.StringVar() self.INI_USE.set(False) self.xo = tk.DoubleVar() self.yo = tk.DoubleVar() self.zo = tk.DoubleVar() self.to = tk.DoubleVar() self.do = tk.StringVar() self.to_use = tk.BooleanVar() self.reverse = tk.BooleanVar() self.crop = tk.BooleanVar() self.west = tk.DoubleVar() self.east = tk.DoubleVar() self.south = tk.DoubleVar() self.north = tk.DoubleVar() self.Lini = tk.IntVar() self.Tini = tk.DoubleVar() self.Dini = tk.StringVar() self.Duration = tk.StringVar() self.dt = tk.IntVar() self.script = tk.BooleanVar() self.alpha = tk.DoubleVar() self.mu = tk.DoubleVar() self.va = tk.DoubleVar() self.nfloats = tk.IntVar() self.Rx = tk.DoubleVar() self.Ry = tk.DoubleVar() # Default "Manufacturer" parameters: # self.PATH.set(os.path.join(COSMO_ROOT, 'bin/')) self.BIN.set('clm') self.TRAJECTORY.set('clm.nc') self.INI.set('') self.FIN.set('final.dat') self.SFILE.set('simulation.clm') self.xo.set(None) self.yo.set(None) self.zo.set(0.0) self.to.set(0.0) self.do.set('') self.crop.set(False) self.Lini.set(2) self.Duration.set(7) self.dt.set(600) self.to_use.set(True) self.script.set(False) self.alpha.set(1.0) self.mu.set(0.0) self.va.set(0.0) self.nfloats.set(10) self.Rx.set(0.02) self.Ry.set(0.02) self.MESSAGE = "\n" if exists(self.FILECONF): self.MESSAGE += 'Reading CLM configuration' self.load(self.FILECONF) else: self.MESSAGE += 'Saving CLM configuration' self.save(self.FILECONF)