Laserfiche WebLink
TSTool Documentation Examples of Use <br />6.3 Time Series Ensemble Examples <br /> <br />The general term time series ensemble refers to groups of a time series, often shown in overlapping <br />fashion. Common ways to create ensembles are: <br /> <br />• Split time series into N-year lengths and shift to overlap. <br />• Run a model multiple times with different input, in order to generate many possible outcomes. <br />• Generate synthetic data to use as input to a model. <br /> <br />Several TSTool commands have been implemented to create and process time series ensembles. Many <br />other commands allow ensembles to be specified to provide a list of time series for processing. TSTool <br />manages ensemble data by using an ensemble identif ier and optionally using a trace (sequence) number <br />for each time series, which when processing historical da ta is typically the starting historical year for the <br />trace. For most functionality, the ensemble is si mply a collection of the time series traces in the <br />ensemble. <br /> <br />6.3.1 Time Series Traces – Comparing Historic al and Current Conditions (Input=HydroBase) <br /> <br />The following command file illustrates how historical time series traces can be plotted on top of real-time <br />data. The features illustrated in the example were im plemented to help determine an estimate of future <br />flow based on current conditions. <br /> <br /># StartLog(LogFile="Example_Ensemble.TSTool.log") <br /># These commands query historical and real-time data at the lobatos gage and <br /># compute a weighted "best-guess" for the flows at lobatos for the remainder <br /># of the current year. In other words, the current year will be complete, <br /># with observed at the beginning and historical "likely" at the end. <br /># <br /># First get the historic daily Lobatos gage and convert to traces. Shift each trace to <br /># 2008-01-01 (the current year) so that the data can overlay the current year's <br /># values. <br />ReadTimeSeries(TSID="08251500.DWR.Streamflow.Day~HydroBase",Alias="daily",IfNotFound=Warn) <br />CreateEnsembleFromOneTimeSeries(TSID="daily",TraceLength=1Year,EnsembleID="Lobatos", <br /> ReferenceDate="2008-01-01",ShiftDataHow=ShiftToReference) <br /># <br /># Now weight the traces using representative historic years. <br /># <br />WeightTraces(EnsembleID="Lobatos",SpecifyWeightsHow="AbsoluteWeights", <br /> Weights="1997,.5,1998,.4,1999,.1",NewTSID="Lobatos..Streamflow.Day.likely", <br /> Alias="lobatos_likely") <br /># <br /># Now query the current (real-time) flows. HydroBase may only hold a few weeks or months <br /># of data. <br /># <br /># Uncomment the following line to see the actual real-time values <br /># 08251500 - RIO GRANDE RIVER NEAR LOBATOS <br />08251500.DWR.Streamflow-DISCHRG.Irregular~HydroBase <br /># Convert the irrigular instantaneous values to a daily instantaneous (midnight) <br />ChangeInterval(TSList=LastMatchingTSID,TSID="08251500.DWR.Streamflow- <br />DISCHRG.Irregular",Alias="lobatos_current",NewInterval=Day,OldTimeScale=INST,NewTimeScale=INST) <br /># <br /># Blend the current data to the end of the historical data (the current data <br /># will override. <br /># <br />Blend(TSID="lobatos_current",IndependentTSID="lobatos_likely",BlendMethod=BlendAtEnd) <br /># <br /># After the above commands are executed, time series in memory will include the traces and <br /># the current time series. You can select only the time series of interest and plot <br /># OR select many time series and then disable/enable in the plot. You may need to use <br /># both approaches to find appropriate time series to weight. <br /> <br />ExamplesOfUse/Ensemble_Realtime+WeightedHistorical/Example_Realtime+WeightedHistorical <br /> Examples - 9 89