The menu Data Preparation ‣ Data Operation   allows to compute a derived variable from one or more variables using a formula from the simplest to the most complex.




  1. Select the temporal resolution of the input data. The available temporal resolution are: minutes, hourly, daily, pentad, dekadal, monthly data and others (seasonal, annual, …).

  2. In case of minutes and hourly, select here the time step of the input data.

  3. Select the input data format. Available data formats are: CDT stations data format, CDT dataset format (gridded) and NetCDF gridded data.

  4. If the input data is a CDT station data format, select from the drop-down list the file containing the station data if it is already loaded, or open it from the browse button on the right. If the input data is a CDT dataset format (gridded), type the full path to the index file of the CDT dataset or browse it. In case of NetCDF gridded data, type the full path to the folder containing the netCDF files or browse it.

  5. In case of NetCDF gridded data, click on the button   Settings   to provide a sample and change the filename format of the netCDF. See Setting NetCDF data for more details.

  6. Click on the button   Remove   to remove an unwanted an input variable or dataset.

  7. Click on the button   Add Data/Variables  . Each input data is assigned to a variable X<variable_number>. <variable number> will be incremented each time a new dataset is added.

  8. Edit here the formula to compute the derived variable. The formula must not contain a matrix multiplication and the current date does not depend on the past or future dates. If you need more than one line of command to compute the derived variable, you have to put all the commands inside a curly brackets {} and separated by semicolons.

    Examples of formula
    The line starting with # is a comment

    • To convert the air temperature from degree Kelvin into Celsius, use the following formula

      ## X1 is the variable representing the air temperature data in degree Kelvin
      
      X1 - 273.15
    • To compute the average temperature from the minimum and maximum temperature, the formula would be like this

      ## X1 is the variable representing the minimum temperature data
      ## X2 is the variable representing the maximum temperature data
      
      (X1 + X2)/2
    • To compute the dew point from the air temperature and relative humidity, you can use the following commands

      ## X1 is the variable representing the air temperature data in degree Celsius
      ## X2 is the variable representing the relative humidity data in percentage
      
      {
        es = 6.112 * exp((17.67 * X1)/(X1 + 243.5));
        ea = es * (X2/100);
        td = (log(ea/6.112) * 243.5)/(17.67 - log(ea/6.112));
        td
      }

      A screenshots of the dialog box using those formulas are shown below.

  9. This button is enabled when the format of the data is CDT dataset format (gridded) and NetCDF gridded data. It opens a dialog box allowing to specify the information of the derived variable to create the netCDF data.




  1. If the input data is a CDT station data format, type the name of the file to save the result or the full path to the file or browse it from the button on the right. For CDT dataset format (gridded) and NetCDF gridded data, type the full path to the folder to save the output or browse with the button .

Click on the button to compute the derived variable.

In case of CDT dataset format (gridded) and NetCDF gridded data, a folder named dataOperation_Output is created under the folder you provided in (10).

Example converting variable units

The screenshots below show the conversion of daily air temperature netCDF data from Kelvin into Celsius

Here X1 is the variable for the air temperature




The netCDF files settings dialog box is as follow




The netCDF variable information dialog box is as follow




Example computing average temperature

The screenshots below show the computation of daily average temperature from daily minimum and maximum temperature for a netCDF dataset.

X1 is the variable for the daily minimum temperature and X2 for daily maximum temperature




The netCDF variable information dialog box is as follow




Example computing dew point

The screenshots below show the computation of daily dew point from daily mean temperature and daily mean relative humidity for a netCDF dataset.

X1 is the variable for the daily mean temperature in degree Celsius and X2 for daily mean relative humidity in percentage

You can write the formula in the same line

{es = 6.112 * exp((17.67 * X1)/(X1 + 243.5)); ea = es * (X2/100); td = (log(ea/6.112) * 243.5)/(17.67 - log(ea/6.112)); td}



The netCDF variable information dialog box is as follow