From 6845e2d36317eb2b605db0ebe3649fe5da8aef5d Mon Sep 17 00:00:00 2001 From: Simon Pfreundschuh Date: Fri, 4 Oct 2024 16:31:01 -0600 Subject: [PATCH] Include observations from noaa20. --- gprof_nn/data/pretraining.py | 3 ++- gprof_nn/data/training_data.py | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/gprof_nn/data/pretraining.py b/gprof_nn/data/pretraining.py index fa11afe..674cc4e 100644 --- a/gprof_nn/data/pretraining.py +++ b/gprof_nn/data/pretraining.py @@ -29,6 +29,7 @@ from pansat.products.satellite.gpm import ( l1c_gpm_gmi, l1c_npp_atms, + l1c_noaa20_atms, l1c_gcomw1_amsr2, merged_ir ) @@ -56,7 +57,7 @@ # pansat products for each sensor. PRODUCTS = { "gmi": (l1c_gpm_gmi,), - "atms": (l1c_npp_atms,), + "atms": (l1c_npp_atms, l1c_noaa20_atms), "amsr2": (l1c_gcomw1_amsr2,) } diff --git a/gprof_nn/data/training_data.py b/gprof_nn/data/training_data.py index 7ce5405..7fdfa0d 100644 --- a/gprof_nn/data/training_data.py +++ b/gprof_nn/data/training_data.py @@ -1636,14 +1636,17 @@ def worker_init_fn(self, w_id: int): def __len__(self): - return len(self.input_files) + return len(self.input_files) // 100 def __getitem__(self, ind: int): + ind_r = ind * 100 + self.rng.integers(0, 100) + try: - data = xr.open_dataset(self.input_files[ind]) + data = xr.open_dataset(self.input_files[ind_r]) except Exception: return self[self.rng.integers(0, len(self))] + ind = ind_r n_chans_in = data.input_channels.size n_chans_out = data.target_channels.size