"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/metgm/MetGmTags.cc" between
fimex-1.4.1.tar.gz and fimex-1.4.2.tar.gz

About: Fimex is a the File Interpolation, Manipulation and EXtraction library for gridded geospatial data. It converts between different, extensible dataformats (currently netcdf, NcML, grib1/2 and felt).

MetGmTags.cc  (fimex-1.4.1):MetGmTags.cc  (fimex-1.4.2)
/* /*
* Fimex * Fimex
* *
* (C) Copyright 2011, met.no * (C) Copyright 2011-2019, met.no
* *
* Project Info: https://wiki.met.no/fimex/start * Project Info: https://wiki.met.no/fimex/start
* *
* This library is free software; you can redistribute it and/or modify it * This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by * under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or * the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This library is distributed in the hope that it will be useful, but * This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
skipping to change at line 47 skipping to change at line 47
#include "metgm.h" #include "metgm.h"
// fimex // fimex
// //
#include "fimex/CDMReader.h" #include "fimex/CDMReader.h"
#include "fimex/CDMVariable.h" #include "fimex/CDMVariable.h"
namespace MetNoFimex { namespace MetNoFimex {
std::shared_ptr<MetGmTags> MetGmTags::createMetGmTagsForWriting(const CDMReader_ p pCdmReader, const CDMVariable* pVariable, std::shared_ptr<MetGmTags> MetGmTags::createMetGmTagsForWriting(const CDMReader_ p pCdmReader, const CDMVariable* pVariable,
const std::share const std::share
d_ptr<MetGmHandlePtr> mgmHandle, const unsigned short p_id, d_ptr<MetGmHandlePtr> mgmHandle, const unsigned short p_id)
const std::strin
g fillValue, const std::string addOffset, const std::string scaleFactor)
{ {
std::shared_ptr<MetGmTags> tags = std::shared_ptr<MetGmTags>(new MetGmTags); std::shared_ptr<MetGmTags> tags = std::shared_ptr<MetGmTags>(new MetGmTags);
tags->pGp3_ = MetGmGroup3Ptr::createMetGmGroup3PtrForWriting(mgmHandle, p_id ); tags->pGp3_ = MetGmGroup3Ptr::createMetGmGroup3PtrForWriting(mgmHandle, p_id );
tags->dimTag_ = MetGmHDTag::createMetGmDimensionsTagForWriting(pCdmReader, p Variable); tags->dimTag_ = MetGmHDTag::createMetGmDimensionsTagForWriting(pCdmReader, p Variable);
tags->pGp5_ = MetGmGroup5Ptr::createMetGmGroup5PtrForWriting(pCdmReader, pVa riable, tags->pGp3_, fillValue, addOffset, scaleFactor); tags->pGp5_ = MetGmGroup5Ptr::createMetGmGroup5PtrForWriting(pCdmReader, pVa riable, tags->pGp3_);
if (tags->pGp5_.get() && tags->dimTag_.get() && tags->pGp3_.get()) if (tags->pGp5_.get() && tags->dimTag_.get() && tags->pGp3_.get())
return tags; return tags;
else else
return std::shared_ptr<MetGmTags>(); return std::shared_ptr<MetGmTags>();
} }
std::shared_ptr<MetGmTags> MetGmTags::createMetGmTagsForReading(const std::s hared_ptr<MetGmGroup1Ptr> pGp1, const std::shared_ptr<MetGmGroup2Ptr> pGp2, std::shared_ptr<MetGmTags> MetGmTags::createMetGmTagsForReading(const std::s hared_ptr<MetGmGroup1Ptr> pGp1, const std::shared_ptr<MetGmGroup2Ptr> pGp2,
const std::s hared_ptr<MetGmVerticalTag> vTag) const std::s hared_ptr<MetGmVerticalTag> vTag)
{ {
skipping to change at line 95 skipping to change at line 94
std::shared_ptr<MetGmTags> tags = std::shared_ptr<MetGmTags>(new MetGmTa gs); std::shared_ptr<MetGmTags> tags = std::shared_ptr<MetGmTags>(new MetGmTa gs);
tags->pGp3_ = MetGmGroup3Ptr::createMetGmGroup3PtrForWriting(mgmHandle , p_id); tags->pGp3_ = MetGmGroup3Ptr::createMetGmGroup3PtrForWriting(mgmHandle , p_id);
tags->dimTag_ = MetGmHDTag::createMetGmDimensionsTagForWriting(pCdmReade r, pVariable); tags->dimTag_ = MetGmHDTag::createMetGmDimensionsTagForWriting(pCdmReade r, pVariable);
tags->pGp5_ = MetGmGroup5Ptr::createMetGmGroup5PtrForSlicedWriting(pCd mReader, pVariable, tags->pGp3_); tags->pGp5_ = MetGmGroup5Ptr::createMetGmGroup5PtrForSlicedWriting(pCd mReader, pVariable, tags->pGp3_);
if(tags->pGp5_.get() && tags->dimTag_.get() && tags->pGp3_.get()) if(tags->pGp5_.get() && tags->dimTag_.get() && tags->pGp3_.get())
return tags; return tags;
else else
return std::shared_ptr<MetGmTags>(); return std::shared_ptr<MetGmTags>();
} }
const unsigned short MetGmTags::p_id() const { return pGp3_->p_id(); } unsigned short MetGmTags::p_id() const
const int MetGmTags::pr() const { return pGp3_->pr(); } {
const int MetGmTags::pz() const { return pGp3_->pz(); } return pGp3_->p_id();
const unsigned short MetGmTags::hd() const { return dimTag_->asShort(); } }
int MetGmTags::pr() const
{
return pGp3_->pr();
}
int MetGmTags::pz() const
{
return pGp3_->pz();
}
unsigned short MetGmTags::hd() const
{
return dimTag_->asShort();
}
int MetGmTags::set_nt(int nt) { return pGp3_->set_nt(nt); } int MetGmTags::set_nt(int nt) { return pGp3_->set_nt(nt); }
int MetGmTags::set_dt(float dt) { return pGp3_->set_dt(dt); } int MetGmTags::set_dt(float dt) { return pGp3_->set_dt(dt); }
int MetGmTags::set_nz(int nz) { return pGp3_->set_nz(nz); } int MetGmTags::set_nz(int nz) { return pGp3_->set_nz(nz); }
int MetGmTags::set_pz(int pz) { return pGp3_->set_pz(pz); } int MetGmTags::set_pz(int pz) { return pGp3_->set_pz(pz); }
int MetGmTags::set_pr(int pr) { return pGp3_->set_pr(pr); } int MetGmTags::set_pr(int pr) { return pGp3_->set_pr(pr); }
int MetGmTags::set_nx(int nx) { return pGp3_->set_nx(nx); } int MetGmTags::set_nx(int nx) { return pGp3_->set_nx(nx); }
int MetGmTags::set_dx(float dx) { return pGp3_->set_dx(dx); } int MetGmTags::set_dx(float dx) { return pGp3_->set_dx(dx); }
skipping to change at line 132 skipping to change at line 143
} }
std::shared_ptr<MetGmVerticalTag>& MetGmTags::zTag() std::shared_ptr<MetGmVerticalTag>& MetGmTags::zTag()
{ {
return dimTag_->zTag(); return dimTag_->zTag();
} }
std::shared_ptr<MetGmTimeTag>& MetGmTags::tTag() std::shared_ptr<MetGmTimeTag>& MetGmTags::tTag()
{ {
return dimTag_->tTag(); return dimTag_->tTag();
} }
const unsigned long MetGmTags::totalDataSize() { return dimTag_->totalSize() unsigned long MetGmTags::totalDataSize()
; } {
const unsigned long MetGmTags::sliceDataSize() { return dimTag_->sliceSize() return dimTag_->totalSize();
; } }
unsigned long MetGmTags::sliceDataSize()
{
return dimTag_->sliceSize();
}
void MetGmTags::sliceToMetGmLayout(shared_array<float>& slice) void MetGmTags::sliceToMetGmLayout(shared_array<float>& slice)
{ {
pGp5_->sliceToMetGmLayout(slice); pGp5_->sliceToMetGmLayout(slice);
} }
shared_array<float> MetGmTags::readDataSlices(size_t pos, size_t numberOfSli ces) shared_array<float> MetGmTags::readDataSlices(size_t pos, size_t numberOfSli ces)
{ {
return pGp5_->readDataSlices(pos, numberOfSlices); return pGp5_->readDataSlices(pos, numberOfSlices);
} }
const shared_array<float>& MetGmTags::data() const shared_array<float>& MetGmTags::data()
{ {
return pGp5_->data(); return pGp5_->data();
} }
const std::string MetGmTags::units() const { return pGp5_->units(); } std::string MetGmTags::units() const
{
return pGp5_->units();
}
} }
 End of changes. 6 change blocks. 
15 lines changed or deleted 32 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)