Commit c085f493 authored by Dipl.-Ing. Jonas Stienen's avatar Dipl.-Ing. Jonas Stienen
Browse files

Fixing a bug in spectrum to JSON exporter

parent b193b6d8
......@@ -9,7 +9,8 @@ void ITABase::Utils::JSON::Export( const CITASpectrum* pSpectrum, const std::str
jnRoot.push_back( JSONNode( "num_bands", pSpectrum->GetNumBands() ) );
jnRoot.push_back( JSONNode( "value_unit", pSpectrum->GetValueUnit() ) );
JSONNode jnBins;
JSONNode jnSpectrum;
jnSpectrum.set_name( "spectrum" );
for( int i = 0; i < pSpectrum->GetNumBands(); i++ )
{
JSONNode jnBin;
......@@ -17,8 +18,9 @@ void ITABase::Utils::JSON::Export( const CITASpectrum* pSpectrum, const std::str
jnBin.push_back( JSONNode( "center_frequency", pSpectrum->GetCenterFrequencies()[ i ] ) );
jnBin.push_back( JSONNode( "value", pSpectrum->GetValues()[ i ] ) );
jnBins.push_back( jnBin );
jnSpectrum.push_back( jnBin );
}
jnRoot.push_back( jnSpectrum );
std::ofstream fsOut( sTargetFilePath );
fsOut << jnRoot.write_formatted();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment