<commit_before>/*
 * himan_common.h
 *
 *  Created on: Nov 17, 2012
 *	  Author: partio
 */

#ifndef HIMAN_COMMON_H
#define HIMAN_COMMON_H

/**
 * @file himan_common.h
 *
 * Definitions common to all classes. Mostly enums.
 *
 */

// Work around "passing 'T' chooses 'int' over 'unsigned int'" warnings when T
// is an enum type:

#if !defined __clang__ && defined __GNUC__ && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) && ! __CUDACC__
#pragma GCC diagnostic ignored "-Wsign-promo"
#endif

#include <ostream>
#include <memory>
#include <boost/assign/list_of.hpp>
#include <boost/unordered_map.hpp>

namespace himan
{

using boost::assign::map_list_of;

// Define some constants

const int kHPMissingInt = 999999;
const double kHPMissingValue = -999.;

// const float kFloatEpsilon = std::numeric_limits<float>::epsilon();

// Define different plugin types

enum HPPluginClass
{
	kUnknownPlugin = 0,
	kInterpreted,
	kCompiled,
	kAuxiliary
};

// Define different logging levels

enum HPDebugState
{
	kTraceMsg = 0,
	kDebugMsg,
	kInfoMsg,
	kWarningMsg,
	kErrorMsg,
	kFatalMsg
};

// Define supported file types

enum HPFileType
{
	kUnknownFile = 0,
	kGRIB1,
	kGRIB2,
	kGRIB, // when we don't know if its 1 or 2
	kQueryData,
	kNetCDF
};

const boost::unordered_map<HPFileType,const char*> HPFileTypeToString = map_list_of
		(kUnknownFile, "unknown")
		(kGRIB1, "grib edition 1")
		(kGRIB2, "grib edition 2")
		(kGRIB, "grib edition 1 or 2")
		(kQueryData, "QueryData")
		(kNetCDF, "NetCDF");

// Define supported projections
// Values equal to those in newbase

enum HPProjectionType
{
	kUnknownProjection = 0,
	kLatLonProjection = 10,
	kRotatedLatLonProjection = 11,
	kStereographicProjection = 13
};

const boost::unordered_map<HPProjectionType,const char*> HPProjectionTypeToString = map_list_of
		(kLatLonProjection, "ll")
		(kRotatedLatLonProjection, "rll")
		(kStereographicProjection, "polster");

// Define supported parameter units

enum HPParameterUnit
{
	kUnknownUnit = 0,
	kPa,
	kK,
	kC,
	kPas, // Pa/s
	kHPa,
	kPrcnt,
	kMs, // m/s
	kM, // meters
	kMm, // millimeters
	kGph, // geopotential height, m^2 / s^2
	kKgkg, // kg/kg
	kJm2, // J per square meter
	kKgm2 // kg/m^2
};

enum HPLevelType
{
	kUnknownLevel = 0,
	kGround = 1,
	kPressure = 100,
	kMeanSea = 102,
	kHeight = 105,
	kHybrid = 109,
	kGndLayer = 112,
	kDepth = 160
};

const boost::unordered_map<HPLevelType,const char*> HPLevelTypeToString = map_list_of
		(kUnknownLevel, "unknown")
		(kGround, "ground")
		(kPressure, "pressure")
		(kMeanSea, "meansea")
		(kHeight, "height")
		(kHybrid, "hybrid")
		(kGndLayer, "gndlayer")
		(kDepth, "depth")
		;

enum HPFileWriteOption
{
	kUnknownFileWriteOption = 0,
	kSingleFile,
	kMultipleFiles,
	kNeons
};

const boost::unordered_map<HPFileWriteOption,const char*> HPFileWriteOptionToString = map_list_of
		(kUnknownFileWriteOption, "unknown")
		(kSingleFile, "single file only")
		(kMultipleFiles, "multiple files")
		(kNeons, "write to neons")
		;

// Values match to newbase<commit_msg>Add top of atmosphere -level<commit_after>/*
 * himan_common.h
 *
 *  Created on: Nov 17, 2012
 *	  Author: partio
 */

#ifndef HIMAN_COMMON_H
#define HIMAN_COMMON_H

/**
 * @file himan_common.h
 *
 * Definitions common to all classes. Mostly enums.
 *
 */

// Work around "passing 'T' chooses 'int' over 'unsigned int'" warnings when T
// is an enum type:

#if !defined __clang__ && defined __GNUC__ && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) && ! __CUDACC__
#pragma GCC diagnostic ignored "-Wsign-promo"
#endif

#include <ostream>
#include <memory>
#include <boost/assign/list_of.hpp>
#include <boost/unordered_map.hpp>

namespace himan
{

using boost::assign::map_list_of;

// Define some constants

const int kHPMissingInt = 999999;
const double kHPMissingValue = -999.;

// const float kFloatEpsilon = std::numeric_limits<float>::epsilon();

// Define different plugin types

enum HPPluginClass
{
	kUnknownPlugin = 0,
	kInterpreted,
	kCompiled,
	kAuxiliary
};

// Define different logging levels

enum HPDebugState
{
	kTraceMsg = 0,
	kDebugMsg,
	kInfoMsg,
	kWarningMsg,
	kErrorMsg,
	kFatalMsg
};

// Define supported file types

enum HPFileType
{
	kUnknownFile = 0,
	kGRIB1,
	kGRIB2,
	kGRIB, // when we don't know if its 1 or 2
	kQueryData,
	kNetCDF
};

const boost::unordered_map<HPFileType,const char*> HPFileTypeToString = map_list_of
		(kUnknownFile, "unknown")
		(kGRIB1, "grib edition 1")
		(kGRIB2, "grib edition 2")
		(kGRIB, "grib edition 1 or 2")
		(kQueryData, "QueryData")
		(kNetCDF, "NetCDF");

// Define supported projections
// Values equal to those in newbase

enum HPProjectionType
{
	kUnknownProjection = 0,
	kLatLonProjection = 10,
	kRotatedLatLonProjection = 11,
	kStereographicProjection = 13
};

const boost::unordered_map<HPProjectionType,const char*> HPProjectionTypeToString = map_list_of
		(kLatLonProjection, "ll")
		(kRotatedLatLonProjection, "rll")
		(kStereographicProjection, "polster");

// Define supported parameter units

enum HPParameterUnit
{
	kUnknownUnit = 0,
	kPa,
	kK,
	kC,
	kPas, // Pa/s
	kHPa,
	kPrcnt,
	kMs, // m/s
	kM, // meters
	kMm, // millimeters
	kGph, // geopotential height, m^2 / s^2
	kKgkg, // kg/kg
	kJm2, // J per square meter
	kKgm2 // kg/m^2
};

enum HPLevelType
{
	kUnknownLevel = 0,
	kGround = 1,
	kTopOfAtmosphere = 8,
	kPressure = 100,
	kMeanSea = 102,
	kHeight = 105,
	kHybrid = 109,
	kGndLayer = 112,
	kDepth = 160
};

const boost::unordered_map<HPLevelType,const char*> HPLevelTypeToString = map_list_of
		(kUnknownLevel, "unknown")
		(kGround, "ground")
		(kPressure, "pressure")
		(kMeanSea, "meansea")
		(kHeight, "height")
		(kHybrid, "hybrid")
		(kGndLayer, "gndlayer")
		(kDepth, "depth")
		(kTopOfAtmosphere, "top of atmosphere")
		;

enum HPFileWriteOption
{
	kUnknownFileWriteOption = 0,
	kSingleFile,
	kMultipleFiles,
	kNeons
};

const boost::unordered_map<HPFileWriteOption,const char*> HPFileWriteOptionToString = map_list_of
		(kUnknownFileWriteOption, "unknown")
		(kSingleFile, "single file only")
		(kMultipleFiles, "multiple files")
		(kNeons, "write to neons")
		;

// Values match to newbase
{'fraction_non_alphanumeric': 0.12234216552175335, 'fraction_numerical': 0.021426234870788353, 'mean_word_length': 4.364035087719298, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, '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': '341764', 'n_tokens_mistral': 2566, 'n_tokens_neox': 2377, 'n_words': 583}