Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="f1ddce88067ef9a0-a1925efd-41cb4ac1-8e3cb9a5-53170074a649a9059741c8e0"><ac:plain-text-body><![CDATA[

self.configBool(param_name[,default])

returns value of parameter as a boolean value, strings "yes", "true", "True", "on", "1" represent true value, strings "no", "false", "False", "off", "0" represent false value, any other string will raise exception. If parameter is not defined in a file then default value is returned without conversion, if default value was not given then exception is raised.

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="050ddeff8838840a-29d4123e-402e4fd0-a1648c03-43b17b57fbd570ab0adb701c"><ac:plain-text-body><![CDATA[

self.configInt(param_name[,default])

returns value of parameter as integer value. If parameter is not defined in a file then default value is returned without conversion, if default value was not given then exception is raised. If conversion from string to integer fails the standard exception is raised.

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="2c30ceca4d8073d2-e75f665f-43334580-83f7ab97-9f70571465a5593640a973d8"><ac:plain-text-body><![CDATA[

self.configFloat(param_name[,default])

returns value of parameter as floating point value. If parameter is not defined in a file then default value is returned without conversion, if default value was not given then exception is raised. If conversion from string to floating point fails the standard exception is raised.

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="41189bec3dd00468-718346e0-405d46b2-b8ccb753-8492ead27c5a9a1364e6d61c"><ac:plain-text-body><![CDATA[

self.configStr(param_name[,default])

returns value of parameter as string. If parameter is not defined in a file then default value is returned without conversion, if default value was not given then exception is raised.

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="47319a3230702a4d-94f63cc9-4b5349f7-bd8fa4fd-178bedbaf289b3686633e146"><ac:plain-text-body><![CDATA[

self.configSrc(param_name[,default])

returns value of parameter as "source address" string. If parameter is not defined in a file then default value is returned without conversion, if default value was not given then exception is raised. This method does the same as self.configStr but it may also check correctness of the source string format.

]]></ac:plain-text-body></ac:structured-macro>

self.configListBool(param_name)

returns value of parameter as a list of boolean values. If parameter is not defined in a file then empty list is returned, otherwise every word in a parameter value is converted to boolean (according to same rules as defined for self.configBool) and all values are returned in one list.

self.configListInt(param_name)

returns value of parameter as a list of integers. If parameter is not defined in a file then empty list is returned, otherwise every word in a parameter value is converted to integers and all numbers are returned in one list. Conversion errors will raise exception.

self.configListFloat(param_name)

returns value of parameter as a list of floating point numbers. If parameter is not defined in a file then empty list is returned, otherwise every word in a parameter value is converted to float and all numbers are returned in one list. Conversion errors will raise exception.

self.configListStr(param_name)

returns value of parameter as a list of strings. If parameter is not defined in a file then empty list is returned, otherwise parameter value is split into words which are returned in one list.

self.configListSrc(param_name)

returns value of parameter as a list of "source address" strings. If parameter is not defined in a file then empty list is returned, otherwise parameter value is split into words which are returned in one list.

...

Note

The list of currently available TypeId can be seen in the file TypeId.cpp.
The list of Sources Source-s available in xtc file can be obtained by the command:
psana -m EventKeys <path-to-xtc-file>

...

  1. Wiki Markup
    {{evt.get(type, src\[, key:string\])}} where {{type}} is python class corresponding to the data type (or list of classes), e.g. {{psana.Camera.FrameV1}}. The {{src}} argument must be an instance of {{psana.Source}} type which provides a match for device address, {{psana.Source}} is returned from {{self.configSrc(...)}} method. If {{key}} argument is provided then it must be a string, missing key  argument is identical to empty string.
  2. Wiki Markup
    {{evt.get(type\[, key:string\])}} - variation of the above method without source argument. This method is used to retrieve data which is not associated with any device but is a property of the event as a whole. Good example of this kidkind of data is the {{psana.EventId}} object.
  3. self.get(typeId:int, addr:string) - this is pyana-compatibility method and should only be used during migration or in the code which is supposed to run in both pyana and psana. This method is equivalent to pyana method evt.get(TypeId, address). Note that in psana there will be data types which do not have corresponding TypeId, this method cannot be used with those types (TypeId is a property of XTC data types, other data types do not have TypeId).
  4. self.get(key:string) - this is pyana-compatibility method and should only be used during migration or in the code which is supposed to run in both pyana and psana. This method is equivalent to pyana method evt.get(key, None) and is used to retrieve data stored with evt.put(object, key).
Note

The list of currently available TypeId can be seen in the file TypeId.cpp.
The list of type and src arguments available in xtc file can be obtained by the command:

psana -m EventKeys <path-to-xtc-file>

psana example corresponding to the above pyana example which retrieves gas detector data should look like:

...