<commit_before>/**
 * @file hitool.h
 *
 * @date Sep 3, 2013
 * @author partio
 *
 * @brief Contains smarttool functions converted to himan
 */

#ifndef HITOOL_H
#define HITOOL_H

#include "auxiliary_plugin.h"
#include "himan_common.h"
#include "plugin_configuration.h"
#include "modifier.h"

namespace himan
{
namespace plugin
{

typedef std::pair<std::shared_ptr<info>, std::shared_ptr<info>> valueheight;

class hitool : public auxiliary_plugin
{
public:

    hitool();
	hitool(std::shared_ptr<plugin_configuration> conf);

    virtual ~hitool() {};

    virtual std::string ClassName() const
    {
        return "himan::plugin::hitool";
    }

    virtual HPPluginClass PluginClass() const
    {
        return kAuxiliary;
    }

    virtual HPVersionNumber Version() const
    {
        return HPVersionNumber(0, 1);
    }

	/**
	 * @brief Find maximum value of a given parameter in a given height range
	 */

	std::shared_ptr<info> VerticalMaximum(const param& wantedParam, const std::shared_ptr<info> firstLevelValueInfo, const std::shared_ptr<info> lastLevelValueInfo) const;

	/**
	 * @brief Find minimum value of a given parameter in a given height range
	 */

	std::shared_ptr<info> VerticalMinimum(const param& wantedParam, const std::shared_ptr<info> firstLevelValueInfo, const std::shared_ptr<info> lastLevelValueInfo) const;
	std::shared_ptr<info> VerticalAverage(const param& wantedParam, const std::shared_ptr<info> firstLevelValueInfo, const std::shared_ptr<info> lastLevelValueInfo) const;
	std::shared_ptr<info> VerticalHeight(const param& wantedParam, const std::shared_ptr<info> firstLevelValueInfo, const std::shared_ptr<info> lastLevelValueInfo, const std::shared_ptr<info> findValueInfo , size_t findNth = 1) const;

	/**
	 * @brief Find value of parameter from given height
	 *
	 * Only for hybrid levels.
	 * 
	 */
	
	std::shared_ptr<info> VerticalValue(const param& wantedParam, const std::shared_ptr<info> findValueInfo) const;

	/**
	 * @brief Find the number of occurrences of a given parameter value in a given height range
	 *
	 * Only for hybrid levels.
	 */

	std::shared_ptr<info> VerticalCount(const param& wantedParam, const std::shared_ptr<info> firstLevelValueInfo, const std::shared_ptr<info> lastLevelValueInfo, const std::shared_ptr<info> findValueInfo) const;

	std::shared_ptr<info> Stratus();
	std::shared_ptr<info> FreezingArea();

	void Time(const forecast_time& theTime);
	void Configuration(const std::shared_ptr<const plugin_configuration> conf);

private:
	std::shared_ptr<modifier> CreateModifier(HPModifierType modifierType) const;

	std::shared_ptr<info> VerticalExtremeValue(std::shared_ptr<modifier> mod,
							HPLevelType wantedLevelType,
							const param& sourceParam,
							const param& targetParam,
							const std::shared_ptr<info> firstLevelValueInfo = std::shared_ptr<info> (),
							const std::shared_ptr<info> lastLevelValueInfo = std::shared_ptr<info> (),
							const std::shared_ptr<info> findValueInfo = std::shared_ptr<info> ()) const;

	valueheight GetData(const level& wantedLevel, const param& wantedParam, const forecast_time& wantedTime) const;

	std::shared_ptr<const plugin_configuration> itsConfiguration;
	forecast_time itsTime;
	
};

#ifndef HIMAN_AUXILIARY_INCLUDE

// the class factory

extern "C" std::shared_ptr<himan_plugin> create()
{
    return std::shared_ptr<hitool> (new hitool());<commit_msg>using new modifier<commit_after>/**
 * @file hitool.h
 *
 * @date Sep 3, 2013
 * @author partio
 *
 * @brief Contains smarttool functions converted to himan
 */

#ifndef HITOOL_H
#define HITOOL_H

#include "auxiliary_plugin.h"
#include "himan_common.h"
#include "plugin_configuration.h"
#include "modifier.h"

namespace himan
{
namespace plugin
{

typedef std::pair<std::shared_ptr<info>, std::shared_ptr<info>> valueheight;

class hitool : public auxiliary_plugin
{
public:

    hitool();
	hitool(std::shared_ptr<plugin_configuration> conf);

    virtual ~hitool() {};

    virtual std::string ClassName() const
    {
        return "himan::plugin::hitool";
    }

    virtual HPPluginClass PluginClass() const
    {
        return kAuxiliary;
    }

    virtual HPVersionNumber Version() const
    {
        return HPVersionNumber(0, 1);
    }

	/**
	 * @brief Find maximum value of a given parameter in a given height range
	 */

	std::vector<double> VerticalMaximum(const param& wantedParam, const std::vector<double>& firstLevelValueInfo, const std::vector<double>& lastLevelValueInfo) const;

	/**
	 * @brief Find minimum value of a given parameter in a given height range
	 */

	std::vector<double> VerticalMinimum(const param& wantedParam, const std::vector<double>& firstLevelValueInfo, const std::vector<double>& lastLevelValueInfo) const;
	std::vector<double> VerticalAverage(const param& wantedParam, const std::vector<double>& firstLevelValueInfo, const std::vector<double>& lastLevelValueInfo) const;
	std::vector<double> VerticalHeight(const param& wantedParam, const std::vector<double>& firstLevelValueInfo, const std::vector<double>& lastLevelValueInfo, const std::vector<double>& findValueInfo , size_t findNth = 1) const;

	/**
	 * @brief Find value of parameter from given height
	 *
	 * Only for hybrid levels.
	 * 
	 */
	
	std::vector<double> VerticalValue(const param& wantedParam, const std::vector<double>& findValueInfo) const;

	/**
	 * @brief Find the number of occurrences of a given parameter value in a given height range
	 *
	 * Only for hybrid levels.
	 */

	std::vector<double> VerticalCount(const param& wantedParam, const std::vector<double>& firstLevelValueInfo, const std::vector<double>& lastLevelValueInfo, const std::vector<double>& findValueInfo) const;

	std::shared_ptr<info> Stratus();
	std::shared_ptr<info> FreezingArea();

	void Time(const forecast_time& theTime);
	void Configuration(const std::shared_ptr<const plugin_configuration> conf);

private:
	std::shared_ptr<modifier> CreateModifier(HPModifierType modifierType) const;

	std::vector<double> VerticalExtremeValue(std::shared_ptr<modifier> mod,
							HPLevelType wantedLevelType,
							const param& sourceParam,
							const param& targetParam,
							const std::vector<double>& firstLevelValueInfo = std::vector<double>(),
							const std::vector<double>& lastLevelValueInfo = std::vector<double>(),
							const std::vector<double>& findValueInfo = std::vector<double>()) const;

	valueheight GetData(const level& wantedLevel, const param& wantedParam, const forecast_time& wantedTime) const;

	std::shared_ptr<const plugin_configuration> itsConfiguration;
	forecast_time itsTime;
	
};

#ifndef HIMAN_AUXILIARY_INCLUDE

// the class factory

extern "C" std::shared_ptr<himan_plugin> create()
{
    return std::shared_ptr<hitool> (new hitool());
{'fraction_non_alphanumeric': 0.11232957913455839, 'fraction_numerical': 0.0023710729104919974, 'mean_word_length': 5.391098484848484, 'pattern_counts': {'":': 0, '<': 79, '<?xml version=': 0, '>': 79, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2950581', 'n_tokens_mistral': 2183, 'n_tokens_neox': 1987, 'n_words': 533}