File tree Expand file tree Collapse file tree 3 files changed +12
-4
lines changed
Expand file tree Collapse file tree 3 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -160,3 +160,7 @@ class UltraConstants:
160160 # For FOV calculations
161161 FOV_THETA_OFFSET_DEG = 0.0
162162 FOV_PHI_LIMIT_DEG = 60.0
163+
164+ # For spatiotemporal culling
165+ EARTH_RADIUS_KM : float = 6378.1
166+ DEFAULT_EARTH_CULLING_RADIUS = EARTH_RADIUS_KM * 30
Original file line number Diff line number Diff line change 1313 met_to_ttj2000ns ,
1414 ttj2000ns_to_et ,
1515)
16+ from imap_processing .ultra .constants import UltraConstants
1617from imap_processing .ultra .l1b .ultra_l1b_culling import get_de_rejection_mask
1718from imap_processing .ultra .l1c .l1c_lookup_utils import (
1819 build_energy_bins ,
@@ -203,7 +204,7 @@ def calculate_helio_pset(
203204 # Compute mask for culling the Earth
204205 compute_culling_mask (
205206 time_bins ,
206- 6378.1 , # Earth radius
207+ UltraConstants . DEFAULT_EARTH_CULLING_RADIUS ,
207208 helio_pset_quality_flags ,
208209 nside = nside ,
209210 )
@@ -229,8 +230,10 @@ def calculate_helio_pset(
229230 pset_dict ["spin_phase_step" ] = np .arange (len (deadtime_ratios ))
230231 pset_dict ["quality_flags" ] = helio_pset_quality_flags [np .newaxis , ...]
231232
232- pset_dict ["scatter_theta" ] = scattering_theta
233- pset_dict ["scatter_phi" ] = scattering_phi
233+ # Convert FWHM to gaussian uncertainty by dividing by 2.355
234+ # See algorithm documentation (section 3.5.7, third bullet point) for more details
235+ pset_dict ["scatter_theta" ] = scattering_theta / 2.355
236+ pset_dict ["scatter_phi" ] = scattering_phi / 2.355
234237 pset_dict ["scatter_threshold" ] = scattering_thresholds
235238
236239 # Add the energy delta plus/minus to the dataset
Original file line number Diff line number Diff line change 1313 met_to_ttj2000ns ,
1414 ttj2000ns_to_et ,
1515)
16+ from imap_processing .ultra .constants import UltraConstants
1617from imap_processing .ultra .l1b .ultra_l1b_culling import get_de_rejection_mask
1718from imap_processing .ultra .l1c .l1c_lookup_utils import (
1819 build_energy_bins ,
@@ -190,7 +191,7 @@ def calculate_spacecraft_pset(
190191 # Compute mask for culling the Earth
191192 compute_culling_mask (
192193 time_bins ,
193- 6378.1 , # Earth radius
194+ UltraConstants . DEFAULT_EARTH_CULLING_RADIUS ,
194195 spacecraft_pset_quality_flags ,
195196 nside = nside ,
196197 )
You can’t perform that action at this time.
0 commit comments