Skip to content

Commit

Permalink
T2ElasticcRedshiftSampler: deal with actuall-null redshifts
Browse files Browse the repository at this point in the history
  • Loading branch information
jvansanten committed Jan 15, 2024
1 parent e8ef3d2 commit 824fdba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ampel/contrib/hu/t2/T2ElasticcRedshiftSampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def process(self, datapoint: DataPoint) -> Union[UBson, UnitResult]:
weight = weight_quantiles['w']
quantiles = weight_quantiles['q']
t2_output["z_samples"].append( np.mean( [qv
for q in quantiles if (qv := dp.get(prefix+q,-9))>-9] ) ) # -9 seems to be null
for q in quantiles if (qv := dp.get(prefix+q,-9)) is not None and qv >-9] ) ) # -9 seems to be null
t2_output["z_weights"].append(weight)


Expand Down

0 comments on commit 824fdba

Please sign in to comment.