HEC-DSS supports time series ensembles through the use of "collections", a group of similar datasets for the same time window. Typically, ensembles are historical or statistical conditions applied to current conditions for (short term) future conditions. For example, all historical precipitation for current month can be used a future precipitation for a hydrology model to obtain a potential flow dataset for each year. A collection is implemented by using an F Part naming convention which starts with "C:" followed by the collection sequence, the pipe symbol "|" and then the regular F part. The sequence character string must be 6 characters long and may be simple integers or alpha-numeric strings, but must be unique within the collection and sortable. Characters following the separator will be the same for all members in the collection. DSS is able to identify a member of a collection by its F Part string. An example collection pathname is:  /YUBA/SMARTSVILLE/FLOW/01JAN1997/1HOUR/C:000042|OPERATION A/ 


An example collection plot (spaghetti plot) is: !worddavb519be04105299f104bf7b7036b2fd55.png|height=302,width=364!



The DSS API includes the following collection methods to

//	Determine whether a pathname is a collection (or member of a collection) :
DSSPathname:  public static boolean isaCollectionPath(String pathname) 
 
//	Set a Sequence ID in a pathname 
//  Adds in the “C:” and “|” when getPathname() called
DSSPathname:  public void setCollectionSequence(String collectionSequence) 
DSSPathname:  public void setCollectionSequence(int collectionSequence) 

//	Get the Sequence ID from a collection pathname 
DSSPathname:  public static String getCollectionSequence(String pathname) 
DSSPathname:  public String getCollectionSequence()  

//	Read and write specific members of a collection 
Standard read and write using TimeSeriesContainer with a collection pathname: 
HecTimeSeries: 
public int read(TimeSeriesContainer timeSeriesContainer, boolean removeMissing) 
public int write (TimeSeriesContainer timeSeriesContainer, boolean replaceAll) 

//Read and write all members in a collection 
HecTimeSeries: 
public int read(TimeSeriesCollectionContainer collectionContainer, boolean trimMissing) 
public int write (TimeSeriesCollectionContainer collectionContainer) 

//	Example 1:
		HecTimeSeries timeSeries = new HecTimeSeries();
		timeSeries.setDSSFileName (dssFileName);
		timeSeries.setPathname (pathname);
		//  Optional:
		//  timeSeries.setTimeWindow(“01Jan1950 0100 30Jan1950 2400”);
		//  or, if you want:
		//  timeSeries.setRetrieveAllTimes(true);
		TimeSeriesCollectionContainer tscc = new 
			TimeSeriesCollectionContainer();
		int status = timeSeries.read(tscc, true);

//Example 2:
		HecTimeSeries timeSeries = new HecTimeSeries();
		TimeSeriesCollectionContainer tscc = new 
			TimeSeriesCollectionContainer();
		tscc fullName = pathname;
		tscc.fileName = dssFileName;
timeSeries.setRetrieveAllTimes(true);
		int status = timeSeries.read(tscc, true);

//Example Write:
		for (int i=0; i< tscc.size(); i++) {
			TimeSeriesContainer tsc = tscc.get(i);
			DSSPathname path = new DSSPathname(tsc.fullName);
			path.setFPart("Run 2");
			tsc.fullName = path.getPathname();
		}
		int status = timeSeries.write(tscc);

	

//	Return the number of members in a collection 
TimeSeriesCollectionContainer : public int size()
//  or….
//  Use sparingly, as this searches the database
//  Recommend that getCollectionList be used instead
HecDataManager:  public synchronized in getCollectionSize (String seedPathname)


//Return list of member ids from the collection 
TimeSeriesCollectionContainer : public String[] getSequences()
//  or….
HecDataManager:  public synchronized String[] getCollectionSequenceList(String seedPathname) 

//Return the list of member paths in the collection 
TimeSeriesCollectionContainer : public String[] getPathnameList()
//  or….
HecDataManager:  public synchronized String[] getCollectionList(String seedPathname) 

//Provide a condensed catalog where collections are shown as a single path 
//HEC-DSSVue Collections; Menu  View -> Condensed – Group Collections

//Provide a condensed catalog where all collection member paths are shown 
//HEC-DSSVue Collections; Menu  View -> Condensed Catalog

//	Create a collection from a selection of records 
DSSPathname:  
public static String getCollectionSequence(int sequenceNumber) 
public void setCollectionSequence(int sequenceNumber)
public void setCollectionSequence(String collectionSequence)

TimeSeriesCollectionContainer: 
public boolean set(TimeSeriesContainer[] containers, int startingSequenceNumber)
public boolean set(TimeSeriesContainer[] containers, String[] sequences) 
 //  containers.length must = sequences.length
public void set(TimeSeriesContainer[] containers)        


CODE