diff --git a/include/picongpu/plugins/radiation/Radiation.hpp b/include/picongpu/plugins/radiation/Radiation.hpp index 966cba0e8db..34e0f39dcde 100644 --- a/include/picongpu/plugins/radiation/Radiation.hpp +++ b/include/picongpu/plugins/radiation/Radiation.hpp @@ -744,6 +744,13 @@ namespace picongpu ::openPMD::Series& openPMDdataFile = series.value(); ::openPMD::Iteration openPMDdataFileIteration = openPMDdataFile.writeIterations()[currentStep]; + /* begin required openPMD global attributes */ + openPMDdataFileIteration.setDt(DELTA_T); + const float_X time = float_X(currentStep) * DELTA_T; + openPMDdataFileIteration.setTime(time); + openPMDdataFileIteration.setTimeUnitSI(UNIT_TIME); + /* end required openPMD global attributes */ + // begin: write amplitude data ::openPMD::Mesh mesh_amp = openPMDdataFileIteration.meshes[dataLabels(-1)]; @@ -909,15 +916,6 @@ namespace picongpu omega_mrc.storeChunk(detectorFrequencies, offset_omega, extent_omega); // end: write frequencies - /* begin openPMD attributes */ - /* begin required openPMD global attributes */ - - openPMDdataFileIteration.setDt(DELTA_T); - const float_X time = float_X(currentStep) * DELTA_T; - openPMDdataFileIteration.setTime(time); - openPMDdataFileIteration.setTimeUnitSI(UNIT_TIME); - /* end required openPMD global attributes */ - openPMDdataFileIteration.close(); openPMDdataFile.flush(); }