|Java Class -
|from herschel.hifi.pipeline.product import HifiProduct
HifiProduct is an extension of MapContext<-Product, which contains
datasets identified by number ( > 0 ). It contains an iterator over the stored datasets.
|Example 1: HifiProduct
vds = HifiProduct() # create a HifiProduct
s1 = Spectrum1d() # create some Datasets
s2 = Spectrum2d()
s3 = ArrayDataset( )
vds.set( s1 ) # set s1 at number "0001"
vds.set( s2 ) # set s2 at number "0002"
vds.set( s3, 4 ) # set s3 at number "0004"
s4 = vds.get( 1 ) # s4 equals s1
print vds.getCount() # yields 3 (3 sets in vds)
print vds.getLastIndex() # yields 4 (last one is at 4)
it = vds.iterator() # iterator over the datasets.
while it.hasNext(): print it.next().__class__ # print classes
vds.remove( 2 ) # leaves sets at 1 and 4
vds.collapse() # renumbers sets to 1 and 2
vds.remove() # removes last one, leaves only nr 1
HifiProduct still is a MapContext<-Product and can be addressed as such. If you do so, the special methods of HifiProduct are not guarandeed to work.