diff --git a/devel-docs/doxygen/Doxyfile.doxy b/devel-docs/doxygen/Doxyfile.doxy index b8c44923..fbedcc58 100644 --- a/devel-docs/doxygen/Doxyfile.doxy +++ b/devel-docs/doxygen/Doxyfile.doxy @@ -1,1600 +1,1600 @@ # Doxyfile 1.6.3 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project # # All text after a hash (#) is considered a comment and will be ignored # The format is: # TAG = value [value, ...] # For lists items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (" ") #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # This tag specifies the encoding used for all characters in the config file # that follow. The default is UTF-8 which is also the encoding used for all # text before the first occurrence of this tag. Doxygen uses libiconv (or the # iconv built into libc) for the transcoding. See # http://www.gnu.org/software/libiconv for the list of possible encodings. DOXYFILE_ENCODING = UTF-8 # The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. PROJECT_NAME = kst # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or # if some version control system is used. PROJECT_NUMBER = 2.0 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. OUTPUT_DIRECTORY = . # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create # 4096 sub-directories (in 2 levels) under the output directory of each output # format and will distribute the generated files over these directories. # Enabling this option can be useful when feeding doxygen a huge amount of # source files, where putting all generated files in the same directory would # otherwise cause performance problems for the file system. CREATE_SUBDIRS = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # The default language is English, other supported languages are: # Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, # Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, # Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English # messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, # Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, # Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. OUTPUT_LANGUAGE = English # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will # include brief member descriptions after the members that are listed in # the file and class documentation (similar to JavaDoc). # Set to NO to disable this. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend # the brief description of a member or function before the detailed description. # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator # that is used to form the text in various listings. Each string # in this list, if found as the leading text of the brief description, will be # stripped from the text and the result after processing the whole list, is # used as the annotated text. Otherwise, the brief description is used as-is. # If left blank, the following values are used ("$name" is automatically # replaced with the name of the entity): "The $name class" "The $name widget" # "The $name file" "is" "provides" "specifies" "contains" # "represents" "a" "an" "the" ABBREVIATE_BRIEF = "The $name class" \ "The $name widget" \ "The $name file" \ is \ provides \ specifies \ contains \ represents \ a \ an \ the # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # Doxygen will generate a detailed section even if there is only a brief # description. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all # inherited members of a class in the documentation of that class as if those # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full # path before files name in the file list and in the header files. If set # to NO the shortest path that makes the file name unique will be used. FULL_PATH_NAMES = YES # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag # can be used to strip a user-defined part of the path. Stripping is # only done if one of the specified strings matches the left-hand part of # the path. The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the # path to strip. STRIP_FROM_PATH = /Users/dimitri/doxygen/mail/1.5.7/doxywizard/ # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of # the path mentioned in the documentation of a class, which tells # the reader which header file to include in order to use a class. # If left blank only the name of the header file containing the class # definition is used. Otherwise one should specify the include paths that # are normally passed to the compiler using the -I flag. STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter # (but less readable) file names. This can be useful is your file systems # doesn't support long names like on DOS, Mac, or CD-ROM. SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen # will interpret the first line (until the first dot) of a JavaDoc-style # comment as the brief description. If set to NO, the JavaDoc # comments will behave just like regular Qt-style comments # (thus requiring an explicit @brief command for a brief description.) JAVADOC_AUTOBRIEF = NO # If the QT_AUTOBRIEF tag is set to YES then Doxygen will # interpret the first line (until the first dot) of a Qt-style # comment as the brief description. If set to NO, the comments # will behave just like regular Qt-style comments (thus requiring # an explicit \brief command for a brief description.) QT_AUTOBRIEF = NO # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen # treat a multi-line C++ special comment block (i.e. a block of //! or /// # comments) as a brief description. This used to be the default behaviour. # The new default is to treat a multi-line C++ comment block as a detailed # description. Set this tag to YES if you prefer the old behaviour instead. MULTILINE_CPP_IS_BRIEF = NO # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented # member inherits the documentation from any documented member that it # re-implements. INHERIT_DOCS = YES # If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce # a new page for each member. If set to NO, the documentation of a member will # be part of the file/class/namespace that contains it. SEPARATE_MEMBER_PAGES = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. # Doxygen uses this value to replace tabs by spaces in code fragments. TAB_SIZE = 8 # This tag can be used to specify a number of aliases that acts # as commands in the documentation. An alias has the form "name=value". # For example adding "sideeffect=\par Side Effects:\n" will allow you to # put the command \sideeffect (or @sideeffect) in the documentation, which # will result in a user-defined paragraph with heading "Side Effects:". # You can put \n's in the value part of an alias to insert newlines. ALIASES = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C # sources only. Doxygen will then generate output that is more tailored for C. # For instance, some of the names that are used will be different. The list # of all members will be omitted, etc. OPTIMIZE_OUTPUT_FOR_C = NO # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java # sources only. Doxygen will then generate output that is more tailored for # Java. For instance, namespaces will be presented as packages, qualified # scopes will look different, etc. OPTIMIZE_OUTPUT_JAVA = NO # Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran # sources only. Doxygen will then generate output that is more tailored for # Fortran. OPTIMIZE_FOR_FORTRAN = NO # Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL # sources. Doxygen will then generate output that is tailored for # VHDL. OPTIMIZE_OUTPUT_VHDL = NO # Doxygen selects the parser to use depending on the extension of the files it parses. # With this tag you can assign which parser to use for a given extension. # Doxygen has a built-in mapping, but you can override or extend it using this tag. # The format is ext=language, where ext is a file extension, and language is one of # the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP, # Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat # .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran), # use: inc=Fortran f=C. Note that for custom extensions you also need to set # FILE_PATTERNS otherwise the files are not read by doxygen. EXTENSION_MAPPING = # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want # to include (a tag file for) the STL sources as input, then you should # set this tag to YES in order to let doxygen match functions declarations and # definitions whose arguments contain STL classes (e.g. func(std::string); v.s. # func(std::string) {}). This also make the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. BUILTIN_STL_SUPPORT = NO # If you use Microsoft's C++/CLI language, you should set this option to YES to # enable parsing support. CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. # Doxygen will parse them like normal C++ but will assume all classes use public # instead of private inheritance when no explicit protection keyword is present. SIP_SUPPORT = NO # For Microsoft's IDL there are propget and propput attributes to indicate getter # and setter methods for a property. Setting this option to YES (the default) # will make doxygen to replace the get and set methods by a property in the # documentation. This will only work if the methods are indeed getting or # setting a simple type. If this is not the case, or you want to show the # methods anyway, you should set this option to NO. IDL_PROPERTY_SUPPORT = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES, then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. DISTRIBUTE_GROUP_DOC = NO # Set the SUBGROUPING tag to YES (the default) to allow class member groups of # the same type (for instance a group of public functions) to be put as a # subgroup of that type (e.g. under the Public Functions section). Set it to # NO to prevent subgrouping. Alternatively, this can be done per class using # the \nosubgrouping command. SUBGROUPING = YES # When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum # is documented as struct, union, or enum with the name of the typedef. So # typedef struct TypeS {} TypeT, will appear in the documentation as a struct # with name TypeT. When disabled the typedef will appear as a member of a file, # namespace, or class. And the struct will be named TypeS. This can typically # be useful for C code in case the coding convention dictates that all compound # types are typedef'ed and only the typedef is referenced, never the tag name. TYPEDEF_HIDES_STRUCT = NO # The SYMBOL_CACHE_SIZE determines the size of the internal cache use to # determine which symbols to keep in memory and which to flush to disk. # When the cache is full, less often used symbols will be written to disk. # For small to medium size projects (<1000 input files) the default value is # probably good enough. For larger projects a too small cache size can cause # doxygen to be busy swapping symbols to and from disk most of the time # causing a significant performance penality. # If the system has enough physical memory increasing the cache will improve the # performance by keeping more symbols in memory. Note that the value works on # a logarithmic scale so increasing the size by one will rougly double the # memory usage. The cache size is given by this formula: # 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, # corresponding to a cache size of 2^16 = 65536 symbols SYMBOL_CACHE_SIZE = 0 #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in # documentation are documented, even if no documentation was available. # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES EXTRACT_ALL = YES # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. EXTRACT_PRIVATE = YES # If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. EXTRACT_STATIC = YES # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) # defined locally in source files will be included in the documentation. # If set to NO only classes defined in header files are included. EXTRACT_LOCAL_CLASSES = YES # This flag is only useful for Objective-C code. When set to YES local # methods, which are defined in the implementation section but not in # the interface are included in the documentation. # If set to NO (the default) only methods in the interface are included. EXTRACT_LOCAL_METHODS = YES # If this flag is set to YES, the members of anonymous namespaces will be # extracted and appear in the documentation as a namespace called # 'anonymous_namespace{file}', where file will be replaced with the base # name of the file that contains the anonymous namespace. By default # anonymous namespace are hidden. EXTRACT_ANON_NSPACES = YES # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all # undocumented members of documented classes, files or namespaces. # If set to NO (the default) these members will be included in the # various overviews, but no documentation section is generated. # This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. # If set to NO (the default) these classes will be included in the various # overviews. This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all # friend (class|struct|union) declarations. # If set to NO (the default) these declarations will be included in the # documentation. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any # documentation blocks found inside the body of a function. # If set to NO (the default) these blocks will be appended to the # function's detailed documentation block. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation # that is typed after a \internal command is included. If the tag is set # to NO (the default) then the documentation will be excluded. # Set it to YES to include the internal documentation. INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate # file names in lower-case letters. If set to YES upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. CASE_SENSE_NAMES = NO # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen # will show members with their full class and namespace scopes in the # documentation. If set to YES the scope will be hidden. HIDE_SCOPE_NAMES = NO # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen # will put a list of the files that are included by a file in the documentation # of that file. SHOW_INCLUDE_FILES = YES # If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen # will list include files with double quotes in the documentation # rather than with sharp brackets. FORCE_LOCAL_INCLUDES = NO # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] # is inserted in the documentation for inline members. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen # will sort the (detailed) documentation of file and class members # alphabetically by member name. If set to NO the members will appear in # declaration order. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the # brief documentation of file, namespace and class members alphabetically # by member name. If set to NO (the default) the members will appear in # declaration order. SORT_BRIEF_DOCS = NO # If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen # will sort the (brief and detailed) documentation of class members so that # constructors and destructors are listed first. If set to NO (the default) # the constructors will appear in the respective orders defined by # SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. # This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO # and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. SORT_MEMBERS_CTORS_1ST = NO # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the # hierarchy of group names into alphabetical order. If set to NO (the default) # the group names will appear in their defined order. SORT_GROUP_NAMES = NO # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be # sorted by fully-qualified names, including namespaces. If set to # NO (the default), the class list will be sorted only by class name, # not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. # Note: This option applies only to the class list, not to the # alphabetical list. SORT_BY_SCOPE_NAME = NO # The GENERATE_TODOLIST tag can be used to enable (YES) or # disable (NO) the todo list. This list is created by putting \todo # commands in the documentation. GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable (YES) or # disable (NO) the test list. This list is created by putting \test # commands in the documentation. GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable (YES) or # disable (NO) the bug list. This list is created by putting \bug # commands in the documentation. GENERATE_BUGLIST = YES # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or # disable (NO) the deprecated list. This list is created by putting # \deprecated commands in the documentation. GENERATE_DEPRECATEDLIST= YES # The ENABLED_SECTIONS tag can be used to enable conditional # documentation sections, marked by \if sectionname ... \endif. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines # the initial value of a variable or define consists of for it to appear in # the documentation. If the initializer consists of more lines than specified # here it will be hidden. Use a value of 0 to hide initializers completely. # The appearance of the initializer of individual variables and defines in the # documentation can be controlled using \showinitializer or \hideinitializer # command in the documentation regardless of this setting. MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated # at the bottom of the documentation of classes and structs. If set to YES the # list will mention the files that were used to generate the documentation. SHOW_USED_FILES = YES # If the sources in your project are distributed over multiple directories # then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy # in the documentation. The default is NO. SHOW_DIRECTORIES = NO # Set the SHOW_FILES tag to NO to disable the generation of the Files page. # This will remove the Files entry from the Quick Index and from the # Folder Tree View (if specified). The default is YES. SHOW_FILES = YES # Set the SHOW_NAMESPACES tag to NO to disable the generation of the # Namespaces page. This will remove the Namespaces entry from the Quick Index # and from the Folder Tree View (if specified). The default is YES. SHOW_NAMESPACES = YES # The FILE_VERSION_FILTER tag can be used to specify a program or script that # doxygen should invoke to get the current version for each file (typically from # the version control system). Doxygen will invoke the program by executing (via # popen()) the command , where is the value of # the FILE_VERSION_FILTER tag, and is the name of an input file # provided by doxygen. Whatever the program writes to standard output # is used as the file version. See the manual for examples. FILE_VERSION_FILTER = # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by # doxygen. The layout file controls the global structure of the generated output files # in an output format independent way. The create the layout file that represents # doxygen's defaults, run doxygen with the -l option. You can optionally specify a # file name after the option, if omitted DoxygenLayout.xml will be used as the name # of the layout file. LAYOUT_FILE = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated # by doxygen. Possible values are YES and NO. If left blank NO is used. QUIET = NO # The WARNINGS tag can be used to turn on/off the warning messages that are # generated by doxygen. Possible values are YES and NO. If left blank # NO is used. WARNINGS = YES # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings # for undocumented members. If EXTRACT_ALL is set to YES then this flag will # automatically be disabled. WARN_IF_UNDOCUMENTED = YES # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as not documenting some # parameters in a documented function, or documenting parameters that # don't exist or using markup commands wrongly. WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be abled to get warnings for # functions that are documented, but have no documentation for their parameters # or return value. If set to NO (the default) doxygen will only warn about # wrong or incomplete parameter documentation, but not about the absence of # documentation. WARN_NO_PARAMDOC = NO # The WARN_FORMAT tag determines the format of the warning messages that # doxygen can produce. The string should contain the $file, $line, and $text # tags, which will be replaced by the file and line number from which the # warning originated and the warning text. Optionally the format may contain # $version, which will be replaced by the version of the file (if it could # be obtained via FILE_VERSION_FILTER) WARN_FORMAT = "$file:$line: $text" # The WARN_LOGFILE tag can be used to specify a file to which warning # and error messages should be written. If left blank the output is written # to stderr. WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag can be used to specify the files and/or directories that contain # documented source files. You may enter file names like "myfile.cpp" or # directories like "/usr/src/myproject". Separate the files or directories # with spaces. INPUT = ../../src # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is # also the default input encoding. Doxygen uses libiconv (or the iconv built # into libc) for the transcoding. See http://www.gnu.org/software/libiconv for # the list of possible encodings. INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank the following patterns are tested: # *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx # *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 FILE_PATTERNS = *.c \ *.cc \ *.cxx \ *.cpp \ *.c++ \ *.d \ *.java \ *.ii \ *.ixx \ *.ipp \ *.i++ \ *.inl \ *.h \ *.hh \ *.hxx \ *.hpp \ *.h++ \ *.idl \ *.odl \ *.cs \ *.php \ *.php3 \ *.inc \ *.m \ *.mm \ *.dox \ *.py \ *.f90 \ *.f \ *.vhd \ *.vhdl # The RECURSIVE tag can be used to turn specify whether or not subdirectories # should be searched for input files as well. Possible values are YES and NO. # If left blank NO is used. RECURSIVE = YES # The EXCLUDE tag can be used to specify files and/or directories that should # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used select whether or not files or # directories that are symbolic links (a Unix filesystem feature) are excluded # from the input. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. Note that the wildcards are matched # against the file with absolute path, so to exclude all test directories # for example use the pattern */test/* EXCLUDE_PATTERNS = .svn # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the # output. The symbol name can be a fully qualified name, a word, or if the # wildcard * is used, a substring. Examples: ANamespace, AClass, # AClass::ANamespace, ANamespace::*Test EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or # directories that contain example code fragments that are included (see # the \include command). EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank all files are included. EXAMPLE_PATTERNS = * # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude # commands irrespective of the value of the RECURSIVE tag. # Possible values are YES and NO. If left blank NO is used. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or # directories that contain image that are included in the documentation (see # the \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command , where # is the value of the INPUT_FILTER tag, and is the name of an # input file. Doxygen will then use the output that the filter program writes # to standard output. If FILTER_PATTERNS is specified, this tag will be # ignored. INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. Doxygen will compare the file name with each pattern and apply the # filter if there is a match. The filters are a list of the form: # pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further # info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER # is applied to all files. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will be used to filter the input files when producing source # files to browse (i.e. when SOURCE_BROWSER is set to YES). FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will # be generated. Documented entities will be cross-referenced with these sources. # Note: To get rid of all source code in the generated output, make sure also # VERBATIM_HEADERS is set to NO. SOURCE_BROWSER = YES # Setting the INLINE_SOURCES tag to YES will include the body # of functions and classes directly in the documentation. INLINE_SOURCES = YES # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct # doxygen to hide any special comment blocks from generated source code # fragments. Normal C and C++ comments will always remain visible. STRIP_CODE_COMMENTS = NO # If the REFERENCED_BY_RELATION tag is set to YES # then for each documented function all documented # functions referencing it will be listed. REFERENCED_BY_RELATION = YES # If the REFERENCES_RELATION tag is set to YES # then for each documented function all documented entities # called/used by that function will be listed. REFERENCES_RELATION = YES # If the REFERENCES_LINK_SOURCE tag is set to YES (the default) # and SOURCE_BROWSER tag is set to YES, then the hyperlinks from # functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will # link to the source code. Otherwise they will link to the documentation. REFERENCES_LINK_SOURCE = YES # If the USE_HTAGS tag is set to YES then the references to source code # will point to the HTML generated by the htags(1) tool instead of doxygen # built-in source browser. The htags tool is part of GNU's global source # tagging system (see http://www.gnu.org/software/global/global.html). You # will need version 4.8.6 or higher. USE_HTAGS = NO # If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen # will generate a verbatim copy of the header file for each class for # which an include is specified. Set to NO to disable this. VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index # of all compounds will be generated. Enable this if the project # contains a lot of classes, structs, unions or interfaces. ALPHABETICAL_INDEX = NO # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns # in which this list will be split (can be a number in the range [1..20]) COLS_IN_ALPHA_INDEX = 5 # In case all classes in a project start with a common prefix, all # classes will be put under the same header in the alphabetical index. # The IGNORE_PREFIX tag can be used to specify one or more prefixes that # should be ignored while generating the index headers. IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES (the default) Doxygen will # generate HTML output. GENERATE_HTML = YES # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `html' will be used as the default path. HTML_OUTPUT = html # The HTML_FILE_EXTENSION tag can be used to specify the file extension for # each generated HTML page (for example: .htm,.php,.asp). If it is left blank # doxygen will generate files with .html extension. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a personal HTML header for # each generated HTML page. If it is left blank doxygen will generate a # standard header. HTML_HEADER = # The HTML_FOOTER tag can be used to specify a personal HTML footer for # each generated HTML page. If it is left blank doxygen will generate a # standard footer. HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading # style sheet that is used by each HTML page. It can be used to # fine-tune the look of the HTML output. If the tag is left blank doxygen # will generate a default style sheet. Note that doxygen will try to copy # the style sheet file to the HTML output directory, so don't put your own # stylesheet in the HTML output directory as well, or it will be erased! HTML_STYLESHEET = # If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML # page will contain the date and time when the page was generated. Setting # this to NO can help when comparing the output of multiple runs. HTML_TIMESTAMP = YES # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, # files or namespaces will be aligned in HTML using tables. If set to # NO a bullet list will be used. HTML_ALIGN_MEMBERS = YES # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. For this to work a browser that supports # JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox # Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). HTML_DYNAMIC_SECTIONS = NO # If the GENERATE_DOCSET tag is set to YES, additional index files # will be generated that can be used as input for Apple's Xcode 3 # integrated development environment, introduced with OSX 10.5 (Leopard). # To create a documentation set, doxygen will generate a Makefile in the # HTML output directory. Running make will produce the docset in that # directory and running "make install" will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find # it at startup. # See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information. GENERATE_DOCSET = NO # When GENERATE_DOCSET tag is set to YES, this tag determines the name of the # feed. A documentation feed provides an umbrella under which multiple # documentation sets from a single provider (such as a company or product suite) # can be grouped. DOCSET_FEEDNAME = "Doxygen generated docs" # When GENERATE_DOCSET tag is set to YES, this tag specifies a string that # should uniquely identify the documentation set bundle. This should be a # reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen # will append .docset to the name. DOCSET_BUNDLE_ID = org.doxygen.Project # If the GENERATE_HTMLHELP tag is set to YES, additional index files # will be generated that can be used as input for tools like the # Microsoft HTML help workshop to generate a compiled HTML help file (.chm) # of the generated HTML documentation. GENERATE_HTMLHELP = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can # be used to specify the file name of the resulting .chm file. You # can add a path in front of the file if the result should not be # written to the html output directory. CHM_FILE = # If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can # be used to specify the location (absolute path including file name) of # the HTML help compiler (hhc.exe). If non-empty doxygen will try to run # the HTML help compiler on the generated index.hhp. HHC_LOCATION = # If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag # controls if a separate .chi index file is generated (YES) or that # it should be included in the master .chm file (NO). GENERATE_CHI = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING # is used to encode HtmlHelp index (hhk), content (hhc) and project file # content. CHM_INDEX_ENCODING = # If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag # controls whether a binary table of contents is generated (YES) or a # normal table of contents (NO) in the .chm file. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members # to the contents of the HTML help documentation and to the tree view. TOC_EXPAND = NO # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER # are set, an additional index file will be generated that can be used as input for # Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated # HTML documentation. GENERATE_QHP = NO # If the QHG_LOCATION tag is specified, the QCH_FILE tag can # be used to specify the file name of the resulting .qch file. # The path specified is relative to the HTML output folder. QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating # Qt Help Project output. For more information please see # http://doc.trolltech.com/qthelpproject.html#namespace QHP_NAMESPACE = org.doxygen.Project # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating # Qt Help Project output. For more information please see # http://doc.trolltech.com/qthelpproject.html#virtual-folders QHP_VIRTUAL_FOLDER = doc # If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add. # For more information please see # http://doc.trolltech.com/qthelpproject.html#custom-filters QHP_CUST_FILTER_NAME = # The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see # Qt Help Project / Custom Filters. QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's # filter section matches. # Qt Help Project / Filter Attributes. QHP_SECT_FILTER_ATTRS = # If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can # be used to specify the location of Qt's qhelpgenerator. # If non-empty doxygen will try to run qhelpgenerator on the generated # .qhp file. QHG_LOCATION = # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files # will be generated, which together with the HTML files, form an Eclipse help # plugin. To install this plugin and make it available under the help contents # menu in Eclipse, the contents of the directory containing the HTML and XML # files needs to be copied into the plugins directory of eclipse. The name of # the directory within the plugins directory should be the same as # the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before # the help appears. GENERATE_ECLIPSEHELP = NO # A unique identifier for the eclipse help plugin. When installing the plugin # the directory name containing the HTML and XML files should also have # this name. ECLIPSE_DOC_ID = org.doxygen.Project # The DISABLE_INDEX tag can be used to turn on/off the condensed index at # top of each HTML page. The value NO (the default) enables the index and # the value YES disables it. DISABLE_INDEX = NO # This tag can be used to set the number of enum values (range [1..20]) # that doxygen will group on one line in the generated HTML documentation. ENUM_VALUES_PER_LINE = 4 # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. # If the tag value is set to YES, a side panel will be generated # containing a tree-like index structure (just like the one that # is generated for HTML Help). For this to work a browser that supports # JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). # Windows users are probably better off using the HTML help feature. GENERATE_TREEVIEW = NO # By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, # and Class Hierarchy pages using a tree view instead of an ordered list. USE_INLINE_TREES = NO # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be # used to set the initial width (in pixels) of the frame in which the tree # is shown. TREEVIEW_WIDTH = 250 # Use this tag to change the font size of Latex formulas included # as images in the HTML documentation. The default is 10. Note that # when you change the font size after a successful doxygen run you need # to manually remove any form_*.png images from the HTML output directory # to force them to be regenerated. FORMULA_FONTSIZE = 10 # When the SEARCHENGINE tag is enabled doxygen will generate a search box # for the HTML output. The underlying search engine uses javascript # and DHTML and should work on any modern browser. Note that when using # HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets # (GENERATE_DOCSET) there is already a search function so this one should # typically be disabled. For large projects the javascript based search engine # can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. SEARCHENGINE = YES # When the SERVER_BASED_SEARCH tag is enabled the search engine will be # implemented using a PHP enabled web server instead of at the web client # using Javascript. Doxygen will generate the search PHP script and index # file to put on the web server. The advantage of the server # based approach is that it scales better to large projects and allows # full text search. The disadvances is that it is more difficult to setup # and does not have live searching capabilities. SERVER_BASED_SEARCH = NO #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # generate Latex output. GENERATE_LATEX = NO # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `latex' will be used as the default path. LATEX_OUTPUT = latex # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. If left blank `latex' will be used as the default command name. # Note that when enabling USE_PDFLATEX this option is only used for # generating bitmaps for formulas in the HTML output, but not in the # Makefile that is written to the output directory. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to # generate index for LaTeX. If left blank `makeindex' will be used as the # default command name. MAKEINDEX_CMD_NAME = makeindex # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact # LaTeX documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_LATEX = NO # The PAPER_TYPE tag can be used to set the paper type that is used # by the printer. Possible values are: a4, a4wide, letter, legal and # executive. If left blank a4wide will be used. PAPER_TYPE = a4wide # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX # packages that should be included in the LaTeX output. EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for # the generated latex document. The header should contain everything until # the first chapter. If it is left blank doxygen will generate a # standard header. Notice: only use this tag if you know what you are doing! LATEX_HEADER = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated # is prepared for conversion to pdf (using ps2pdf). The pdf file will # contain links (just like the HTML output) instead of page references # This makes the output suitable for online browsing using a pdf viewer. PDF_HYPERLINKS = YES # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of # plain latex in the generated Makefile. Set this option to YES to get a # higher quality PDF documentation. USE_PDFLATEX = YES # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. # command to the generated LaTeX files. This will instruct LaTeX to keep # running if errors occur, instead of asking the user for help. # This option is also used when generating formulas in HTML. LATEX_BATCHMODE = NO # If LATEX_HIDE_INDICES is set to YES then doxygen will not # include the index chapters (such as File Index, Compound Index, etc.) # in the output. LATEX_HIDE_INDICES = NO # If LATEX_SOURCE_CODE is set to YES then doxygen will include # source code with syntax highlighting in the LaTeX output. # Note that which sources are shown also depends on other settings # such as SOURCE_BROWSER. LATEX_SOURCE_CODE = NO #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output # The RTF output is optimized for Word 97 and may not look very pretty with # other RTF readers or editors. GENERATE_RTF = NO # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `rtf' will be used as the default path. RTF_OUTPUT = rtf # If the COMPACT_RTF tag is set to YES Doxygen generates more compact # RTF documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_RTF = NO # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated # will contain hyperlink fields. The RTF file will # contain links (just like the HTML output) instead of page references. # This makes the output suitable for online browsing using WORD or other # programs which support those fields. # Note: wordpad (write) and others do not support links. RTF_HYPERLINKS = NO # Load stylesheet definitions from file. Syntax is similar to doxygen's # config file, i.e. a series of assignments. You only have to provide # replacements, missing definitions are set to their default value. RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an rtf document. # Syntax is similar to doxygen's config file. RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- # If the GENERATE_MAN tag is set to YES (the default) Doxygen will # generate man pages GENERATE_MAN = NO # The MAN_OUTPUT tag is used to specify where the man pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `man' will be used as the default path. MAN_OUTPUT = man # The MAN_EXTENSION tag determines the extension that is added to # the generated man pages (default is the subroutine's section .3) MAN_EXTENSION = .3 # If the MAN_LINKS tag is set to YES and Doxygen generates man output, # then it will generate one additional man file for each entity # documented in the real man page(s). These additional files # only source the real man page, but without them the man command # would be unable to find the correct page. The default is NO. MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- # If the GENERATE_XML tag is set to YES Doxygen will # generate an XML file that captures the structure of # the code including all documentation. GENERATE_XML = NO # The XML_OUTPUT tag is used to specify where the XML pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `xml' will be used as the default path. XML_OUTPUT = xml # The XML_SCHEMA tag can be used to specify an XML schema, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_SCHEMA = # The XML_DTD tag can be used to specify an XML DTD, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_DTD = # If the XML_PROGRAMLISTING tag is set to YES Doxygen will # dump the program listings (including syntax highlighting # and cross-referencing information) to the XML output. Note that # enabling this will significantly increase the size of the XML output. XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will # generate an AutoGen Definitions (see autogen.sf.net) file # that captures the structure of the code including all # documentation. Note that this feature is still experimental # and incomplete at the moment. GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # configuration options related to the Perl module output #--------------------------------------------------------------------------- # If the GENERATE_PERLMOD tag is set to YES Doxygen will # generate a Perl module file that captures the structure of # the code including all documentation. Note that this # feature is still experimental and incomplete at the # moment. GENERATE_PERLMOD = NO # If the PERLMOD_LATEX tag is set to YES Doxygen will generate # the necessary Makefile rules, Perl scripts and LaTeX code to be able # to generate PDF and DVI output from the Perl module output. PERLMOD_LATEX = NO # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be # nicely formatted so it can be parsed by a human reader. This is useful # if you want to understand what is going on. On the other hand, if this # tag is set to NO the size of the Perl module output will be much smaller # and Perl will parse it just the same. PERLMOD_PRETTY = YES # The names of the make variables in the generated doxyrules.make file # are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. # This is useful so different doxyrules.make files included by the same # Makefile don't overwrite each other's variables. PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- # If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will # evaluate all C-preprocessor directives found in the sources and include # files. ENABLE_PREPROCESSING = YES # If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro # names in the source code. If set to NO (the default) only conditional # compilation will be performed. Macro expansion can be done in a controlled # way by setting EXPAND_ONLY_PREDEF to YES. MACRO_EXPANSION = NO # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES # then the macro expansion is limited to the macros specified with the # PREDEFINED and EXPAND_AS_DEFINED tags. EXPAND_ONLY_PREDEF = NO # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files # in the INCLUDE_PATH (see below) will be search if a #include is found. SEARCH_INCLUDES = YES # The INCLUDE_PATH tag can be used to specify one or more directories that # contain include files that are not input files but should be processed by # the preprocessor. INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the # directories. If left blank, the patterns specified with FILE_PATTERNS will # be used. INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that # are defined before the preprocessor is started (similar to the -D option of # gcc). The argument of the tag is a list of macros of the form: name # or name=definition (no spaces). If the definition and the = are # omitted =1 is assumed. To prevent a macro definition from being # undefined via #undef or recursively expanded use the := operator # instead of the = operator. PREDEFINED = # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. # The macro definition that is found in the sources will be used. # Use the PREDEFINED tag if you want to use a different macro definition. EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then # doxygen's preprocessor will remove all function-like macros that are alone # on a line, have an all uppercase name, and do not end with a semicolon. Such # function macros are typically used for boiler-plate code, and will confuse # the parser if not removed. SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- # The TAGFILES option can be used to specify one or more tagfiles. # Optionally an initial location of the external documentation # can be added for each tagfile. The format of a tag file without # this location is as follows: # TAGFILES = file1 file2 ... # Adding location for the tag files is done as follows: # TAGFILES = file1=loc1 "file2 = loc2" ... # where "loc1" and "loc2" can be relative or absolute paths or # URLs. If a location is present for each tag, the installdox tool # does not have to be run to correct the links. # Note that each tag file must have a unique name # (where the name does NOT include the path) # If a tag file is not located in the directory in which doxygen # is run, you must also specify the path to the tagfile here. TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create # a tag file that is based on the input files it reads. GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES all external classes will be listed # in the class index. If set to NO only the inherited external classes # will be listed. ALLEXTERNALS = NO # If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed # in the modules index. If set to NO, only the current project's groups will # be listed. EXTERNAL_GROUPS = YES # The PERL_PATH should be the absolute path and name of the perl script # interpreter (i.e. the result of `which perl'). PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will # generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base # or super classes. Setting the tag to NO turns the diagrams off. Note that # this option is superseded by the HAVE_DOT option below. This is only a # fallback. It is recommended to install and use dot, since it yields more # powerful graphs. CLASS_DIAGRAMS = YES # You can define message sequence charts within doxygen comments using the \msc # command. Doxygen will then run the mscgen tool (see # http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the # documentation. The MSCGEN_PATH tag allows you to specify the directory where # the mscgen tool resides. If left empty the tool is assumed to be found in the # default search path. MSCGEN_PATH = # If set to YES, the inheritance and collaboration graphs will hide # inheritance and usage relations if the target is undocumented # or is not a class. HIDE_UNDOC_RELATIONS = YES # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz, a graph visualization # toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) HAVE_DOT = YES # By default doxygen will write a font called FreeSans.ttf to the output # directory and reference it in all dot files that doxygen generates. This # font does not include all possible unicode characters however, so when you need # these (or just want a differently looking font) you can specify the font name -# using DOT_FONTNAME. You need need to make sure dot is able to find the font, +# using DOT_FONTNAME. You need to make sure dot is able to find the font, # which can be done by putting it in a standard location or by setting the # DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory # containing the font. DOT_FONTNAME = FreeSans # The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. # The default size is 10pt. DOT_FONTSIZE = 10 # By default doxygen will tell dot to use the output directory to look for the # FreeSans.ttf font (which doxygen will put there itself). If you specify a # different font using DOT_FONTNAME you can set the path where dot # can find it using this tag. DOT_FONTPATH = # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect inheritance relations. Setting this tag to YES will force the # the CLASS_DIAGRAMS tag to NO. CLASS_GRAPH = YES # If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect implementation dependencies (inheritance, containment, and # class references variables) of the class with other documented classes. COLLABORATION_GRAPH = YES # If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen # will generate a graph for groups, showing the direct groups dependencies GROUP_GRAPHS = YES # If the UML_LOOK tag is set to YES doxygen will generate inheritance and # collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. UML_LOOK = NO # If set to YES, the inheritance and collaboration graphs will show the # relations between templates and their instances. TEMPLATE_RELATIONS = NO # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT # tags are set to YES then doxygen will generate a graph for each documented # file showing the direct and indirect include dependencies of the file with # other documented files. INCLUDE_GRAPH = NO # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and # HAVE_DOT tags are set to YES then doxygen will generate a graph for each # documented header file showing the documented files that directly or # indirectly include this file. INCLUDED_BY_GRAPH = NO # If the CALL_GRAPH and HAVE_DOT options are set to YES then # doxygen will generate a call dependency graph for every global function # or class method. Note that enabling this option will significantly increase # the time of a run. So in most cases it will be better to enable call graphs # for selected functions only using the \callgraph command. CALL_GRAPH = YES # If the CALLER_GRAPH and HAVE_DOT tags are set to YES then # doxygen will generate a caller dependency graph for every global function # or class method. Note that enabling this option will significantly increase # the time of a run. So in most cases it will be better to enable caller # graphs for selected functions only using the \callergraph command. CALLER_GRAPH = YES # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen # will graphical hierarchy of all classes instead of a textual one. GRAPHICAL_HIERARCHY = YES # If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES # then doxygen will show the dependencies a directory has on other directories # in a graphical way. The dependency relations are determined by the #include # relations between the files in the directories. DIRECTORY_GRAPH = NO # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. Possible values are png, jpg, or gif # If left blank png will be used. DOT_IMAGE_FORMAT = png # The tag DOT_PATH can be used to specify the path where the dot tool can be # found. If left blank, it is assumed the dot tool can be found in the path. DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the # \dotfile command). DOTFILE_DIRS = # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of # nodes that will be shown in the graph. If the number of nodes in a graph # becomes larger than this value, doxygen will truncate the graph, which is # visualized by representing a node as a red box. Note that doxygen if the # number of direct children of the root node in a graph is already larger than # DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note # that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. DOT_GRAPH_MAX_NODES = 50 # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the # graphs generated by dot. A depth value of 3 means that only nodes reachable # from the root by following a path via at most 3 edges will be shown. Nodes # that lay further from the root node will be omitted. Note that setting this # option to 1 or 2 may greatly reduce the computation time needed for large # code bases. Also note that the size of a graph can be further restricted by # DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. MAX_DOT_GRAPH_DEPTH = 0 # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent # background. This is disabled by default, because dot on Windows does not # seem to support this out of the box. Warning: Depending on the platform used, # enabling this option may lead to badly anti-aliased labels on the edges of # a graph (i.e. they become hard to read). DOT_TRANSPARENT = NO # Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) # support this, this feature is disabled by default. DOT_MULTI_TARGETS = NO # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will # generate a legend page explaining the meaning of the various boxes and # arrows in the dot generated graphs. GENERATE_LEGEND = YES # If the DOT_CLEANUP tag is set to YES (the default) Doxygen will # remove the intermediate dot files that are used to generate # the various graphs. DOT_CLEANUP = YES diff --git a/docbook/kst/tutorial.docbook b/docbook/kst/tutorial.docbook index 736e97da..618bb587 100644 --- a/docbook/kst/tutorial.docbook +++ b/docbook/kst/tutorial.docbook @@ -1,878 +1,878 @@ Barth Netterfield
kst@kde.org
Rick Chern
kst@kde.org
2004 The University of British Columbia 2004 - 2017 C. Barth Netterfield
The &kst; Tutorial Welcome Welcome to &kst;! In a few minutes, you will be on your way to exploring the rich features of this plotting and data manipulation package. Here are just some of the tasks you can accomplish using &kst;: Quickly plot multiple graphs using only the command-line. Analyze data using an extensive set of tools including histograms, power spectra, and custom equations. Effortlessly zoom in and out of interesting areas of plots using either the mouse or keyboard Monitor live streaming data using &kst;'s real-time plotting capabilities. This tutorial covers the basics of installing, running, and working with &kst;. You are invited to further investigate any features at any time. All features are documented in the rest of this Handbook. Creating plots from the Command-line A common use of &kst; is to quickly produce plots of data from the command-line. This method of producing plots requires almost no knowledge of &kst;'s graphical user interface, yet produces immediate, useful results. The following instructions assume linux or osX. This tutorial uses a demo package of data files which are available online at http://omega.astro.utoronto.ca/kst/tutorial/kst_tutorialdata.tgz. Download and untar the package, and change to the resulting directory: tar -zxvf kst_tutorialdata.tgz cd kst_tutorialdata To obtain an overview of all available &kst; command-line options, type: kst2 --help A syntax description and list of commands similar to the following will be displayed: KST Command Line Usage ************************ *** Load a kst file: *** kst [OPTIONS] kstfile [OPTIONS] will override the datasource parameters for all data sources in the kst file: -F <datasource> -f <startframe> -n <numframes> -s <frames per sample> -a (apply averaging filter: requires -s) ************************ *** Read a data file *** kst datasource OPTIONS [datasource OPTIONS []] OPTIONS are read and interpreted in order. Except for data object options, all are applied to all future data objects, unless later overridden. Output Options: --print <filename> Print to file and exit. --landscape Print in landscape mode. --portrait Print in portrait mode. --Letter Print to Letter sized paper. --A4 Print to A4 sized paper. --png <filename> Render to a png image, and exit. --pngHeight <height> Height of png image (pixels) --pngWidth <width> Width of png image (pixels) File Options: -f <startframe> default: 'end' counts from end. -n <numframes> default: 'end' reads to end of file -s <frames per sample> default: 0 (read every sample) -a apply averaging filter: requires -s Ascii File Options - for ascii files only: these are all sticky --asciiDataStart <Line> Data starts here. Files start at line 1. --asciiFieldNames <Line> Field names are in this row. --asciiNoFieldNames Fields are named for their data column --asciiReadUnits <Line> Read units from line <Line> --asciiNoUnits Do not read units --asciiSpaceDelim Columns are Space/tab delimited --asciiDelim <char> Columns are dlimited with <char> --asciiFixedWidth <w> Columns have width <w> --asciiNoFixedWidth Columns are delimited, not fixed width --asciiDecimalDot Use a . as a decimal separator (ie, 10.1) --asciiDecimalComma Use a , as a decimal separator (ie, 10,1) Position: -P <plot name>: Place curves in one plot. -A Place future curves in individual plots. -m <columns> Layout plots in columns -T <tab name> Place future curves a new tab. Appearance -d: use points for the next curve -l: use lines for the next curve -b: use bargraph for the next curve --xlabel <X Label> Set X label of all future plots. --ylabel <Y Label> Set Y label of all future plots. --xlabelauto AutoSet X label of all future plots. --ylabelauto AutoSet Y label of all future plots. Data Object Modifiers -x <field>: Create vector and use as X vector for curves. -e <field>: Create vector and use as Y-error vector for next -y. -r <rate>: sample rate (spectra and spectograms). Data Objects: -y <field> plot an XY curve of field. -p <field> plot the spectrum of field. -h <field> plot a histogram of field. -z <field> plot an image of matrix field. **************** *** Examples *** Data sources and fields: Plot all data in column 2 from data.dat. kst data.dat -y 2 Same as above, except only read 20 lines, starting at line 10. kst data.dat -f 10 -n 20 -y 2 ... also read col 1. One plot per curve. kst data.dat -f 10 -n 20 -y 1 -y 2 Read col 1 from data2.dat and col 1 from data.dat kst data.dat -f 10 -n 20 -y 2 data2.dat -y 1 Same as above, except read 40 lines starting at 30 in data2.dat kst data.dat -f 10 -n 20 -y 2 data2.dat -f 30 -n 40 -y 1 Specify the X vector and error bars: Plot x = col 1 and Y = col 2 and error flags = col 3 from data.dat kst data.dat -x 1 -e 3 -y 2 Get the X vector from data1.dat, and the Y vector from data2.dat. kst data1.dat -x 1 data2.dat -y 1 Placement: Plot column 2 and column 3 in plot P1 and column 4 in plot P2 kst data.dat -P P1 -y 2 -y 3 -P P2 -y 4 We will first take a look at reading the ASCII file gyrodata.dat, included in the demo package. ASCII files are one of the many file types &kst; is capable of reading. In ASCII files, data is arranged in columns, with each column corresponding to a field, and the column numbers (beginning with 1 from left to right) corresponding to field names. This particular ASCII file contains 3 columns, and thus has field names 1, 2, and 3. To produce a plot of the first column, simply type: kst2 gyrodata.dat -y 1 All the data in the first column will be plotted: Note that no field was specified for the X axis of the plot, so &kst; used the default INDEX vector. The INDEX vector is a special vector in &kst; that contains integers from 0 to N-1, where N is the number of frames read in the corresponding Y axis vector. Close &kst; by selecting Quit from the File menu, or by typing &Ctrl;Q. gyrodata.dat contains 20000 frames, so you may wish to only look at a portion of the data. To only plot 10000 frames starting from frame 7000, type: kst2 gyrodata.dat -f 7000 -n 10000 -y 1 One of &kst;'s strengths is its ability to plot real-time data. Imagine that new data was being continually added to the end of gyrodata.dat. In such a scenario, it would be useful to only plot the most recent portion of the data. To plot only the last 1000 frames of gyrodata.dat, enter the following: kst2 gyrodata.dat -n 1000 -y 1 If gyrodata.dat was being updated, the plot would continuously scroll to display only the last 1000 frames. Note that the description of the option states that Multiple instances of the option are allowed. This allows quick plotting of more than one curve. To plot all three fields in gyrodata.dat in separate plots, arranged in one column, enter the following: kst2 gyrodata.dat -m 1 -y 1 -y 2 -y 3 The option specifies that the plots should be in a single column. To plot column 1 in one plot, and columns 2 and three in a second plot, displayed side by side enter: kst2 gyrodata.dat -m 2 -P 1 -y 1 -P 2 -y 2 -y 3 Creating plots with the Data Wizard &kst; can also be completely controlled through the graphical user interface, without ever using the command line. In this section, we will look at the Data Wizard, which a quick and easy way of creating vectors, curves, and plots in &kst; from data files. To launch the wizard, select Data Wizard... from the Data menu or click the button on the toolbar. You will be prompted to select a data source by the following dialog: Data Wizard Screen 1 Data Wizard Screen 2 Select the gyrodata.dat file used in the command-line examples. If you have completed the command-line exercises in the previous sections, then the file should be listed in the recent files list, as shown. Simply click on it to select it. Otherwise, enter the full path in the top text entry box (or click on the icon and browse to the file). Once you have selected the file, the Next button will be enabled. Click on it to proceed to the next page. The following window will be displayed: Data Wizard Screen 2 Data Wizard Screen 2 Fields in gyrodata.dat available to be plotted are listed in the Available data box on the left. Fields that have been selected for plotting are listed in the Selected data box on the right. In the image shown, Column 1 has been selected for plotting. Select Column 1, Column 2, and Column 3 for plotting by moving them to the Selected data box. To move a field from Available data to Selected data, double click on it, or highlight it (with mouse or keyboard) and click on the icon. As well as using the mouse or keyboard, you may highlight fields by entering a string to match into the text box above the list. Wildcards such as *, ? and [ ] are supported. Click Next once you have selected the three columns of data. Data Wizard Screen 3 Data Wizard Screen 2 The next tab is used to select the data range to be plotted, and whether to create XY plots, spectrum plots, or both. The Data Range section is used to specify the range of data to read from the selected vectors in the input file. The following discussion assumes knowledge of frames. For ASCII files such as gyrodata.dat, a frame is simply a row of data, though for other formats this can be more complicated. For a detailed description of this concept, see . Start, End, Count from end, Range, and Read to end Using these five settings, the lower and upper boundaries of the data range can be set. The settings in the above image are set to read the entire data file (starting at frame 0, and reading to the end). If new data were being appended to the end of the file in real time, then the range would be continuously increasing and &kst; would update to reflect this. If instead one wanted to only display the last 1000 frames of the file, one would instead select Count from end and enter 1000 in Range. &kst; would scroll the data along as new data were appended to the data file. Read 1 sample per N frames and Boxcar filter first The number of data points plotted can be reduced using this option. If Read 1 sample per N frames is not selected, all samples in the selected range will be read. Alternatively, frames in the data file can be skipped by selecting Read 1 sample per N frames. For now, read all of the data by deselecting Read 1 sample per N frames, as shown. In this tutorial, we are only going to plot the gyroscope time series, and not spectra. To do this, select Create XY plots and deselect Create Spectra Plots as shown. Set the X axis vectors for the curves to be The vector to be INDEX by selecting Create from field and selecting INDEX in vector selector, as shown. The FFT Options subsection in the Plot Types section is available only if a power spectrum is to be plotted. This tutorial will not deal with the details of power spectra. Once you are satisfied with all the settings, click Next to advance to the next window. Data Wizard Screen 4 Data Wizard Screen 3 From here, you can change general plotting settings. Most of the settings are self-explanatory. Select 1 new plot per curve for Curve Placement. Once you are satisfied with all the settings, click Finish and the plots will be generated: The Generated Plots The Generated Plots Generating these plots took a bit of effort, so we should save the current &kst; session (it will be used in the next section of this tutorial). Select Save As... from the File menu, and save the session as mykstsession.kst: Saving a &kst; session saves all the plots, data objects (you will learn about these later), and layouts that exist at the time of saving. Once the file has been saved, you can exit &kst;. The Basics of Plot Manipulation Now that you are comfortable with creating plots in &kst;, we can explore some of the plot manipulation features available through the &kst; graphical user interface. Start &kst; and load the mykstsession.kst file you saved earlier. This can be done one of three ways: From the command line: kst mykstsession.kst Selecting Open from the toolbar or from the File menu and selecting mykstsession.kst from wherever you saved it. Selecting mykstsession.kst from Recent Files in the File menu. All the plots you created earlier should now be loaded in &kst;. Consider the plot of Column 1. To take a closer look at that plot, right click in it and select the Maximize menu item (see below). Notice that the menu item shows that Z is a shortcut for this, so you could also just type Z in the plot rather than using the context menu for this. Selecting Maximize (either way) will cause the selected plot to fill the entire kst window. Selecting Maximize (or typing Z in the plot) again will restore it the plots to their previous arrangement. This is especially valuable if you have a grid of many small plots and want to temporarily look at just one of them. Obviously typing Z is going to be the most convienient way to do this, but the context menu is there in case you forget. Maximizing a plot Maximizing a plot In &kst;, it is very easy to zoom and scroll the data, using either the mouse or the keyboard. To do this you should be in XY Zoom/Scroll mode, selected by selecting the icon in the tool bar. This is the default mode. To zoom into a region of interest, left-click drag a box in the window with the mouse. When you release the mouse, the window will zoom in X and Y into the region you selected. Holding &Shift; when you do this will cause the plot to zoom only in Y. Holding &Ctrl; when you do this will cause the plot to zoom only in X. Arrow keys scroll the plot. Arrow keys with &Shift; held down will change the scale. The M key auto-zooms the plots to view all of the data. Play around with these options to become familier with the various options. Now look at the plots with y axes labeled Column 2 and Column 3. These are plots of the pitch gyro and roll gyro, respectively, from an instrument. Since these two plots are related, it can be useful to zoom and scroll them simultaneously. Click on the circles located at the top right corners of the two plots. They should turn dark in color to indicate that the two plots are now tied together: Tied Zoom Tied Zoom Now try zooming in with the mouse on a portion of the green curve in the middle plot. You will find that the lower plot will become blank. This is because the lower plot axes have changed to match the upper plot axes, and there is no data in that particular region of the lower plot. Type M while the mouse cursor is over either plot to return to maximum zoom on both plots. Now hold down &Ctrl; (this is equivalent to selecting X Mouse Zoom Mode from the Mode menu or clicking the toolbar button). If you then move the mouse, you will see that it is now dragging a vertical line the heght of the plots in both of the plots that are tied to gether. While keeping &Ctrl; held down, drag a rectangle in the middle plot. While dragging, the region you are selecting will be displayed in both tied plots. Both plots will rescale to the region you have selected. As with the mouse actions, the keyboard based zoom/scrolling actions described earlier will now be applied to both plots. You can quickly tie or untie all the plots in the window by selecting Toggle Tied Zoom from the Mode menu or by clicking the toolbar button. When you are finished experimenting with the zooming features, you can close &kst;. There is no need to save the plots this time (unless you wish to). A Brief Overview of Data Objects In addition to simple plotting, &kst; has the ability to do real time analysis of data using a number of Data Objects, which include spectra, equations, histograms, fits, and filters. As a quick demo of Data Objects, lets create a spectrum. Start &kst; and re-load mykstsession.kst that you created in previous sections. Then, from the Create menu select Power Spectrum. The New Power Spectrum menu will appear. New Spectrum Dialog The New Spectrum Dialog Fill out the dialog as shown. Make sure you select Column 3 (V4) as the Data vector, set the FFT length to 2^13, Sample rate to 60 and select In new tab under Placement. Then select OK. A plot of the spectrum of Column 3 (V4) will appear in a new tab. Spectrum Spectrum It is hard to see any details in this plot - a log-log plot would be much easier. To convert the Y axis to log hit L and to convert the X axis to log hit G. (These options are also available in the context menu under the Zoom submenu in case you forget the keyboard commands). The plot will now be log-log, as shown: Spectrum Spectrum From the Create you can similarly create histograms, spectograms, and equations of fields you have loaded. Filters With &kst;, we can apply a variety of fits and filters to vectors in kst. The results of these will be updated in real time as new data comes in. To demonstrate this, load in the first 1000 samples of second column of gyrodata.dat using either the Data Wizard, as demonstrated earlier, or from the command line: kst2 gyrodata.dat -f 0 -n 1000 -y 2 Once it is loaded, right click in the plot and select Column 1 vs INDEX (C1) from the Filter menu, as shown: Spectrum Spectrum This will bring up the New Filter Dialog: Spectrum Spectrum Fill out the dialog as shown. In particular, select Low Pass Filter as the Plugin, set Cutoff Frequency/Sample Rate to 0.05, and select Place in existing plot. Here we have also set the line to be red, and the Weight to 2, so the line will be more visible. When you are satisfied, select OK. - This will add a the the low-pass filtered data as a new curve in the plot: + This will add the low-pass filtered data as a new curve in the plot: Filtered Curve Filtered Curve In the same way you can fit a variety of functions to curves using the Fit submenu after right-clicking in a plot. Conclusion This concludes the &kst; tutorial. Hopefully you have gained enough knowledge to begin to use &kst;. Keep in mind that this tutorial does not cover all the functionality of &kst;—there is still much to explore and experiment with.
diff --git a/old_datasources/healpix/healpix_tools_pix.cpp b/old_datasources/healpix/healpix_tools_pix.cpp index 6767ea24..f0a03935 100644 --- a/old_datasources/healpix/healpix_tools_pix.cpp +++ b/old_datasources/healpix/healpix_tools_pix.cpp @@ -1,854 +1,854 @@ /*************************************************************************** healpix_tools.cpp - tools for healpix datasource ------------------- begin : Wed June 01 2005 copyright : (C) 2005 Ted Kisner email : tskisner.public@gmail.com ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ /*************************************************************************** * Some of these pixel tools are based on code from Healpix_cxx 2.00. * * See http://sourceforge.net/projects/healpix/ for the original code * * * - * Healpix 2.00 was developed by by E. Hivon, M. Reinecke, W. O'Mullane, * + * Healpix 2.00 was developed by E. Hivon, M. Reinecke, W. O'Mullane, * * H.K. Eriksen, K.M. Gorski, A.J. Banday * ***************************************************************************/ #include "healpix_tools.h" #include #define HEALPIX_CHK if(!healpix_doneinit)healpix_init() static size_t healpix_ctab[0x100]; static size_t healpix_utab[0x100]; static const size_t healpix_jrll[] = {2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4}; static const size_t healpix_jpll[] = {1, 3, 5, 7, 0, 2, 4, 6, 1, 3, 5, 7}; static int healpix_doneinit = 0; void healpix_init(); /* NULL checking */ int healpix_is_dnull(double val) { if ((val > HEALPIX_NULL - HEALPIX_EPSILON) && (val < HEALPIX_NULL + HEALPIX_EPSILON)) { return 1; } else { return 0; } } int healpix_is_fnull(float val) { if ((val > HEALPIX_NULL - HEALPIX_EPSILON) && (val < HEALPIX_NULL + HEALPIX_EPSILON)) { return 1; } else { return 0; } } int healpix_is_inull(int val) { if (val == HEALPIX_INT_NULL) { return 1; } else { return 0; } } /* simple tools */ char **healpix_strarr_alloc(size_t nstring) { size_t i,j; char **array = NULL; if (nstring == 0) { return NULL; } array = (char **)calloc(nstring, sizeof(char *)); if (!array) { return NULL; } for (i = 0; i < nstring; i++) { array[i] = NULL; array[i] = (char *)calloc(HEALPIX_STRNL, sizeof(char)); if (!array[i]) { for (j = 0; j < i; j++) { free(array[j]); } free(array); return NULL; } } return array; } int healpix_strarr_free(char **array, size_t nstring) { size_t i; if ((array == NULL)||(nstring == 0)) { return 0; } for (i = 0; i < nstring; i++) { free(array[i]); } free(array); return 0; } int healpix_nsidecheck(size_t nside) { if (nside > HEALPIX_NSIDE_MAX) { return 1; } if (nside == 0) { return 1; } if (((~nside)&(nside-1)) != (nside-1)) { return 1; } return 0; } size_t healpix_npix2nside(size_t npix) { double fpix; int err; fpix = ((double)npix) / 12.0; fpix = sqrt(fpix); err = healpix_nsidecheck((size_t) fpix); if (err) { return 0; } return (size_t) fpix; } size_t healpix_nside2npix(size_t nside) { int err; err = healpix_nsidecheck(nside); if (err) { return 0; } return 12 * nside * nside; } size_t healpix_nside2factor(size_t nside) { int err; size_t factor = 0; err = healpix_nsidecheck(nside); if (err) { return 0; } while (nside != (1ul< HEALPIX_NSIDE_MAX) { return 0; } return nside; } /* initialization */ void healpix_init() { size_t m; QMutex tablock; tablock.lock(); for (m = 0; m < 0x100; m++) { healpix_ctab[m] = (m&0x1) | ((m&0x2) << 7) | ((m&0x4) >> 1) | ((m&0x8) << 6) | ((m&0x10) >> 2) | ((m&0x20) << 5) | ((m&0x40) >> 3) | ((m&0x80) << 4); healpix_utab[m] = (m&0x1) | ((m&0x2) << 1) | ((m&0x4) << 2) | ((m&0x8) << 3) | ((m&0x10) << 4) | ((m&0x20) << 5) | ((m&0x40) << 6) | ((m&0x80) << 7); } healpix_doneinit = 1; tablock.unlock(); return; } /* Definitions for 32bit pixel values. Note that */ /* HEALPIX_NSIDE_MAX must be <= 2^14 in order to have */ /* 12*nside^2 be < 2^32. */ int healpix_xy2pix(size_t x, size_t y, size_t *pix) { HEALPIX_CHK; (*pix) = healpix_utab[x&0xff] | (healpix_utab[x>>8]<<16) | (healpix_utab[y&0xff]<<1) | (healpix_utab[y>>8]<<17); return 0; } int healpix_x2pix(size_t x, size_t *pix) { HEALPIX_CHK; (*pix) = healpix_utab[x&0xff] | (healpix_utab[x>>8]<<16); return 0; } int healpix_y2pix(size_t y, size_t *pix) { HEALPIX_CHK; (*pix) = (healpix_utab[y&0xff]<<1) | (healpix_utab[y>>8]<<17); return 0; } int healpix_pix2xy(size_t pix, size_t *x, size_t *y) { size_t raw; HEALPIX_CHK; raw = (pix&0x5555) | ((pix&0x55550000)>>15); (*x) = healpix_ctab[raw&0xff] | (healpix_ctab[raw>>8]<<4); raw = ((pix&0xaaaa)>>1) | ((pix&0xaaaa0000)>>16); (*y) = healpix_ctab[raw&0xff] | (healpix_ctab[raw>>8]<<4); return 0; } /* low level pixel routines */ int healpix_nest2xyf (size_t nside, size_t pix, size_t *x, size_t *y, size_t *face_num) { int err; size_t factor = healpix_nside2factor(nside); (*face_num) = pix >> (2*factor); err = healpix_pix2xy(pix & (nside*nside-1), x, y); return err; } int healpix_xyf2nest (size_t nside, size_t x, size_t y, size_t face_num, size_t *pix) { int err; size_t factor = healpix_nside2factor(nside); err = healpix_xy2pix(x, y, pix); (*pix) += (face_num<<(2*factor)); return err; } int healpix_ring2xyf (size_t nside, size_t pix, size_t *x, size_t *y, size_t *face_num) { long iring, iphi, kshift, nr; long nl2 = 2 * nside; size_t ncap = 2 * (nside*nside - nside); long tmp, ip, ire, irm, ifm, ifp, irt, ipt; long factor = (long int)healpix_nside2factor(nside); long face; if (pix < ncap) { iring = (long)(0.5*(1.0+sqrt((double)(1+2*pix)))); iphi = (long)(pix+1) - 2*iring*(iring-1); kshift = 0; nr = iring; face = 0; tmp = iphi-1; if (tmp >= (2*iring)) { face = 2; tmp -= 2*iring; } if (tmp >= iring) { face++; } } else if (pix < (12*nside*nside - ncap)) { ip = (long)(pix - ncap); iring = (ip>>(factor+2)) + (long)nside; iphi = (ip&(4*(long)nside-1)) + 1; kshift = (iring+(long)nside)&1; nr = (long)nside; ire = iring - (long)nside + 1; irm = nl2+2-ire; ifm = (iphi - ire/2 + (long)nside - 1) >> factor; ifp = (iphi - irm/2 + (long)nside - 1) >> factor; if (ifp == ifm) /* faces 4 to 7 */ face = (ifp==4) ? 4 : ifp+4; else if (ifp < ifm) /* (half-)faces 0 to 3 */ face = ifp; else /* (half-)faces 8 to 11 */ face = ifm + 8; } else { ip = (long)(12*nside*nside - pix); iring = (long)(0.5*(1.0+sqrt((double)(2*ip-1)))); iphi = 4*iring + 1 - (ip - 2*iring*(iring-1)); kshift = 0; nr = iring; iring = 2*nl2-iring; face = 8; tmp = iphi-1; if (tmp >= (2*nr)) { face = 10; tmp -= 2*nr; } if (tmp >= nr) face++; } irt = iring - (long)(healpix_jrll[face]*nside) + 1; ipt = 2*iphi - (long)healpix_jpll[face]*nr - kshift -1; if (ipt >= nl2) ipt -= 8*nside; (*face_num) = face; (*x) = (size_t)((ipt-irt) >> 1); (*y) = (size_t)((-(ipt+irt)) >> 1); return 0; } int healpix_xyf2ring (size_t nside, size_t x, size_t y, size_t face_num, size_t *pix) { long nl4 = 4*(long)nside; long jr = (long)healpix_jrll[face_num]; long nr, kshift, n_before; long ncap = 2 * (long)(nside*nside - nside); long jp; jr = (jr*(long)nside) - (long)x - (long)y - 1; if (jr < (long)nside) { nr = jr; n_before = 2 * nr * (nr-1); kshift = 0; } else if (jr > (long)(3*nside)) { nr = nl4 - jr; n_before = (long)(12*nside*nside) - 2*(nr+1)*nr; kshift = 0; } else { nr = (long)nside; n_before = ncap + (jr - (long)nside)*nl4; kshift = (jr - (long)nside)&1; } jp = (long)((long)((long)healpix_jpll[face_num]*nr + (long)x - (long)y + 1 + kshift) / 2); if (jp > nl4) { jp -= nl4; } else { if (jp < 1) jp += nl4; } (*pix) = (size_t)(n_before + jp - 1); return 0; } /* slightly higher-level functions */ int healpix_nest2ring (size_t nside, size_t pnest, size_t *pring) { int err; size_t x, y, face_num; err = healpix_nsidecheck(nside); if (err) { return err; } if (pnest > (12 * nside * nside - 1)) { return 1; } err = healpix_nest2xyf(nside, pnest, &x, &y, &face_num); if (err) { return err; } err = healpix_xyf2ring(nside, x, y, face_num, pring); fflush(stdout); return err; } int healpix_ring2nest(size_t nside, size_t pring, size_t *pnest) { int err; size_t x, y, face_num; err = healpix_nsidecheck(nside); if (err) { return err; } if (pring > (12 * nside * nside - 1)) { return 1; } err = healpix_ring2xyf(nside, pring, &x, &y, &face_num); fflush(stdout); if (err) { return err; } err = healpix_xyf2nest(nside, x, y, face_num, pnest); fflush(stdout); return err; } // In normal healpix operations, we want to convert the angle // to a pixel value *at the maximum resolution*, and then degrade // this pixel number to the desired NSIDE. This ensures that // round-off error is consistent between different resolutions. // This is the method used in the HPIC library (for example). // For the purposes of display, we don't really care that much // about round-off error- we want speed. These functions do a // straight conversion to the desired NSIDE in order to eliminate // the need to do many degrade operations. int healpix_ang2pix_ring(size_t nside, double theta, double phi, size_t *pix) { double z = cos(theta); double za = fabs(z); double tt; double intpart; long longpart; double temp1, temp2; long jp, jm; long ip, ir, kshift; size_t ncap = 2 * (nside*nside - nside); double tp, tmp; while (phi < 0.0) { phi += 2.0 * HEALPIX_PI; } intpart = floor(phi / (2.0*HEALPIX_PI)); phi -= intpart; tt = 2.0 * phi / HEALPIX_PI; if (za <= (2.0/3.0)) { temp1 = (double)nside * (0.5+tt); temp2 = (double)nside * z * 0.75; jp = (long)(temp1 - temp2); /* index of ascending edge line */ jm = (long)(temp1 + temp2); /* index of descending edge line */ /* ring number counted from z=2/3 */ ir = nside + 1 + jp - jm; /* in {1,2n+1} */ kshift = 1 - (ir&1); /* kshift=1 if ir even, 0 otherwise */ ip = (long)((long)(jp + jm - nside + kshift + 1) / 2); /* in {0,4n-1} */ ip = ip % (long)(4*nside); (*pix) = ncap + (size_t)((ir-1) * 4 * nside + ip); } else { tp = tt - floor(tt); tmp = (double)(nside) * sqrt(3.0 * (1.0 - za)); jp = (long)(tp * tmp); /* increasing edge line index */ jm = (long)((1.0-tp)*tmp); /* decreasing edge line index */ ir = jp + jm + 1; /* ring number counted from the closest pole */ ip = (long)(tt * (double)ir); /* in {0,4*ir-1} */ longpart = (long)(ip / (4*ir)); ip -= longpart; if (z > 0.0) { (*pix) = (size_t)(2 * ir * (ir-1) + ip); } else { (*pix) = (size_t)((long)(12*nside*nside) - 2*ir*(ir+1) + ip); } } return 0; } int healpix_ang2pix_nest(size_t nside, double theta, double phi, size_t *pix) { double z = cos(theta); double za = fabs(z); double tt; double intpart; double temp1, temp2; long jp, jm; long face, x, y; long ifp, ifm, ntt; size_t sipf; size_t factor; int err; double tp, tmp; while (phi < 0.0) { phi += 2.0 * HEALPIX_PI; } intpart = floor(phi / (2.0*HEALPIX_PI)); phi -= intpart; tt = 2.0 * phi / HEALPIX_PI; factor = healpix_nside2factor(nside); if (za <= (2.0/3.0)) { temp1 = (double)nside * (0.5+tt); temp2 = (double)nside * z * 0.75; jp = (long)(temp1-temp2); /* index of ascending edge line */ jm = (long)(temp1+temp2); /* index of descending edge line */ ifp = jp >> factor; /* in {0,4} */ ifm = jm >> factor; if (ifp == ifm) { /* faces 4 to 7 */ face = (ifp==4) ? (long)4 : ifp+4; } else if (ifp < ifm) { /* (half-)faces 0 to 3 */ face = ifp; } else { /* (half-)faces 8 to 11 */ face = ifm + 8; } x = jm & (long)(nside-1); y = (long)nside - (jp & (long)(nside-1)) - 1; } else { ntt = (long)tt; tp = tt - (double)ntt; tmp = (double)nside * sqrt(3.0*(1.0-za)); jp = (long)(tp*tmp); /* increasing edge line index */ jm = (long)((1.0-tp)*tmp); /* decreasing edge line index */ if (jp >= (long)nside) { jp = (long)nside-1; /* for points too close to the boundary */ } if (jm >= (long)nside) { jm = (long)nside-1; } if (z >= 0) { face = ntt; /* in {0,3} */ x = nside - jm - 1; y = nside - jp - 1; } else { face = ntt + 8; /* in {8,11} */ x = jp; y = jm; } } err = healpix_xy2pix((size_t)x, (size_t)y, &sipf); if (err) { return err; } (*pix) = sipf + (size_t)(face << (2*factor)); return err; } int healpix_pix2ang_ring(size_t nside, size_t pix, double *theta, double *phi){ size_t ncap = 2 * (nside*nside - nside); long iring, iphi; long ip, nl2; double fodd; if (pix < ncap) { iring = (long)(0.5*(1.0+sqrt(1.0+2.0*(double)pix))); iphi = (long)(pix+1) - 2 * iring * (iring-1); (*theta) = acos(1.0 - (double)(iring*iring) / (double)(3*nside*nside)); (*phi) = ((double)iphi - 0.5) * HEALPIX_PI / (2.0 * (double)iring); } else if (pix < (12*nside*nside-ncap)) { ip = (long)pix - (long)ncap; iring = (long)(ip / (4*(long)nside)) + (long)nside; /* counted from North pole */ iphi = ip % (4*(long)nside) + 1; /* 1 if iring+nside is odd, 1/2 otherwise */ fodd = ((iring+(long)nside)&1) ? 1.0 : 0.5; nl2 = 2 * (long)nside; (*theta) = acos((double)(nl2-iring) * 2.0 / (double)(3*nside)); (*phi) = ((double)iphi - fodd) * HEALPIX_PI / (double)nl2; } else { ip = (long)(12*nside*nside - pix); iring = (long)(0.5*(1.0+sqrt((double)(2*ip-1)))); iphi = 4*iring + 1 - (ip - 2*iring*(iring-1)); (*theta) = acos(-1.0 + (double)(iring*iring) / (double)(3*nside*nside)); (*phi) = ((double)iphi - 0.5) * HEALPIX_PI / (double)(2*iring); } return 0; } int healpix_pix2ang_nest(size_t nside, size_t pix, double *theta, double *phi){ size_t factor = healpix_nside2factor(nside); long nl4 = (long)(nside*4); long face = (long)pix >> (2*factor); long ipf = (long)pix & (long)(nside*nside-1); long x, y; size_t sx, sy; long jr, nr, kshift, jp; double z; int err; err = healpix_pix2xy((size_t)ipf, &sx, &sy); if (err) { return err; } x = (long)sx; y = (long)sy; jr = (long)(healpix_jrll[face]< (long)(3*nside)) { nr = nl4 - jr; z = (double)(nr*nr) / (double)(3*nside*nside) - 1.0; kshift = 0; } else { nr = (long)nside; z = (double)((long)(2*nside)-jr) * 2.0 / (double)(3*nside); kshift = (jr-(long)nside)&1; } jp = (long)((long)((long)healpix_jpll[face]*nr + x - y + 1 + kshift) / 2); if (jp > nl4) jp -= nl4; if (jp < 1) jp += nl4; (*theta) = acos(z); (*phi) = ((double)jp - (double)(kshift+1)*0.5) * HEALPIX_HALFPI / (double)nr; return 0; } /* degrade */ int healpix_degrade_nest(size_t oldnside, size_t oldpix, size_t newnside, size_t * newpix) { size_t oldfactor; size_t newfactor; size_t face; int err; err = healpix_nsidecheck(oldnside); if (err) { return err; } err = healpix_nsidecheck(newnside); if (err) { return err; } if (oldnside < newnside) { return 1; } oldfactor = healpix_nside2factor(oldnside); newfactor = healpix_nside2factor(newnside); face = oldpix >> 2*oldfactor; (*newpix) = ((oldpix & (oldnside*oldnside-1)) >> (2*(oldfactor-newfactor))) + (face << 2*newfactor); return 0; } int healpix_degrade_ring(size_t oldnside, size_t oldpix, size_t newnside, size_t * newpix) { size_t oldnest; size_t newnest; int err; err = healpix_ring2nest(oldnside, oldpix, &oldnest); if (err) { return err; } err = healpix_degrade_nest(oldnside, oldnest, newnside, &newnest); if (err) { return err; } err = healpix_nest2ring(newnside, newnest, newpix); if (err) { return err; } return 0; } /* unit sphere vectors */ int healpix_vec2ang(double xcomp, double ycomp, double zcomp, double *theta, double *phi) { double sint; (*theta) = acos(zcomp); sint = sin((*theta)); if (ycomp >= 0.0) { (*phi) = acos(xcomp / sint); } else { (*phi) = acos(xcomp / sint) + HEALPIX_PI; } return 0; } int healpix_ang2vec(double theta, double phi, double *xcomp, double *ycomp, double *zcomp) { (*xcomp) = sin(theta) * cos(phi); (*ycomp) = sin(theta) * sin(phi); (*zcomp) = cos(theta); return 0; } int healpix_pix2vec_ring(size_t nside, size_t pix, double *xcomp, double *ycomp, double *zcomp) { double theta; double phi; int err; err = healpix_pix2ang_ring(nside, pix, &theta, &phi); if (err) { return err; } err = healpix_ang2vec(theta, phi, xcomp, ycomp, zcomp); if (err) { return err; } return 0; } int healpix_pix2vec_nest(size_t nside, size_t pix, double *xcomp, double *ycomp, double *zcomp) { double theta; double phi; int err; err = healpix_pix2ang_nest(nside, pix, &theta, &phi); if (err) { return err; } err = healpix_ang2vec(theta, phi, xcomp, ycomp, zcomp); if (err) { return err; } return 0; } int healpix_vec2pix_ring(size_t nside, double xcomp, double ycomp, double zcomp, size_t * pix) { double theta; double phi; int err; err = healpix_vec2ang(xcomp, ycomp, zcomp, &theta, &phi); if (err) { return err; } err = healpix_ang2pix_ring(nside, theta, phi, pix); if (err) { return err; } return 0; } int healpix_vec2pix_nest(size_t nside, double xcomp, double ycomp, double zcomp, size_t * pix) { double theta; double phi; int err; err = healpix_vec2ang(xcomp, ycomp, zcomp, &theta, &phi); if (err) { return err; } err = healpix_ang2pix_nest(nside, theta, phi, pix); if (err) { return err; } return 0; } /* nearest neighbors */ int healpix_neighbors(size_t nside, int ordering, size_t pixel, long *parray) { int err; size_t i; size_t ptemp; static const int xoffset[] = { -1, 1, 0, 0,-1,-1, 1, 1 }; static const int yoffset[] = { 0, 0,-1, 1,-1, 1, 1,-1 }; static const int facearray[][12] = { { 8, 9,10,11,-1,-1,-1,-1,10,11, 8, 9 }, /* S */ { 5, 6, 7, 4, 8, 9,10,11, 9,10,11, 8 }, /* SE */ { -1,-1,-1,-1, 5, 6, 7, 4,-1,-1,-1,-1 }, /* E */ { 4, 5, 6, 7,11, 8, 9,10,11, 8, 9,10 }, /* SW */ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11 }, /* center */ { 1, 2, 3, 0, 0, 1, 2, 3, 5, 6, 7, 4 }, /* NE */ { -1,-1,-1,-1, 7, 4, 5, 6,-1,-1,-1,-1 }, /* W */ { 3, 0, 1, 2, 3, 0, 1, 2, 4, 5, 6, 7 }, /* NW */ { 2, 3, 0, 1,-1,-1,-1,-1, 0, 1, 2, 3 } }; /* N */ static const int swaparray[][12] = { { 0,0,0,0,0,0,0,0,3,3,3,3 }, /* S */ { 0,0,0,0,0,0,0,0,6,6,6,6 }, /* SE */ { 0,0,0,0,0,0,0,0,0,0,0,0 }, /* E */ { 0,0,0,0,0,0,0,0,5,5,5,5 }, /* SW */ { 0,0,0,0,0,0,0,0,0,0,0,0 }, /* center */ { 5,5,5,5,0,0,0,0,0,0,0,0 }, /* NE */ { 0,0,0,0,0,0,0,0,0,0,0,0 }, /* W */ { 6,6,6,6,0,0,0,0,0,0,0,0 }, /* NW */ { 3,3,3,3,0,0,0,0,0,0,0,0 } }; /* N */ int x, y, ix, iy, f; size_t stx, sty; size_t face; const size_t nsm1 = nside - 1; size_t nbnum; int tmp; if (ordering == HEALPIX_RING) { err = healpix_ring2xyf(nside, pixel, &stx, &sty, &face); } else { err = healpix_nest2xyf(nside, pixel, &stx, &sty, &face); } if (err) { return err; } ix = (int)stx; iy = (int)sty; for (i = 0; i < 8; i++) { parray[i] = -1l; } if ((ix > 0)&&(ix < (int)nsm1)&&(iy > 0)&&(iy < (int)nsm1)) { if (ordering == HEALPIX_RING) { for (i = 0; i < 8; i++) { err = healpix_xyf2ring(nside, (size_t)(ix + xoffset[i]), (size_t)(iy+yoffset[i]), face, &ptemp); parray[i] = ptemp; } } else { for (i = 0; i < 8; i++) { err = healpix_xyf2nest(nside, (size_t)(ix + xoffset[i]), (size_t)(iy+yoffset[i]), face, &ptemp); parray[i] = ptemp; } } } else { for (i = 0; i < 8; i++) { x = ix + xoffset[i]; y = iy + yoffset[i]; nbnum = 4; if (x < 0) { x += (int)nside; nbnum -= 1; } else if (x >= (int)nside) { x -= (int)nside; nbnum += 1; } if (y < 0) { y += (int)nside; nbnum -= 3; } else if (y >= (int)nside) { y -= (int)nside; nbnum += 3; } f = facearray[nbnum][face]; if (f >= 0) { if (swaparray[nbnum][face]&1) { x = (int)nside - x - 1; } if (swaparray[nbnum][face]&2) { y = (int)nside - y - 1; } if (swaparray[nbnum][face]&4) { tmp = x; x = y; y = tmp; } if (ordering == HEALPIX_RING) { err = healpix_xyf2ring(nside, (size_t)x, (size_t)y, (size_t)f, &ptemp); } else { err = healpix_xyf2nest(nside, (size_t)x, (size_t)y, (size_t)f, &ptemp); } parray[i] = ptemp; } } } return 0; } /* angular distance between two pixels */ double healpix_loc_dist(size_t nside, int order, size_t pix1, size_t pix2) { double x1, y1, z1; double x2, y2, z2; double alpha; if (healpix_nsidecheck(nside)) { return 0.0; } if (pix1 > 12 * nside * nside) { return 0.0; } if (pix2 > 12 * nside * nside) { return 0.0; } if (order == HEALPIX_NEST) { healpix_pix2vec_nest(nside, pix1, &x1, &y1, &z1); healpix_pix2vec_nest(nside, pix2, &x2, &y2, &z2); } else { healpix_pix2vec_ring(nside, pix1, &x1, &y1, &z1); healpix_pix2vec_ring(nside, pix2, &x2, &y2, &z2); } alpha = acos((x1 * x2) + (y1 * y2) + (z1 * z2)); return alpha; } diff --git a/pyKst/pykst.py b/pyKst/pykst.py index f68e9cec..d616b2f0 100644 --- a/pyKst/pykst.py +++ b/pyKst/pykst.py @@ -1,3684 +1,3684 @@ import sys import math import ctypes import atexit import os from ast import literal_eval try: from PySide import QtCore, QtNetwork, QtGui except ImportError as err1: try: from PyQt4 import QtCore, QtNetwork, QtGui except ImportError as err2: print("ImportError: {} and {}. One of the two is required.".format(err1, err2)) sys.exit() QtGui.QApplication([""]) from numpy import * import tempfile import time import subprocess def cleanTmpFile(file): os.remove(file.name) def b2str(val): if isinstance(val, bool): return "True" if val else "False" else: return str(val) class Client: """ An interface to a running kst session. A client provides a connection to a running kst session. The constructor creates a connection to either a running kst session with name , or if none exists, a new one. If server_name is not specified, it creates a connection to either the kst session with the name ``kstScript``, or if none exists, a new one. The Client provides functions which effect the entire kst session, provides convenience functions to create objects within kst (eg, ``client.new_generated_vector(0, 1, 6)``), and provides convenience functions to access objects already within kst (eg, ``client.vector("V2")``. This is the suggested method. Alternatively, the constructor for every class inside pykst accepts an instance of Client which it uses to interact with a kst session. To connect to a kst session named ``kstSession`` (starting kst if necessary):: import pykst as kst client = kst.Client("kstSession") """ def __init__(self,server_name="kstScript"): self.ls=QtNetwork.QLocalSocket() self.ls.connectToServer(server_name) self.ls.waitForConnected(300) self.server_name=server_name if self.ls.state() == QtNetwork.QLocalSocket.UnconnectedState: subprocess.Popen(["kst2","--serverName="+str(server_name)]) time.sleep(.5) while self.ls.state()==QtNetwork.QLocalSocket.UnconnectedState: self.ls.connectToServer(server_name) self.ls.waitForConnected(300) def send(self,command): """ Sends a command to kst and returns a response. You should never use this directly, as there is no guarantee that the internal command list kst uses won't change. Instead use the convenience classes included with pykst. """ self.ls.write(command) self.ls.flush() self.ls.waitForReadyRead(300000) x=self.ls.readAll() return x def send_si(self, handle, command): self.send(b2str("beginEdit("+handle+")")) x = self.send(command) self.send(b2str("endEdit()")) return x def testCommand(self): self.send("testCommand()") def clear(self): """ Clears all objects from kst. Equivalent to file->close from the menubar inside kst. """ self.send("clear()") def open_kst_file(self, filename): """ open a .kst file in kst. """ self.send("fileOpen("+b2str(filename)+")") def save_kst_file(self, filename): """ save a .kst file in kst. """ self.send("fileSave("+b2str(filename)+")") def export_graphics_file(self, filename, format=None, width=1280, height=1024, display = 2, all_tabs = False, autosave_period = 0): """ export the kst session as a set of graphics files. :param filename: the name of the file to be saved :param format: the format to be used. if None, the format is determined from the filename extension. :param width: width of the plot, in pixels, if required by the display setting. :param height: the height of the plot, in pixels, if required by the display setting. :param display: how the dimensions are interpreted. :param all_tabs: if True, all tabs are exported as _. :param autosave_period: save the image every seconds. If 0, only save once. *display* determines the shape of the plot. Values are :: 0 Width set by user, maintain aspect ratio 1 Height set by user, maintain aspect ratio 2 Width and Height set by user. 3 a Width x Width square plot. """ if format is None: format = os.path.splitext(filename)[1][1:].strip().lower() self.send("exportGraphics("+str(filename)+","+str(format)+","+str(width)+","+ str(height)+","+str(display)+","+str(all_tabs)+","+str(autosave_period) + ")") def screen_back(self): """ Equivalent to "Range>Back One Screen" from the menubar inside kst. """ self.send("screenBack()") def screen_forward(self): """ Equivalent to "Range>Forward One Screen" from the menubar inside kst. """ self.send("screenForward()") def count_from_end(self): """ Equivalent to "Range>Count From End" from the menubar inside kst. """ self.send("countFromEnd()") def read_to_end(self): """ Equivalent to "Range>Read To End" from the menubar inside kst. """ self.send("readToEnd()") def set_paused(self): """ Equivalent to checking "Range>Pause" from the menubar inside kst.""" self.send("setPaused()") def unset_paused(self): """ Equivalent to unchecking "Range>Pause" from the menubar inside kst.""" self.send("unsetPaused()") def hide_window(self): """ Hide the kst window. pyKst operations which effect the display are far faster when the window is hidden. Restore with show_window() or maximize_window().""" self.send("hide()") def quit(self): """ Tell the kst window to terminate After this, client will no longer be valid.""" self.send("quit()") def minimize_window(self): """ Minimize the kst window. """ self.send("minimize()") def maximize_window(self): """ Maximize the kst window. """ self.send("maximize()") def show_window(self): """ unminimize and show the kst window. """ self.send("show()") def tab_count(self): """ Get the number of tabs open in the current document. """ return self.send("tabCount()") def new_tab(self): """ Create a new tab in the current document and switch to it. """ return self.send("newTab()") def set_tab(self,tab): """ Set the index of the current tab. tab must be greater or equal to 0 and less than tabCount(). """ self.send("setTab("+b2str(tab)+")") def set_tab_text(self,new_name): """ Set the text of the current tab. """ self.send("renameTab("+new_name+")") def cleanup_layout(self, columns="Auto"): """ Cleanup layout in the current tab. If columns is not set, use auto-layout. """ self.send("cleanupLayout("+b2str(columns)+")") def get_scalar_list(self): """ returns the scalar names from kst """ x = self.send("getScalarList()") name_list=x.data().split('|') return [Scalar(self, name=n) for n in name_list] def new_generated_string(self, string, name=""): """ Create a new generated string in kst. See :class:`GeneratedString` """ return GeneratedString(self, string, name) def generated_string(self, name): """ Returns a generated string from kst given its name. See :class:`GeneratedString` """ return GeneratedString(self, "", name, new=False) def new_datasource_string(self, filename, field, name=""): """ Create a New Data Source String in kst. See :class:`DataSourceString` """ return DataSourceString(self, filename, field, name) def datasource_string(self, name): """ Returns a datasource string from kst given its name. See :class:`DataSourceString` """ return DataSourceString(self, "", "", name, new=False) def new_generated_scalar(self, value, name=""): """ Create a New Generated Scalar in kst. See :class:`GeneratedScalar` """ return GeneratedScalar(self, value, name) def generated_scalar(self, name): """ Returns a Generated Scalar from kst given its name. See :class:`GeneratedScalar` """ return GeneratedScalar(self, "", name, new=False) def new_datasource_scalar(self, filename, field, name=""): """ Create a New DataSource Scalar in kst. See :class:`DataSourceScalar` """ return DataSourceScalar(self, filename, field, name) def datasource_scalar(self, name): """ Returns a DataSource Scalar from kst given its name. See :class:`DataSourceScalar` """ return DataSourceScalar(self, "", "", name, new=False) def new_vector_scalar(self, filename, field, frame=-1, name=""): """ Create a New VectorScalar in kst. See :class:`VectorScalar` """ return VectorScalar(self, filename, field, frame, name) def vector_scalar(self, name): """ Returns a VectorScalar from kst given its name. See :class:`VectorScalar` """ return VectorScalar(self, "", "", 0, name, new=False) def new_data_vector(self, filename, field, start=0, num_frames=-1, skip=0, boxcarFirst=False, name="") : """ Create a New DataVector in kst. See :class:`DataVector` """ return DataVector(self, filename, field, start, num_frames, skip, boxcarFirst, name) def data_vector(self, name): """ Returns a DataVector from kst given its name. See :class:`DataVector` """ return DataVector(self, "", "", name=name, new=False) def new_generated_vector(self, x0, x1, n, name=""): """ Create a New GeneratedVector in kst. See :class:`GeneratedVector` """ return GeneratedVector(self, x0, x1, n, name) def generated_vector(self, name): """ Returns a GeneratedVector from kst given its name. See :class:`GeneratedVector` """ return GeneratedVector(self, 0, 0, 0, name, new=False) def new_editable_vector(self, np_array = None, name=""): """ Create a New Editable Vector in kst. See :class:`EditableVector` """ return EditableVector(self, np_array, name) def editable_vector(self, name): """ Returns an Editable Vector from kst given its name. See :class:`EditableVector` """ return EditableVector(self, None, name, new=False) def get_vector_list(self): """ returns vectors from kst. """ x = self.send("getVectorList()") name_list=x.data().split('|') return [VectorBase(self, name=n) for n in name_list] def get_data_vector_list(self): """ returns data vectors from kst. """ x = self.send("getDataVectorList()") name_list=x.data().split('|') return [DataVector(self, "", "", name=n, new=False) for n in name_list] def get_generated_vector_list(self): """ returns generated vectors from kst. """ x = self.send("getGeneratedVectorList()") name_list=x.data().split('|') return [GeneratedVector(self, name=n, new=False) for n in name_list] def get_editable_vector_list(self): """ returns editable vectors from kst. """ x = self.send("getEditableVectorList()") name_list=x.data().split('|') return [EditableVector(self, name=n, new=False) for n in name_list] def new_data_matrix(self, filename, field, start_x=0, start_y=0, num_x=-1, num_y=-1, min_x=0, min_y=0, dx=1, dy=1,name="") : """ Create a New DataMatrix in kst. See :class:`DataMatrix` """ return DataMatrix(self, filename, field, start_x, start_y, num_x, num_y, min_x, min_y, dx, dy,name) def data_matrix(self, name): """ Returns a DataMatrix from kst given its name. See :class:`DataMatrix` """ return DataMatrix(self, "", "", name=name, new=False) def new_editable_matrix(self, np_array = None, name=""): """ Create a New Editable Matrix in kst. See :class:`EditableMatrix` """ return EditableMatrix(self, np_array, name) def editable_matrix(self, name): """ Returns an Editable Matrix from kst given its name. See :class:`EditableMatrix` """ return EditableMatrix(self, None, name, new=False) def get_matrix_list(self): """ returns matrixes from kst. """ x = self.send("getMatrixList()") name_list=x.data().split('|') return [Matrix(self, name=n) for n in name_list] def new_curve(self, x_vector, y_vector, name=""): """ Create a New Curve in kst. See :class:`Curve` """ return Curve(self, x_vector, y_vector, name) def curve(self, name): """ Returns a Curve from kst given its name. See :class:`Curve` """ return Curve(self, "", "", name, new=False) def new_image(self, matrix, name=""): """ Create a new Image in kst. See :class:`Image` """ return Image(self, matrix, name) def image(self, name): """ Returns an Image from kst given its name. See :class:`Image` """ return Image(self, "", "", name, new=False) def new_equation(self, x_vector, equation, interpolate=True, name=""): """ Create a new Equation in kst. See :class:`Equation` """ return Equation(self, x_vector, equation, interpolate, name) def equation(self, name): """ Returns an Equation from kst given its name. See :class:`Equation` """ return Equation(self, "", "", name, new=False) def new_histogram(self, vector, bin_min=0, bin_max=1, num_bins=60, normalization = 0, auto_bin = True, name=""): """ Create a new histogram in kst. See :class:`Histogram` """ return Histogram(self, vector, bin_min, bin_max, num_bins, normalization, auto_bin, name) def histogram(self, name): """ Returns a histogram from kst given its name. See :class:`Histogram` """ return Histogram(self, "", 0,0,0, name=name, new=False) def new_cross_spectrum(self, V1, V2, fft_size=10, sample_rate = 1.0, name = ""): """ Create a cross spectrum object in kst. See :class:`CrossSpectrum` """ return CrossSpectrum(self, V1,V2, fft_size, sample_rate, name) def new_spectrum(self, vector, sample_rate = 1.0, interleaved_average = False, fft_length = 10, apodize = True, remove_mean = True, vector_units = "", rate_units = "Hz", apodize_function = 0, sigma = 1.0, output_type = 0, name=""): """ Create a new Spectrum in kst. See :class:`Spectrum` """ return Spectrum(self, vector, sample_rate, interleaved_average, fft_length, apodize, remove_mean, vector_units, rate_units, apodize_function, sigma, output_type, name) def spectrum(self, name): """ Returns a spectrum from kst given its name. See :class:`Spectrum` """ return Spectrum(self, "", name=name, new=False) def new_linear_fit(self, x_vector, y_vector, weightvector = 0, name = ""): """ Create a New Linear Fit in kst. See :class:`LinearFit` """ return LinearFit(self, x_vector, y_vector, weightvector, name) def linear_fit(self, name): """ Returns a linear fit from kst given its name. See :class:`LinearFit` """ return LinearFit(self, "", "", 0, name, new=False) def new_polynomial_fit(self, order, x_vector, y_vector, weightvector = 0, name = ""): """ Create a New Polynomial Fit in kst. See :class:`PolynomialFit` """ return PolynomialFit(self, order, x_vector, y_vector, weightvector, name) def polynomial_fit(self, name): """ Returns a polynomial fit from kst given its name. See :class:`PolynomialFit` """ return PolynomialFit(self, 0, "", "", 0, name, new=False) def new_flag_filter(self, y_vector, flag, mask="0xffffff", valid_is_zero=True, name = ""): """ Create a flag filter inside kst. See :class:`FlagFilter` """ return FlagFilter(self, y_vector, flag, mask, valid_is_zero, name) def flag_filter(self, name): """ Returns a flag_filter from kst given its name. See :class:`FlagFilter` """ return FlagFilter(self, "", "", name, new=False) def new_label(self, text, pos=(0.5,0.5), rot=0, font_size=12, bold=False, italic=False, font_color="black", font_family="Serif", name="") : """ Create a New Label in kst. See :class:`Label` """ return Label(self, text, pos, rot, font_size, bold, italic, font_color, font_family, name) def label(self, name): """ Returns a Label from kst given its name. See :class:`Label` """ return Label(self, "", name=name, new=False) def get_label_list(self): """ Get a list of all labels in kst. See :class:`Label` """ x=self.send("getLabelList()") name_list = x.data()[1:-1].split("][") return [Label(self, name=n, new=False) for n in name_list] def new_box(self, pos=(0.1,0.1), size=(0.1,0.1), rot=0, fill_color="white", fill_style=1, stroke_style=1, stroke_width=1, stroke_brush_color="black", stroke_brush_style=1, strokeJoinStyle=1, stroke_cap_style=1, fix_aspect=False, name="") : """ Create a New Box in kst. See :class:`Box` """ return Box(self, pos, size, rot, fill_color, fill_style, stroke_style, stroke_width, stroke_brush_color, stroke_brush_style, strokeJoinStyle, stroke_cap_style, fix_aspect, name) def box(self, name): """ Returns a Box from kst given its name. See :class:`Box` """ return Box(self, name=name, new=False) def get_box_list(self): """ Get a list of all boxes in kst. See :class:`Box` """ x=self.send("getBoxList()") name_list = x.data()[1:-1].split("][") return [Box(self, name=n, new=False) for n in name_list] def new_legend(self, plot, name = "") : """ Create a new Legend in a plot in kst. See :class:'Legend' """ return Legend(self, plot, name) def legend(self, name): """ Returns a Legend from kst given its name. See :class:`Legend` """ return Legend(self, name=name, new=False) def get_legend_list(self): """ Get a list of all legends in kst. See :class:`Legend` """ x=self.send("getLegendList()") name_list = x.data()[1:-1].split("][") return [Legend(self, name=n, new=False) for n in name_list] def new_circle(self, pos=(0.1, 0.1), diameter=0.1, fill_color="white",fill_style=1,stroke_style=1, stroke_width=1,stroke_brush_color="grey",stroke_brush_style=1, name="") : """ Create a New Circle in kst. See :class:`Circle` """ return Circle(self, pos, diameter, fill_color, fill_style, stroke_style, stroke_width, stroke_brush_color, stroke_brush_style, name) def circle(self, name): """ Returns a Circle from kst given its name. See :class:`Circle` """ return Circle(self, name=name, new=False) def get_circle_list(self): """ Get a list of all ciircles in kst. See :class:`Circle` """ x=self.send("getCircleList()") name_list = x.data()[1:-1].split("][") return [Circle(self, name=n, new=False) for n in name_list] def new_ellipse(self,pos=(0.1,0.1), size=(0.1,0.1), rot=0, fill_color="white", fill_style=1, stroke_style=1, stroke_width=1, stroke_brush_color="black", stroke_brush_style=1, fix_aspect=False, name="") : """ Create a New Ellipse in kst. See :class:`Ellipse` """ return Ellipse(self,pos, size, rot, fill_color, fill_style, stroke_style, stroke_width, stroke_brush_color, stroke_brush_style, fix_aspect, name) def ellipse(self, name): """ Returns an ellipse from kst given its name. See :class:`Ellipse` """ return Ellipse(self, name=name, new=False) def get_ellipse_list(self): """ Get a list of all ellipse in kst. See :class:`Ellipse` """ x=self.send("getEllipseList()") name_list = x.data()[1:-1].split("][") return [Ellipse(self, name=n, new=False) for n in name_list] def new_line(self,start=(0,0),end = (1,1), stroke_style=1,stroke_width=1,stroke_brush_color="black", stroke_brush_style=1,stroke_cap_style=1, name="") : """ Create a New Line in kst. See :class:`Line` """ return Line(self,start,end, stroke_style, stroke_width, stroke_brush_color, stroke_brush_style, stroke_cap_style, name) def line(self, name): """ Returns a Line from kst given its name. See :class:`Line` """ return Line(self, name=name, new=False) def get_line_list(self): """ Get a list of all lines in kst. See :class:`Line` """ x=self.send("getLineList()") name_list = x.data()[1:-1].split("][") return [Line(self, name=n, new=False) for n in name_list] def new_arrow(self,start=(0,0),end = (1,1), arror_at_start = False, arrow_at_end = True, arrow_size = 12.0, stroke_style=1, stroke_width=1, stroke_brush_color="black", stroke_brush_style=1, stroke_cap_style=1, name="") : """ Create a New Arrow in kst. See :class:`Arrow` """ return Arrow(self,start,end, arror_at_start, arrow_at_end, arrow_size, stroke_style, stroke_width, stroke_brush_color, stroke_brush_style, stroke_cap_style, name) def arrow(self, name): """ Returns an Arrow from kst given its name. See :class:`Arrow` """ return Arrow(self, name=name, new=False) def get_arrow_list(self): """ Get a list of all arrows in kst. See :class:`Arrow` """ x=self.send("getArrowList()") name_list = x.data()[1:-1].split("][") return [Arrow(self, name=n, new=False) for n in name_list] def new_picture(self,filename,pos=(0.1,0.1), width=0.1,rot=0, name="") : """ Create a New Picture in kst. See :class:`Picture` """ return Picture(self,filename, pos, width, rot, name) def picture(self, name): """ Returns a Picture from kst given its name. See :class:`Picture` """ return Picture(self, "", name = name, new=False) def get_picture_list(self): """ Get a list of all pictures in kst. See :class:`Picture` """ x=self.send("getPictureList()") name_list = x.data()[1:-1].split("][") return [Picture(self, name=n, new=False) for n in name_list] def new_SVG(self, filename, pos=(0.1,0.1), width=0.1, rot=0, name="") : """ Create a New SVG in kst. See :class:`SVG` """ return SVG(self, filename, pos, width, rot, name) def SVG(self, name): """ Returns a SVG from kst given its name. See :class:`SVG` """ return SVG(self, "", name = name, new=False) def get_SVG_list(self): """ Get a list of all SVGs in kst. See :class:`SVG` """ x=self.send("getSVGList()") name_list = x.data()[1:-1].split("][") return [SVG(self, name=n, new=False) for n in name_list] def new_plot(self,pos=(0.1,0.1),size=(0,0),rot=0,font_size = 0, columns=0, fill_color="white", fill_style=1, stroke_style=1, stroke_width=1, stroke_brush_color="black", stroke_brush_style=1, strokeJoinStyle=1, stroke_cap_style=1, fix_aspect=False, auto_position = True, name="") : """ Create a New Plot in kst. See :class:`Plot` """ return Plot(self, pos, size, rot, font_size, columns, fill_color, fill_style, stroke_style, stroke_width, stroke_brush_color, stroke_brush_style, strokeJoinStyle, stroke_cap_style, fix_aspect, auto_position, name) def plot(self, name): """ Returns a Plot from kst given its name. See :class:`Plot` """ return Plot(self, name = name, new=False) def get_plot_list(self): """ Get a list of all plots in kst. See :class:`Plot` """ x=self.send("getPlotList()") name_list = x.data()[1:-1].split("][") return [Plot(self, name=n, new=False) for n in name_list] def set_datasource_option(self, option, value, filename, data_source="Ascii File"): """ Sets the value of a data source configuration option. :param option: the name of the option - eg ""Data Start" :param value: True or False :param filename: the name of the file or 0 to set global default :param data_source: the type of data source Examples: Tell kst that trial1.csv is a file with the field names in row 1 and units in row 2:: import pykst as kst client = kst.Client() client.set_datasource_option("Column Delimiter", ",", "trial1.csv") client.set_datasource_option("Column Type", 2, "trial1.csv") client.set_datasource_option("Data Start", 3-1, "trial1.csv") client.set_datasource_option("Fields Line", 1-1, "trial1.csv") client.set_datasource_option("Read Fields", True, "trial1.csv") client.set_datasource_option("Units Line", 2-1, "trial1.csv") client.set_datasource_option("Read Units", True, "trial1.csv") Configuration options supported by the ASCII data source (default) are:: "ASCII Time format" "Column Delimiter" "Column Type" "Column Width" "Column Width is const" "Comment Delimiters" "Data Rate for index" "Data Start" "Default INDEX Interpretation" "Fields Line" "Filename Pattern" "Index" "Limit file buffer size" "NaN value" "Read Fields" "Read Units" "Size of limited file buffer" "Units Line" "Use Dot" "Use threads when parsing Ascii data" "date/time offset" "relative offset" "updateType" "use an explicit date/time offset" "use file time/date as offset" "use relative file time offset" """ if (filename == 0): filename = "$DEFAULT" if isinstance(value, bool): self.send("setDatasourceBoolConfig("+data_source+","+filename+","+option+","+b2str(value)+")") elif isinstance(value, int): self.send("setDatasourceIntConfig("+data_source+","+filename+","+option+","+str(value)+")") else: v = value v.replace(',', '`') self.send("setDatasourceStringConfig("+data_source+","+filename+","+option+","+str(v)+")") class NamedObject: """ Convenience class. You should not use it directly.""" def __init__(self,client): self.client=client def set_name(self,name): """ Set the name of the object inside kst. """ self.client.send_si(self.handle, b2str("setName("+b2str(name)+")")) def name(self): """ Returns the name of the object from inside kst. """ return self.client.send_si(self.handle, "name()") def description_tip(self): """ Returns a string describing the object """ return self.client.send_si(self.handle, "descriptionTip()") def test_command(self): return self.client.send_si(self.handle, "testCommand()") class Object(NamedObject) : """ Convenience class. You should not use it directly.""" def __init__(self,client) : NamedObject.__init__(self,client) def type_str(self): """ Returns the type of the object from inside kst. """ return self.client.send_si(self.handle, "type()") class String(Object) : """ Convenience class. You should not use it directly.""" def __init__(self,client) : Object.__init__(self,client) def value(self) : """ Returns the string. """ return self.client.send_si(self.handle, "value()") class GeneratedString(String) : """ A string constant inside kst. This class represents a string you would create via "Create>String>Generated" from the menubar inside kst. :param string: The value of the string. To import the string "Hello World" into kst:: import pykst as kst client = kst.Client() s = client.new_generatedString("Hello World") """ def __init__(self,client,string,name="", new=True) : String.__init__(self,client) if (new == True): self.client.send("newGeneratedString()") self.handle=self.client.send("endEdit()") self.handle.remove(0,self.handle.indexOf("ing ")+4) self.set_value(string) self.set_name(name) else: self.handle = name def set_value(self,val): """ set the value of the string inside kst. """ self.client.send_si(self.handle, b2str("setValue("+b2str(val)+")")) class DataSourceString(String) : """ A string read from a data source inside kst. This class represents a string you would create via "Create>String>Read from Data Source" from the menubar inside kst. :param filename: The name of the file/data source to read the string from. :param field: the name of the field in the data source. To read "File path" from the data source "tmp.dat" into kst:: import pykst as kst client = kst.Client() s = client.new_datasource_string("tmp.dat", "File Path") """ def __init__(self,client,filename,field,name="", new=True) : String.__init__(self,client) if (new == True): self.client.send("newDataString()") self.handle=self.client.send("endEdit()") self.handle.remove(0,self.handle.indexOf("ing ")+4) self.change(filename, field) else: self.handle = name def change(self,filename,field): """ Change a DataSource String. Change the file and field of a DataSourceString in kst. :param filename: The name of the file/data source to read the string from. :param field: the name of the field in the data source. """ self.client.send_si(self.handle, b2str("change("+b2str(filename)+","+b2str(field)+")")) class Scalar(Object) : """ Convenience class. You should not use it directly.""" def __init__(self,client, name="") : Object.__init__(self,client) self.handle = name def value(self) : """ Returns the scalar. """ return self.client.send_si(self.handle, "value()") class GeneratedScalar(Scalar) : """ A scalar constant inside kst. This class represents a scalar you would create via "Create>Scalar>Generate" from the menubar inside kst. :param value: the value to assign to the scalar constant. To import the scalar of value 42 into kst:: import pykst as kst client = kst.Client() s = client.new_generated_scalar(42) """ def __init__(self, client, value, name="", new=True) : Scalar.__init__(self,client) if (new == True): self.client.send("newGeneratedScalar()") self.handle=self.client.send("endEdit()") self.handle.remove(0,self.handle.indexOf("ing ")+4) self.set_value(value) self.set_name(name) else: self.handle = name def set_value(self,val): """ set the value of the string inside kst. """ self.client.send_si(self.handle, b2str("setValue("+b2str(val)+")")) class DataSourceScalar(Scalar) : """ A scalar read from a data source inside kst. This class represents a scalar you would create via "Create>Scalar>Read from Data Source" from the menubar inside kst. :param filename: The name of the file/data source to read the scalar from. :param field: the name of the field in the data source. To read "CONST1" from the data source "tmp.dat" into kst:: import pykst as kst client = kst.Client() x = client.new_datasource_scalar("tmp.dat", "CONST1") """ def __init__(self,client,filename,field,name="", new=True) : Scalar.__init__(self,client) if (new == True): self.client.send("newDataScalar()") self.handle=self.client.send("endEdit()") self.handle.remove(0,self.handle.indexOf("ing ")+4) self.change(filename, field) else: self.handle = name def change(self,filename,field): """ Change a DataSource Scalar. Change the file and field of a DataSourceScalar in kst. :param filename: The name of the file/data source to read the scalar from. :param field: the name of the field in the data source. """ self.client.send_si(self.handle, "change("+filename+","+field+")") def file(self) : - """ Returns the the data source file name. """ + """ Returns the data source file name. """ return self.client.send_si(self.handle, "file()") def field(self) : """ Returns the field. """ return self.client.send_si(self.handle, "field()") class VectorScalar(Scalar) : """ A scalar in kst read from a vector from a data source. This class represents a scalar you would create via "Create>Scalar>Read from vector" from the menubar inside kst. :param filename: The name of the file/data source to read the scalar from. :param field: the name of the vector in the data source. :param frame: which frame of the vector to read the scalar from. frame = -1 (the default) reads from the end of the file. To read the last value of the vector INDEX from the file "tmp.dat" into kst:: import pykst as kst client = kst.Client() x = client.new_vector_scalar("tmp.dat", "INDEX", -1) """ def __init__(self, client, filename, field, frame=-1, name="", new=True) : Scalar.__init__(self,client) if (new == True): self.client.send("newVectorScalar()") self.handle=self.client.send("endEdit()") self.handle.remove(0,self.handle.indexOf("ing ")+4) self.change(filename, field, frame) else: self.handle = name def change(self,filename,field,frame): """ Change a Vector Scalar in kst. Change the file, field and frame of a VectorScalar in kst. :param filename: The name of the file/data source to read the scalar from. :param field: the name of the vector in the data source. :param frame: which frame of the vector to read the scalar from. frame = -1 reads from the end of the file. """ self.client.send_si(self.handle, b2str("change("+b2str(filename)+","+b2str(field)+","+b2str(frame)+")")) def file(self) : - """ Returns the the data source file name. """ + """ Returns the data source file name. """ return self.client.send_si(self.handle, "file()") def field(self) : """ Returns the field. """ return self.client.send_si(self.handle, "field()") def frame(self) : """ Returns the fame. """ return self.client.send_si(self.handle, "frame()") class VectorBase(Object): """ Convenience class. You should not use it directly.""" def __init__(self,client,name="") : Object.__init__(self,client) self.handle = name def value(self,index): """ Returns element i of this vector. """ return self.client.send_si(self.handle, "value("+b2str(index)+")") def length(self): """ Returns the number of samples in the vector. """ return self.client.send_si(self.handle, "length()") def min(self): """ Returns the minimum value in the vector. """ return self.client.send_si(self.handle, "min()") def mean(self): """ Returns the mean of the vector. """ return self.client.send_si(self.handle, "mean()") def max(self): """ Returns the maximum value in the vector. """ return self.client.send_si(self.handle, "max()") def get_numpy_array(self) : """ get a numpy array which contains the kst vector values """ with tempfile.NamedTemporaryFile() as f: self.client.send_si(self.handle, "store(" + f.name + ")") array = fromfile(f.name, dtype = float64) return array class DataVector(VectorBase): """ A vector in kst, read from a data source. This class represents a vector you would create via "Create>Vector>Read from Data Source" from the menubar inside kst. The parameters of this function mirror the parameters within "Create>Vector>Read from Data Source". :param filename: The name of the file/data source to read the scalar from. :param field: the name of the vector in the data source. :param start: The starting index of the vector. start = -1 for count from end. :param num_frames: The number of frames to read. num_frames = -1 for read to end. :param skip: The number of frames per sample read. skip = 0 to read every sample. :param boxcarFirst: apply a boxcar filter before skiping. To create a vector from "tmp.dat" with field "INDEX" from frame 3 to frame 10, reading a sample every other frame without a boxcar filter:: import pykst as kst client = kst.Client() v = client.new_data_vector("tmp.dat", "INDEX", 3, 10, 2, False) """ def __init__(self, client, filename, field, start=0, num_frames=-1, skip=0, boxcarFirst=False, name="", new=True) : VectorBase.__init__(self,client) if (new == True): self.client.send("newDataVector()") self.handle=self.client.send("endEdit()") self.handle.remove(0,self.handle.indexOf("ing ")+4) self.change(filename, field, start, num_frames, skip, boxcarFirst) else: self.handle = name def change(self, filename, field, start, num_frames, skip, boxcarFirst): """ Change the parameters of a data vector. :param filename: The name of the file/data source to read the scalar from. :param field: the name of the vector in the data source. :param start: The starting index of the vector. start = -1 for count from end. :param num_frames: The number of frames to read. num_frames = -1 for read to end. :param skip: The number of frames per sample read. skip = 0 to read every sample. :param boxcarFirst: apply a boxcar filter before skiping. """ self.client.send_si(self.handle, "change("+filename+","+field+"," +b2str(start)+","+b2str(num_frames)+","+b2str(skip) +","+b2str(boxcarFirst)+")") def change_frames(self, start, num_frames, skip, boxcarFirst): """ Change the parameters of a data vector. :param start: The starting index of the vector. start = -1 for count from end. :param num_frames: The number of frames to read. num_frames = -1 for read to end. :param skip: The number of frames per sample read. skip = 0 to read every sample. :param boxcarFirst: apply a boxcar filter before skiping. """ self.client.send_si(self.handle, "changeFrames(" +b2str(start)+","+b2str(num_frames)+","+b2str(skip) +","+b2str(boxcarFirst)+")") def field(self): """ Returns the fieldname. """ return self.client.send_si(self.handle, "field()") def filename(self): """ Returns the filename. """ return self.client.send_si(self.handle, "filename()") def start(self): """ Returns the index of first frame in the vector. -1 means count from end. """ return self.client.send_si(self.handle, "start()") def n_frames(self): """ Returns the number of frames to be read. -1 means read to end. """ return self.client.send_si(self.handle, "NFrames()") def skip(self): """ Returns number of frames to be skipped between samples read. """ return self.client.send_si(self.handle, "skip()") def boxcar_first(self): """ True if boxcar filtering has been applied before skipping. """ return self.client.send_si(self.handle, "boxcarFirst()") class GeneratedVector(VectorBase): """ Create a generated vector in kst. This class represents a vector you would create via "Create>Vector>Generate" from the menubar inside kst. :param x0: The first value in the vector. :param x1: The last value in the vector. :param n: The number of evenly spaced values in the vector. To create the vector {0, 0.2, 0.4, 0.6, 0.8, 1.0}:: import pykst as kst client = kst.Client() v = client.new_generated_vector(0, 1, 6) """ def __init__(self, client, x0=0, x1=1, n=100, name="", new=True) : VectorBase.__init__(self,client) if (new == True): self.client.send("newGeneratedVector()") self.handle=self.client.send("endEdit()") self.handle.remove(0,self.handle.indexOf("ing ")+4) self.change(x0, x1, n) self.set_name(name) else: self.handle = name def change(self,x0, x1, n): """ Change the parameters of a Generated Vector inside kst. :param x0: The first value in the vector. :param x1: The last value in the vector. :param n: The number of evenly spaced values in the vector. """ self.client.send_si(self.handle, "change("+b2str(x0)+","+b2str(x1)+ ","+b2str(n)+")") class EditableVector(VectorBase): """ A vector in kst, which is editable from python. This vector in kst can be created from a numpy array, (with ''load()'') or edited point by point (with ''setValue()''). "Create>Vector>Generate" from the menubar inside kst. :param np_array: initialize the vector in kst to this (optional) 1D numpy array. To create a from the num py array np:: import pykst as kst client = kst.Client() v = client.new_editable_vector(np) """ def __init__(self, client, np_array = None, name="", new=True) : VectorBase.__init__(self,client) if (new == True): self.client.send("newEditableVector()") if (np_array != None) : assert(np_array.dtype == float64) with tempfile.NamedTemporaryFile(delete=False) as f: f.close() #atexit.register(cleanTmpFile, f) np_array.tofile(f.name) self.client.send("load(" + f.name + ")") os.unlink(f.name) self.handle=self.client.send("endEdit()") self.handle.remove(0,self.handle.indexOf("ing ")+4) self.set_name(name) else: self.handle = name def load(self, np_array): """ sets the value of the vector to that of the float64 1D np array """ assert(np_array.dtype == float64) with tempfile.NamedTemporaryFile(delete=False) as f: f.close() #atexit.register(cleanTmpFile, f) np_array.tofile(f.name) retval = self.client.send_si(self.handle, "load(" + f.name + ")") os.unlink(f.name) return retval class Matrix(Object): """ Convenience class. You should not use it directly.""" def __init__(self,client, name="") : Object.__init__(self,client) self.handle = name def value(self,i_x, i_y): """ Returns element (i_x, i_y} of this matrix. """ return self.client.send_si(self.handle, "value("+b2str(i_x)+ ","+b2str(i_y)+")") def length(self): """ Returns the number of elements in the matrix. """ return self.client.send_si(self.handle, "length()") def min(self): """ Returns the minimum value in the matrix. """ return self.client.send_si(self.handle, "min()") def mean(self): """ Returns the mean of the matrix. """ return self.client.send_si(self.handle, "mean()") def max(self): """ Returns the maximum value in the matrix. """ return self.client.send_si(self.handle, "max()") def width(self): """ Returns the X dimension of the matrix. """ return self.client.send_si(self.handle, "width()") def height(self): """ Returns the Y dimension of the matrix. """ return self.client.send_si(self.handle, "height()") def dx(self): """ Returns the X spacing of the matrix, for when the matrix is used in an image. """ return self.client.send_si(self.handle, "dX()") def dy(self): """ Returns the Y spacing of the matrix, for when the matrix is used in an image. """ return self.client.send_si(self.handle, "dY()") def min_x(self): """ Returns the minimum X location of the matrix, for when the matrix is used in an image. """ return self.client.send_si(self.handle, "minX()") def min_y(self): """ Returns the minimum X location of the matrix, for when the matrix is used in an image. """ return self.client.send_si(self.handle, "minY()") def get_numpy_array(self) : """ get a numpy array which contains the kst matrix values """ with tempfile.NamedTemporaryFile() as f: args = str(self.client.send_si(self.handle, "store(" + f.name + ")")) dims = tuple(map(int, args.split())) array = fromfile(f.name, dtype = float64) array = array.reshape((dims)) return array class DataMatrix(Matrix): """ Create a Data Matrix which reads from a data source inside kst. This class represents a matrix you would create via "Create>Vector>Read from Data Source" from the menubar inside kst. The parameters of this function mirror the parameters within "Create>Matrix>Read from Data Source". :param filename: The name of the file/data source to read the scalar from. :param field: the name of the vector in the data source. :param start_x/start_y: the x/y index to start reading from. start_x/Y = -1 to count from the right/bottom. :param num_x/num_y: the number of columns/rows to read. num_x/Y = -1 to read to the end. :param min_x/min_y: Hint to Images of the coordinates corresponding to the the left/bottom of the Matrix :param dx/dy: Hint to Images of the spacing between points. To create a matrix from 'foo.png' with field '1':: import pykst as kst client = kst.Client() v = client.new_data_matrix("foo.png", "1") """ def __init__(self,client,filename,field,start_x=0,start_y=0,num_x=-1,num_y=-1, min_x=0, min_y=0, dx=1, dy=1,name="", new=True) : Matrix.__init__(self,client) if (new == True): self.client.send("newDataMatrix()") self.handle=self.client.send("endEdit()") self.handle.remove(0,self.handle.indexOf("ing ")+4) self.change(filename,field,start_x,start_y,num_x,num_y,min_x,min_y,dx,dy) else: self.handle = name def change(self,filename,field,start_x=0,start_y=0,num_x=-1,num_y=-1, min_x=0, min_y=0, dx=1, dy=1): """ Change the parameters if a Data Matrix inside kst. :param filename: The name of the file/data source to read the scalar from. :param field: the name of the vector in the data source. :param start_x/start_y: the x/y index to start reading from. start_x/y = -1 to count from the right/bottom. :param num_x/num_y: the number of columns/rows to read. num_x/Y = -1 to read to the end. :param min_x/min_y: Hint to Images of the coordinates corresponding to the the left/bottom of the Matrix :param dx/dy: Hint to Images of the spacing between points. """ self.client.send_si(self.handle, "change("+b2str(filename)+","+ b2str(field)+","+b2str(start_x)+","+ b2str(start_y)+","+b2str(num_x)+","+b2str(num_y)+","+ b2str(min_x)+","+b2str(min_y)+","+b2str(dx)+","+ b2str(dy)+")") def field(self): """ Returns the fieldname. """ return self.client.send_si(self.handle, "field()") def filename(self): """ Returns the filename. """ return self.client.send_si(self.handle, "filename()") def start_x(self): """ Returns the X index of the matrix in the file """ return self.client.send_si(self.handle, "startX()") def start_y(self): """ Returns the Y index of the matrix in the file """ return self.client.send_si(self.handle, "startY()") class EditableMatrix(Matrix): """ A matrix in kst, which is editable from python. This matrix in kst can be created from 2D float64 numpy array, (with ''load()'') or edited point by point (with ''setValue()''). :param np_array: initialize the matrix in kst to this 2D numpy array. To create an editable matrix from the num py array np:: import pykst as kst client = kst.Client() m = client.new_editable_matrix(np) """ def __init__(self, client, np_array = None, name="", new=True) : Matrix.__init__(self,client) if (new == True): self.client.send("newEditableMatrix()") if (np_array != None) : assert(np_array.dtype == float64) nx = np_array.shape[0] ny = np_array.shape[1] with tempfile.NamedTemporaryFile(delete=False) as f: f.close() atexit.register(cleanTmpFile, f) np_array.tofile(f.name) self.client.send("load(" + f.name + ","+b2str(nx)+","+b2str(ny)+")") self.handle=self.client.send("endEdit()") self.handle.remove(0,self.handle.indexOf("ing ")+4) self.set_name(name) else: self.handle = name def load(self, np_array): """ sets the values of the matrix in kst to that of the float64 2D np array """ assert(np_array.dtype == float64) nx = np_array.shape[0] ny = np_array.shape[1] with tempfile.NamedTemporaryFile(delete=False) as f: f.close() atexit.register(cleanTmpFile, f) np_array.tofile(f.name) retval = self.client.send_si(self.handle, "load(" + f.name + ","+b2str(nx)+","+b2str(ny)+")") return retval class Relation(Object): """ Convenience class. You should not use it directly.""" def __init__(self,client) : Object.__init__(self,client) def max_x(self): """ Returns the max X value of the curve or image. """ return self.client.send_si(self.handle, "maxX()") def min_x(self): """ Returns the min X value of the curve or image. """ return self.client.send_si(self.handle, "minX()") def max_y(self): """ Returns the max Y value of the curve or image. """ return self.client.send_si(self.handle, "maxY()") def min_y(self): """ Returns the min Y value of the curve or image. """ return self.client.send_si(self.handle, "minY()") def show_edit_dialog(self): """ shows the edit dialog for the curve or image. """ return self.client.send_si(self.handle, "showEditDialog()") class Curve(Relation): """ A Curve inside kst. This class represents a string you would create via "Create>Curve" from the menubar inside kst. The parameters of this function mirror the parameters within "Create>Curve". :param x_vector: The vector which specifies the X coordinates of each point. :param x_vector: The vector which specifies the Y coordinates of each point. Use the convenience function in client to create a curve in kst session "client" of vectors v1 and v2:: c1 = client.new_curve(v1, v2) """ def __init__(self,client, x_vector, y_vector, name="", new=True) : Relation.__init__(self,client) if (new == True): self.client.send("newCurve()") self.client.send("setXVector("+x_vector.handle+")") self.client.send("setYVector("+y_vector.handle+")") self.handle=self.client.send("endEdit()") self.handle.remove(0,self.handle.indexOf("ing ")+4) self.set_name(name) else: self.handle = name def set_y_error(self,vector, vectorminus=0): """ Set the Y Error flags for the curve. The error bars are symetric if vectorminus is not set. """ self.client.send("beginEdit("+self.handle+")") self.client.send("setYError("+vector.handle+")") if vectorminus != 0: self.client.send("setYMinusError("+vectorminus.handle+")") else: self.client.send("setYMinusError("+vector.handle+")") self.client.send("endEdit()") def set_x_error(self,vector, vectorminus=0): """ Set the X Error flags for the curve. The error bars are symetric if vectorminus is not set. """ self.client.send("beginEdit("+self.handle+")") self.client.send("setXError("+vector.handle+")") if vectorminus != 0: self.client.send("setXMinusError("+vectorminus.handle+")") else: self.client.send("setXMinusError("+vector.handle+")") self.client.send("endEdit()") def set_color(self,color): """ Set the color of the points and lines. Colors are given by a name such as ``red`` or a hex number such as ``#FF0000``. """ self.client.send_si(self.handle, "setColor("+color+")") def set_head_color(self,color): """ Set the color of the Head marker, if any. Colors are given by a name such as ``red`` or a hex number such as ``#FF0000``. """ self.client.send_si(self.handle, "setHeadColor("+color+")") def set_bar_fill_color(self,color): """ Set the fill color of the histogram bars, if any. Colors are given by a name such as ``red`` or a hex number such as ``#FF0000``. """ self.client.send_si(self.handle, "setBarFillColor("+color+")") def set_has_points(self,has=True): """ Set whether individual points are drawn on the curve """ if (has == True): self.client.send_si(self.handle, "setHasPoints(True)") else: self.client.send_si(self.handle, "setHasPoints(False)") def set_has_bars(self,has=True): """ Set whether histogram bars are drawn. """ if (has == True): self.client.send_si(self.handle, "setHasBars(True)") else: self.client.send_si(self.handle, "setHasBars(False)") def set_has_lines(self,has=True): """ Set whether lines are drawn. """ if (has == True): self.client.send_si(self.handle, "setHasLines(True)") else: self.client.send_si(self.handle, "setHasLines(False)") def set_has_head(self,has=True): """ Set whether a point at the head of the line is drawn """ if (has == True): self.client.send_si(self.handle, "setHasHead(True)") else: self.client.send_si(self.handle, "setHasHead(False)") def set_line_width(self,x): """ Sets the width of the curve's line. """ self.client.send_si(self.handle, "setLineWidth("+b2str(x)+")") def set_point_size(self,x): """ Sets the size of points, if they are drawn. """ self.client.send_si(self.handle, "setPointSize("+b2str(x)+")") def set_point_density(self,density): """ Sets the point density. When show_points is true, this option can be used to only show a subset of the points, for example, to use point types to discriminate between different curves.. This does not effect 'lines', where every point is always connected. density can be from 0 (all points) to 4. """ self.client.send_si(self.handle, "setPointDensity("+b2str(density)+")") def set_point_type(self,point_type): """ Sets the point type. The available point types are:: 0: X 1: open square 2: open circle, 3: filled circle 4: downward open triangle 5: upward open triangle 6: filled square 7: + 8: * 9: downward filled triangle 10: upward filled triangle 11: open diamond 12: filled diamond """ self.client.send_si(self.handle, "setPointType("+b2str(point_type)+")") def set_head_type(self,x): """ Sets the head point type. See set_point_type for details.""" self.client.send_si(self.handle, "setHeadType("+b2str(x)+")") def set_line_style(self,lineStyle): """ Sets the line type. 0 is SolidLine, 1 is DashLine, 2 is DotLine, 3 is DashDotLine, and 4 isDashDotDotLine, """ self.client.send_si(self.handle, "setLineStyle("+b2str(lineStyle)+")") def color(self): """ Returns the curve color. """ return self.client.send_si(self.handle, "color()") def head_color(self): """ Returns the curve head color. """ return self.client.send_si(self.handle, "headColor()") def bar_fill_color(self): """ Returns the bar fill color. """ return self.client.send_si(self.handle, "barFillColor()") def has_points(self): """ Returns True if the line has points. """ return (self.client.send_si(self.handle, "hasPoints()")=="True") def has_lines(self): """ Returns True if the line has lines. """ return (self.client.send_si(self.handle, "hasLines()")=="True") def has_bars(self): """ Returns True if the line has historgram bars. """ return (self.client.send_si(self.handle, "hasBars()")=="True") def has_head(self): """ Returns True if the last point has a special marker. """ return (self.client.send_si(self.handle, "hasHead()")=="True") def line_width(self): """ Returns the width of the line. """ return self.client.send_si(self.handle, "lineWidth()") def point_size(self): """ Returns the size of the points. """ return self.client.send_si(self.handle, "pointSize()") def point_type(self): """ Returns index of the point type. See set_point_type. """ return self.client.send_si(self.handle, "pointType()") def head_type(self): """ Returns index of the head point type. See set_point_type. """ return self.client.send_si(self.handle, "headType()") def line_style(self): """ Returns the index of the line style. See set_line_style. """ return self.client.send_si(self.handle, "lineStyle()") def point_density(self): """ Returns the density of points shown. see set_point_density. """ return self.client.send_si(self.handle, "pointDensity()") def x_vector(self): """ Returns the x vector of the curve. FIXME: should figure out what kind of vector this is and return that. """ vec = VectorBase(self.client) vec.handle = self.client.send_si(self.handle, "xVector()") return vec def y_vector(self): """ Returns the y vector of the curve. FIXME: should figure out what kind of vector this is and return that. """ vec = VectorBase(self.client) vec.handle = self.client.send_si(self.handle, "yVector()") return vec def x_error_vector(self): """ Returns the +x error vector of the curve. FIXME: should figure out what kind of vector this is and return that. """ vec = VectorBase(self.client) vec.handle = self.client.send_si(self.handle, "xErrorVector()") return vec def y_error_vector(self): """ Returns the +y error vector of the curve. FIXME: should figure out what kind of vector this is and return that. """ vec = VectorBase(self.client) vec.handle = self.client.send_si(self.handle, "yErrorVector()") return vec def x_minus_error_vector(self): """ Returns the -x error vector of the curve. FIXME: should figure out what kind of vector this is and return that. """ vec = VectorBase(self.client) vec.handle = self.client.send_si(self.handle, "xMinusErrorVector()") return vec def y_minus_error_vector(self): """ Returns the -y error vector of the curve. FIXME: should figure out what kind of vector this is and return that. """ vec = VectorBase(self.client) vec.handle = self.client.send_si(self.handle, "yMinusErrorVector()") return vec class Image(Relation): """ An image inside kst. This class represents an image you would create via "Create>Image" from the menubar inside kst. The parameters of this function mirror the parameters within "Create>Curve". :param matrix: The matrix which defines the image. Use the convenience function in client to create an image in kst session "client" of Matrix m:: i1 = client.new_image(m) """ def __init__(self,client, matrix, name="", new=True) : Relation.__init__(self,client) if (new == True): self.client.send("newImage()") self.client.send("setMatrix("+matrix.handle+")") self.handle=self.client.send("endEdit()") self.handle.remove(0,self.handle.indexOf("ing ")+4) self.set_name(name) else: self.handle = name def set_matrix(self, matrix): """ change the matrix which is the source of the image. """ self.client.send_si(self.handle, "setMatrix("+matrix.handle+")") def set_palette(self, palette): """ set the palette, selected by index. The available palettes are:: 0: Grey 1: Red 2: Spectrum 3: EOS-A 4: EOS-B 5: 8 colors 6: Cyclical Spectrum Note: this is not the same order as the dialog. """ self.client.send_si(self.handle, "setPalette("+b2str(palette)+")") def set_range(self, zmin, zmax): """ sets the z range of the color map.""" self.client.send_si(self.handle, "setFixedColorRange("+ b2str(zmin)+","+b2str(zmax)+")") def set_auto_range(self, saturated=0): """ Automatically set the z range of the color map :param saturated: The colormap range is set so that this fraction of the points in the matrix are saturated. Equal numbers of points are saturated at both ends of the color map. """ self.client.send_si(self.handle, "setAutoColorRange("+b2str(saturated) + ")") def max_z(self): """ Returns the max Z value of the curve or image. """ return self.client.send_si(self.handle, "maxZ()") def min_z(self): """ Returns the max Z value of the curve or image. """ return self.client.send_si(self.handle, "minZ()") # Equation ############################################################ class Equation(Object) : """ An equation inside kst. :param xvector: the x vector of the equation :param equation: the equation Vectors inside kst are refered to as [vectorname] or [scalarname]. """ def __init__(self, client, xvector, equation, interpolate=True, name="", new=True) : Object.__init__(self,client) if (new == True): self.client.send("newEquation()") self.client.send("setEquation(" + equation + ")") self.client.send("setInputVector(X,"+xvector.handle+")") self.client.send("interpolateVectors("+b2str(interpolate)+")") self.handle=self.client.send("endEdit()") self.handle.remove(0,self.handle.indexOf("ing ")+4) self.set_name(name) else: self.handle = name def y(self) : """ a vector containing the equation """ vec = VectorBase(self.client) vec.handle = self.client.send_si(self.handle, "outputVector(O)") return vec def x(self) : """ a vector containing the x vector """ vec = VectorBase(self.client) vec.handle = self.client.send_si(self.handle, "outputVector(XO)") return vec def set_x(self, xvector): """ set the x vector of an existing equation. xvector is a kst vector. """ self.client.send_si(self.handle, "setInputVector(X,"+xvector.handle+")") def set_equation(self, equation): """ set the equation of an existing equation """ self.client.send_si(self.handle, "setEquation(" + equation + ")") def set_inpterpolate(self, interpolate): """ set whether all vectors are interpolated to the highest resolution vector. """ self.client.send_si(self.handle, "interpolateVectors(" + b2str(interpolate) + ")") # Histogram ############################################################ class Histogram(Object) : """ A Histogram inside kst. :param vector: the vector to take the histogram of :param bin_min: the low end of the lowest bin :param bin_max: the high end of the highest bin :param num_bins: the number of bins :param normalization: see below :param auto_bin: if True, set xmin and xmax based on the vector The normalization types are:: 0: Number in the bin 1: Percent in the bin 2: Fraction in the bin 3: Peak is normalized to 1.0 """ def __init__(self, client, vector, bin_min, bin_max, num_bins, normalization = 0, auto_bin = False, name="", new=True) : Object.__init__(self,client) if (new == True): self.client.send("newHistogram()") self.client.send("change(" + vector.handle + "," + b2str(bin_min) + "," + b2str(bin_max) + "," + b2str(num_bins) + "," + b2str(normalization) + "," + b2str(auto_bin) + ")") self.handle=self.client.send("endEdit()") self.handle.remove(0,self.handle.indexOf("ing ")+4) self.set_name(name) else: self.handle = name def y(self) : """ a vector containing the histogram values """ vec = VectorBase(self.client) vec.handle = self.client.send_si(self.handle, "outputVector(H)") return vec def x(self) : """ a vector containing the bin centers """ vec = VectorBase(self.client) vec.handle = self.client.send_si(self.handle, "outputVector(B)") return vec def change(self, vector, bin_min, bin_max, num_bins, normalization = 0, auto_bin = False): """ Change Histogram parameters. :param vector: the vector to take the histogram of :param bin_min: the low end of the lowest bin :param bin_max: the high end of the highest bin :param num_bins: the number of bins :param normalization: See :class:`Histogram` :param auto_bin: if True, set xmin and xmax based on the vector """ self.client.send_si(self.handle, "change(" + vector.handle + "," + b2str(bin_min) + "," + b2str(bin_max) + "," + b2str(num_bins) + "," + b2str(normalization) + "," + b2str(auto_bin) + ")") def bin_min(self): """ the low end of the lowest bin """ retval = self.client.send_si(self.handle, "xMin()") return retval def bin_max(self): """ the high end of the lowest bin """ retval = self.client.send_si(self.handle, "xMax()") return retval def num_bins(self): """ the number of bins """ retval = self.client.send_si(self.handle, "nBins()") return retval def normalization(self): """ how the bins are normalized See :class:`Histogram` """ retval = self.client.send_si(self.handle, "normalizationType()") return retval def auto_bin(self): """ if True, xmin and xmax are set based on the vector """ retval = self.client.send_si(self.handle, "autoBin()") return retval # Spectrum ############################################################ class Spectrum(Object) : """ An spectrum inside kst. :param vector: the vector to take the spectrum of :param sample_rate: the sample rate of the vector :param interleaved_average: average spectra of length fft_length :param fft_length: the fft is 2^fft_length long if interleaved_average is true. :param apodize: if true, apodize the vector first :param remove_mean: if true, remove mean first :param vector_unints: units of the input vector - for labels. :param rate_units: the units of the sample rate - for labels. :param apodize_function: index of the apodization function - see apodize_function() :param sigma: only used if gausian apodization is selected. :param output_type: index for the output type - see output_type() The apodize function is:: 0: default 1: Bartlett 2: Window 3: Connes 4: Cosine 5: Gaussian 6: Hamming 7: Hann 8: Welch 9: Uniform The output type is:: 0: Amplitude Spectral Density 1: Power Spectral Density 2: AmplitudeSpectrum 3: Power Spectrum """ def __init__(self, client, vector, sample_rate = 1.0, interleaved_average = False, fft_length = 10, apodize = True, remove_mean = True, vector_units = "", rate_units = "Hz", apodize_function = 0, sigma = 1.0, output_type = 0, name="", new=True) : Object.__init__(self,client) if (new == True): self.client.send("newSpectrum()") self.client.send("change(" + vector.handle + "," + b2str(sample_rate) + "," + b2str(interleaved_average) + "," + b2str(fft_length) + "," + b2str(apodize) + "," + b2str(remove_mean) + "," + vector_units + "," + rate_units + "," + b2str(apodize_function) + "," + b2str(sigma) + "," + b2str(output_type) + "," + ")") self.handle=self.client.send("endEdit()") self.handle.remove(0,self.handle.indexOf("ing ")+4) self.set_name(name) else: self.handle = name def y(self) : """ a vector containing the spectrum """ vec = VectorBase(self.client) vec.handle = self.client.send_si(self.handle, "outputVector(S)") return vec def x(self) : """ a vector containing the frequency bins """ vec = VectorBase(self.client) vec.handle = self.client.send_si(self.handle, "outputVector(F)") return vec def set_vector(self, xvector): """ set the input vector """ self.client.send_si(self.handle, "setInputVector(I,"+xvector.handle+")") def interleaved_average(self): """ average spectra of length fft_length() """ retval = self.client.send_si(self.handle, "interleavedAverage()") return retval def sample_rate(self): """ the sample rate assumed for the spectra. """ retval = self.client.send_si(self.handle, "sampleRate()") return retval def fft_length(self): """ ffts are 2^fft_length() long if interleaved_average is set """ retval = self.client.send_si(self.handle, "fftLength()") return retval def apodize(self): """ apodize before taking spectra, if set """ retval = self.client.send_si(self.handle, "apodize()") return retval def remove_mean(self): """ remove mean before taking spectra, if set """ retval = self.client.send_si(self.handle, "removeMean()") return retval def vector_units(self): """ the units of the input vector. For labels """ retval = self.client.send_si(self.handle, "vectorUnits()") return retval def rate_units(self): """ the units of the sample rate. For labels """ retval = self.client.send_si(self.handle, "rateUnits()") return retval def apodize_function(self): """ the index of the apodize function. The apodize funcition is:: 0: default 1: Bartlett 2: Window 3: Connes 4: Cosine 5: Gaussian 6: Hamming 7: Hann 8: Welch 9: Uniform """ retval = self.client.send_si(self.handle, "apodizeFunctionIndex()") return retval def gaussian_sigma(self): """ the width, if apodize_funcion_index() is 5 (gaussian). """ retval = self.client.send_si(self.handle, "gaussianSigma()") return retval def output_type(self): """ the index of the spectrum output type. The output type is:: 0: Amplitude Spectral Density 1: Power Spectral Density 2: AmplitudeSpectrum 3: Power Spectrum """ retval = self.client.send_si(self.handle, "outputTypeIndex()") return retval # Cross Spectrum ######################################################## class CrossSpectrum(Object) : """ a cross spectrum plugin inside kst. Takes two equal sized vectors and calculates their cross spectrum. :param V1: First kst vector :param V2: Second kst vector. Must be the same size as V1 :param fft_size: the fft will be on subvectors of length 2^fft_size :param sample_rate: the sample rate of the vectors """ def __init__(self, client, V1, V2, fft_size, sample_rate, name="", new=True) : Object.__init__(self,client) if (new == True): self.client.send("newPlugin(Cross Spectrum)") self.client.send("setInputVector(Vector In One,"+V1.handle+")") self.client.send("setInputVector(Vector In Two,"+V2.handle+")") if isinstance(fft_size, Scalar): self.client.send("setInputScalar(Scalar In FFT,"+fft_size.handle+")") else: tmpscalar = self.client.new_generated_scalar(fft_size) self.client.send("setInputScalar(Scalar In FFT,"+tmpscalar.handle+")") if isinstance(sample_rate, Scalar): self.client.send("setInputScalar(Scalar In Sample Rate,"+sample_rate.handle+")") else: tmpscalar2 = self.client.new_generated_scalar(sample_rate) self.client.send("setInputScalar(Scalar In Sample Rate,"+tmpscalar2.handle+")") self.handle=self.client.send("endEdit()") self.handle.remove(0,self.handle.indexOf("ing ")+4) self.set_name(name) else: self.handle = name def x(self) : """ a vector containing the frequency bins of the fft """ vec = VectorBase(self.client) vec.handle = self.client.send_si(self.handle, "outputVector(Frequency)") return vec def y(self) : """ a vector containing the real part if the cross spectrum """ vec = VectorBase(self.client) vec.handle = self.client.send_si(self.handle, "outputVector(Real)") return vec def yi(self) : """ a vector containing the imaginary part if the cross spectrum """ vec = VectorBase(self.client) vec.handle = self.client.send_si(self.handle, "outputVector(Imaginary)") return vec # FILTER ################################################################ class Filter(Object) : """ This is a class which provides some methods common to all filters """ def __init__(self,client) : Object.__init__(self,client) def output(self) : """ a vector containing the output of the filter """ vec = VectorBase(self.client) vec.handle = self.client.send_si(self.handle, "outputVector(Y)") return vec # FLAG FILTER ############################################################ class FlagFilter(Filter) : """ a flagged vector inside kst The output is the input when flag == 0, or NaN if flag is non-0. """ def __init__(self, client, yvector, flag, mask="0xffffff", valid_is_zero=True, name="", new=True) : Filter.__init__(self,client) if (new == True): self.client.send("newPlugin(Flag Filter)") self.client.send("setInputVector(Y Vector,"+yvector.handle+")") self.client.send("setInputVector(Flag Vector,"+flag.handle+")") self.client.send("setProperty(Mask,"+mask+")") if (valid_is_zero==True): self.client.send("setProperty(ValidIsZero,true)") else: self.client.send("setProperty(ValidIsZero,false)") self.handle=self.client.send("endEdit()") self.handle.remove(0,self.handle.indexOf("ing ")+4) self.set_name(name) else: self.handle = name # FIT ################################################################### class Fit(Object) : """ This is a class which provides some methods common to all fits """ def __init__(self,client) : Object.__init__(self,client) def parameters(self) : """ a vector containing the Parameters of the fit """ vec = VectorBase(self.client) vec.handle = self.client.send_si(self.handle, "outputVector(Parameters Vector)") return vec def fit(self) : """ a vector containing the fit """ vec = VectorBase(self.client) vec.handle = self.client.send_si(self.handle, "outputVector(Fit)") return vec def residuals(self) : """ a vector containing the Parameters of the fit """ vec = VectorBase(self.client) vec.handle = self.client.send_si(self.handle, "outputVector(Residuals)") return vec def covariance(self) : """ a vector containing the Covariance of the fit """ vec = VectorBase(self.client) vec.handle = self.client.send_si(self.handle, "outputVector(Covariance)") return vec def reduced_chi2(self) : """ a scalar containing the Parameters of the fit """ X = Scalar(self.client) X.handle = self.client.send_si(self.handle, "outputScalar(chi^2/nu)") return X # LINEAR FIT ############################################################ class LinearFit(Fit) : """ A linear fit inside kst. If weightvector is 0, then the fit is unweighted. """ def __init__(self, client, xvector, yvector, weightvector=0, name="", new=True) : Fit.__init__(self,client) if (new == True): if weightvector==0: self.client.send("newPlugin(Linear Fit)") else: self.client.send("newPlugin(Linear Weighted Fit)") self.client.send("setInputVector(Weights Vector,"+weightvector.handle+")") self.client.send("setInputVector(X Vector,"+xvector.handle+")") self.client.send("setInputVector(Y Vector,"+yvector.handle+")") self.handle=self.client.send("endEdit()") self.handle.remove(0,self.handle.indexOf("ing ")+4) self.set_name(name) else: self.handle = name def slope(self) : """ The slope of the fit. """ vec = VectorBase(self.client) vec.handle = self.client.send_si(self.handle, "outputVector(Parameters Vector)") return vec.value(1) def intercept(self) : """ The intercept of the fit. """ vec = VectorBase(self.client) vec.handle = self.client.send_si(self.handle, "outputVector(Parameters Vector)") return vec.value(0) # POLYNOMIAL FIT ############################################################ class PolynomialFit(Fit) : """ A Polynomial fit inside kst. :param order: The order of the fit """ def __init__(self, client, order, xvector, yvector, weightvector=0, name="", new=True) : Fit.__init__(self,client) if (new == True): if weightvector==0: self.client.send("newPlugin(Polynomial Fit)") else: self.client.send("newPlugin(Polynomial Weighted Fit)") self.client.send("setInputVector(Weights Vector,"+weightvector.handle+")") self.client.send("setInputVector(X Vector,"+xvector.handle+")") self.client.send("setInputVector(Y Vector,"+yvector.handle+")") self.client.send("setInputScalar(Order Scalar,"+order.handle+")") self.handle=self.client.send("endEdit()") self.handle.remove(0,self.handle.indexOf("ing ")+4) self.set_name(name) else: self.handle = name # View Items ################################################################ class ViewItem(NamedObject): """ Convenience class. You should not use it directly.""" def __init__(self,client): self.client=client def set_h_margin(self,margin): self.client.send_si(self.handle, "setLayoutHorizontalMargin("+b2str(margin)+")") def set_v_margin(self,margin): self.client.send_si(self.handle, "setLayoutVerticalMargin("+b2str(margin)+")") def set_h_space(self,space): self.client.send_si(self.handle, "setLayoutHorizontalSpacing("+b2str(space)+")") def set_v_space(self,space): self.client.send_si(self.handle, "setLayoutVerticalSpacing("+b2str(space)+")") def set_fill_color(self,color): """ Set the fill/background color. Colors are given by a name such as ``red`` or a hex number such as ``#FF0000``. """ self.client.send_si(self.handle, b2str("setFillColor("+b2str(color)+")")) def set_fill_style(self,style): """ Set the background fill style. This is equivalent to setting the index of Apperance>Fill>Style within a view item dialog in kst.:: 0: NoBrush 1: SolidPattern 2: Dense1Pattern 3: Dense2Pattern 4: Dense3Pattern 5: Dense4Pattern 6: Dense5Pattern 7: Dense6Pattern 8: Dense7Pattern 9: HorPattern 11: VerPattern 12: CrossPattern, 13: BDiagPattern 14: FDiagPattern. """ self.client.send_si(self.handle, "setIndexOfFillStyle("+b2str(style)+")") def set_stroke_style(self,style): """ Set the stroke style of lines for the item. This is equivalent to setting the index of Apperance>Stroke>Style within a view item dialog in kst:: 0: SolidLine 1: DashLine 2: DotLine 3: DashDotLine 4: DashDotDotLine 5: CustomDashLine """ self.client.send_si(self.handle, "setIndexOfStrokeStyle("+b2str(style)+")") def set_stroke_width(self,width): """ Set the width of lines for the item. """ self.client.send_si(self.handle, "setStrokeWidth("+b2str(width)+")") def set_stroke_brush_color(self,color): """ Set the color for lines for the item. Colors are given by a name such as ``red`` or a hex number such as ``#FF0000``. """ self.client.send_si(self.handle, "setStrokeBrushColor("+b2str(color)+")") def set_stroke_brush_style(self,style): """ Set the brush style for lines for the item. This is equivalent to setting the index of Apperance>Stroke>Brush Style within a view item dialog in kst. This sets the brush type for lines in the item, and not for the fill, so values other than ``1`` (SolidPattern) only make sense for wide lines and are rarely used:: 0: NoBrush 1: SolidPattern 2: Dense1Pattern 3: Dense2Pattern 4: Dense3Pattern 5: Dense4Pattern 6: Dense5Pattern 7: Dense6Pattern 8: Dense7Pattern 9: HorPattern 11: VerPattern 12: CrossPattern, 13: BDiagPattern 14: FDiagPattern. """ self.client.send_si(self.handle, "setIndexOfStrokeBrushStyle("+b2str(style)+")") def set_stroke_join_style(self,style): """ Set the style by which lines are joined in the item. This is equivalent to setting the index of Apperance>Stroke>Join Style within a view item dialog in kst. 0 is MiterJoin, 1 is BevelJoin, 2 is RoundJoin, and 3 is SvgMiterJoin. """ self.client.send_si(self.handle, "setIndexOfStrokeJoinStyle("+b2str(style)+")") def set_stroke_cap_style(self,style): """ Set the cap style for the ends of lines in the item. This is equivalent to setting the index of Apperance>Stroke>Cap Style within a view item dialog in kst. 0 is FlatCap, 1 is SquareCap, and 2 is RoundCap. """ self.client.send_si(self.handle, "setIndexOfStrokeCapStyle("+b2str(style)+")") def set_fixed_aspect_ratio(self, fixed=True): """ if True, fix the aspect ratio of the item to its current value. This is equivalent to checking Dimensions>Fix aspect ratio within a view item dialog in kst. """ if fixed == True: self.client.send_si(self.handle, b2str("lockAspectRatio(True)")) else: self.client.send_si(self.handle, b2str("lockAspectRatio(False)")) def position(self): x = str(self.client.send_si(self.handle, "position()")) ret=literal_eval(x) return ret def dimensions(self): x = str(self.client.send_si(self.handle, "dimensions()")) ret=literal_eval(x) return ret def set_pos(self,pos): """ Set the center position of the item. :param pos: a 2 element tuple ``(x,y)`` specifying the position. The Top Left of the parent is (0,0). The Bottom Right of the parent is (1,1) """ x,y = pos self.client.send("beginEdit("+self.handle+")") self.client.send("setPos("+b2str(x)+","+b2str(y)+")") #self.client.send("setPosX("+b2str(x)+")") #self.client.send("setPosY("+b2str(y)+")") self.client.send("endEdit()") def set_size(self,size): """ Set the size of the item. :param size: a 2 element tuple ``(w,h)`` specifying the size. Elements go from 0 to 1. If the aspect ratio is fixed, then ``h`` is ignored. This is equivalent to setting Dimensions>Position within a view item dialog in kst. """ w,h = size self.client.send("beginEdit("+self.handle+")") self.client.send("setSize("+b2str(w)+","+b2str(h)+")") self.client.send("endEdit()") def set_lock_pos_to_data(self, lock=True): """ if lock is True, and the item is in a plot, then the position of the item will be locked to the data coordinates in the plot. The item will move with zooming and scrolling. If lock is False, or the item is not in a plot, then the item will be fixed to the geometry of the window, and zooming/scrolling will not change its position. """ if lock==True: self.client.send_si(self.handle, "setLockPosToData(True)") else: self.client.send_si(self.handle, "setLockPosToData(False)") def set_parent_auto(self): """ Set the parent of the viewitem to an existing view item which fully contains it. Once reparented, moving/resizing the parent will also move/resize the child. By default view items created by pyKst are parented by the toplevel view unless this method is called, or if the item is moved/resized in the GUI. """ self.client.send_si(self.handle, "updateParent()") def set_parent_toplevel(self): """ Set the parent of the viewitem to the toplevel view. By default view items created by pyKst are parented by the toplevel view unless set_parent_auto() is called, or if the item is moved/resized in the GUI. """ self.client.send_si(self.handle, "parentTopLevel()") def subplot(self, *args): """ Set the item position according to the given grid definition. Typical call signature:: subplot(nrows, ncols, plot_number) Where *nrows* and *ncols* are used to notionally split the figure into ``nrows * ncols`` sub-axes, and *plot_number* is used to identify the particular subplot that this function is to create within the notional grid. *plot_number* starts at 1, increments across rows first and has a maximum of ``nrows * ncols``. In the case when *nrows*, *ncols* and *plot_number* are all less than 10, a convenience exists, such that the a 3 digit number can be given instead, where the hundreds represent *nrows*, the tens represent *ncols* and the units represent *plot_number*. For instance:: subplot(211) - place the plot in the the top grid location (i.e. the + place the plot in the top grid location (i.e. the first) in a 2 row by 1 column notional grid (no grid actually exists, but conceptually this is how the returned subplot has been positioned). """ w = 0 h = 0 x = 0 y = 0 n = 0 if (len(args) == 1): h = args[0]/100 w = (args[0]%100)/10 n = args[0]%10 elif (len(args) == 3): h = args[0] w = args[1] n = args[2] else: w = h = n = 1 x = (n-1)%w y = (n-1)/w size = (1.0/w, 1.0/h) pos = (x/float(w)+0.5/w,y/float(h)+0.5/h) self.set_pos(pos) self.set_size(size) def set_rotation(self,rot): """ Set the rotation of the item. This is equivalent to setting Dimensions>Rotation within a view item dialog. """ self.client.send_si(self.handle, b2str("setRotation("+b2str(rot)+")")) def remove(self): """ This removes the object from Kst. """ self.client.send("eliminate("+self.handle+")") # LABELS ###################################################################### class Label(ViewItem) : """ A floating label inside kst. :param text: the text of the label. Supports scalars, equations, and a LaTeX subset. :param pos: a 2 element tuple ``(x,y)`` specifying the position. (0,0) is top left. (1,1) is bottom right. :param rot: rotation of the label in degrees. :param font_size: size of the label in points, when the printed at the reference size. :param font_color: Colors are given by a name such as ``red`` or a hex number such as ``#FF0000``. :param font_family: The font family. eg, TimeNewRoman. Scalars and scalar equations can be displayed live in labels. When the scalar is updated, the label is updated. The format is:: Scalar: [scalarname] eg [GYRO1:Mean(X4)] Vector Element: [vectorName[index]] eg [GYRO1 (V2)[4]] Equation: [=equation] eg [=[GYRO1:Mean(X4)]/[GYRO1:Sigma (X4)]] These numerical fields can be formatted by appending a C printf format embedded in { } immediately after the field. For example:: [GYRO1:Mean(X4)]{%4.2f} Labels in kst support a derrivitive subset of LaTeX. For example, to display the equation for the area of a circle, you could set the label to ``A=2\pir^2``. Unlike LaTeX, it is not necessary to enter math mode using ``$``. Also, unlike LaTeX, variables are not automatically displayed in italic font. If desired, this must be done explicitly using ``\\textit{}``. Greek letters: \\\\name or \\\\Name. eg: ``\\alpha`` Other symbols: ``\\approx, \\cdot, \\ge, \\geq, \\inf, \\approx, \\cdot, \\ge, \\geq, \\inf, \\int, \\le, \\leq, \\ne, \\n, \\partial, \\prod, \\pm, \\sum, \\sqrt`` Font effects: ``\\textcolor{colorname}{colored text}, \\textbf{bold text}, \\textit{italicized text}, \\underline{underlined text}, \\overline{overlined text}.`` Other:``x^y``, ``x_y``, ``\\t``, ``\\n``, ``\\[`` This class represents a label you would create via "Create>Annotations>Label" from the menubar inside kst. Use the convenience function in Client to create a label "Test Label" in kst:: import pykst as kst client = kst.Client() L = client.new_label("Test Label", (0.25, 0.25), font_size=18) """ def __init__(self,client, text, pos=(0.5,0.5), rot=0, font_size=12, bold=False, italic=False, font_color="black", font_family="Serif", name="", new=True) : ViewItem.__init__(self,client) if (new == True): self.client.send("newLabel()") self.handle=self.client.send("endEdit()") self.handle.remove(0,self.handle.indexOf("ing ")+4) self.set_text(text) self.set_label_font_size(font_size) self.set_pos(pos) self.set_fixed_aspect_ratio(True) self.set_rotation(rot) self.set_font_color(font_color) self.set_font_family(font_family) self.set_font_bold(bold) self.set_font_italic(italic) self.set_name(name) else: self.handle = name def set_text(self,text): """ Set text displayed by the label. Scalars and scalar equations can be displayed live in labels. When the scalar is updated, the label is updated. The format is:: Scalar: [scalarname] eg [GYRO1:Mean(X4)] Vector Element: [vectorName[index]] eg [GYRO1 (V2)[4]] Equation: [=equation] eg [=[GYRO1:Mean(X4)]/[GYRO1:Sigma (X4)]] Labels in kst support a derrivitive subset of LaTeX. For example, to display the equation for the area of a circle, you could set the label to ``A=2\pir^2``. Unlike LaTeX, it is not necessary to enter math mode using ``$``. Also, unlike LaTeX, variables are not automatically displayed in italic font. If desired, this must be done explicitly using ``\\textit{}``. Greek letters: \\\\name or \\\\Name. eg: ``\\alpha`` Other symbols: ``\\approx, \\cdot, \\ge, \\geq, \\inf, \\approx, \\cdot, \\ge, \\geq, \\inf, \\int, \\le, \\leq, \\ne, \\n, \\partial, \\prod, \\pm, \\sum, \\sqrt`` Font effects: ``\\textcolor{colorname}{colored text}, \\textbf{bold text}, \\textit{italicized text}, \\underline{underlined text}, \\overline{overlined text}.`` Other:``x^y``, ``x_y``, ``\\t``, ``\\n``, ``\\[`` """ self.client.send_si(self.handle, b2str("setLabel("+b2str(text)+")")) def set_label_font_size(self,size): """ size of the label in points, when the printed at the reference size.""" self.client.send_si(self.handle, b2str("setFontSize("+b2str(size)+")")) def set_font_bold(self, bold = True): """ . . . """ if bold == True: self.client.send_si(self.handle, b2str("checkLabelBold()")) else: self.client.send_si(self.handle, b2str("uncheckLabelBold()")) def set_font_italic(self, italic = True): """ . . . """ if italic == True: self.client.send_si(self.handle, b2str("checkLabelItalic()")) else: self.client.send_si(self.handle, b2str("uncheckLabelItalic()")) def set_font_color(self,color): """ Colors are given by a name such as ``red`` or a hex number such as ``#FF0000`` """ self.client.send_si(self.handle, b2str("setLabelColor("+b2str(color)+")")) def set_font_family(self,family): """ set the font family. eg, TimeNewRoman. """ self.client.send_si(self.handle, b2str("setFontFamily("+b2str(family)+")")) class Legend(ViewItem) : """ A legend in a plot in kst. : param plot: a plot in kst. Use the convenience function in Client to create a legend in kst:: import pykst as kst client = kst.Client() ... P1 = client.new_plot() L1 = client.new_legend(P1) """ def __init__(self,client, plot, name="", new=True) : ViewItem.__init__(self,client) if (new == True): self.client.send("newLegend("+plot.name()+")") self.handle=self.client.send("endEdit()") self.handle.remove(0,self.handle.indexOf("ing ")+4) else: self.handle = name def set_font_size(self,size): """ size of the label in points, when the printed at the reference size.""" self.client.send_si(self.handle, b2str("setFontSize("+b2str(size)+")")) def set_font_bold(self, bold = True): """ . . . """ if bold == True: self.client.send_si(self.handle, b2str("checkLabelBold()")) else: self.client.send_si(self.handle, b2str("uncheckLabelBold()")) def set_font_italic(self, italic = True): """ . . . """ if italic == True: self.client.send_si(self.handle, b2str("checkLabelItalic()")) else: self.client.send_si(self.handle, b2str("uncheckLabelItalic()")) def set_font_color(self,color): """ Colors are given by a name such as ``red`` or a hex number such as ``#FF0000`` """ self.client.send_si(self.handle, b2str("setLegendColor("+b2str(color)+")")) def set_font_family(self,family): """ set the font family. eg, TimeNewRoman. """ self.client.send_si(self.handle, b2str("setFontFamily("+b2str(family)+")")) class Box(ViewItem) : """ A floating box inside kst. :param pos: a 2 element tuple ``(x,y)`` specifying the position. ``(0,0)`` is top left. ``(1,1)`` is bottom right. :param size: a 2 element tuple ``(w,h)`` specifying the size. ``(1,1)`` is the size of the window. :param rotation: rotation of the label in degrees. :param fill_color: the background color. :param fill_style: the background fill style. See set_fill_style. :param stroke_style: see set_stroke_style :param stroke_width: the pen width for the box outline. :param stroke_brush_color: the box outline color :param stroke_brush_style: see set_stroke_brush_style :param strokeJoinStyle: see set_stroke_join_style :param stroke_cap_style: see set_stroke_cap_style :param fix_aspect: if true, the box will have a fixed aspect ratio. Colors are given by a name such as ``red`` or a hex number such as ``#FF0000``. This class represents a box you would create via "Create>Annotations>Box" from the menubar inside kst. Use the convenience function in Client to create a box in kst:: import pykst as kst client = kst.Client() ... B = client.new_box((0.25, 0.25), (0.2, 0.1), fill_color="blue") """ def __init__(self,client, pos=(0.1,0.1), size=(0.1,0.1), rot=0, fill_color="white", fill_style=1, stroke_style=1, stroke_width=1, stroke_brush_color="black", stroke_brush_style=1, strokeJoinStyle=1, stroke_cap_style=1, fix_aspect=False, name="", new=True) : ViewItem.__init__(self,client) if (new == True): self.client.send("newBox()") self.handle=self.client.send("endEdit()") self.handle.remove(0,self.handle.indexOf("ing ")+4) self.set_pos(pos) self.set_size(size) self.set_fixed_aspect_ratio(fix_aspect) self.set_rotation(rot) self.set_stroke_brush_color(stroke_brush_color) self.set_fill_color(fill_color) self.set_fill_style(fill_style) self.set_stroke_style(stroke_style) self.set_stroke_width(stroke_width) self.set_stroke_brush_color(stroke_brush_color) self.set_stroke_brush_style(stroke_brush_style) self.set_stroke_join_style(strokeJoinStyle) self.set_stroke_cap_style(stroke_cap_style) self.set_name(name) else: self.handle = name class Circle(ViewItem) : """ A floating circle inside kst. :param pos: a 2 element tuple ``(x,y)`` specifying the position. ``(0,0)`` is top left. ``(1,1)`` is bottom right. :param diameter: the diameter of the circle. 1 is the width of the window. :param fill_color: the background color. :param fill_style: the background fill style. See set_fill_style. :param stroke_style: see set_stroke_style :param stroke_width: the pen width for the circle outline. :param stroke_brush_color: the circle outline color :param stroke_brush_style: see set_stroke_brush_style Colors are given by a name such as ``red`` or a hex number such as ``#FF0000``. This class represents a circle you would create via "Create>Annotations>Circle" from the menubar inside kst. Use the convenience function in Client to create a circle in kst:: import pykst as kst client = kst.Client() ... Cr = client.new_circle((0.5, 0.5), 0.2, fill_color="red") """ def __init__(self,client,pos=(0.1, 0.1), diameter=0.1, fill_color="white",fill_style=1,stroke_style=1, stroke_width=1,stroke_brush_color="grey",stroke_brush_style=1, name="", new=True) : ViewItem.__init__(self,client) if (new == True): self.client.send("newCircle()") self.handle=self.client.send("endEdit()") self.handle.remove(0,self.handle.indexOf("ing ")+4) self.set_pos(pos) self.set_diameter(diameter) self.set_stroke_brush_color(stroke_brush_color) self.set_fill_color(fill_color) self.set_fill_style(fill_style) self.set_stroke_style(stroke_style) self.set_stroke_width(stroke_width) self.set_stroke_brush_color(stroke_brush_color) self.set_stroke_brush_style(stroke_brush_style) self.set_name(name) else: self.handle = name def set_diameter(self,diameter): """ set the diamter of the circle. The width of the window is 1.0. """ self.client.send_si(self.handle,"setSize("+b2str(diameter)+","+b2str(diameter)+")") class Ellipse(ViewItem) : """ A floating ellipse inside kst. :param pos: a 2 element tuple ``(x,y)`` specifying the position. ``(0,0)`` is top left. ``(1,1)`` is bottom right. :param size: a 2 element tuple ``(w,h)`` specifying the size. ``(1,1)`` is the size of the window. :param fill_color: the background color. :param fill_style: the background fill style. See set_fill_style. :param stroke_style: see set_stroke_style :param stroke_width: the pen width for the ellipse outline. :param stroke_brush_color: the ellipse outline color :param stroke_brush_style: see set_stroke_brush_style Colors are given by a name such as ``red`` or a hex number such as ``#FF0000``. This class represents an ellipse you would create via "Create>Annotations>Ellipse" from the menubar inside kst. Use the convenience function in Client to create an Ellipse in kst:: import pykst as kst client = kst.Client() ... E = client.new_ellipse((0.25, 0.25), (0.2, 0.1), fill_color="green") """ def __init__(self,client,pos=(0.1,0.1), size=(0.1,0.1), rot=0, fill_color="white", fill_style=1, stroke_style=1, stroke_width=1, stroke_brush_color="black", stroke_brush_style=1, fix_aspect=False, name="", new=True) : ViewItem.__init__(self,client) if (new == True): self.client.send("newEllipse()") self.handle=self.client.send("endEdit()") self.handle.remove(0,self.handle.indexOf("ing ")+4) self.set_pos(pos) self.set_size(size) if fix_aspect==True: self.set_fixed_aspect_ratio(True) else: self.set_fixed_aspect_ratio(False) self.set_rotation(rot) self.set_stroke_brush_color(stroke_brush_color) self.set_fill_color(fill_color) self.set_fill_style(fill_style) self.set_stroke_style(stroke_style) self.set_stroke_width(stroke_width) self.set_stroke_brush_color(stroke_brush_color) self.set_stroke_brush_style(stroke_brush_style) self.set_name(name) else: self.handle = name class Line(ViewItem) : """ A floating line inside kst. :param start: a 2 element tuple ``(x,y)`` specifying the position of the start of the line. ``(0,0)`` is top left of the window, and ``(1,1)`` is bottom right. :param end: a 2 element tuple ``(x,y)`` specifying the position of the end of the line. ``(0,0)`` is top left of the window, and ``(1,1)`` is bottom right. :param length: The length of the line. 1 is the width of the window. :param rot: rotation of the line in degrees. :param stroke_style: see set_stroke_style :param stroke_width: the pen width for the ellipse outline. :param stroke_brush_color: the ellipse outline color :param stroke_brush_style: see set_stroke_brush_style :param stroke_cap_style: see set_stroke_cap_style Colors are given by a name such as ``red`` or a hex number such as ``#FF0000``. This class represents a line you would create via "Create>Annotations>Line" from the menubar inside kst. Colors are given by a name such as ``red`` or a hex number such as ``#FF0000``". Use the convenience function in Client to create a line in kst:: import pykst as kst client = kst.Client() ... Ln = client.new_line((0.25, 0.25), (0.5, 0.5)) """ def __init__(self,client,start=(0,0),end=(1,1), stroke_style=1,stroke_width=1,stroke_brush_color="black", stroke_brush_style=1,stroke_cap_style=1, name="", new=True) : ViewItem.__init__(self,client) if (new == True): self.client.send("newLine()") self.handle=self.client.send("endEdit()") self.handle.remove(0,self.handle.indexOf("ing ")+4) self.set_endpoints(start, end) self.set_stroke_brush_color(stroke_brush_color) self.set_stroke_style(stroke_style) self.set_stroke_width(stroke_width) self.set_stroke_brush_color(stroke_brush_color) self.set_stroke_brush_style(stroke_brush_style) self.set_stroke_cap_style(stroke_cap_style) self.set_name(name) else: self.handle = name def set_length(self, length): """ set the length of the line. The length, between 0 and 1, is as a fraction of the width of the parent item. """ self.client.send_si(self.handle,"setSize("+b2str(length)+","+b2str(length)+")") def set_endpoints(self, start = (0,0), end = (1,1)) : """ set the endpoints of the line. If lock_pos_to_data has been set True, and the item parent is a plot, then the coordinates are in terms the data's coordinates. Otherwise, the coordinates, between 0 and 1, are relative to the dimensions of the parent object. """ x1,y1 = start x2,y2 = end self.client.send_si(self.handle, "setLineEndpoints("+b2str(x1)+","+b2str(y1)+","+b2str(x2)+","+b2str(y2)+")") class Arrow(ViewItem) : """ A floating arrow inside kst. :param pos: a 2 element tuple ``(x,y)`` specifying the position of the center of the line. ``(0,0)`` is top left. ``(1,1)`` is bottom right. :param length: The length of the line. 1 is the width of the window. :param rot: rotation of the line in degrees. :param arror_at_start: if True, draw an arrow at the start of the line. :param arrow_at_end: if True, draw an arrow at the end of the line. :param arrow_size: the size of the arrow. :param stroke_style: see set_stroke_style. :param stroke_width: the pen width for the ellipse outline. :param stroke_brush_color: the ellipse outline color :param stroke_brush_style: see set_stroke_brush_style :param stroke_cap_style: see set_stroke_cap_style Colors are given by a name such as ``red`` or a hex number such as ``#FF0000``. This class represents an arrow you would create via "Create>Annotations>Arrow" from the menubar inside kst. Use the convenience function in Client to create an arrow in kst:: import pykst as kst client = kst.Client() ... Ln = client.new_arrow((0.25, 0.25), 0.2, rot=15, arror_at_start=True) """ def __init__(self,client,start=(0,0),end = (1,1), arror_at_start = False, arrow_at_end = True, arrow_size = 12.0, stroke_style=1, stroke_width=1, stroke_brush_color="black", stroke_brush_style=1, stroke_cap_style=1, name="", new=True) : ViewItem.__init__(self,client) if (new == True): self.client.send("newArrow()") self.handle=self.client.send("endEdit()") self.handle.remove(0,self.handle.indexOf("ing ")+4) self.set_endpoints(start,end) #self.set_pos(pos) #self.set_length(length) #self.set_rotation(rot) self.set_stroke_brush_color(stroke_brush_color) self.set_stroke_style(stroke_style) self.set_stroke_width(stroke_width) self.set_stroke_brush_color(stroke_brush_color) self.set_stroke_brush_style(stroke_brush_style) self.set_stroke_cap_style(stroke_cap_style) self.set_arrow_at_start(arror_at_start) self.set_arrow_at_end(arrow_at_end) self.set_arrow_size(arrow_size) self.set_name(name) else: self.handle = name def set_arrow_at_start(self, arrow=True) : """ Set whether an arrow head is shown at the start of the line """ if arrow==True: self.client.send_si(self.handle, b2str("arrowAtStart(True)")) else: self.client.send_si(self.handle, b2str("arrowAtStart(False)")) def set_arrow_at_end(self, arrow=True) : """ Set whether an arrow head is shown at the end of the line """ if arrow==True: self.client.send_si(self.handle, b2str("arrowAtEnd(True)")) else: self.client.send_si(self.handle, b2str("arrowAtEnd(False)")) def set_arrow_size(self, arrow_size) : self.client.send_si(self.handle, b2str("arrowHeadScale("+b2str(arrow_size)+")")) def set_length(self, length): """ set the length of the line. The width of the window is 1.0. """ self.client.send_si(self.handle,"setSize("+b2str(length)+","+b2str(length)+")") def set_endpoints(self, start = (0,0), end = (1,1)) : """ set the endpoints of the arrow. If lock_pos_to_data has been set True, and the item parent is a plot, then the coordinates are in terms the data's coordinates. Otherwise, the coordinates, between 0 and 1, are relative to the dimensions of the parent object. """ x1,y1 = start x2,y2 = end self.client.send_si(self.handle, "setLineEndpoints("+b2str(x1)+","+b2str(y1)+","+b2str(x2)+","+b2str(y2)+")") class Picture(ViewItem) : """ A floating image inside kst. :param filename: the file which holds the image to be shown. :param pos: a 2 element tuple ``(x,y)`` specifying the position of the center of the picture. ``(0,0)`` is top left. ``(1,1)`` is bottom right. :param width: The width of the picture. 1 is the width of the window. :param rot: rotation of the picture in degrees. This class represents a picture you would create via "Create>Annotations>Picture" from the menubar inside kst. Use the convenience function in Client to create a picture in kst:: import pykst as kst client = kst.Client() ... pic = client.new_picture("image.jpg", (0.25, 0.25), 0.2) BUG: the aspect ratio of the picture is wrong. """ def __init__(self,client,filename,pos=(0.1,0.1), width=0.1,rot=0, name="", new=True) : ViewItem.__init__(self,client) if (new == True): self.client.send("newPicture("+b2str(filename)+")") self.handle=self.client.send("endEdit()") self.handle.remove(0,self.handle.indexOf("ing ")+4) self.set_pos(pos) self.set_width(width) self.set_fixed_aspect_ratio(True) self.set_rotation(rot) self.set_name(name) else: self.handle = name def set_width(self, width): """ set the width of the picture. The width of the window is 1.0. """ self.client.send_si(self.handle,"setSize("+b2str(width)+")") def set_picture(self,pic): """ BUG: aspect ratio is not changed. There is no parellel for this function within the kst GUI. """ self.client.send_si(self.handle, b2str("setPicture("+b2str(pic)+")")) class SVG(ViewItem) : """ A floating svg image inside kst. :param filename: the file which holds the svg image to be shown. :param pos: a 2 element tuple ``(x,y)`` specifying the position of the center of the picture. ``(0,0)`` is top left. ``(1,1)`` is bottom right. :param width: The width of the picture. 1 is the width of the window. :param rot: rotation of the picture in degrees. This class represents a picture you would create via "Create>Annotations>SVG" from the menubar inside kst. Use the convenience function in Client to create an SVG picture in kst:: import pykst as kst client = kst.Client() ... svg1 = client.new_SVG("image.svg", (0.25, 0.25), 0.2) """ def __init__(self,client,filename, pos=(0.1,0.1), width=0.1, rot=0, name="", new=True) : ViewItem.__init__(self,client) if (new == True): self.client.send("newSvgItem("+b2str(filename)+")") self.handle=self.client.send("endEdit()") self.handle.remove(0,self.handle.indexOf("ing ")+4) self.set_pos(pos) self.set_width(width) self.set_fixed_aspect_ratio(True) self.set_rotation(rot) self.set_name(name) else: self.handle = name def set_width(self, width): """ set the width of the picture. The width of the window is 1.0. """ self.client.send_si(self.handle,"setSize("+b2str(width)+")") class Plot(ViewItem) : """ A plot inside kst. :param pos: a 2 element tuple ``(x,y)`` specifying the position. ``(0,0)`` is top left. ``(1,1)`` is bottom right. :param size: a 2 element tuple ``(w,h)`` specifying the size. ``(1,1)`` is the size of the window. :param font_size: font size for labels in the plot. kst default if 0. :param rotation: rotation of the label in degrees. :param columns: auto-place the plot, reformatting into this many columns. :param fill_color: the background color. :param fill_style: the background fill style. See set_fill_style. :param stroke_style: see set_stroke_style :param stroke_width: the pen width for the plot outline. :param stroke_brush_color: the plot outline color :param stroke_brush_style: see set_stroke_brush_style :param strokeJoinStyle: see set_stroke_join_style :param stroke_cap_style: see set_stroke_cap_style :param fix_aspect: if true, the plot will have a fixed aspect ratio. :param auto_postion: if True (the default) the plot will be auto-placed. Ignored if pos is set. Colors are given by a name such as ``red`` or a hex number such as ``#FF0000``. This class represents a Plot you would create via "Create>Annotations>Plot" from the menubar inside kst. To create an plot in kst and plot a curve ``curve1``:: import pykst as kst client = kst.Client() ... P1 = client.new_plot((0.25, 0.25), (0.5,0.5)) P1.add(curve1) """ def __init__(self,client,pos=(0,0),size=(0,0),rot=0, font_size = 0, columns = 0, fill_color="white", fill_style=1, stroke_style=1, stroke_width=1, stroke_brush_color="black", stroke_brush_style=1, strokeJoinStyle=1, stroke_cap_style=1, fix_aspect=False, auto_position = True, name="", new=True) : ViewItem.__init__(self,client) if (size != (0,0)): auto_position = False if (new == True): self.client.send("newPlot()") if (columns>0): self.client.send("addToCurrentView(Columns,"+b2str(columns)+")") elif (auto_position == True): self.client.send("addToCurrentView(Auto,2)") else: self.client.send("addToCurrentView(Protect,2)") self.handle=self.client.send("endEdit()") self.handle.remove(0,self.handle.indexOf("ing ")+4) if (size != (0,0)): self.set_size(size) self.set_pos(pos) self.set_global_font(font_size = font_size) self.set_fixed_aspect_ratio(fix_aspect) self.set_rotation(rot) self.set_stroke_brush_color(stroke_brush_color) self.set_fill_color(fill_color) self.set_fill_style(fill_style) self.set_stroke_style(stroke_style) self.set_stroke_width(stroke_width) self.set_stroke_brush_color(stroke_brush_color) self.set_stroke_brush_style(stroke_brush_style) self.set_stroke_join_style(strokeJoinStyle) self.set_stroke_cap_style(stroke_cap_style) self.set_name(name) else: self.handle = name def add(self, relation) : """ Add a curve or an image to the plot. """ self.client.send_si(self.handle, "addRelation(" + relation.handle + ")") def set_x_range(self,x0, x1) : """ Set X zoom range from x0 to x1 """ self.client.send_si(self.handle, "setXRange("+b2str(x0)+","+b2str(x1)+")") def set_y_range(self, y0, y1) : """ Set Y zoom range from y0 to y1 """ self.client.send_si(self.handle, "setYRange("+b2str(y0)+","+b2str(y1)+")") def set_x_auto(self) : """ Set X zoom range to autoscale """ self.client.send_si(self.handle,"setXAuto()") def set_y_auto(self) : """ Set Y zoom range to autoscale """ self.client.send_si(self.handle, "setPlotYAuto()") def set_x_auto_border(self) : """ Set X zoom range to autoscale with a small border """ self.client.send_si(self.handle, "setPlotXAutoBorder()") def set_y_auto_border(self) : """ Set Y zoom range to autoscale with a small border """ self.client.send_si(self.handle, "setYAutoBorder()") def set_x_no_spike(self) : """ Set X zoom range to spike insensitive autoscale """ self.client.send_si(self.handle, "setXNoSpike()") def set_y_no_spike(self) : """ Set Y zoom range to spike insensitive autoscale """ self.client.send_si(self.handle, "setYNoSpike()") def set_x_ac(self, r) : """ Set X zoom range to fixed range, centered around the mean. Similar to AC coupling on an oscilloscope. """ self.client.send_si(self.handle, "setXAC("+b2str(r)+")") def set_y_ac(self, r) : """ Set Y zoom range to fixed range, centered around the mean. Similar to AC coupling on an oscilloscope. """ self.client.send_si(self.handle, "setYAC("+b2str(r)+")") def set_global_font(self, family="", font_size = 0, bold=False, italic=False) : """ Set the global plot font. By default, the axis labels all use this, unless they have been set to use their own. If the parameter 'family' is empty, the font family will be unchanged. If the parameter 'font_size' is 0, the font size will be unchanged. The font will be bold if parameter 'bold' is set to 'bold' or 'True'. The font will be italic if parameter 'italic' is set to 'italic' or 'True'. """ self.client.send_si(self.handle, "setGlobalFont("+family+","+ b2str(font_size)+","+b2str(bold)+","+b2str(italic)+")") def set_top_label(self, label="") : """ Set the plot top label """ self.client.send_si(self.handle, "setTopLabel("+label+")") def set_bottom_label(self, label="") : """ Set the plot bottom label """ self.client.send_si(self.handle, "setBottomLabel("+label+")") def set_left_label(self, label="") : """ Set the plot left label """ self.client.send_si(self.handle, "setLeftLabel("+label+")") def set_right_label(self, label="") : """ Set the plot right label """ self.client.send_si(self.handle, "setRightLabel("+label+")") def set_top_label_auto(self) : """ Set the top label to auto generated. """ self.client.send_si(self.handle, "setTopLabelAuto()") def set_bottom_label_auto(self) : """ Set the bottom label to auto generated. """ self.client.send_si(self.handle, "setBottomLabelAuto()") def set_left_label_auto(self) : """ Set the left label to auto generated. """ self.client.send_si(self.handle, "setLeftLabelAuto()") def set_right_label_auto(self) : """ Set the right label to auto generated. """ self.client.send_si(self.handle, "setRightLabelAuto()") def normalize_x_to_y(self) : """ Adjust the X zoom range so X and Y have the same scale per unit (square pixels) """ self.client.send_si(self.handle, "normalizeXtoY()") def set_log_x(self, log_mode = True) : """ Set X axis to log mode. """ self.client.send_si(self.handle, "setLogX("+b2str(log_mode) + ")") def set_log_y(self, log_mode = True) : """ Set Y axis to log mode. """ self.client.send_si(self.handle, "setLogY("+b2str(log_mode) + ")") def set_y_axis_reversed(self, reversed=True) : """ set the Y axis to decreasing from bottom to top. """ if reversed == True: self.client.send_si(self.handle, "setYAxisReversed()") else: self.client.send_si(self.handle, "setYAxisNotReversed()") def set_x_axis_reversed(self, reversed=True) : """ set the X axis to decreasing from left to right. """ if reversed == True: self.client.send_si(self.handle, "setXAxisReversed()") else: self.client.send_si(self.handle, "setXAxisNotReversed()") def set_x_axis_interpretation(self, interp = "ctime") : """ Interpret the x axis as time :param interp: interpret the time as follows interp can be:: ctime: Standard unix C time year: Decimal year jd: Julian Date mjd: Modified Julian Date excel: Time as used by MS Excel """ self.client.send_si(self.handle, "setXAxisInterpretation("+interp+")") def clear_x_axis_interpretation(self) : """ do not intepret the x axis as time """ self.client.send_si(self.handle, "clearXAxisInterpretation()") def set_x_axis_display(self, display = "yyyy/MM/dd h:mm:ss ap") : """ if the x axis has been interpreted as time, set the display. Display Types:: year: display the decimal year qttextdtehhmmss: HH:MM:SS.SS qtlocaldatehhmmss: HH:MM:SS.SS jd: Julian Date mjd: Modified Julian Date All others: custom format The custom format is defined as:: d the day as number without a leading zero (1 to 31) dd the day as number with a leading zero (01 to 31) ddd the abbreviated localized day name (e.g. 'Mon' to 'Sun'). Uses the system locale to localize the name, i.e. QLocale::system(). dddd the long localized day name (e.g. 'Monday' to 'Qt::Sunday'). Uses the system locale to localize the name, i.e. QLocale::system(). M the month as number without a leading zero (1-12) MM the month as number with a leading zero (01-12) MMM the abbreviated localized month name (e.g. 'Jan' to 'Dec'). Uses the system locale to localize the name, i.e. QLocale::system(). MMMM the long localized month name (e.g. 'January' to 'December'). Uses the system locale to localize the name, i.e. QLocale::system(). yy the year as two digit number (00-99) yyyy the year as four digit number h the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display) hh the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display) H the hour without a leading zero (0 to 23, even with AM/PM display) HH the hour with a leading zero (00 to 23, even with AM/PM display) m the minute without a leading zero (0 to 59) mm the minute with a leading zero (00 to 59) s the second without a leading zero (0 to 59) ss the second with a leading zero (00 to 59) z the milliseconds without leading zeroes (0 to 999) zzz the milliseconds with leading zeroes (000 to 999) AP or A use AM/PM display. A/AP will be replaced by either "AM" or "PM". ap or a use am/pm display. a/ap will be replaced by either "am" or "pm". t the timezone (for example "CEST") """ self.client.send_si(self.handle, "setXAxisDisplay("+display+")") class Button(ViewItem) : """ This represents a button inside a View. When the button is pressed, it sends a message via a socket. socket is a QtNetwork.QLocalSocket that is not connected to anything. The message "clicked" will be sent when the button is pressed. See the bonjourMonde example. """ def __init__(self,client,text,socket,posX=0.1,posY=0.1,sizeX=0.1,sizeY=0.1,rot=0) : ViewItem.__init__(self,client) self.client.send("newButton()") self.client.send("setPos("+b2str(posX)+","+b2str(posY)+")") self.client.send("setSize("+b2str(sizeX)+","+b2str(sizeY)+")") self.client.send("setText("+b2str(text)+")") self.client.send("setRotation("+b2str(rot)+")") self.handle=self.client.send("endEdit()") self.handle.remove(0,self.handle.indexOf("ing ")+4) socket.connectToServer(client.server_name) socket.waitForConnected(300) socket.write(b2str("attachTo("+self.handle+")")) def set_text(self,text): """ Sets the text of the button. """ self.client.send("beginEdit("+self.handle+")") self.client.send("setText("+b2str(text)+")") self.client.send("endEdit()") class LineEdit(ViewItem) : """ This represents a line edit inside a View. When the lineedit's value is changed, it sends a message via a socket. socket is a QtNetwork.QLocalSocket that is not connected to anything. The message "valueSet:VAL" where VAL is some text will be sent when the text is changed. See the ksNspire example. """ def __init__(self,client,text,socket,posX=0.1,posY=0.1,sizeX=0.1,sizeY=0.1,rot=0) : ViewItem.__init__(self,client) self.client.send("newLineEdit()") self.client.send("setPos("+b2str(posX)+","+b2str(posY)+")") self.client.send("setSize("+b2str(sizeX)+","+b2str(sizeY)+")") self.client.send("setText("+b2str(text)+")") self.client.send("setRotation("+b2str(rot)+")") self.handle=self.client.send("endEdit()") self.handle.remove(0,self.handle.indexOf("ing ")+4) socket.connectToServer(b2str(client.server_name)) socket.waitForConnected(300) socket.write(b2str("attachTo("+self.handle+")")) def set_text(self,text): """ Sets the text of the line edit. """ self.client.send("beginEdit("+self.handle+")") self.client.send("setText("+b2str(text)+")") self.client.send("endEdit()")