MeteoIODoc 2.11.0
mio::SnowlineAlgorithm Class Reference

Detailed Description

Assimilation of snowline elevation information into snow maps.

This algorithm applies a base interpolation method and reads in snowline elevation information to be able to
a) set snow heights below the snowline elevation to zero
b) check the lapse rate of the base algorithm, and if this is "reversed" inject one derived from the snowline elevation.

A problem that may turn up for practitioners when creating snow maps is that a station higher up is more eposed to wind, or may measure less snow than a station further down in the valley for any other reason. Then, if applying an algorithm that computes a lapse rate, snow is transported downwards resulting in maps that show little snow on the mountain tops and a lot of snow in the valleys.

To combat this, external knowledge is required. In case of this SNOWLINE algorithm the user provides a text file containing information about the (estimated) snowline elevation, i. e. the elevation above which there is snow. This can for example come from satellite images, webcams, or manual observations. If it is deemed unphysical in the calculated domain to have less snow further up, then the trend can be forced to be the other way around.

The algorithm takes the following parameters:

  • BASE: Name of the base interpolation algorithm. Can be any 2d interpolation available. Of course, injecting a new rate only works if the base algorithm uses a lapse rate (default: IDW_LAPSE).
  • SNOWLINEFILE: Text file containing the snowline elevation(s), potentially split up into multiple slope aspects (see below).
  • SNOWLINE: The snowline elevation can be supplied in the ini file directly which is most useful for standalone experiments and testing (single aspect only).
  • ENFORCE_POSITIVE_RATE: If the trend is "reversed" as explained above, calculate it from the snowline elevation and the highest available station (default: false).
  • CALC_BASE_RATE: Use a lapse rate deduced from the snowline in any case, i. e. not only when it is "reversed" in the data (default: false).
  • FALLBACK_RATE: If the trend is reversed but no snowline information is available, use this lapse rate.
  • METHOD: Decide how to cut off snow below the snowline elevation. Can be CUTOFF (hard cut to zero below snowline, default), BANDS (simple linear gradient from zero to the measured data), or FORMULA (evaluate all pixels according to a custom formula).
  • BAND_NO: For BANDS smoothing, use this many steps to go from zero snow to measured snow (default: 10).
  • BAND_HEIGHT: For BANDS smoothing, use bands of this height (default: 10 m).
  • FORMULA: Expression for FORMULA smoothing. The same mathematics as in FilterMaths are available. In addition, you can use the following substitutions: snowline (the snowline elevation), altitude (the pixel's altitude) and param (the original value as calculated by the base algorithm).
  • VERBOSE: Print some info messages (default: true)?
  • SET: Below the snow line, do not set snow to 0 but to this value.

In addition, you can set the base algorithm's parameters as usual.

The minimal settings to control the default IDW_LAPSE interpolation by setting HS to zero below the snowline elevation are the following:

HS::ALGORITHMS = SNOWLINE
HS::SNOWLINE::SNOWLINEFILE = /home/snow/sat/snowlines.txt

To calculate the lapse rate from the snowline and inject it in an IDW_SLOPES interpolation if necessary (using a fixed rate if the snowline is n/a) use the following setup:

HS::ALGORITHMS = SNOWLINE
HS::SNOWLINE::BASE = IDW_SLOPES
HS::SNOWLINE::METHOD = BANDS
HS::SNOWLINE::SNOWLINEFILE = /home/snow/sat/snowlines.txt
HS::SNOWLINE::ENFORCE_POSITIVE_RATE = TRUE
HS::SNOWLINE::FALLBACK_RATE = 0.0005

The format specification of the text file containing snowline elevations per slope aspect is as follows: aspect_#,beg_azimuth end_azimuth snowline with one line per slope aspect. For example:

#Format: aspect_#,beg_azimuth end_azimuth snowline
#Snowline in meters, azimuth in degrees.
aspect_1,45 135 2200
aspect_2,135 225 2400
aspect_3,225 315 2200
aspect_4,315 45 2100

Set elevations to the nodata value (usually -999) to mark them as unknown.

A minimal file for a single slope aspect (complete circle from 0 to 360/0 degrees) might look like this for a snowline elevation of 2500 m:

aspect_1,0 0 2500
Author
Michael Reisecker
Date
2020-09

#include <SnowlineAlgorithm.h>

Public Member Functions

 SnowlineAlgorithm (const std::vector< std::pair< std::string, std::string > > &vecArgs, const std::string &i_algo, const std::string &i_param, TimeSeriesManager &i_tsm, GridsManager &i_gdm, Meteo2DInterpolator &i_mi)
 
virtual double getQualityRating (const Date &i_date)
 
virtual void calculate (const DEMObject &dem, Grid2DObject &grid)
 
- Public Member Functions inherited from mio::InterpolationAlgorithm
 InterpolationAlgorithm (const std::vector< std::pair< std::string, std::string > > &, const std::string &i_algo, const std::string &i_param, TimeSeriesManager &i_tsm)
 
virtual ~InterpolationAlgorithm ()
 
virtual double getQualityRating (const Date &i_date)=0
 
virtual void calculate (const DEMObject &dem, Grid2DObject &grid)=0
 
std::string getInfo () const
 Return an information string about the interpolation process. More...
 

Additional Inherited Members

- Public Attributes inherited from mio::InterpolationAlgorithm
const std::string algo
 
- Protected Member Functions inherited from mio::InterpolationAlgorithm
std::vector< double > getData (const Date &i_date, const std::string &i_param)
 
size_t getData (const Date &i_date, const std::string &i_param, std::vector< double > &o_vecData, std::vector< StationData > &o_vecMeta)
 
- Protected Attributes inherited from mio::InterpolationAlgorithm
TimeSeriesManagertsmanager
 
Date date
 
std::vector< MeteoDatavecMeteo
 
std::vector< double > vecData
 store the measurement for the given parameter More...
 
std::vector< StationDatavecMeta
 store the station data for the given parameter More...
 
std::ostringstream info
 to store some extra information about the interplation process More...
 
const std::string param
 the parameter that we will interpolate More...
 
size_t nrOfMeasurments
 Number of stations that have been used, so this can be reported to the user. More...
 

Constructor & Destructor Documentation

◆ SnowlineAlgorithm()

mio::SnowlineAlgorithm::SnowlineAlgorithm ( const std::vector< std::pair< std::string, std::string > > &  vecArgs,
const std::string &  i_algo,
const std::string &  i_param,
TimeSeriesManager i_tsm,
GridsManager i_gdm,
Meteo2DInterpolator i_mi 
)

Member Function Documentation

◆ calculate()

void mio::SnowlineAlgorithm::calculate ( const DEMObject dem,
Grid2DObject grid 
)
virtual

◆ getQualityRating()

double mio::SnowlineAlgorithm::getQualityRating ( const Date i_date)
virtual

The documentation for this class was generated from the following files: