<!--
/*****************************************************************************/
/*  Copyright 2020 WSL Institute for Snow and Avalanche Research  SLF-DAVOS  */
/*****************************************************************************/
/* This file is part of INIshell.
INIshell is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

INIshell is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with INIshell.  If not, see <http://www.gnu.org/licenses/>.
*/
-->

<!--
INIshell include file for timeseries output plugin definitions
Please include meteoio_parametergroups before use!
-->

<inishell_include>

	<!-- Alternative panel: METEOIO_TS_OUT -->
	<parametergroup name="METEOIO_TS_OUT">
		<!-- it's nice to give defaults to non-optional keys (no 'unsaved changes' warning: -->
		<parameter type="helptext" wrap="true">
			<help>The plugins in the dropdown menu below that are italicized require third-party libraries that might not be installed on your system.</help>
		</parameter>
		<parameter key="METEO" label="Select METEO data plugin:" type="alternative" optional="false" default="SMET" pre-generate="false">
			<section name="Output"/>
			<option value="A3D">
				<parameter key="METEOPATH" type="path" optional="false">
					<help>Path to the meteorological files; this path must exist, it won't be created</help>
				</parameter>
				<help>Original Alpine3D meteo files [&lt;a href=&quot;https://models.slf.ch/docserver/meteoio/html/a3d.html&quot;&gt;more…&lt;/a&gt;]</help>
			</option>
			<option value="GEOTOP">
				<reference name="GEOTOP_OUT"/>
				<help>GeoTop meteo files [&lt;a href=&quot;https://models.slf.ch/docserver/meteoio/html/geotop.html&quot;&gt;more…&lt;/a&gt;]</help>
			</option>
			<option value="NETCDF" bold="true" italic="true">
				<reference name="NETCDF_OUT"/>
				<help>NetCDF grids and timeseries [&lt;a href=&quot;https://models.slf.ch/docserver/meteoio/html/netcdf.html&quot;&gt;more…&lt;/a&gt;]</help>
			</option>
			<option value="PSQL" italic="true">
				<reference name="PSQL_OUT"/>
				<help>PostgreS output (not suitable for most users) [&lt;a href=&quot;https://models.slf.ch/docserver/meteoio/html/psqlio.html&quot;&gt;more…&lt;/a&gt;]</help>
			</option>
			<option value="SMET" bold="true">
				<reference name="SMET_OUT"/>
				<help>SMET data files [&lt;a href=&quot;https://models.slf.ch/docserver/meteoio/html/smetio.html&quot;&gt;more…&lt;/a&gt;]</help>
			</option>
			<option value="SNOWPACK">
				<parameter key="METEOPATH" type="path" optional="false">
					<help>Path to the SNOWPACK files; this path MUST exist, it won't be created</help>
				</parameter>
				<help>Original SNOWPACK meteo files [&lt;a href=&quot;https://models.slf.ch/docserver/meteoio/html/snowpack.html&quot;&gt;more…&lt;/a&gt;]</help>
			</option>
			<option value="ZRXP">
				<reference name="ZRXP"/>
				<help>Text format that can be read by the WISKI database environment [&lt;a href=&quot;https://models.slf.ch/docserver/meteoio/html/zrxpio.html&quot;&gt;more…&lt;/a&gt;]</help>
			</option>

			<help>See &lt;a href=&quot;https://models.slf.ch/docserver/meteoio/html/data_sources.html&quot;&gt;MeteoIO's help&lt;/a&gt; for more information</help>
		</parameter>
	</parametergroup>

	<!-- GEOTOP -->
	<parametergroup name="GEOTOP_OUT">
		<parameter key="METEOPATH" type="path" optional="false">
			<help>Path to the data files</help>
		</parameter>
		<parameter key="METEOPREFIX" type="text">
			<help>prefix to append when generating a file name for reading</help>
		</parameter>
		<parameter key="METEOSEQ" type="text" optional="false">
			<help>specifiy in which order the columns should be printed out</help>
		</parameter>
	</parametergroup>

	<!-- NETCDF -->
	<parametergroup name="NETCDF_OUT">
		<parameter key="METEOPATH" type="path" optional="false">
			<help>Path to the data files</help>
		</parameter>
		<parameter key="NC_SINGLE_FILE" type="alternative" default="FALSE">
			<option value="TRUE">
				<parameter key="METEOFILE" type="file" mode="output" optional="false">
					<help>Absolute filename of the metadata file</help>
				</parameter>
			</option>
			<option value="FALSE"/>
			<help>force all stations to be contained in a single file?</help>
		</parameter>
		<parameter key="NETCDF_SCHEMA" type="alternative" default="CF-1.6">
			<option value="CF-1.6"/>
			<option value="CROCUS"/>
			<option value="AMUNDSEN"/>
			<option value="ERA-INTERIM"/>
			<option value="ERA5"/>
			<option value="WRF"/>
			<help>Data schema to use (i. e. mostly variables and dimensions naming)</help>
		</parameter>
		<parameter key="NC_STRICT_SCHEMA" type="alternative" default="FALSE">
			<option value="TRUE"/>
			<option value="FALSE"/>
			<help>only write out parameters that are specifically described in the chosen schema?</help>
		</parameter>
		<parameter key="NC_LAX_SCHEMA" type="alternative" default="FALSE">
			<option value="TRUE"/>
			<option value="FALSE"/>
			<help>write out all provided parameters even if no metadata can be associated with them?</help>
		</parameter>
		<parameter type="horizontal" label="">
			<o><parameter key="ZREF" type="number" size="small"/></o>
			<o><parameter key="UREF" type="number" size="small"/></o>
			<help>For some applications, some extra information (meteorological measurements reference height ZREF, wind measurements reference height UREF) must be provided for meteorological time series (for example, for Crocus)</help>
		</parameter>
		<parameter type="horizontal" label="">
			<o><parameter key="DEFAULT_SLOPE" type="number" size="small"/></o>
			<o><parameter key="DEFAULT_AZI" type="number" size="small"/></o>
			<help>For some applications, some extra information (default slope and azimuth) must be provided for meteorological time series (for example, for Crocus)</help>
		</parameter>
		<parameter key="ACDD_METADATA" label="Provide ACDD metadata" type="alternative" default="FALSE">
			<option value="TRUE"><reference name="ACDD"/></option>
			<option value="FALSE"/>
			<help>fill ACDD metadata fields</help>
		</parameter>
		<parameter key="NC_KEEP_FILES_OPEN" type="alternative">
			<option value="TRUE"/>
			<option value="FALSE"/>
			<help>keep files open for efficient access? Beware, simulateous writing to a file in the case of parallelized processing could lead to data corruption (default: false)</help>
		</parameter>
	</parametergroup>

	<!-- PSQL -->
	<parametergroup name="PSQL_OUT">
		<parameter key="PSQL_URL" type="text" optional="false">
			<help>Database URL</help>
		</parameter>
		<parameter key="PSQL_PORT" type="text" validate="[0-9]+" size="small">
			<help>Database port to use for connection</help>
		</parameter>
		<parameter key="PSQL_DB" type="text" optional="false">
			<help>Database name</help>
		</parameter>
		<parameter key="PSQL_USER" type="text" optional="false"/>
		<parameter key="PSQL_PASS" type="text" optional="false"/>
		<parameter key="SQL_META" type="text" optional="false">
			<help>Query to retrieve the metadata. For example, &lt;code&gt;SELECT id, station_name AS name, x_coord AS x, y_coord AS y, z AS altitude, epsg from all_stations WHERE id IN&lt;/code&gt;
			</help>
		</parameter>
	</parametergroup>

	<!-- SMET output -->
	<parametergroup name="SMET_OUT">
		<parameter key="METEOPATH" type="path" optional="false">
			<help>Directory to save your SMET data output files in</help>
		</parameter>
		<parameter key="METEOPARAM" type="alternative">
			<option value="ASCII"/>
			<option value="BINARY"/>
			<help>Either write an ascii file (default) or a binary one</help>
		</parameter>
		<parameter key="SMET_PLOT_HEADERS" type="alternative">
			<option value="TRUE"/>
			<option value="FALSE"/>
			<help>should the plotting headers (to help make more meaningful plots) be included in the outputs? (default: true)</help>
		</parameter>
		<parameter key="SMET_RANDOM_COLORS" type="alternative">
			<option value="TRUE"/>
			<option value="FALSE"/>
			<help>for variables where no predefined colors are available, either specify grey or random colors (default: false)</help>
		</parameter>
		<parameter key="SMET_DEFAULT_PREC" type="number" format="integer+" notoggle="true" size="small">
			<help>default number of decimals for parameters that don't already define it (default: 3)</help>
		</parameter>
		<parameter key="SMET_DEFAULT_WIDTH" type="number" format="integer+" notoggle="true" size="small">
			<help>default number of characters for parameters that don't already define it (default: 8)</help>
		</parameter>
		<parameter key="SMET_APPEND" type="alternative">
			<option value="TRUE"/>
			<option value="FALSE"/>
			<help>when an output file already exists, should the plugin try to append data? (default: false)</help>
		</parameter>
		<parameter key="SMET_OVERWRITE" type="alternative">
			<option value="TRUE"/>
			<option value="FALSE"/>
			<help>when an output file already exists, should the plugin overwrite it? (default: true)</help>
		</parameter>
		<parameter key="ACDD_WRITE" label="Write ACDD metadata" type="alternative">
			<option value="TRUE"><reference name="ACDD"/></option>
			<option value="FALSE"/>
			<help>Should ACDD metadata be written in the header? (default: false)</help>
		</parameter>
		<frame caption="CSV compatibility">
			<parameter type="helptext" wrap="true">
				<help>The options below make it easy to import smet files into various softwares that expect very basic CSV syntax but at the cost of making the smet files &lt;font color="#ff0000"&gt;&lt;strong&gt;non-conformant&lt;/strong&gt;&lt;/font&gt;</help>
			</parameter>
			<parameter key="SMET_SEPARATOR" type="text" validate="." size="small">
				<help>Set a different column delimiter, the posix expression &lt;i&gt;[:space:]&lt;/i&gt; represents any combination of white spaces (default: white spaces)</help>
			</parameter>
			<parameter key="SMET_COMMENTED_HEADERS" type="alternative">
				<option value="TRUE"/>
				<option value="FALSE"/>
				<help>Prefix all header lines with a '#' character? (default: false)</help>
			</parameter>
		</frame>
	</parametergroup>

	<!-- ZRXP -->
	<parametergroup name="ZRXP">
		<parameter key="ZRXP_FILE_EXTENSION" label="File extension:" type="text" default="zrxp" size="small"/>
		<parameter type="horizontal" key="ZRXP_" label="">
			<o><parameter key="@SEPARATOR" label="Header separator:" type="text" default="|" validate="." size="small"/></o>
			<o><parameter key="ZRXP_RINVAL" label="RINVAL:" type="number" default="-999"/></o>
			<help>The file extension for ZRXP files, the delimiter used to separate the header fields, and the value given to WISKI to interpret as missing data (default: MeteoIO's nodata, usually -999)</help>
		</parameter>
		<parameter key="ZRXP_WRITE_UNITS" label="Write out units:" type="Alternative" default="KEYWORD">
			<o value="KEYWORD"><help>Units respected by the WISKI import</help></o>
			<o value="COMMENT"><h>Units transported as comment, not used in WISKI import</h></o>
			<o value="OFF"><h>Do not write out units</h></o>
			<help>Controls whether MeteoIO's stored units for the parameters are written out</help>
		</parameter>
		<parameter key="ZRXP_CONVERT_LATIN" type="checkbox" caption="Use local character encoding" default="FALSE">
			<help>Encode non-ASCII characters on the operating system running the program</help>
		</parameter>
		<parameter key="ZRXP_WRITE_CNR" type="checkbox" caption="Write internal paramater indices" default="TRUE">
			<help>Outputs MeteoIO's internal parameter index</help>
		</parameter>
		<parameter key="ZRXP_NODATA_PARAMS" type="checkbox" caption="Output parameters processed to nodata" default="TRUE">
			<help>Parameters that are nodata throughout will be output if at least one nodata is the result of processing</help>
		</parameter>
		<parameter key="ZRXP_REMARK" label="Enter remark:" type="text" default="" size="large">
			<help>A remark that is passed through to each output line</help>
		</parameter>
		<parameter type="helptext" wrap="true">
			<help>The following are &lt;font color=&quot;#000000&quot;&gt;&lt;u&gt;status values&lt;/u&gt;&lt;/font&gt; that are set depending on how the meteo value was processed:&lt;ul&gt;
				&lt;li&gt;Status to give for data that was checked and left unaltered&lt;/li&gt;
				&lt;li&gt;Status for temporally interpolated data&lt;/li&gt;
				&lt;li&gt;Status for filtered (changed) data&lt;/li&gt;
				&lt;li&gt;Status for data originating from a MeteoIO generator&lt;/li&gt;
				&lt;li&gt;Status for nodata values (default: disabled, has priority over all others)&lt;/li&gt;
				&lt;li&gt;Status for when nodata is already present in the input file and left untouched&lt;/li&gt;
				&lt;/ul&gt;</help>
		</parameter>
		<parameter type="horizontal" key="ZRXP_STATUS_" label="">
			<o><parameter key="@UNALTERED" label="Unaltered:" type="number" format="integer" default="41" notoggle="true"/></o>
			<o><parameter key="@RESAMPLED" label="Resampled:" type="number" format="integer" default="42" notoggle="true"/></o>
			<o><parameter key="@FILTERED" label="Filtered:" type="number" format="integer" default="43" notoggle="true"/></o>
		</parameter>
		<parameter type="horizontal" key="ZRXP_STATUS_" label="">
			<o><parameter key="@GENERATED" label="Generated:" type="number" format="integer" default="44" notoggle="true"/></o>
			<o><parameter key="@NODATA" label="Nodata:" type="number" format="integer" notoggle="true"/></o>
			<o><parameter key="@UNALTERED_NODATA" label="Unaltered n/a:" type="number" format="integer" default="255" notoggle="true"/></o>
		</parameter>
	</parametergroup>
	
	<!-- ACDD input keys for plugins supporting acdd metadata -->
	<parametergroup name="ACDD">
		<parameter key="ACDD_CREATOR" type="text" size="small"><help> the name of the creator of the data set</help></parameter>
		<parameter key="ACDD_EMAIL" type="text" size="medium" validate="^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$"><help> the email of the creator</help></parameter>
		<parameter key="ACDD_KEYWORDS" type="text" size="large"><help>a list of AGU Index Terms</help></parameter>
		<parameter key="ACDD_TITLE" type="text" size="large"><help>a short title for the data set</help></parameter>
		<parameter key="ACDD_INSTITUTION" type="text" size="medium"><help>the institution providing the data set</help></parameter>
		<parameter key="ACDD_PROJECT" type="text" size="small"><help>the scientific project that created the data</help></parameter>
		<parameter key="ACDD_PROGRAM" type="text" size="small"><help>the overarching program(s) of which the dataset is a part;</help></parameter>
		<parameter key="ACDD_ID" type="text" size="small"><help>an identifier for the data set, provided by and unique within its naming authority. Example: DOI, URL, text string, but without white spaces</help></parameter>
		<parameter key="ACDD_NAMING_AUTHORITY" type="text" size="medium"><help>the organization that provides the initial id for the dataset</help></parameter>
		<parameter key="ACDD_PROCESSING_LEVEL" type="text" size="small"><help>a textual description of the processing level</help></parameter>
		<parameter key="ACDD_SUMMARY" type="text" size="large"><help>a paragraph describing the dataset</help></parameter>
		<parameter key="ACDD_SUMMARY_FILE" type="file"  mode="input"><help>a file containing a description of the dataset, it overwrites the value of ACDD_SUMMARY if present</help></parameter>
		<parameter key="ACDD_COMMENT" type="text" size="large"><help>miscellaneous informartion about the dataset</help></parameter>
		<parameter key="ACDD_ACKNOWLEDGEMENT" type="text" size="large"><help>acknowledgement for the various types of support for the project that produced this data</help></parameter>
		<parameter key="ACDD_METADATA_LINK" type="text" size="medium" validate="^(http|https|ftp)://.+"><help>A URL/DOI that gives more complete metadata</help></parameter>
		<parameter key="ACDD_LICENSE" type="text" size="large"><help>describes the license applicable to the dataset</help></parameter>
		<parameter key="ACDD_PRODUCT_VERSION" type="text" size="small"><help>version identifier of the data file or product as assigned by the data creator</help></parameter>
	</parametergroup>

</inishell_include>
