Data Browser¶
Data Browsers are classes that maintain index consistency between two Indexers and provide the functionality required to browse two indexers simultaneously. Since the source databases for results and images could be completely disjointed this means one of the Indexers is designated as a primary indexer. Browsing follows primary indexer while the secondary indexer is queried for the corresponding item.
-
class
lfd.gui.imagechecker.databrowser.
Browser
(primaryIndexer=None, secondaryIndexer=None)[source]¶ Browser is the generic abstraction of a browser that iterates over the pairs of (primary, secondary) items. Given objects capable of itemizing, i.e. indexing, the primary and secondary items Browser will ensure the consistency of the browsing index between the two indexers. For example, if we wanted to browse to the next value of primary indexer the following actions are performed:
- invokes the next method of the primary indexer
- identifies that item
- invokes the get method of the secondary indexer.
This is neccessary since the sets of items indexed by primary and secondary can be completely disjoint.
The attributes and methods of this class are mainly private or hidden. By inheriting this class and declaring a dictionary class attribute “rename” on that class it is possible to rename the methods of this class into something more appropriate such as assigning the name ‘images’ to ‘_primary’ when dealing with ImageBrowser class etc.
Parameters: - primaryIndexer (lfd.gui.imagechecker.Indexer) – the primary Indexer (EventIndexer or ImageIndexer)
- secondaryIndexer (lfd.gui.imagechecker.Indexer) – the secondary Indexer
-
get
(run, camcol, filter, field, which=0)[source]¶ Given frame specifiers (run, camcol, filter, field) select and advance both indexers to the item if possible. Relationship from primary to secondary indexer can be many to one, so providing ‘which’ allows selection on a particular secondary of interest.
-
class
lfd.gui.imagechecker.databrowser.
EventBrowser
(resdbURI=None, imgdbURI=None)[source]¶ A Browser which primary set of items to browse through are Events. For each Event indexed it will attempt to find a corresponding image. This Browser guarantees that all Events will be Browsed, but not all indexed images will be browsed through.
Parameters: - resdbURI (str) – URI of the database of Events (i.e. results)
- imgdbURI (str) – URI of the database of Images
-
event
¶ The item, of the primary indexer, pointed to by the current index.
-
events
¶ The items indexed by the primary indexer.
-
image
¶ The item, of the secondary indexer, pointed to by the current index.
-
images
¶ The items indexed by the secondary indexer.
-
initEvents
(URI)¶ Instantiate the primary indexer.
-
initImages
(URI)¶ Instantiate the secondary indexer.
-
class
lfd.gui.imagechecker.databrowser.
GenericBrowser
[source]¶ GenericBrowser metaclass offers the ability to rename the values of attributes being browsed through into something more appropriate. In the case of an EventBrowser for example that would be:
primary --> Event secondary --> Images
and the other way around for ImageBrowser. This is completely superfluous and here more because I wanted to tr something out than out of any real neccessity.
-
class
lfd.gui.imagechecker.databrowser.
ImageBrowser
(resdbURI=None, imgdbURI=None)[source]¶ A Browser which primary set of items to browse through are Images. For each Image indexed it will attempt to find a corresponding Event. This Browser guarantees that all Images will be browsed, but not all indexed events will be browsed through.
Parameters: - resdbURI (str) – URI of the database of Events (i.e. results)
- imgdbURI (str) – URI of the database of Images
-
event
¶ The item, of the secondary indexer, pointed to by the current index.
-
events
¶ The items indexed by the secondary indexer.
-
image
¶ The item, of the primary indexer, pointed to by the current index.
-
images
¶ The items indexed by the primary indexer.
-
initEvents
(URI)¶ Instantiate the secondary indexer.
-
initImages
(URI)¶ Instantiate the primary indexer.