Skip to content

Masking bug in viirs_aod2ioda.py #1727

@weiwilliam

Description

@weiwilliam

Description

The viirs_aod2ioda.py has a bug to create the mask properly when because winmsk is created before the thinning.

# assign the observation time based on time coverage
self.obs_time = np.full(np.shape(self.lons), round(0.5*(self.s_time + self.e_time)), dtype=np.int64)
winmsk = ((self.obs_time >= self.wbeg) & (self.obs_time <= self.wend))
# apply thinning mask
if self.thin > 0.0:
mask_thin = np.random.uniform(size=len(self.lons)) > self.thin
self.lons = self.lons[mask_thin]
self.lats = self.lats[mask_thin]
self.lsfs = self.lsfs[mask_thin]
self.vals = self.vals[mask_thin]
self.errs = self.errs[mask_thin]
self.qcfs = self.qcfs[mask_thin]
self.obs_time = self.obs_time[mask_thin]
# Write out data
self.outdata[('latitude', metaDataName)] = np.append(
self.outdata[('latitude', metaDataName)], np.array(self.lats[winmsk], dtype=np.float32))

Requirements

winmsk should be defined after the thinning.
Move this line after thinning section.

winmsk = ((self.obs_time >= self.wbeg) & (self.obs_time <= self.wend))

Acceptance Criteria (Definition of Done)

It can run with --thin properly.

Dependencies

No dependency.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions