File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -1808,8 +1808,24 @@ bool SpecFile::load_from_pcf( std::istream &input )
18081808
18091809 if ( measurements_.empty () )
18101810 throw runtime_error ( " Didnt read in any Measurements" );
1811-
1812-
1811+
1812+ // With GADRAS inject, the non-background records will often times have a detector name (from
1813+ // the title) like Aa1, but the background record wont have this - the title will just be "Background".
1814+ // The inject also likely have the same start time, so to avoid a changing of record order, and to
1815+ // be reasonable, we'll set the background detector name like the rest.
1816+ // But note that this logic below will catch other cases - but this behaviour is still probably reasonable.
1817+ if ( (detector_names.size () == 2 ) && detector_names.count (" " ) )
1818+ {
1819+ detector_names.erase (" " );
1820+ const string det_name = *begin (detector_names);
1821+ for ( auto &p : measurements_ )
1822+ {
1823+ if ( p->detector_name_ .empty () )
1824+ p->detector_name_ = det_name;
1825+ }
1826+ }// if( (detector_names.size() == 2) && detector_names.count("") )
1827+
1828+
18131829 if ( !allSamplesHaveNumbers )
18141830 {
18151831 if ( someSamplesHaveNumbers )
You can’t perform that action at this time.
0 commit comments