Skip to content

Commit

Permalink
Include observations from noaa20.
Browse files Browse the repository at this point in the history
  • Loading branch information
simonpf committed Oct 4, 2024
1 parent 9a5775b commit 6845e2d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion gprof_nn/data/pretraining.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
from pansat.products.satellite.gpm import (
l1c_gpm_gmi,
l1c_npp_atms,
l1c_noaa20_atms,
l1c_gcomw1_amsr2,
merged_ir
)
Expand Down Expand Up @@ -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,)
}

Expand Down
7 changes: 5 additions & 2 deletions gprof_nn/data/training_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6845e2d

Please sign in to comment.