Skip to content
Snippets Groups Projects
Commit 949f1800 authored by Greg Quinn's avatar Greg Quinn
Browse files

Don't use INVALID flag for bowtie-deleted pixels

parent b74d7ce4
No related branches found
No related tags found
No related merge requests found
......@@ -24,14 +24,17 @@ def read_viirs_radiances(sdr_filenames):
rad_tmp = g['Radiance'][:]
if 'RadianceFactors' in g:
mask = rad_tmp > 65000
rad_tmp = np.ma.array(rad_tmp, mask=(rad_tmp > 65000))
bowtie_mask = (rad_tmp == 65533)
mask = (rad_tmp > 65000)
rad_tmp = np.ma.array(rad_tmp, mask=mask)
sf_a, sf_b = g['RadianceFactors'][:]
rad_tmp = sf_a * rad_tmp + sf_b
else:
bowtie_mask = (rad_tmp == -999.7)
mask = (rad_tmp <= -999.0)
rad[i] = rad_tmp
rad[i][mask] = -9999.0
rad[i][bowtie_mask] = -9997.0
return rad
......@@ -86,6 +89,10 @@ for cris_row in range(num_cris_scans):
bad_idxs = (rads == -9999.0)
flags[bad_idxs.any(axis=1)] |= INVALID
# we also need to trim out bowtie-deleted pixels, though
# they should not result in setting the INVALID flag
bad_idxs = np.logical_or(bad_idxs, rads == -9997.0)
# determine how many pixels are being used per band
n[:] = num - bad_idxs.sum(axis=1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment