def __init__(self): """ 1) Inititialise parser options. 2) Proces options (e.g. turn string lists into pyton lists) 3) Create dataBaseBackend instance for retrievel of data and info 4) Initialise variables """ ### Parse options and arguments # Create option parser parser = OptionParser() # Add the option names parser.add_option("-t", "--type") parser.add_option("-i", "--idlist") parser.add_option("-f", "--from_d") parser.add_option("-z", "--to_d") parser.add_option("-a", "--xmin") parser.add_option("-b", "--xmax") parser.add_option("-c", "--ymin") parser.add_option("-d", "--ymax") parser.add_option("-o", "--offset") parser.add_option("-e", "--as_function_of_t") parser.add_option("-l", "--logscale") parser.add_option("-s", "--shift_temp_unit") parser.add_option("-j", "--shift_be_ke") # Parse the options and arguments (self.options, args) = parser.parse_args() ### Process options # Fetch idlist self.idlist = [int(element) for element in self.options.idlist.split(',')[1:]] # Turn the offset "key:value," pair string into a dictionary self.offsets = dict([[int(offset.split(':')[0]), offset.split(':')[1]] for offset in self.options.offset.split(',')[1:]]) # Turn booleans into python booleans self.as_function_of_t = True if self.options.as_function_of_t ==\ 'checked' else False self.shift_temp_unit = True if self.options.shift_temp_unit ==\ 'checked' else False self.logscale = True if self.options.logscale == 'checked' else False self.shift_be_ke = True if self.options.shift_be_ke ==\ 'checked' else False ### Create dataBaseBackend instance for data and info retrievel self.from_to = {'from':self.options.from_d, 'to':self.options.to_d} self.db = dataBaseBackend(typed=self.options.type, from_to=self.from_to, id_list=self.idlist, offsets=self.offsets, as_function_of_t=self.as_function_of_t, shift_temp_unit=self.shift_temp_unit, shift_be_ke=self.shift_be_ke) ### Initialise the local data variable to the empty list self.data = []
def __init__(self): """ Turn all the input options into appropriate python data structures and initiate a few helper objects """ parser = OptionParser() # Add the options to the option parser # Option help at https://cinfwiki.fysik.dtu.dk/cinfwiki/Software/ # DataWebPageDeveloperDocumentation#plot.py parser.add_option('--type') # String option parser.add_option('--boolean_options') # Boolean options parser.add_option('--left_plotlist') # int list parser.add_option('--right_plotlist') # int list parser.add_option('--xscale_bounding') # Float pair parser.add_option('--left_yscale_bounding') # Float pair parser.add_option('--right_yscale_bounding') # Float pair parser.add_option('--from_to') # Time stamp pair NOT HANDLED # Parse the options (options, args) = parser.parse_args() ### Process options into self.o - all options are given as strings, ### and they need to be converted into other data types self.o = {} # Parse boolean options for pair in options.boolean_options.split(',')[1:]: key, value = pair.split(':') self.o[key] = True if value == 'checked' else False # Parse bounds bkeys = [s + '_bounding' for s in ['xscale', 'left_yscale', 'right_yscale']] for bound in bkeys: bounding = [b if b != '' else '0' for b in options.__dict__[bound].split(',')] if bounding != ['0', '0']: self.o[bound] = tuple( [float(b) for b in bounding] ) else: self.o[bound] = None # Parse lists for plotlist in ['left_plotlist', 'right_plotlist']: # List comprehension, split list string up and turn into integer # and add to new list, but only of > 0 self.o[plotlist] = [int(a) for a in options.__dict__[plotlist].split(',')[1:] if int(a) > 0] # Parse string options for key in ['type']: self.o[key] = options.__dict__[key] # From_to self.o['from_to'] = options.from_to.split(',') ### Done processing options # If a dateplot and called without (valid) datetimes fill them in try: strptime(self.o['from_to'][0], '%Y-%m-%d %H:%M') strptime(self.o['from_to'][1], '%Y-%m-%d %H:%M') except ValueError: # [now-1d, now] self.o['from_to'][0] = strftime('%Y-%m-%d %H:%M', localtime(time()-24*3600)) self.o['from_to'][1] = strftime('%Y-%m-%d %H:%M') # Get a (g)eneral (g)raph (s)ettings object # (Is not polulated with data set specific values) self.ggs = graphSettings(self.o['type']).settings ### Create database backend object self.db = dataBaseBackend(options=self.o, ggs=self.ggs) self.defaults = {}
def __init__(self): """ Description of init """ # Create the option parser for the command line options usage = ( 'usage: %prog [options]\n\n' 'All options are strings. Boolean options are true when they \n' 'contains a certain specific keywords, which is written in \n' 'the option description in parantheses.') parser = OptionParser(usage=usage) # Add the options to the option parser parser.add_option('-a', '--type', help='Type string from ' 'graphsettings.xml') parser.add_option('-b', '--idlist', help='List of id\'s to plot') parser.add_option('-c', '--from_d', help='From timestamp, format: ' 'YYYY-MM-DD HH:MM') parser.add_option('-d', '--to_d', help='To timestamp, format: ' 'YYYY-MM-DD HH:MM') parser.add_option('-e', '--xmin', help='X-min for zoom') parser.add_option('-f', '--xmax', help='X-max for zoom') parser.add_option('-g', '--ymin', help='Y-min for zoom') parser.add_option('-i', '--ymax', help='Y-max for zoom') parser.add_option('-j', '--offset', help='List of offsets for the ' 'graphs (for plots that goes on a log scale and has ' 'negative values)') parser.add_option( '-k', '--as_function_of_t', help='Plot the graphs as ' 'a function of temperature (boolean \'checked\'=True)') parser.add_option('-l', '--logscale', help='Use a log for the right ' 'axis (boolean \'checked\'=True)') parser.add_option('-m', '--shift_temp_unit', help='Change between K ' 'and C when values are plotted as a function of ' 'temperature (boolean \'checked\'=True)') parser.add_option('-n', '--flip_x', help='Exchange min and max for the ' 'x-axis (boolean \'checked\'=True)') parser.add_option('-o', '--shift_be_ke', help='Shift between binding ' 'energy and kinetic energy for XPS plots (boolean ' '\'checked\'=True)') # -p is availabel from previous options parser.add_option( '-q', '--image_format', help='Image format for the ' 'figure exports, given as the figure extension. Can ' 'be svg, eps, ps, pdf and default. Default means use ' 'the one in graphsettings.xml or internal deaault.') parser.add_option('-r', '--small_plot', help='Produce a small plot ' '(boolean \'checked\'=1)') # Parse the options (options, args) = parser.parse_args() ### Process options - all options are given as string, and they need to ### be converted into other data types # Convert idlist self.idlist = [ int(element) for element in options.idlist.split(',')[1:] ] # Turn the offset 'key:value,' pair string into a dictionary self.offsets = dict([[int(offset.split(':')[0]), offset.split(':')[1]] for offset in options.offset.split(',')[1:]]) # Gather from and to in a fictionary self.from_to = {'from': options.from_d, 'to': options.to_d} # Turn several options into booleans self.as_function_of_t = True if options.as_function_of_t ==\ 'checked' else False self.shift_temp_unit = True if options.shift_temp_unit ==\ 'checked' else False self.logscale = True if options.logscale == 'checked' else False self.flip_x = True if options.flip_x == 'checked' else False self.shift_be_ke = True if options.shift_be_ke == 'checked' else False self.small_plot = True if options.small_plot == '1' else False ### Create database backend object self.db = dataBaseBackend(typed=options.type, from_to=self.from_to, id_list=self.idlist, offsets=self.offsets, as_function_of_t=self.as_function_of_t, shift_temp_unit=self.shift_temp_unit, shift_be_ke=self.shift_be_ke) ### Ask self.db for a measurement count measurement_count = self.db.get_data_count() # Set the image format to standard, overwite with gs value and again # options value if i exits if options.image_format: if options.image_format == 'default': if self.db.global_settings.has_key('image_format'): self.image_format = self.db.global_settings['image_format'] else: self.image_format = 'png' else: self.image_format = options.image_format else: self.image_format = 'png' # Create a hash from the measurement_count, options and #self.db.global_settings hash = hashlib.md5() hash.update( str(options) + str(self.db.global_settings) + str(measurement_count)) # self.namehash is unique for this plot and will form the filename self.namehash = ('/var/www/cinfdata/figures/' + hash.hexdigest() + '.' + self.image_format) # For use in other methods self.options = options # object to give first good color, and then random colors self.c = Color() self.left_color = 'black' self.right_color = 'black'
def __init__(self): """ Description of init """ # Create optionparser parser = OptionParser() # Add the options to the option parser # Option help at https://cinfwiki.fysik.dtu.dk/cinfwiki/Software/ # DataWebPageDeveloperDocumentation#plot.py parser.add_option('--type') # String option parser.add_option('--boolean_options') # Boolean options parser.add_option('--left_plotlist') # int list parser.add_option('--right_plotlist') # int list parser.add_option('--xscale_bounding') # Float pair parser.add_option('--left_yscale_bounding') # Float pair parser.add_option('--right_yscale_bounding') # Float pair parser.add_option('--from_to') # Time stamp pair NOT HANDLED parser.add_option('--image_format') # String options parser.add_option('--manual_labels_n_titel') # Manual labels and title for mpl parser.add_option('--input_id') # Database id for plugin input parser.add_option('--reference_lines') # Reference lines # KARL TODO To __init__ add command line options to recieve # the reference line sets that should be displayed and parse # it # Parse the options (options, args) = parser.parse_args() ### Process options into self.o - all options are given as strings, ### and they need to be converted into other data types self.o = {} # Parse boolean options for pair in options.boolean_options.split(',')[1:]: key, value = pair.split(':') self.o[key] = True if value == 'checked' else False # Parse bounds bkeys = [s + '_bounding' for s in ['xscale', 'left_yscale', 'right_yscale']] for bound in bkeys: bounding = [b if b != '' else '0' for b in options.__dict__[bound].split(',')] if bounding != ['0', '0']: self.o[bound] = tuple( [float(b) for b in bounding] ) else: self.o[bound] = None # Parse lists for plotlist in ['left_plotlist', 'right_plotlist']: # List comprehension, split list string up and turn into integer # and add to new list, but only of > 0 self.o[plotlist] = [int(a) for a in options.__dict__[plotlist].split(',')[1:] if int(a) > 0] # Parse reference lines self.o['reference_lines'] = options.reference_lines.strip(',').split(',') # Parse string options for key in ['type', 'image_format']: self.o[key] = options.__dict__[key] for opt in options.manual_labels_n_titel.split(','): self.o[opt.split('=')[0]] = opt.split('=')[1] # From_to self.o['from_to'] = options.from_to.split(',') # Database ID for plugin input self.o['input_id'] = int(options.input_id) ### Done processing options # Get a (g)eneral (g)raph (s)ettings object # (Are not polulated with data set specific values) self.ggs = graphSettings(self.o['type']) # If a dateplot and called without (valid) datetimes fill them in try: strptime(self.o['from_to'][0], '%Y-%m-%d %H:%M') strptime(self.o['from_to'][1], '%Y-%m-%d %H:%M') except ValueError: start = time()-24*3600 if self.ggs.has_key('default_time'): default_time = int(self.ggs['default_time']) start = time()-default_time*3600 # [now-1d, now] self.o['from_to'][0] = strftime('%Y-%m-%d %H:%M', localtime(start)) self.o['from_to'][1] = strftime('%Y-%m-%d %H:%M') ### Create database backend object self.db = dataBaseBackend(options=self.o, ggs=self.ggs) self.defaults = {}
def __init__(self): """ Description of init """ # Create optionparser parser = OptionParser() # Add the options to the option parser # Option help at https://cinfwiki.fysik.dtu.dk/cinfwiki/Software/ # DataWebPageDeveloperDocumentation#plot.py parser.add_option('--type') # String option parser.add_option('--boolean_options') # Boolean options parser.add_option('--left_plotlist') # int list parser.add_option('--right_plotlist') # int list parser.add_option('--xscale_bounding') # Float pair parser.add_option('--left_yscale_bounding') # Float pair parser.add_option('--right_yscale_bounding') # Float pair parser.add_option('--from_to') # Time stamp pair NOT HANDLED parser.add_option('--image_format') # String options parser.add_option('--manual_labels_n_titel') # Manual labels and title for mpl parser.add_option('--input_id') # Database id for plugin input # Parse the options (options, args) = parser.parse_args() ### Process options into self.o - all options are given as strings, ### and they need to be converted into other data types self.o = {} # Parse boolean options for pair in options.boolean_options.split(',')[1:]: key, value = pair.split(':') self.o[key] = True if value == 'checked' else False # Parse bounds bkeys = [s + '_bounding' for s in ['xscale', 'left_yscale', 'right_yscale']] for bound in bkeys: bounding = [b if b != '' else '0' for b in options.__dict__[bound].split(',')] if bounding != ['0', '0']: self.o[bound] = tuple( [float(b) for b in bounding] ) else: self.o[bound] = None # Parse lists for plotlist in ['left_plotlist', 'right_plotlist']: # List comprehension, split list string up and turn into integer # and add to new list, but only of > 0 self.o[plotlist] = [int(a) for a in options.__dict__[plotlist].split(',')[1:] if int(a) > 0] # Parse string options for key in ['type', 'image_format']: self.o[key] = options.__dict__[key] for opt in options.manual_labels_n_titel.split(','): self.o[opt.split('=')[0]] = opt.split('=')[1] # From_to self.o['from_to'] = options.from_to.split(',') # Database ID for plugin input self.o['input_id'] = int(options.input_id) ### Done processing options # Get a (g)eneral (g)raph (s)ettings object # (Are not polulated with data set specific values) self.ggs = graphSettings(self.o['type']).settings # If a dateplot and called without (valid) datetimes fill them in try: strptime(self.o['from_to'][0], '%Y-%m-%d %H:%M') strptime(self.o['from_to'][1], '%Y-%m-%d %H:%M') except ValueError: start = time()-24*3600 if self.ggs.has_key('default_time'): default_time = int(self.ggs['default_time']) start = time()-default_time*3600 # [now-1d, now] self.o['from_to'][0] = strftime('%Y-%m-%d %H:%M', localtime(start)) self.o['from_to'][1] = strftime('%Y-%m-%d %H:%M') ### Create database backend object self.db = dataBaseBackend(options=self.o, ggs=self.ggs) self.defaults = {}
def __init__(self): """ Description of init """ # Create the option parser for the command line options usage = ('usage: %prog [options]\n\n' 'All options are strings. Boolean options are true when they \n' 'contains a certain specific keywords, which is written in \n' 'the option description in parantheses.') parser = OptionParser(usage=usage) # Add the options to the option parser parser.add_option('-a', '--type', help='Type string from ' 'graphsettings.xml') parser.add_option('-b', '--idlist', help='List of id\'s to plot') parser.add_option('-c', '--from_d', help='From timestamp, format: ' 'YYYY-MM-DD HH:MM') parser.add_option('-d', '--to_d', help='To timestamp, format: ' 'YYYY-MM-DD HH:MM') parser.add_option('-e', '--xmin', help='X-min for zoom') parser.add_option('-f', '--xmax', help='X-max for zoom') parser.add_option('-g', '--ymin', help='Y-min for zoom') parser.add_option('-i', '--ymax', help='Y-max for zoom') parser.add_option('-j', '--offset', help='List of offsets for the ' 'graphs (for plots that goes on a log scale and has ' 'negative values)') parser.add_option('-k', '--as_function_of_t', help='Plot the graphs as ' 'a function of temperature (boolean \'checked\'=True)') parser.add_option('-l', '--logscale', help='Use a log for the right ' 'axis (boolean \'checked\'=True)') parser.add_option('-m', '--shift_temp_unit', help='Change between K ' 'and C when values are plotted as a function of ' 'temperature (boolean \'checked\'=True)') parser.add_option('-n', '--flip_x', help='Exchange min and max for the ' 'x-axis (boolean \'checked\'=True)') parser.add_option('-o', '--shift_be_ke', help='Shift between binding ' 'energy and kinetic energy for XPS plots (boolean ' '\'checked\'=True)') # -p is availabel from previous options parser.add_option('-q', '--image_format', help='Image format for the ' 'figure exports, given as the figure extension. Can ' 'be svg, eps, ps, pdf and default. Default means use ' 'the one in graphsettings.xml or internal deaault.') parser.add_option('-r', '--small_plot', help='Produce a small plot ' '(boolean \'checked\'=1)') # Parse the options (options, args) = parser.parse_args() ### Process options - all options are given as string, and they need to ### be converted into other data types # Convert idlist self.idlist = [int(element) for element in options.idlist.split(',')[1:]] # Turn the offset 'key:value,' pair string into a dictionary self.offsets = dict([[int(offset.split(':')[0]), offset.split(':')[1]] for offset in options.offset.split(',')[1:]]) # Gather from and to in a fictionary self.from_to = {'from':options.from_d, 'to':options.to_d} # Turn several options into booleans self.as_function_of_t = True if options.as_function_of_t ==\ 'checked' else False self.shift_temp_unit = True if options.shift_temp_unit ==\ 'checked' else False self.logscale = True if options.logscale == 'checked' else False self.flip_x = True if options.flip_x == 'checked' else False self.shift_be_ke = True if options.shift_be_ke == 'checked' else False self.small_plot = True if options.small_plot == '1' else False ### Create database backend object self.db = dataBaseBackend(typed=options.type, from_to=self.from_to, id_list=self.idlist, offsets=self.offsets, as_function_of_t=self.as_function_of_t, shift_temp_unit=self.shift_temp_unit, shift_be_ke=self.shift_be_ke) ### Ask self.db for a measurement count measurement_count = self.db.get_data_count() # Set the image format to standard, overwite with gs value and again # options value if i exits if options.image_format: if options.image_format == 'default': if self.db.global_settings.has_key('image_format'): self.image_format = self.db.global_settings['image_format'] else: self.image_format = 'png' else: self.image_format = options.image_format else: self.image_format = 'png' # Create a hash from the measurement_count, options and #self.db.global_settings hash = hashlib.md5() hash.update(str(options) + str(self.db.global_settings) + str(measurement_count)) # self.namehash is unique for this plot and will form the filename self.namehash = ('/var/www/cinfdata/figures/' + hash.hexdigest() + '.' + self.image_format) # For use in other methods self.options = options # object to give first good color, and then random colors self.c = Color() self.left_color = 'black' self.right_color = 'black'
def __init__(self): """ Description of init """ # Create and parse the options parser = OptionParser() # Add the option names parser.add_option("-a", "--type") parser.add_option("-b", "--idlist") parser.add_option("-c", "--from_d") parser.add_option("-d", "--to_d") parser.add_option("-e", "--xmin") parser.add_option("-f", "--xmax") parser.add_option("-g", "--ymin") parser.add_option("-i", "--ymax") parser.add_option("-j", "--offset") parser.add_option("-k", "--as_function_of_t") parser.add_option("-l", "--logscale") parser.add_option("-m", "--shift_temp_unit") parser.add_option("-n", "--flip_x") parser.add_option("-o", "--shift_be_ke") parser.add_option("-p", "--size") (options, args) = parser.parse_args() # For use in other methods self.options = options ### Process options # Fetch idlist self.idlist = [ int(element) for element in options.idlist.split(',')[1:] ] # Turn the offset "key:value," pair string into a dictionary self.offsets = dict([[int(offset.split(':')[0]), offset.split(':')[1]] for offset in options.offset.split(',')[1:]]) # Turn as_function_of_t into boolean self.as_function_of_t = True if options.as_function_of_t ==\ 'checked' else False self.shift_temp_unit = True if options.shift_temp_unit ==\ 'checked' else False self.logscale = True if options.logscale == 'checked' else False self.flip_x = True if options.flip_x == 'checked' else False self.shift_be_ke = True if options.shift_be_ke == 'checked' else False ### Create db object # ADD MORE OPTIONS self.from_to = {'from': options.from_d, 'to': options.to_d} self.db = dataBaseBackend(typed=options.type, from_to=self.from_to, id_list=self.idlist, offsets=self.offsets, as_function_of_t=self.as_function_of_t, shift_temp_unit=self.shift_temp_unit, shift_be_ke=self.shift_be_ke) self.standard_sizes = { 'small': '450x300', 'large': '4500x3000', 'def_size': '900x600' } # The 'name' is a string that is unique for this plot # Here we add all the information that is entered into the db object self.name = self.db.global_settings['chamber_name'] + '_' + options.type if options.from_d != '' or options.to_d != '': self.name += '_' + options.from_d + '_' + options.to_d self.name += ('_' + 'as_function_of_t') if self.as_function_of_t else '' self.name += ('_' + 'shift_temp_unit') if self.shift_temp_unit else '' self.name += ('_' + 'logscale') if self.logscale else '' self.name += ('_' + 'flip_x') if self.flip_x else '' self.name += ('_' + 'shift_be_ke') if self.shift_be_ke else '' if len(self.idlist) > 0: self.name += '_' + str(self.idlist) # object to give first good color, and then random colors self.c = color()
def __init__(self): """ Description of init """ # Create and parse the options parser = OptionParser() # Add the option names parser.add_option("-a", "--type") parser.add_option("-b", "--idlist") parser.add_option("-c", "--from_d") parser.add_option("-d", "--to_d") parser.add_option("-e", "--xmin") parser.add_option("-f", "--xmax") parser.add_option("-g", "--ymin") parser.add_option("-i", "--ymax") parser.add_option("-j", "--offset") parser.add_option("-k", "--as_function_of_t") parser.add_option("-l", "--logscale") parser.add_option("-m", "--shift_temp_unit") parser.add_option("-n", "--flip_x") parser.add_option("-o", "--shift_be_ke") parser.add_option("-p", "--size") (options, args) = parser.parse_args() # For use in other methods self.options = options ### Process options # Fetch idlist self.idlist = [int(element) for element in options.idlist.split(',')[1:]] # Turn the offset "key:value," pair string into a dictionary self.offsets = dict([[int(offset.split(':')[0]), offset.split(':')[1]] for offset in options.offset.split(',')[1:]]) # Turn as_function_of_t into boolean self.as_function_of_t = True if options.as_function_of_t ==\ 'checked' else False self.shift_temp_unit = True if options.shift_temp_unit ==\ 'checked' else False self.logscale = True if options.logscale == 'checked' else False self.flip_x = True if options.flip_x == 'checked' else False self.shift_be_ke = True if options.shift_be_ke == 'checked' else False ### Create db object # ADD MORE OPTIONS self.from_to = {'from':options.from_d, 'to':options.to_d} self.db = dataBaseBackend(typed=options.type, from_to=self.from_to, id_list=self.idlist, offsets=self.offsets, as_function_of_t=self.as_function_of_t, shift_temp_unit=self.shift_temp_unit, shift_be_ke=self.shift_be_ke) self.standard_sizes = {'small':'450x300', 'large':'4500x3000', 'def_size':'900x600'} # The 'name' is a string that is unique for this plot # Here we add all the information that is entered into the db object self.name = self.db.global_settings['chamber_name'] + '_' + options.type if options.from_d != '' or options.to_d != '': self.name += '_' + options.from_d + '_' + options.to_d self.name += ('_' + 'as_function_of_t') if self.as_function_of_t else '' self.name += ('_' + 'shift_temp_unit') if self.shift_temp_unit else '' self.name += ('_' + 'logscale') if self.logscale else '' self.name += ('_' + 'flip_x') if self.flip_x else '' self.name += ('_' + 'shift_be_ke') if self.shift_be_ke else '' if len(self.idlist) > 0: self.name += '_' + str(self.idlist) # object to give first good color, and then random colors self.c = color()
# Fetch idlist idlist = [int(element) for element in options.idlist.split(',')[1:]] # Turn the offset "key:value," pair string into a dictionary offsets = dict([[int(offset.split(':')[0]), offset.split(':')[1]] for offset in options.offset.split(',')[1:]]) # Turn as_function_of_t into boolean as_function_of_t = True if options.as_function_of_t == 'checked' else False shift_temp_unit = True if options.shift_temp_unit == 'checked' else False logscale = True if options.logscale == 'checked' else False flip_x = True if options.flip_x == 'checked' else False shift_be_ke = True if options.shift_be_ke == 'checked' else False # Create db object # ADD MORE OPTIONS from_to = {'from':options.from_d, 'to':options.to_d} db = dataBaseBackend(typed=options.type, from_to=from_to, id_list=idlist, offsets=offsets, as_function_of_t=as_function_of_t, shift_temp_unit=shift_temp_unit, shift_be_ke=shift_be_ke) # The 'name' is a string that is unique for this plot # Here we add all the information that is entered into the db object name = db.global_settings['chamber_name'] + '_' + options.type if options.from_d != '' or options.to_d != '': name += '_' + options.from_d + '_' + options.to_d name += ('_' + 'as_function_of_t') if as_function_of_t else '' name += ('_' + 'shift_temp_unit') if shift_temp_unit else '' name += ('_' + 'logscale') if logscale else '' if len(idlist) > 0: name += '_' + str(idlist)
offsets = dict([[int(offset.split(':')[0]), offset.split(':')[1]] for offset in options.offset.split(',')[1:]]) # Turn as_function_of_t into boolean as_function_of_t = True if options.as_function_of_t == 'checked' else False shift_temp_unit = True if options.shift_temp_unit == 'checked' else False logscale = True if options.logscale == 'checked' else False flip_x = True if options.flip_x == 'checked' else False shift_be_ke = True if options.shift_be_ke == 'checked' else False # Create db object # ADD MORE OPTIONS from_to = {'from': options.from_d, 'to': options.to_d} db = dataBaseBackend(typed=options.type, from_to=from_to, id_list=idlist, offsets=offsets, as_function_of_t=as_function_of_t, shift_temp_unit=shift_temp_unit, shift_be_ke=shift_be_ke) # The 'name' is a string that is unique for this plot # Here we add all the information that is entered into the db object name = db.global_settings['chamber_name'] + '_' + options.type if options.from_d != '' or options.to_d != '': name += '_' + options.from_d + '_' + options.to_d name += ('_' + 'as_function_of_t') if as_function_of_t else '' name += ('_' + 'shift_temp_unit') if shift_temp_unit else '' name += ('_' + 'logscale') if logscale else ''