Laserfiche WebLink
table as the list # Read a one-column table that will be passed to the template as a list ReadTableFromDelimitedFile(TableID="locList",InputFile="Data\loclist.csv") ExpandTemplateFile(InputFile="Data <br />\ProcessorTable.txt", OutputFile="Results/Test_ExpandTemplateFile_ProcessorTable_out.txt") Example Using a Multiple-Column Table to Loop Through Two Lists The previous example illustrated <br />how a one-column table can be used to loop over a list. However, often it is necessary to loop over one list and access the corresponding items from another list. The following example <br />illustrates how a template command file can perform this task. Note that each list must be a onecolumn table in TSTool. If the original table has more than one column, use the CopyTable() <br />command to create as many one-column tables as are necessary. In this example, a comma-separatedvalue (CSV) file is used for the table: # Simple list to use during template expansion <br />"Location","Value" loc1,1.0 loc2,2.0 loc3,3.0 loc4,4.0 The template file to expand is similar to the one-column example; however, the second list is also used to provide information <br />when expanding the commands (see bold text below): # Simple template to illustrate how to repeat commands with a list of # location identifiers # Create a time series for each location <br /># The following ensures that the created template is read-only, # so users modify the template instead: # The location list is provided by the processor as a one-column table # with <br />ID matching the list name # The value list is provided by the processor as a corresponding one-column # table with ID "valueList" #@readOnly <#assign setStart = "2000-01-01"> <#assign <br />setEnd = "2000-03-15"> <#assign units = "CFS"> # The loc_index is referenced to zero <#list locList as loc> <#assign value = valueList[loc_index]> NewPatternTimeSeries(Alias="${loc}",NewTSID="${loc}. <br />.Streamflow.Day", SetStart="${setStart}",SetEnd="${setEnd}",Units="${units}", PatternValues="${value}") NewPatternTimeSeries(Alias="${loc}",NewTSID="${loc}..Streamflow.Day", SetStart="${setStart}",Se <br />tEnd="${setEnd}",Units="${units}", PatternValues="${valueList[loc_index]}") </#list> 160 <br />TSTool Documentation ExpandTemplateFile() Command Command Reference – ExpandTemplateFile() -7 The following command file reads the list of locations from the table and then expands the <br />template file. Note that the TableID must match the list name in the <#list…> element and corresponding arrays in the template. # Test expanding a FreeMarker template for a list of time <br />series, using a # two-column table as the list # Read a one-column table that will be passed to the template as a list ReadTableFromDelimitedFile(TableID="locList2", InputFile="Data\2column-table.csv <br />") CopyTable(TableID="locList2",NewTableID="locList", IncludeColumns="Location") CopyTable(TableID="locList2",NewTableID="valueList", IncludeColumns="Value") ExpandTemplateFile(InputFile="Data\Proces <br />sorTable.txt", OutputFile="Results/Test_ExpandTemplateFile_ProcessorTable_out.txt") Example of Expanding a Template to a Processor Property The following example illustrates how to expand <br />a list into a SQL “in” clause, which is used to query specific matching records. A one-column table with identifier locList must have been created to supply the list of identifiers. <br />The property set with the OutputProperty command parameter can then be used in the SQL statement for the ReadTableFromDataStore() command. IN (<#list locList as loc><#if (loc_index > <br />0)>,</#if>'${loc}'</#list>) Example of Using ExpandTemplateFile() in a Loop to Expand Multiple Files A template file cannot be expanded to multiple files using the approach illustrated <br />above. However, by placing an ExpandTemplateFile() command inside a template that uses a loop (a list), it is possible to expand a template to multiple files. One example of this is <br />the automated generation of time series product files used with TSTool graphs, where a graph is created for each location being processed. Graphs that are formatted with time series <br />product files allow a certain amount of dynamic information to be considered. However, because the products are organized into product (page), sub-product (graph on page), and data (time <br />series in graph), dynamic data may not be configurable at the desired level. For example, time series legend text can be configured to automatically use the time series identifier; however, <br />this information is not appropriate for the page title because the software cannot automatically decide which time series to use for the main title. A solution is to use a template time <br />series product (TSP) file that has a place-holder variable for the title and then expand the TSP file as the command file is processed. For troubleshooting and data management purposes, <br />it is recommended that the TSP files are saved in a folder separate from final output. The same TSP filename could be reused; however, the files are small and saving distinct files allows <br />them to be used individually if necessary. The following TSP file illustrates a simple graph: # Template product file for graphs [Product] ProductType = "Graph" TotalWidth = "600" 161 <br />ExpandTemplateFile() Command TSTool Documentation Command Reference – ExpandTemplateFile() -8 TotalHeight = "400" MainTitleString = "${loc} Streamflow" [SubProduct 1] GraphType = "Line" <br />[Data 1.1] TSID = "${loc}..Streamflow.Day" TSAlias = "${loc}" The following template command file illustrates how a property is set to control expansion of a template time series product <br />file (note that templates are stored in a Data folder and final output in a Results folder for testing purposes but data management will vary by application): # Simple template to illustrate <br />how to repeat commands # with a list of location identifiers, and produce individual graphs. # The list is provided by the processor as a one-column table # with ID matching the list <br />name # The @readOnly comment ensures that the created template is read-only, # so users modify the template instead. #@readOnly <#assign setStart = "2000-01-01"> <#assign setEnd = "2000-03-15"> <br /><#assign units = "CFS"> <#list locList as loc> # Set the loc variable for the processor so that it can pass # to the ExpandTemplateFile command below SetProperty(PropertyName="loc",PropertyType="Stri <br />ng",PropertyValue="${loc}") # Create the time series NewPatternTimeSeries(Alias="${loc}",NewTSID="${loc}..Streamflow.Day", SetStart="${setStart}",SetEnd="${setEnd}",Units="${units}", <br />PatternValues="${loc_index + 1},0") # Expand the time series product file (graph) for the time series ExpandTemplateFile(InputFile="..\Data\ProcessorTable_TSP_template.tsp", OutputFile="${loc}.tsp") <br /># Process the graph ProcessTSProduct(TSProductFile="${loc}.tsp",OutputFile="${loc}.tsp) </#list> The following expanded command file creates time series and graphs. Although blocks of <br />commands are repeated, the location identifier is different in each block of commands. Any errors in processing can be pinpointed when the expanded command file is loaded and generally <br />are due to logic errors in the original template (errors repeated throughout the expanded command file) or data availability issues in specific time series (errors in one part of the <br />expanded command file). # Simple template to illustrate how to repeat commands # with a list of location identifiers, and produce individual graphs. # The list is provided by the processor <br />as a one-column table # with ID matching the list name # The @readOnly comment ensures that the created template is read-only, # so users modify the template instead. #@readOnly # Set <br />the loc variable for the processor so that it can pass 162 <br />TSTool Documentation ExpandTemplateFile() Command Command Reference – ExpandTemplateFile() -9 # to the ExpandTemplateFile command below SetProperty(PropertyName="loc",PropertyType="String",PropertyVa <br />lue="loc1") # Create the time series NewPatternTimeSeries(Alias="loc1",NewTSID="loc1..Streamflow.Day", SetStart="2000-01-01",SetEnd="2000-03-15",Units="CFS",PatternValues="1,0") # Expand <br />the time series product file (graph) for the time series ExpandTemplateFile(InputFile="..\Data\ProcessorTable_TSP_template.tsp", OutputFile="loc1.tsp") # Process the graph ProcessTSProduct(TSProductF <br />ile="loc1.tsp",OutputFile="loc1.tsp) # Set the loc variable for the processor so that it can pass # to the ExpandTemplateFile command below SetProperty(PropertyName="loc",PropertyType="String",Proper <br />tyValue="loc2") # Create the time series NewPatternTimeSeries(Alias="loc2",NewTSID="loc2..Streamflow.Day", SetStart="2000-01-01",SetEnd="2000-03-15",Units="CFS",PatternValues="2,0") <br /># Expand the time series product file (graph) for the time series ExpandTemplateFile(InputFile="..\Data\ProcessorTable_TSP_template.tsp", OutputFile="loc2.tsp") # Process the graph ProcessTSProduct(T <br />SProductFile="loc2.tsp",OutputFile="loc2.tsp) # Set the loc variable for the processor so that it can pass # to the ExpandTemplateFile command below SetProperty(PropertyName="loc",PropertyType="Strin <br />g",PropertyValue="loc3") # Create the time series NewPatternTimeSeries(Alias="loc3",NewTSID="loc3..Streamflow.Day", SetStart="2000-01-01",SetEnd="2000-03-15",Units="CFS",PatternValues="3,0") <br /># Expand the time series product file (graph) for the time series ExpandTemplateFile(InputFile="..\Data\ProcessorTable_TSP_template.tsp", OutputFile="loc3.tsp") # Process the graph ProcessTSProduct(T <br />SProductFile="loc3.tsp",OutputFile="loc3.tsp) # Set the loc variable for the processor so that it can pass # to the ExpandTemplateFile command below SetProperty(PropertyName="loc",PropertyType="Strin <br />g",PropertyValue="loc4") # Create the time series NewPatternTimeSeries(Alias="loc4",NewTSID="loc4..Streamflow.Day", SetStart="2000-01-01",SetEnd="2000-03-15",Units="CFS",PatternValues="4,0") <br /># Expand the time series product file (graph) for the time series ExpandTemplateFile(InputFile="..\Data\ProcessorTable_TSP_template.tsp", OutputFile="loc4.tsp") # Process the graph ProcessTSProduct(T <br />SProductFile="loc4.tsp",OutputFile="loc4.tsp) Also note that when the expanded command file is first opened in TSTool the ProcessTSProduct() commands will have a failure indicated. This <br />is because the TSP file being used by the command has not yet been created (it is created as the commands are run). After the commands are run one time, the files will exist and subsequent <br />loads of the command file will not show the warnings. This illustrates a potential issue, which is that templates can result in large numbers of files and the files should be cleared <br />at appropriate times to ensure that old files are not used by mistake. 163 <br />ExpandTemplateFile() Command TSTool Documentation Command Reference – ExpandTemplateFile() -10 The FreeMarker language provides many features beyond those illustrated in these examples, <br />including conditional (“if”) statements. However, the more complex the templates become, the more difficult they are to implement, troubleshoot, and maintain. Enhancements to TSTool <br />may help with a solution that otherwise might require undesirable complexity. 164 <br />TSTool Documentation ExpandTemplateFile() Command Command Reference – ExpandTemplateFile() -11 This page is intentionally blank. 165 <br />ExpandTemplateFile() Command TSTool Documentation Command Reference – ExpandTemplateFile() -12 This page is intentionally blank. 166 <br />Command Reference: FillConstant() Fill missing time series data using a constant value Version 09.07.02, 2010-08-20 The FillConstant() command fills the missing data in a time series <br />with the specified value. This fill technique is useful for filling missing data with zeros, perhaps as the last step in a sequence of filling commands. The following dialog is used <br />to edit the command and illustrates the command syntax. FillConstant FillConstant() Command Editor 167 Command Reference – FillConstant() -1 <br />FillConstant() Command TSTool Documentation The command syntax is as follows: FillConstant(Parameter=Value,…) Command Parameters Parameter Description Default TSList Indicates the list <br />of time series to be processed, one of: • AllMatchingTSID – all time series that match the TSID (single TSID or TSID with wildcards) will be modified. • AllTS – all time series before <br />the command. • EnsembleID – all time series in the ensemble will be modified. • FirstMatchingTSID – the first time series that matches the TSID (single TSID or TSID with wildcards) will <br />be modified. • LastMatchingTSID – the last time series that matches the TSID (single TSID or TSID with wildcards) will be modified. • SelectedTS – the time series are those selected <br />with the SelectTimeSeries() command. AllTS TSID The time series identifier or alias for the time series to be modified, using the * wildcard character to match multiple time series. <br />Required for TSList=*TSID. EnsembleID The ensemble to be modified, if processing an ensemble. Required for TSList=EnsembleID. ConstantValue Constant value to use when filling missing <br />data. None – must be specified. FillStart Date/time indicating the start of filling, using a precision appropriate for the time series, or OutputStart. Fill the entire time series. FillEnd <br />Date/time indicating the end of filling, using a precision appropriate for the time series, or OutputEnd. Fill the entire time series. FillFlag If specified, data flags will be enabled <br />for the time series and each filled value will be tagged with the specified string. The flag can then be used later to label graphs, etc. The flag will be appended to existing flags <br />if necessary. No flag is assigned. A sample command file to fill a time series from the State of Colorado’s HydroBase is as follows: # 08236500 -ALAMOSA RIVER BELOW TERRACE RESERVOIR <br />08236500.DWR.Streamflow.Month~HydroBase FillConstant(TSList=AllMatchingTSID,TSID="08236500.DWR.Streamflow.Month", ConstantValue=500,FillStart="1970-02",FillEnd="1970-10",FillFlag="C") <br />Command Reference – FillConstant() -2 168 <br />Command Reference: FillDayTSFrom2MonthTSAnd1DayTS() Fill a daily time series from monthly volumes and daily pattern Version 08.16.04, 2008-09-19 The FillDayTSFrom2MonthTSAnd1DayTS() <br />command fills a daily time series using the following relationship: D1i = D2i*(M1i/M2i) where: i = day D1 is the daily data at location 1 M1 is the monthly data at location 1 (for the <br />month corresponding to the day) D2 is the daily data at location 2 M2 is the monthly data at location 2 (for the month corresponding to the day) This fill method assumes the monthly <br />time series are filled and reasonably correlated and that the daily pattern D2 can be applied at D1. For example, use this command to fill daily streamflow where filled monthly data <br />are available at nearby locations and filled daily data is available at the independent (D2) station. 16C9ommand Reference – FillDayTSFrom2MonthTSAnd1DayTS() -1 <br />FillDayTSFrom2MonthTSAnd1DayTS() Command TSTool Documentation The following dialog is used to edit the command and illustrates the syntax of the command. For all the time series identifiers, <br />the last matching identifier before the command will be matched for processing. Currently there is no way to fill multiple time series with one command. FillDayTSFrom2MonthTSAnd1DayTS <br />FillDayTSFrom2MonthTSAnd1DayTS() Command Editor The command syntax is as follows: FillDayTSFrom2MonthTSAnd1DayTS(Parameter=Value,…) Command Parameters Parameter Description Default TSID_D1 <br />The time series identifier or alias for the daily time series to be filled. None – must be specified. TSID_M1 The time series identifier or alias for the monthly time series, corresponding <br />to TSID_D1, to supply the monthly values to be distributed to daily. None – must be specified. TSID_M2 The time series identifier or alias for the independent monthly time series. None <br />– must be specified. TSID_D2 The time series identifier or alias for the independent daily time series, corresponding to TSID_M2. None – must be specified. FillStart Date/time indicating <br />the start of filling, using a precision appropriate for the time series, or OutputStart. Fill the entire time series. FillEnd Date/time indicating the end of filling, using a precision <br />appropriate for the time series, or OutputEnd. Fill the entire time series. Command Reference – FillMonthTSFrom2MonthTSAnd1DayTS1()7 -02 <br />TSTool Documentation FillDayTSFrom2MonthTSAnd1DayTS() Command An example command file to process data from the State of Colorado’s HydroBase is shown below with the resulting graph of <br />daily time series. # The following is D1: # (1995-1998) ALAMOSA RIVER ABOVE JASPER, CO USGS Streamflow Daily 08235350.USGS.Streamflow.Day~HydroBase # The following is M1: # (1995-1998) <br />ALAMOSA RIVER ABOVE JASPER, CO USGS Streamflow Monthly 08235350.USGS.Streamflow.Month~HydroBase # The following is D2: # (1914-1998) ALAMOSA RIVER ABOVE TERRACE RESERVOIR, CO. DWR Streamflow <br />Daily 08236000.DWR.Streamflow.Day~HydroBase # The following is M2: # (1914-1998) ALAMOSA RIVER ABOVE TERRACE RESERVOIR, CO. DWR Streamflow Monthly 08236000.DWR.Streamflow.Month~HydroBase <br />FillRegression(TSID="08235350.USGS.Streamflow.Month", IndependentTSID="08236000.DWR.Streamflow.Month", NumberOfEquations=OneEquation,Transformation=Linear) FillDayTSFrom2MonthTSAnd1DayTS(TSID_D1="082 <br />35350.USGS.Streamflow.Day", TSID_M1="08235350.USGS.Streamflow.Month", TSID_M2="08236000.DWR.Streamflow.Month",TSID_D2="08236000.DWR.Streamflow.Day") 17C1ommand Reference – FillDayTSFrom2MonthTSAnd1Da <br />yTS() -3 <br />FillDayTSFrom2MonthTSAnd1DayTS() Command TSTool Documentation The following graph shows the two daily time series used in the command (zoomed in). Note that the shape of the filled time <br />series is similar to the other time series. fillDayTSFrom2MonthTSAnd1DayTS_Graph Example of Filled Data Command Reference – FillMonthTSFrom2MonthTSAnd1DayTS1()7 -24 <br />Command Reference – FillFromTS() -1 Command Reference: FillFromTS() Fill missing time series data using data from another time series (or ensemble) Version 10.03.00, 2011-12-19 The FillFromTS() <br />command fills missing data in a time series (or ensemble) by transferring nonmissing values from another time series (or ensemble). This is useful when two time series typically have <br />very similar values. The filled time series is not automatically extended. A period can be specified to limit the period that is checked for missing data. See also the SetFromTS() command, <br />which will transfer all values. If multiple time series or an ensemble is being processed, the number of independent time series must be one or the same number as the time series being <br />filled. Data transfer occurs by date/time, not sequentially. This may be a problem if trying to fill from a time series that has been shifted and leap years have caused an offset – an <br />enhancement may be made in the future to address this issue. The following dialog is used to edit the command and illustrates the command syntax. FillFromTS FillFromTS() Command Editor <br />The command syntax is as follows: FillFromTS(Parameter=Value,…) Command Parameters Parameter Description Default TSList Indicates the list of time series to be processed, one of: • AllMatchingTSID <br />– all time series that match AllTS 173 <br />FillFromTS() Command TSTool Documentation Command Reference – FillFromTS() -2 Parameter Description Default the TSID (single TSID or TSID with wildcards) will be modified. • AllTS – <br />all time series before the command. • EnsembleID – all time series in the ensemble will be modified. • FirstMatchingTSID – the first time series that matches the TSID (single TSID or <br />TSID with wildcards) will be modified. • LastMatchingTSID – the last time series that matches the TSID (single TSID or TSID with wildcards) will be modified. • SelectedTS – the time <br />series are those selected with the SelectTimeSeries() command. TSID The time series identifier or alias for the time series to be modified, using the * wildcard character to match multiple <br />time series. Required when a TSList=*TSID EnsembleID The ensemble to be modified, if processing an ensemble. Required when TSList=EnsembleID. Independent TSList Indicates how to determine <br />the list of independent time series (see the explanation of TSList). AllTS Independent TSID The time series identifier or alias for the independent time series (see the explanation of <br />TSID). Required when a IndependentTSList= *TSID Independent EnsembleID The ensemble identifier for the independent time series (see the explanation of EnsembleID). Required when IndependentTSList= <br />EnsembleID. FillStart The date/time to start filling. Fill the entire period. FillEnd The date/time to end filling. Fill the entire period. FillFlag If specified, data flags will be <br />enabled for the time series and each filled value will be tagged with the specified string. The flag can then be used later to label graphs, etc. Prefix with + to append the flag. No <br />flag is assigned. FillFlagDesc Description for the fill flag, used in reports. Automatically generated. Recalc Limits Available only for monthly time series. Indicate whether the original <br />data limits for the time series should be recalculated after the filling the time series. Setting to True is appropriate if the independent time series provides additional data values. <br />False (only the values in the initial time series will be used for historical data). A sample command file to fill data from the State of Colorado’s HydroBase is as follows: # 08241000 <br />-TRINCHERA CREEK ABOVE MOUNTAIN HOME RESERVOIR 08241000.DWR.Streamflow.Month~HydroBase # 08240500 -TRINCHERA CREEK ABOVE TURNER'S RANCH 08240500.DWR.Streamflow.Month~HydroBase FillFromTS(TSList=AllMa <br />tchingTSID,TSID="08241000.DWR.Streamflow.Month", IndependentTSList=AllMatchingTSID, IndependentTSID="08240500.DWR.Streamflow.Month") 174 <br />Command Reference: FillHistMonthAverage() Fill missing time series data using historical monthly average data Version 09.07.00, 2010-06-14 The FillHistMonthAverage() command fills missing <br />data in monthly time series with the average monthly values. The average values are computed using the available data period (or specified averaging period – see the SetAveragePeriod() <br />command) immediately after the time series is read and are then applied when this command is encountered. The following dialog is used to edit the command and illustrates the syntax <br />of the command. FillHistMonthAverage FillHistMonthAverage() Command Editor The command syntax is as follows: FillHistMonthAverage(Parameter=Value,…) Command Parameters Parameter Description <br />Default TSList Indicate how to determine the list of time series to process, one of: 􀂃 AllMatchingTSID – process time series that have identifiers matching the TSID parameter. 􀂃 AllTS <br />– process all the time series. 􀂃 FirstMatchingTSID – process the first time series that has an identifier matching the TSID parameter. None – must be specified. 175 Command Reference <br />– FillHistMonthAverage() -1 <br />FillHistMonthAverage() Command TSTool Documentation Parameter Description Default 􀂃 LastMatchingTSID – process the last time series that has an identifier matching the TSID parameter. <br />􀂃 SelectedTS – process the time series that are selected (see SelectTimeSeries()). TSID Used if TSList=AllMatchingTSID to indicate the time series identifier or alias for the time series <br />to be filled. Specify * to match all time series or use a wildcard for one or more identifier parts. Required if TSList=AllMatchin gTSID. FillStart Date/time indicating the start of <br />filling, using a precision appropriate for the time series, or OutputStart. Fill the entire time series. FillEnd Date/time indicating the end of filling, using a precision appropriate <br />for the time series, or OutputEnd. Fill the entire time series. FillFlag If specified, data flags will be enabled for the time series and each filled value will be tagged with the specified <br />string. The flag can then be used later to label graphs, etc. The flag will be appended to existing flags if necessary. Use Auto to use a flag with the month abbreviation + Avg. No flag <br />is assigned. FillFlag Desc Description for the fill flag, used in reports. Automatically generated. The following command files fill a time series from the State of Colorado’s HydroBase: <br /># 0125 -ALAMOSA 0125.NOAA.Precip.Month~HydroBase FillHistMonthAverage(TSList=AllMatchingTSID,TSID=”0125.NOAA.Precip.Month”, FillFlag=”H”) 0125.NOAA.Precip.Month~HydroBase FillHistMonthAverage(TSList= <br />AllMatchingTSID,TSID=”019*”,FillFlag=”H”) Time series data limits for the averages are printed to the log file, similar to the following examples (note that the period for averaging <br />is always shown and may be different than the output period). Status: Historic averages for time series follow... Time series: 0125.NOAA.Precip.Month (IN) Monthly limits for period 1948-08 <br />to 1949-12 are: # % # Not % Not Month Min MinDate Max MaxDate Sum Miss. Miss. Miss. Miss. Mean --------------------------------------------------------------------------------------------Jan <br />0.2 1949-01 0.2 1949-01 0.2 0 0.00 1 100.00 0.2 Feb 0.1 1949-02 0.1 1949-02 0.1 0 0.00 1 100.00 0.1 Mar 0.1 1949-03 0.1 1949-03 0.1 0 0.00 1 100.00 0.1 Apr -999.0 -999.0 -999.0 1 100.00 <br />0 0.00 -999.0 May -999.0 -999.0 -999.0 1 100.00 0 0.00 -999.0 Jun 0.7 1949-06 0.7 1949-06 0.7 0 0.00 1 100.00 0.7 Jul 1.5 1949-07 1.5 1949-07 1.5 0 0.00 1 100.00 1.5 Aug 0.7 1949-08 <br />0.8 1948-08 1.5 0 0.00 2 100.00 0.8 Sep 0.1 1948-09 1.1 1949-09 1.2 0 0.00 2 100.00 0.6 Oct 0.1 1949-10 0.5 1948-10 0.7 0 0.00 2 100.00 0.3 Nov 0.0 1949-11 0.8 1948-11 0.8 0 0.00 2 100.00 <br />0.4 Dec 0.0 1949-12 0.2 1948-12 0.2 0 0.00 2 100.00 0.1 --------------------------------------------------------------------------------------------Period 0.0 1949-11 1.5 1949-07 6.9 <br />2 11.76 15 88.24 0.5 --------------------------------------------------------------------------------------------Command Reference – FillHistMonthAverage() -2 176 <br />Command Reference: FillHistYearAverage() Fill missing time series data using historical yearly average data Version 10.00.01, 2011-05-12 The FillHistYearAverage() command fills missing <br />data in yearly time series with the average annual value. The average values are computed using the available data period (or specified averaging period – see the SetAveragePeriod()command) <br />immediately after the time series is read and are then applied when this command is encountered. The following dialog is used to edit the command and illustrates the syntax of the command. <br />FillHistYearAverage FillHistYearAverage() Command Editor The command syntax is as follows: FillHistYearAverage(Parameter=Value,…) Command Parameters Parameter Description Default TSList <br />Indicate how to determine the list of time series to process, one of: 􀂃 AllMatchingTSID – process time series that have identifiers matching the TSID parameter. 􀂃 AllTS – process all <br />the time series. None – must be specified. 177 Command Reference – FillHistYearAverage() -1 <br />FillHistYearAverage() Command TSTool Documentation Parameter Description Default 􀂃 SelectedTS – process the time series that are selected (see selectTimeSeries()). TSID Used if TSList=AllMatchingTSI <br />D to indicate the time series identifier or alias for the time series to be filled. Specify * to match all time series or use a wildcard for one or more identifier parts. Required if <br />TSList=AllMatchingTSID. FillStart Date/time indicating the start of filling, using a precision appropriate for the time series, or OutputStart. Fill the entire time series. FillEnd Date/time <br />indicating the end of filling, using a precision appropriate for the time series, or OutputEnd. Fill the entire time series. FillFlag If specified as a single character, data flags will <br />be enabled for the time series and each filled value will be tagged with the specified character. The flag can then be used later to label graphs, etc. The flag will be appended to existing <br />flags if necessary. No flag is assigned. A sample command file to fill data from the State of Colorado’s HydroBase is as follows: LARIMER.NASS.CropArea-Vegetables, Harvested.Year~HydroBase <br />FillHistYearAverage(TSList=AllMatchingTSID, TSID="LARIMER.NASS.CropArea-Vegetables, Harvested.Year") Time series data limits for the averages are printed to the log file, similar to <br />the following example (note that the period for averaging is always shown and may be different than the output period). Min: 95.0000 ACRE on 1954 Max: 2684.0000 ACRE on 1959 Sum: 11090.0000 <br />ACRE Mean: 1008.1818 ACRE Number Missing: 42 (79.25%) Number Not Missing: 11 (20.75%) Total period: 1945 to 1997 Non-missing data period: 1945 to 1997 Command Reference – FillHistYearAverage() <br />-2 178 <br />Command Reference: FillInterpolate() Fill missing time series data by interpolating between known values Version 09.07.02, 2010-08-20 The FillInterpolate() command fills missing data <br />