Skip to content

Commit

Permalink
add cloud amount to maps
Browse files Browse the repository at this point in the history
  • Loading branch information
AugustinMortier committed Sep 17, 2024
1 parent a33f054 commit 30e567e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion aprofiles/cli/utils/json_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def add_to_map(fn, base_dir, yyyy, mm, dd, mapname):

# scene for each hour
max_retrieval_scene = ds.retrieval_scene.resample(time='1H').max().data
max_cloud_amount = ds.cloud_amount.resample(time='1H').max().data

# open current map
with open(Path(base_dir) / yyyy / mm / mapname, 'r') as json_file:
Expand All @@ -72,7 +73,8 @@ def add_to_map(fn, base_dir, yyyy, mm, dd, mapname):
'max_ext:0-2km': [round(ext,4) if not np.isnan(ext) else None for ext in max_ext['0-2']],
'max_ext:2-4km': [round(ext,4) if not np.isnan(ext) else None for ext in max_ext['2-4']],
'max_ext:4-6km': [round(ext,4) if not np.isnan(ext) else None for ext in max_ext['4-6']],
'retrieval_scene': [retrieval_scene if not np.isnan(retrieval_scene) else None for retrieval_scene in max_retrieval_scene.tolist()]
'retrieval_scene': [retrieval_scene if not np.isnan(retrieval_scene) else None for retrieval_scene in max_retrieval_scene.tolist()],
'cloud_amount': [cloud_amount if not np.isnan(cloud_amount) else None for cloud_amount in max_cloud_amount.tolist()],
}

# write new map
Expand Down

0 comments on commit 30e567e

Please sign in to comment.