-
Notifications
You must be signed in to change notification settings - Fork 290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add reader for Goes15 netcdf Eumetsat format #530
Conversation
satpy/readers/nc_goes.py
Outdated
logger.debug('Calibration time: {}'.format(datetime.now() - tic)) | ||
|
||
# Mask space pixels | ||
#data = data.where(self.meta['earth_mask']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E265 block comment should start with '# '
satpy/readers/nc_goes.py
Outdated
Returns: | ||
Radiance [W m-2 um-1 sr-1] | ||
""" | ||
#rad = counts * slope + offset |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E265 block comment should start with '# '
satpy/readers/nc_goes.py
Outdated
logger.debug('Calibrating to reflectance') | ||
# FIXME: quick hack commented out here as VIS is aleady calivrated to | ||
# Albdo | ||
#refl = 100 * k * radiance |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E265 block comment should start with '# '
satpy/readers/nc_goes.py
Outdated
# FIXME: quick hack commented out here as VIS is aleady calivrated to | ||
# Albdo | ||
#refl = 100 * k * radiance | ||
#refl = k |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E265 block comment should start with '# '
satpy/readers/safe_sar_l2_ocn.py
Outdated
except ValueError: | ||
return r.text | ||
for x in r.findall("./*"): | ||
print x, x.tag |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E999 SyntaxError: invalid syntax
satpy/readers/safe_sar_l2_ocn.py
Outdated
res = res.where(res != res.attrs['_FillValue']) | ||
res.attrs['_FillValue'] = np.nan | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
W293 blank line contains whitespace
satpy/readers/safe_sar_l2_ocn.py
Outdated
res.attrs['_FillValue'] = np.nan | ||
|
||
|
||
print "DATA:", self.nc[key.name] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E303 too many blank lines (2)
satpy/readers/safe_sar_l2_ocn.py
Outdated
print "DATA:", self.nc[key.name] | ||
print "END" | ||
|
||
#print self.nc.attrs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E265 block comment should start with '# '
satpy/readers/safe_sar_l2_ocn.py
Outdated
if 'missionName' in self.nc.attrs: | ||
res.attrs.update({'platform_name': self.nc.attrs['missionName']}) | ||
|
||
print "res.shape: ",res.shape |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E231 missing whitespace after ','
satpy/writers/mitiff.py
Outdated
@@ -196,9 +197,13 @@ def _channel_names(self, channels, cns, **kwargs): | |||
return _image_description | |||
|
|||
def _add_sizes(self, datasets, first_dataset): | |||
print "datasets.sizes: ", datasets.sizes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E999 SyntaxError: invalid syntax
I have messed up several changes. |
satpy/readers/nc_goes.py
Outdated
# not needed this will be popped here. | ||
if 'file_type' in info: | ||
info.pop('file_type') | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
W293 blank line contains whitespace
This need to be refactorized by me and @sfinkens before it can be approved. |
Codecov Report
@@ Coverage Diff @@
## master #530 +/- ##
==========================================
+ Coverage 74.62% 74.75% +0.13%
==========================================
Files 136 136
Lines 18342 18517 +175
==========================================
+ Hits 13687 13842 +155
- Misses 4655 4675 +20
Continue to review full report at Codecov.
|
satpy/readers/nc_goes.py
Outdated
@@ -523,6 +558,17 @@ def __init__(self, filename, filename_info, filetype_info): | |||
nlines=self.nlines, | |||
ncols=self.ncols) | |||
self._meta = None | |||
self.geo_data = geo_data if geo_data is not None else self.nc | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
W293 blank line contains whitespace
This also makes sure the file_type is popped from the data array's attributes, not from the ds_info
# Instantiate reader using the mocked open_dataset() method | ||
self.reader = GOESEUMNCFileHandler(filename='dummy', filename_info={}, | ||
filetype_info={}, geo_data=geo_data) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
W293 blank line contains whitespace
calibration=calib, channel=ch) | ||
target_func.assert_called() | ||
|
||
class GOESNCEUMFileHandlerReflectanceTest(unittest.TestCase): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E302 expected 2 blank lines, found 1
I think this is ready for review @sfinkens . I don't understand why the tests dont pass. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Adding in the nc_goes reader possibilities to read the GOES15 EUM format which has slightly different file names and geo location in a separate file equal for all data channels. Also the EUM format data is calibrated to Albedo for the VIS channel and to radiance for the IR channels
nc_goes
reader) #534git diff origin/master -- "*py" | flake8 --diff