-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0b93009
commit eda1b90
Showing
18 changed files
with
814 additions
and
1,051 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,224 @@ | ||
// *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* | ||
// ** Copyright UCAR (c) 1992 - 2024 | ||
// ** University Corporation for Atmospheric Research (UCAR) | ||
// ** National Center for Atmospheric Research (NCAR) | ||
// ** Research Applications Lab (RAL) | ||
// ** P.O.Box 3000, Boulder, Colorado, 80307-3000, USA | ||
// *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* | ||
|
||
/////////////////////////////////////////////////////////////////////////////// | ||
// | ||
// Filename: var_info_pairs.cc | ||
// | ||
// Description: | ||
// | ||
// Mod# Date Name Description | ||
// ---- ---- ---- ----------- | ||
// | ||
/////////////////////////////////////////////////////////////////////////////// | ||
|
||
#include <map> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
#include <strings.h> | ||
|
||
#include "var_info.h" | ||
#include "var_info_pairs.h" | ||
|
||
#include "util_constants.h" | ||
|
||
#include "vx_math.h" | ||
#include "vx_util.h" | ||
#include "vx_log.h" | ||
#include "vx_data2d.h" | ||
|
||
using namespace std; | ||
|
||
/////////////////////////////////////////////////////////////////////////////// | ||
// | ||
// Code for class VarInfoPairs | ||
// | ||
/////////////////////////////////////////////////////////////////////////////// | ||
|
||
VarInfoPairs::VarInfoPairs() { | ||
|
||
init_from_scratch(); | ||
} | ||
|
||
/////////////////////////////////////////////////////////////////////////////// | ||
|
||
VarInfoPairs::~VarInfoPairs() { | ||
|
||
clear(); | ||
} | ||
|
||
/////////////////////////////////////////////////////////////////////////////// | ||
|
||
VarInfoPairs::VarInfoPairs(const VarInfoPairs &f) { | ||
|
||
init_from_scratch(); | ||
|
||
assign(f); | ||
} | ||
|
||
/////////////////////////////////////////////////////////////////////////////// | ||
|
||
VarInfoPairs & VarInfoPairs::operator=(const VarInfoPairs &f) { | ||
|
||
if ( this == &f ) return *this; | ||
|
||
assign(f); | ||
|
||
return *this; | ||
} | ||
|
||
/////////////////////////////////////////////////////////////////////////////// | ||
|
||
VarInfo *VarInfoPairs::clone() const { | ||
|
||
VarInfoPairs *ret = new VarInfoPairs(*this); | ||
|
||
return (VarInfo *)ret; | ||
} | ||
|
||
/////////////////////////////////////////////////////////////////////////////// | ||
|
||
void VarInfoPairs::init_from_scratch() { | ||
|
||
// First call the parent's initialization | ||
VarInfo::init_from_scratch(); | ||
|
||
clear(); | ||
|
||
return; | ||
} | ||
|
||
/////////////////////////////////////////////////////////////////////////////// | ||
|
||
void VarInfoPairs::assign(const VarInfoPairs &v) { | ||
|
||
// First call the parent's assign | ||
VarInfo::assign(v); | ||
|
||
return; | ||
} | ||
|
||
/////////////////////////////////////////////////////////////////////////////// | ||
|
||
void VarInfoPairs::clear() { | ||
|
||
// First call the parent's clear | ||
VarInfo::clear(); | ||
|
||
return; | ||
} | ||
|
||
/////////////////////////////////////////////////////////////////////////////// | ||
|
||
void VarInfoPairs::dump(ostream &out) const { | ||
|
||
// Dump out the contents | ||
out << "VarInfoPairs::dump():\n"; | ||
|
||
VarInfo::dump(out); | ||
|
||
return; | ||
} | ||
|
||
/////////////////////////////////////////////////////////////////////////////// | ||
|
||
void VarInfoPairs::set_dict(Dictionary & dict) { | ||
VarInfo::set_dict(dict); | ||
} | ||
|
||
/////////////////////////////////////////////////////////////////////////////// | ||
|
||
bool VarInfoPairs::is_precipitation() const { | ||
bool status = false; | ||
|
||
// | ||
// Check set_attrs entry | ||
// | ||
if(!is_bad_data(SetAttrIsPrecipitation)) { | ||
return(SetAttrIsPrecipitation != 0); | ||
} | ||
|
||
return status; | ||
} | ||
|
||
/////////////////////////////////////////////////////////////////////////////// | ||
|
||
bool VarInfoPairs::is_specific_humidity() const { | ||
bool status = false; | ||
|
||
// | ||
// Check set_attrs entry | ||
// | ||
if(!is_bad_data(SetAttrIsSpecificHumidity)) { | ||
return(SetAttrIsSpecificHumidity != 0); | ||
} | ||
|
||
return status; | ||
} | ||
|
||
/////////////////////////////////////////////////////////////////////////////// | ||
|
||
bool VarInfoPairs::is_u_wind() const { | ||
bool status = false; | ||
|
||
// | ||
// Check set_attrs entry | ||
// | ||
if(!is_bad_data(SetAttrIsUWind)) { | ||
return(SetAttrIsUWind != 0); | ||
} | ||
|
||
return status; | ||
} | ||
|
||
/////////////////////////////////////////////////////////////////////////////// | ||
|
||
bool VarInfoPairs::is_v_wind() const { | ||
bool status = false; | ||
|
||
// | ||
// Check set_attrs entry | ||
// | ||
if(!is_bad_data(SetAttrIsVWind)) { | ||
return(SetAttrIsVWind != 0); | ||
} | ||
|
||
return status; | ||
} | ||
|
||
/////////////////////////////////////////////////////////////////////////////// | ||
|
||
bool VarInfoPairs::is_wind_speed() const { | ||
bool status = false; | ||
|
||
// | ||
// Check set_attrs entry | ||
// | ||
if(!is_bad_data(SetAttrIsWindSpeed)) { | ||
return(SetAttrIsWindSpeed != 0); | ||
} | ||
|
||
return status; | ||
} | ||
|
||
/////////////////////////////////////////////////////////////////////////////// | ||
|
||
bool VarInfoPairs::is_wind_direction() const { | ||
bool status = false; | ||
|
||
// | ||
// Check set_attrs entry | ||
// | ||
if(!is_bad_data(SetAttrIsWindDirection)) { | ||
return(SetAttrIsWindDirection != 0); | ||
} | ||
|
||
return status; | ||
} | ||
|
||
/////////////////////////////////////////////////////////////////////////////// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
// *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* | ||
// ** Copyright UCAR (c) 1992 - 2024 | ||
// ** University Corporation for Atmospheric Research (UCAR) | ||
// ** National Center for Atmospheric Research (NCAR) | ||
// ** Research Applications Lab (RAL) | ||
// ** P.O.Box 3000, Boulder, Colorado, 80307-3000, USA | ||
// *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* | ||
|
||
|
||
/////////////////////////////////////////////////////////////////////////////// | ||
|
||
#ifndef __VAR_INFO_PAIRS_H__ | ||
#define __VAR_INFO_PAIRS_H__ | ||
|
||
/////////////////////////////////////////////////////////////////////////////// | ||
|
||
#include "var_info.h" | ||
#include "vx_config.h" | ||
|
||
#include "data_file_type.h" | ||
|
||
/////////////////////////////////////////////////////////////////////////////// | ||
|
||
class VarInfoPairs : public VarInfo { | ||
|
||
private: | ||
|
||
void init_from_scratch(); | ||
void assign(const VarInfoPairs &); | ||
|
||
public: | ||
VarInfoPairs(); | ||
~VarInfoPairs(); | ||
VarInfoPairs(const VarInfoPairs &); | ||
VarInfoPairs & operator=(const VarInfoPairs &); | ||
VarInfo *clone() const; | ||
|
||
void dump(std::ostream &) const; | ||
void clear(); | ||
|
||
// | ||
// get stuff | ||
// | ||
|
||
GrdFileType file_type() const; | ||
|
||
// | ||
// set stuff | ||
// | ||
|
||
void set_dict(Dictionary &); | ||
|
||
// | ||
// do stuff | ||
// | ||
|
||
bool is_precipitation() const; | ||
bool is_specific_humidity() const; | ||
bool is_u_wind() const; | ||
bool is_v_wind() const; | ||
bool is_wind_speed() const; | ||
bool is_wind_direction() const; | ||
}; | ||
|
||
/////////////////////////////////////////////////////////////////////////////// | ||
|
||
inline GrdFileType VarInfoPairs::file_type() const { return FileType_Pairs; } | ||
|
||
/////////////////////////////////////////////////////////////////////////////// | ||
|
||
#endif // __VAR_INFO_PAIRS_H__ | ||
|
||
/////////////////////////////////////////////////////////////////////////////// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.