Skip to content

Commit

Permalink
fix bug in climatology by moving clouds detection after seasonal average
Browse files Browse the repository at this point in the history
  • Loading branch information
AugustinMortier committed Sep 23, 2024
1 parent 1b03dee commit 2e74a7b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions aprofiles/cli/utils/json_climatology.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ def compute_climatology(basedir, station_id, variables, aerosols_only):
if isinstance(attrs[attr], np.uint32):
attrs[attr] = int(attrs[attr])

# seasonal resampling
Qds = ds.resample(time="QE").mean().compute()

# keep only clear scenes
if aerosols_only:
Qds = Qds.where((Qds.retrieval_scene <= 1) & (Qds.cloud_amount == 0))
ds = ds.where((ds.retrieval_scene <= 1) & (ds.cloud_amount == 0))

# seasonal resampling
Qds = ds.resample(time="QE").mean().compute()

# add some statistics
attrs["ndays"] = {"ndays": len(station_files), "since": str(ds.time.data[0]).split("T")[0]}
Expand Down

0 comments on commit 2e74a7b

Please sign in to comment.