ClimPACT2
3. Using the Graphical User Interface
3.1 Starting the ClimPACT2 GUI
If you are using Windows, select the ‘R’ icon that was created during the installation of R (either on your Desktop or in the Start menu). Once in R, from the drop down menu click “File -> Change dir…” and choose the climpact2-master directory created when you downloaded ClimPACT2 (see Section 2 if you have not done this). Then, within the R console “>”, type source(“climpact2.GUI.r”).
In Linux or MacOS, open a terminal window, navigate to the directory where you have downloaded the ClimPACT2 software (see Section 2 if you have not done this). Enter R (by typing R at the terminal prompt) and type source(“climpact2.GUI.r”).
The first time climpact2.GUI.r is called, required R packages will be downloaded and installed. This may take a couple of minutes but will only occur once. During this process you may be asked to select the geographical location of the closest 'mirror' to download these packages from (see figure above). You may select any location, though the closest location will offer the fastest download speed.
3.2 Using the ClimPACT2 GUI
Once climpact2.GUI.r has installed the required packages, the ClimPACT2 GUI will open. The user will be presented with the ClimPACT2 home screen shown above. Here, two main options are presented, “STEP. 1” and “STEP. 2”, indicating the order in which the user should proceed to calculate the ClimPACT2 indices. The green highlighting of “STEP. 1” indicates which step the user currently needs to complete and thus which option they should select.
Selecting “STEP. 1” presents a prompt where the user can choose an ASCII file containing their climate data (refer to Appendix B for the required format of this file). The filename should be of the form “stationname.txt”. In this guide the sample file sydney_observatory_hill_1936-2015.txt will be used and the user is encouraged to use this sample file as a template for their own data. Once this file is selected a progress bar may briefly appear indicating progress in scanning for comma delimiters and replacing any with white space, checking that years are in the correct order, and substituting missing values of -99.9 with NA (the R nomenclature for a missing value). If any errors occur in reading the chosen file ClimPACT2 will display the error message and the user must check their file for the correct formatting.
3.3 Load and check data
Once the chosen climate data file has been successfully read by ClimPACT2 the above window will appear, displaying the chosen file across the top (in this case sydney_observatory_hill_1936-2015.txt) and a series of input text boxes and buttons below. In this window metadata for the chosen ASCII file is input for the calculation of the indices. Selecting the ‘?’ icon at the top of the screen will provide a summary of each input on this screen.
The first input text box allows the user to customise the station name of the data (the default being the filename). This should be informative and will be used to name files and directories produced by ClimPACT2 (these include output index .csv files, plots and diagnostic files).
Below this the user must specify the latitude and longitude of the station. This is required for some indices to approximate radiation balance for the site (latitude only). The valid latitude range is -90 to +90 and the valid longitude range is -180 to +180.
The base period input text boxes refer to the years that the user wishes percentile thresholds to be calculated over, this only effects percentile-based indices. For example, in a record from 1950 to 2010, the user may wish percentile thresholds to be calculated over the years 1961 to 1990. For a brief explanation of climate indices refer to Appendix F (Wait, what is a climate index?).
After the above text boxes have been entered, select ‘PROCESS AND QUALITY CONTROL’. This step takes approximately a minute and a progress bar will appear. This step is mandatory to proceed to 'STEP. 2' of the ClimPACT2 process. During this step ClimPACT2 may stop if it detects errors in the data or the user’s preferences. Specifically, ClimPACT2 will stop if the latitude and longitude values are not valid or if the base period years are not valid or compatible with the data. Upon completion, a message stating “QUALITY CONTROL COMPLETE” will be displayed (see figure below), along with a message asking the user to evaluate the quality control diagnostic files produced in the /qc subdirectory (this is located in the same directory as the station data file that the user selects, in this case sample_data/). The user should refer to Appendix C for guidance on interpreting the contents of the /qc directory. It is critical that the quality of the input data is verified before calculation of the ClimPACT2 indices.
By selecting 'Done' the user will be returned to the ClimPACT2 home screen.
3.4 Calculating the indices
After STEP. 1 has been completed successfully, the “STEP. 2” button on the ClimPACT2 home screen will be highlighted green to indicate that the user is now able to calculate the indices, as shown below. Select the “CALCULATE INDICES” button.
3.5 Parameter values for index calculations
The below screen will appear allowing the user to set parameters relevant to several of the ClimPACT2 indices.
The “User defined WSDIn Days” sets the number of days which need to occur consecutively with a TX > 90th percentile to be counted in the WSDIn index.
The “User defined CSDIn Days” sets the number of days which need to occur consecutively with a TN < 10th percentile to be counted in the CSDIn index.
The “User defined RxnDay Days” sets the monthly maximum consecutive n-day precipitation to be recorded by the Rxnday index.
The “User defined n for nTXnTN and nTXbnTNb” sets the number of consecutive days required for the nTXnTN and nTXbnTNb indices.
The “User defined base temperature” for HDDheat, CDDcold and GDDgrow set the temperature to be used in the subtraction in these indices.
The “Count the number of days where precipitation >= nn (Rnnmm)” allows the user to calculate an index where the number of days with precipitation greater than or equal to a set amount is counted. This index will be called ‘rnnmm’, where ‘nn’ is the precipitation set by the user.
Lastly, under "Custom day count index" the user has the option to create their own index based on the number of days crossing a specified threshold for daily maximum temperature (TX), minimum temperature (TN), diurnal temperature range (DTR) or precipitation (PR). To calculate a custom index, the user must select one of these variables, an operator (<,<=,>,>=) and a constant. For example, selecting TX, the ‘>=’ operator and specifying ‘40’ as a constant will produce an index that counts the number of days where TX is greater than or equal to 40°C. ClimPACT2 output will refer to the index as TXge40. Operators are abbreviated in text with lt, le, gt and ge for <, <=, > and >=, respectively.
Once this step is completed, click “OK”. A progress bar will appear to indicate the time remaining. This should take less than a minute. A pop-up window will appear once the indices are computed indicating where output may be found.
3.6 Examining ClimPACT2 output
ClimPACT2 produces two sub-directories where the results of each index are stored. These sub-direcotires are in the folder where your input station file exists (in this example sample_data/). These directories are /plots and /indices. For each index one JPEG file (.jpg) containing a plot of the index and one comma-separated value (.csv) file containing the index values are created and put into the the plots/ and indices/ subdirectories, respectively. The .csv files can be opened in Microsoft Excel, Open Office Calc or a text editor. The index files have names “sydney_observatory_hill_1936-2015_XXX_YYY.csv” where XXX represents the name of the index (see Appendix A) and YYY is either ANN or MON depending on whether the index has been calculated annually or monthly, respectively. A sample .csv file for su is shown below. There is one value for each year the index is calculated. For indices calculated monthly there will be one value per month. A column containing normalised values is also written for most indices (these values are normalised using ALL available years/months).
An example of a plot for the index su is shown below. These files may be opened in any standard image viewing software. The plot of each index is shown with a locally weighted linear regression (red dashed line) to give an indication of longer-term variations. Statistics of the linear trend (solid black line) fitting are displayed at the bottom of the plot. In addition, one .pdf file ending in *_all_plots.pdf (climpact2.sampledata.1d.time-series_all_plots.pdf in our example), is produced in the subdirectory plots/. This file contains all plots in each .jpg file.
See Appendix A for definitions of each ClimPACT2 index.
Resulting trends for all indices are stored in the trend/ subdirectory in a single .csv file. There is one file for all indices with the name, in our example, “climpact2.sampledata.1d.time-series_trend.csv”. Columns represent latitude, longitude, start year for trend calculation, end year for trend calculation, trend per year, standard error on trend calculation and the significance of the trend (< 0.05 indicates significance at the 5% level).