Skip to content

Commit

Permalink
Documentation of classes
Browse files Browse the repository at this point in the history
  • Loading branch information
tnipen committed Feb 6, 2015
1 parent 3248ee5 commit 1f12797
Show file tree
Hide file tree
Showing 13 changed files with 35 additions and 28 deletions.
4 changes: 2 additions & 2 deletions doxygen/config
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ SHORT_NAMES = NO
# comments will behave just like regular Qt-style comments
# (thus requiring an explicit @brief command for a brief description.)

JAVADOC_AUTOBRIEF = NO
JAVADOC_AUTOBRIEF = YES

# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
# interpret the first line (until the first dot) of a Qt-style
Expand Down Expand Up @@ -694,7 +694,7 @@ EXCLUDE_SYMLINKS = NO
# against the file with absolute path, so to exclude all test directories
# for example use the pattern */test/*

EXCLUDE_PATTERNS =
EXCLUDE_PATTERNS = */Testing/* */devel/*

# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the
Expand Down
2 changes: 1 addition & 1 deletion src/Calibrator/Cloud.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "Calibrator.h"
#include "../Variable.h"

// Ensure that if a member has precip it also has full cloud cover
//! Ensures that if a member has precip it also has full cloud cover
class CalibratorCloud : public Calibrator {
public:
CalibratorCloud(Variable::Type iPrecip=Variable::Precip, Variable::Type iCloud=Variable::Cloud);
Expand Down
2 changes: 1 addition & 1 deletion src/Calibrator/Phase.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "Calibrator.h"
class ParameterFile;

// Ensure that if a member has precip it also has full cloud cover
//! Creates a precipitation-phase field
class CalibratorPhase : public Calibrator {
public:
CalibratorPhase(const ParameterFile* iParameterFile);
Expand Down
1 change: 1 addition & 0 deletions src/Calibrator/Smooth.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
class ParameterFile;
class Parameters;

//! Smooths a field by averaging across a neighbourhood
class CalibratorSmooth : public Calibrator {
public:
CalibratorSmooth(Variable::Type iVariable);
Expand Down
8 changes: 4 additions & 4 deletions src/Calibrator/Zaga.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
class ParameterFile;
class Parameters;

// Zero-adjusted gamma distribution, using predictors:
// - ensemble mean
// - ensemble fraction
// Designed for precip
//! Ensemble calibration using zero-adjusted gamma distribution. Its predictors are:
//! - ensemble mean
//! - ensemble fraction
//! Designed for precip
class CalibratorZaga : public Calibrator {
public:
CalibratorZaga(const ParameterFile* iParameterFile, Variable::Type iMainPredictor);
Expand Down
2 changes: 2 additions & 0 deletions src/Downscaler/Bypass.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include "../Variable.h"
#include "../Util.h"
typedef std::vector<std::vector<int> > vec2Int;

//! Skip the downscaling stage
class DownscalerBypass : public Downscaler {
public:
DownscalerBypass(Variable::Type iVariable);
Expand Down
1 change: 1 addition & 0 deletions src/Downscaler/Downscaler.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
class File;
typedef std::vector<std::vector<int> > vec2Int;

//! Converts fields from one grid to another
class Downscaler {
public:
Downscaler(Variable::Type iVariable);
Expand Down
2 changes: 2 additions & 0 deletions src/Downscaler/Smart.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include "../Util.h"
typedef std::vector<std::vector<int> > vec2Int;
typedef std::vector<std::vector<std::vector<int> > > vec3Int; // lat, lon, neighbour index

//! Downscale using neighbours at similar elevation
class DownscalerSmart : public Downscaler {
public:
//! Downscale the specified variable
Expand Down
2 changes: 1 addition & 1 deletion src/Field.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <vector>
#include "Util.h"

//! /brief Encapsulates gridded data in 3 dimensions: latitude, longitude, ensemble member.
//! Encapsulates gridded data in 3 dimensions: latitude, longitude, ensemble member.
//! Latitude generally represents the north-south direction and longitude the east-west, but the
//! grid does not necessarily need to follow a lat/lon grid. Any 2D grid will do.
// TODO: Rename latitude to x and longitude to y, as this is more generally correct.
Expand Down
2 changes: 1 addition & 1 deletion src/File/Fake.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
#define FILE_FAKE_H
#include "File.h"

//! A file type giving fake data, useful for testing
class FileFake : public File {
public:
FileFake(int nLat=10, int nLon=10, int nEns=2, int nTime=10);

std::string name() const {return "fake";};
protected:
void writeCore(std::vector<Variable::Type> iVariables);
Expand Down
5 changes: 3 additions & 2 deletions src/File/File.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,19 @@
// 3D array of data: [lat][lon][ensemble_member]
typedef std::vector<std::vector<float> > vec2; // Lat, Lon

//! Represents a Netcdf data file
//! Represents a data file containing spatial and temporal data initialized at one particular time
class File {
public:
File(std::string iFilename);
virtual ~File();
static File* getScheme(std::string iFilename, bool iReadOnly=false);

FieldPtr getField(Variable::Type iVariable, int iTime) const;

//! Get a new field initialized with missing values
FieldPtr getEmptyField(float iFillValue=Util::MV) const;

// Add a field to the file, overwriting existing ones (if available)
// Add a field to the file, overwriting existing ones (if necessary)
void addField(FieldPtr iField, Variable::Type iVariable, int iTime) const;

// Write these variables to file
Expand Down
7 changes: 3 additions & 4 deletions src/Setup.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@ struct VariableConfiguration {
Options variableOptions;
};

//! Represents what and how the post-processing should be done including which
//! input file to post-process, which output file to place the results in,
//! which variables to post-process, and what post-processing methods to invoke
//! on each variable.
//! Represents what and how the post-processing should be done. Includes which input file to
//! post-process, which output file to place the results in, which variables to post-process,
//! and what post-processing methods to invoke on each variable.
class Setup {
public:
File* inputFile;
Expand Down
25 changes: 13 additions & 12 deletions src/Variable.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,23 @@
#include <iostream>
#include <vector>

// Represents a meteorological variable
//! Represents a meteorological variable and its metadata
class Variable {
public:
//! Variable types
enum Type {
Precip = 0, // Hourly amount ending at the specified time
Precip = 0, // Hourly amount ending at the specified time
PrecipAcc = 1, // Accumulated ending at the specified time
Cloud = 10, // Cloud cover (between 0 and 1)
T = 20, // 2m temperature (K)
U = 30, // 10m U-wind (m/s)
V = 40, // 10m V-wind (m/s)
W = 50, // 10m windspeed (m/s)
WD = 55, // Wind direction (degrees, from north 0)
RH = 60, // Reliative humidity (%)
Phase = 70, // Precip phase
P = 80, // Surface pressure (pa)
Fake = 90 // Fake variable used for testing
Cloud = 10, // Cloud cover (between 0 and 1)
T = 20, // 2m temperature (K)
U = 30, // 10m U-wind (m/s)
V = 40, // 10m V-wind (m/s)
W = 50, // 10m windspeed (m/s)
WD = 55, // Wind direction (degrees, from north 0)
RH = 60, // Reliative humidity (%)
Phase = 70, // Precip phase
P = 80, // Surface pressure (pa)
Fake = 90 // Fake variable used for testing
};

//! Convert type to string
Expand Down

0 comments on commit 1f12797

Please sign in to comment.