From bddaf17711d48b9b97745742d67b65c28ae7c490 Mon Sep 17 00:00:00 2001 From: Brian Healy Date: Tue, 12 Dec 2023 18:04:14 -0600 Subject: [PATCH 1/2] Checkpoint quad file each field --- tools/generate_features_slurm.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tools/generate_features_slurm.py b/tools/generate_features_slurm.py index e66970e3..adcba4a8 100755 --- a/tools/generate_features_slurm.py +++ b/tools/generate_features_slurm.py @@ -59,7 +59,7 @@ def check_quads_for_sources( - fields: list = np.arange(1, 2001), + fields: list = np.arange(331, 2000), catalog: str = source_catalog, count_sources: bool = False, minobs: int = 0, @@ -87,6 +87,10 @@ def check_quads_for_sources( missing_ccd_quad = np.zeros(len(fields), dtype=bool) field_dct = {} + if save: + with open(BASE_DIR / f'{filename}.json', 'r') as f: + field_dct = json.load(f) + for idx, field in enumerate(fields): print('Running field %d' % int(field)) except_count = 0 @@ -165,14 +169,14 @@ def check_quads_for_sources( if except_count > 0: missing_ccd_quad[idx] = True + if save: + with open(BASE_DIR / f'{filename}.json', 'w') as f: + json.dump(field_dct, f) + print(f"Sources found in {np.sum(has_sources)} fields.") if count_sources: print(f"Found {running_total_sources} sources.") - if save: - with open(BASE_DIR / f'{filename}.json', 'w') as f: - json.dump(field_dct, f) - return field_dct, has_sources, missing_ccd_quad From 55a0eeed2d0bc8079c9a138786a19c928cc8a32f Mon Sep 17 00:00:00 2001 From: Brian Healy Date: Thu, 14 Dec 2023 13:11:38 -0600 Subject: [PATCH 2/2] Adjust default fields --- tools/generate_features_slurm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/generate_features_slurm.py b/tools/generate_features_slurm.py index adcba4a8..0ccd9c8b 100755 --- a/tools/generate_features_slurm.py +++ b/tools/generate_features_slurm.py @@ -59,7 +59,7 @@ def check_quads_for_sources( - fields: list = np.arange(331, 2000), + fields: list = np.arange(0, 2000), catalog: str = source_catalog, count_sources: bool = False, minobs: int = 0,