@@ -505,15 +505,6 @@ fn continuumSigmaAtWavelength(
505505 return continuum_table .interpolateSigma (wavelength_nm );
506506}
507507
508- fn strongLineStateAt (
509- states : ? []const ReferenceData.StrongLinePreparedState ,
510- local_index : usize ,
511- ) ? * const ReferenceData.StrongLinePreparedState {
512- const owned_states = states orelse return null ;
513- if (local_index >= owned_states .len ) return null ;
514- return & owned_states [local_index ];
515- }
516-
517508fn particleWavelengthScale (
518509 reference_wavelength_nm : f64 ,
519510 angstrom_exponent : f64 ,
@@ -619,7 +610,7 @@ pub fn sharedBoundaryCarrierAtLevelWithSpectroscopyCache(
619610 const boundary_row_index : usize = @intCast (level_geometry .support_row_index );
620611 if (boundary_row_index >= sublayers .len ) return .{};
621612
622- const strong_line_state = strongLineStateAt (strong_line_states , boundary_row_index );
613+ const strong_line_state = SpectroscopyState . strongLineStateAt (strong_line_states , boundary_row_index );
623614 const gas_carrier = sharedOpticalCarrierAtSupportRowWithSpectroscopyCache (
624615 self ,
625616 wavelength_nm ,
@@ -690,7 +681,7 @@ pub fn sharedBoundaryCarrierAtLevelWithCarrierCache(
690681 const boundary_row_index : usize = @intCast (level_geometry .support_row_index );
691682 if (boundary_row_index >= sublayers .len ) return .{};
692683
693- const strong_line_state = strongLineStateAt (strong_line_states , boundary_row_index );
684+ const strong_line_state = SpectroscopyState . strongLineStateAt (strong_line_states , boundary_row_index );
694685 var fallback_gas_carrier : SharedOpticalScalars = undefined ;
695686 const gas_carrier = wavelength_cache .cachedSupportRowScalarsRef (
696687 self ,
@@ -765,7 +756,7 @@ pub fn fillSourceInterfaceAtLevelWithSpectroscopyCache(
765756 return ;
766757 }
767758
768- const strong_line_state = strongLineStateAt (strong_line_states , boundary_row_index );
759+ const strong_line_state = SpectroscopyState . strongLineStateAt (strong_line_states , boundary_row_index );
769760 const gas_carrier = sharedOpticalCarrierAtSupportRowWithSpectroscopyCache (
770761 self ,
771762 wavelength_nm ,
@@ -830,7 +821,7 @@ pub fn fillSourceInterfaceAtLevelWithCarrierCache(
830821 source_interface .* = .{ .rtm_weight = rtm_weight };
831822 return ;
832823 }
833- const strong_line_state = strongLineStateAt (strong_line_states , boundary_row_index );
824+ const strong_line_state = SpectroscopyState . strongLineStateAt (strong_line_states , boundary_row_index );
834825 var fallback_gas_carrier : SharedOpticalScalars = undefined ;
835826 const gas_carrier = wavelength_cache .cachedSupportRowScalarsRef (
836827 self ,
@@ -935,7 +926,7 @@ pub fn fillRtmQuadratureLevelAtLevelWithSpectroscopyCache(
935926 return ;
936927 }
937928
938- const strong_line_state = strongLineStateAt (strong_line_states , boundary_row_index );
929+ const strong_line_state = SpectroscopyState . strongLineStateAt (strong_line_states , boundary_row_index );
939930 const gas_carrier = sharedOpticalCarrierAtSupportRowWithSpectroscopyCache (
940931 self ,
941932 wavelength_nm ,
@@ -996,7 +987,7 @@ pub fn fillRtmQuadratureLevelAtLevelWithCarrierCache(
996987 fillZeroRtmQuadratureLevel (level_geometry , rtm_level , compute_jacobian );
997988 return ;
998989 }
999- const strong_line_state = strongLineStateAt (strong_line_states , boundary_row_index );
990+ const strong_line_state = SpectroscopyState . strongLineStateAt (strong_line_states , boundary_row_index );
1000991 var fallback_gas_carrier : SharedOpticalScalars = undefined ;
1001992 const gas_carrier = wavelength_cache .cachedSupportRowScalarsRef (
1002993 self ,
@@ -1104,7 +1095,7 @@ pub fn sharedActiveCarrierAtLevelWithSpectroscopyCache(
11041095 const boundary_row_index : usize = @intCast (level_geometry .support_row_index );
11051096 if (boundary_row_index >= sublayers .len ) return .{};
11061097
1107- const strong_line_state = strongLineStateAt (strong_line_states , boundary_row_index );
1098+ const strong_line_state = SpectroscopyState . strongLineStateAt (strong_line_states , boundary_row_index );
11081099 const gas_carrier = sharedOpticalCarrierAtSupportRowWithSpectroscopyCache (
11091100 self ,
11101101 wavelength_nm ,
@@ -1386,7 +1377,10 @@ fn weightedSpectroscopyEvaluationAtSupportRow(
13861377 const weight = line_absorber .number_densities_cm3 [global_sublayer_index ];
13871378 if (weight <= 0.0 ) continue ;
13881379
1389- const prepared_state = strongLineStateAt (line_absorber .strong_line_states , global_sublayer_index );
1380+ const prepared_state = SpectroscopyState .strongLineStateAt (
1381+ line_absorber .strong_line_states ,
1382+ global_sublayer_index ,
1383+ );
13901384 const evaluation = line_absorber .line_list .evaluateAtPrepared (
13911385 wavelength_nm ,
13921386 sublayer .temperature_k ,
0 commit comments