27#ifndef NIDAS_CORE_NEARESTRESAMPLER_H
28#define NIDAS_CORE_NEARESTRESAMPLER_H
35namespace nidas {
namespace core {
60 NearestResampler(
const std::vector<const Variable*>& vars,
bool nansVariable=
true);
142 void flush() throw();
182 std::map<dsm_sample_id_t,std::vector<unsigned int> >
_inmap;
187 std::map<dsm_sample_id_t,std::vector<unsigned int> >
_lenmap;
192 std::map<dsm_sample_id_t,std::vector<unsigned int> >
_outmap;
A simple, nearest-point resampler, for generating merged samples from variables from one or more samp...
Definition NearestResampler.h:54
void removeSampleTag(const SampleTag *tag)
Definition NearestResampler.h:159
std::map< dsm_sample_id_t, unsigned int > _ttOutOfOrder
Definition NearestResampler.h:212
SampleTagIterator getSampleTagIterator() const
Implementation of SampleSource::getSampleTagIterator().
Definition NearestResampler.h:81
void addSampleTag(const SampleTag *tag)
Add a SampleTag to this SampleSource.
Definition NearestResampler.h:154
int _nmaster
Definition NearestResampler.h:200
void removeSampleClientForTag(SampleClient *client, const SampleTag *)
Remove a SampleClient for a given SampleTag from this SampleSource.
Definition NearestResampler.h:109
std::map< dsm_sample_id_t, std::vector< unsigned int > > _lenmap
For each input sample, length of variables to read.
Definition NearestResampler.h:187
void ctorCommon(const std::vector< const Variable * > &vars, bool nansVariable)
Common tasks of constructors.
Definition NearestResampler.cc:80
void addSampleClientForTag(SampleClient *client, const SampleTag *)
Add a Client for a given SampleTag.
Definition NearestResampler.h:103
int getClientCount() const
How many SampleClients are currently in my list.
Definition NearestResampler.h:114
unsigned int _outlen
Definition NearestResampler.h:196
void addSampleClient(SampleClient *client)
Implementation of SampleSource::addSampleClient().
Definition NearestResampler.h:89
~NearestResampler()
Definition NearestResampler.cc:68
dsm_time_t * _nearTT
Definition NearestResampler.h:204
float * _nearData
Definition NearestResampler.h:208
std::map< dsm_sample_id_t, std::vector< unsigned int > > _outmap
For each input sample, index into output sample of each variable.
Definition NearestResampler.h:192
std::vector< Variable * > _reqVars
Requested variables.
Definition NearestResampler.h:171
bool receive(const Sample *s)
Implementation of SampleClient::receive().
Definition NearestResampler.cc:254
std::list< const SampleTag * > getSampleTags() const
Get the SampleTag of my merged output sample.
Definition NearestResampler.h:73
SampleSource * getRawSampleSource()
Several objects in NIDAS can be both a SampleSource of raw Samples and processed Samples.
Definition NearestResampler.h:66
unsigned int _ndataValues
Definition NearestResampler.h:194
void flush()
Implementation of Resampler::flush().
Definition NearestResampler.cc:462
dsm_time_t * _prevTT
Definition NearestResampler.h:202
float * _prevData
Definition NearestResampler.h:206
int * _samplesSinceMaster
Definition NearestResampler.h:210
void removeSampleClient(SampleClient *client)
Remove a SampleClient from this SampleSource.
Definition NearestResampler.h:94
bool _debug
Definition NearestResampler.h:214
NearestResampler(const std::vector< const Variable * > &vars, bool nansVariable=true)
Constructor.
Definition NearestResampler.cc:39
NearestResampler(const NearestResampler &x)
No copy.
SampleTag _outSample
Definition NearestResampler.h:166
std::map< Variable *, unsigned int > _outVarIndices
Index of each requested output variable in the output sample.
Definition NearestResampler.h:176
std::map< dsm_sample_id_t, std::vector< unsigned int > > _inmap
For each input sample, first index of variable data values to be read.
Definition NearestResampler.h:182
NearestResampler & operator=(const NearestResampler &)
No assignment.
SampleSourceSupport _source
Definition NearestResampler.h:164
unsigned int _master
Definition NearestResampler.h:198
void disconnect(SampleSource *src)
Definition NearestResampler.cc:249
const SampleStats & getSampleStats() const
Definition NearestResampler.h:119
SampleSource * getProcessedSampleSource()
Several objects in NIDAS can be both a SampleSource of raw Samples and processed Samples.
Definition NearestResampler.h:68
void connect(SampleSource *src)
Connect the resampler to a SampleSource.
Definition NearestResampler.cc:157
Interface for a resampler, simply a SampleClient and a SampleSource.
Definition Resampler.h:39
Pure virtual interface of a client of Samples.
Definition SampleClient.h:38
A source of samples.
Definition SampleSourceSupport.h:47
void removeSampleClient(SampleClient *c)
Remove a SampleClient from this SampleSource This will also remove a SampleClient if it has been adde...
Definition SampleSourceSupport.cc:88
void addSampleClient(SampleClient *c)
Add a SampleClient to this SampleSource.
Definition SampleSourceSupport.cc:80
SampleTagIterator getSampleTagIterator() const
Definition SampleSourceSupport.cc:75
int getClientCount() const
How many SampleClients are currently in my list.
Definition SampleSourceSupport.cc:136
void removeSampleTag(const SampleTag *tag)
Definition SampleSourceSupport.cc:67
const SampleStats & getSampleStats() const
Definition SampleSourceSupport.h:149
void addSampleTag(const SampleTag *tag)
Add a SampleTag to this SampleSource.
Definition SampleSourceSupport.cc:60
std::list< const SampleTag * > getSampleTags() const
What SampleTags am I a SampleSource for?
Definition SampleSourceSupport.cc:54
Pure virtual interface for a source of Samples.
Definition SampleSource.h:48
A source of samples.
Definition SampleStats.h:41
Class for iterating over the SampleTags of a Project, Site, DSMConfig, or a SampleSource.
Definition NidsIterators.h:218
Class describing a group of variables that are sampled and handled together.
Definition SampleTag.h:88
Interface to a data sample.
Definition Sample.h:190
Class describing a sampled variable.
Definition Variable.h:47
long long dsm_time_t
Posix time in microseconds, the number of non-leap microseconds since 1970 Jan 1 00:00 UTC.
Definition Sample.h:62
Root namespace for the NCAR In-Situ Data Acquisition Software.
Definition A2DConverter.h:31