Skip to content
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 GK-2A AMI L1B Reader #911

Merged
merged 21 commits into from
Oct 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
dca2e1b
Add initial GK-2A AMI L1B Reader
djhoese Sep 22, 2019
db0242c
Add AMI reader to docs reader table
djhoese Sep 22, 2019
2c8f6b3
Add AMI calibration steps
djhoese Sep 23, 2019
d3bf76f
Fix typo in VI005 AMI wavelength
djhoese Sep 25, 2019
9dca407
Make AHI green corrector compositor take fraction parameters
djhoese Sep 25, 2019
6c4aa76
Use channel_name attribute instead of dataset name in AMI reader
djhoese Sep 26, 2019
da31be8
Add AMI orbital_parameters and true_color recipes
djhoese Oct 3, 2019
b1dc6d3
Add AMI reader tests and counts calibration
djhoese Oct 6, 2019
a2e4de0
Fix AMI area definition being flipped vertically
djhoese Oct 8, 2019
2b30720
Use internal calibration coefficients if available
simonrp84 Oct 8, 2019
e714ef2
Remove built-in slope/offset, use values in file. Add option to switc…
simonrp84 Oct 8, 2019
e6872b8
Fix AMI area extent test to match code
djhoese Oct 9, 2019
46cd7d5
Use internal calibration coefficients if available
simonrp84 Oct 8, 2019
35de058
Remove built-in slope/offset, use values in file. Add option to switc…
simonrp84 Oct 8, 2019
552b2e7
Add tests
simonrp84 Oct 11, 2019
796925e
Merge branch 'feature-ami-reader' of github.com:simonrp84/satpy into …
simonrp84 Oct 11, 2019
6088e5f
Move AMI IR calibration to separate method and add test for file calib
djhoese Oct 11, 2019
55798fb
Merge pull request #2 from simonrp84/feature-ami-reader
djhoese Oct 11, 2019
6104366
Copy AHI composites to AMI composite configs
djhoese Oct 11, 2019
7aeb0d5
Add AMI airmass and ash recipes
djhoese Oct 13, 2019
4cfec82
Add assertion to make sure AMI calibration comes from file
djhoese Oct 21, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,9 @@ the base Satpy installation.
- `hsaf_grib`
- | Beta
| Only the h03, h03b, h05 and h05B products are supported at-present
* - GEO-KOMPSAT-2 AMI L1B data in NetCDF4 format
- `ami_l1b`
- Beta


Indices and tables
Expand Down
11 changes: 7 additions & 4 deletions satpy/composites/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,7 @@ def __init__(self, name, common_channel_mask=True, **kwargs):
Args:
common_channel_mask (bool): If True, mask all the channels with
a mask that combines all the invalid areas of the given data.

"""
self.common_channel_mask = common_channel_mask
super(GenericCompositor, self).__init__(name, **kwargs)
Expand Down Expand Up @@ -974,6 +975,7 @@ def __init__(self, name, lim_low=85., lim_high=95., **kwargs):
blending of the given channels
lim_high (float): upper limit of Sun zenith angle for the
blending of the given channels

"""
self.lim_low = lim_low
self.lim_high = lim_high
Expand Down Expand Up @@ -1172,7 +1174,7 @@ class RatioSharpenedRGB(GenericCompositor):
footprint. Note that the input data to this compositor must already be
resampled so all data arrays are the same shape.

Example:
Example::

R_lo - 1000m resolution - shape=(2000, 2000)
G - 1000m resolution - shape=(2000, 2000)
Expand Down Expand Up @@ -1293,7 +1295,7 @@ def _mean4(data, offset=(0, 0), block_id=None):
class SelfSharpenedRGB(RatioSharpenedRGB):
"""Sharpen RGB with ratio of a band with a strided-version of itself.

Example:
Example::

R - 500m resolution - shape=(4000, 4000)
G - 1000m resolution - shape=(2000, 2000)
Expand Down Expand Up @@ -1402,6 +1404,7 @@ def __init__(self, name, filename=None, area=None, **kwargs):
filename (str): Filename of the image to load
area (str): Name of area definition for the image. Optional
for images with built-in area definitions (geotiff)

"""
if filename is None:
raise ValueError("No image configured for static image compositor")
Expand All @@ -1417,9 +1420,9 @@ def __call__(self, *args, **kwargs):
"""Call the compositor."""
from satpy import Scene
# Check if filename exists, if not then try from SATPY_ANCPATH
if (not os.path.isfile(self.filename)):
if not os.path.isfile(self.filename):
tmp_filename = os.path.join(get_environ_ancpath(), self.filename)
if (os.path.isfile(tmp_filename)):
if os.path.isfile(tmp_filename):
self.filename = tmp_filename
scn = Scene(reader='generic_image', filenames=[self.filename])
scn.load(['image'])
Expand Down
17 changes: 9 additions & 8 deletions satpy/composites/ahi.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
#
# You should have received a copy of the GNU General Public License along with
# satpy. If not, see <http://www.gnu.org/licenses/>.
"""Composite classes for the AHI instrument.
"""
"""Composite classes for the AHI instrument."""

import logging

Expand All @@ -26,17 +25,19 @@


class GreenCorrector(GenericCompositor):
"""Corrector of the AHI green band to compensate for the deficit of
chlorophyl signal.
"""
"""Corrector of the AHI green band to compensate for the deficit of chlorophyll signal."""

def __init__(self, *args, **kwargs):
"""Set default keyword argument values."""
# XXX: Should this be 0.93 and 0.07
self.fractions = kwargs.pop('fractions', [0.85, 0.15])
super(GreenCorrector, self).__init__(*args, **kwargs)

def __call__(self, projectables, optional_datasets=None, **attrs):
"""Boost vegetation effect thanks to NIR (0.8µm) band."""

green, nir = self.match_data_arrays(projectables)
LOG.info('Boosting vegetation on green band')

# XXX: Should this be 0.93 and 0.07
new_green = green * 0.85 + nir * 0.15
new_green = green * self.fractions[0] + nir * self.fractions[1]
new_green.attrs = green.attrs.copy()
return super(GreenCorrector, self).__call__((new_green,), **attrs)
153 changes: 153 additions & 0 deletions satpy/etc/composites/ami.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
sensor_name: visir/ami

composites:
green_raw:
compositor: !!python/name:satpy.composites.ahi.GreenCorrector
prerequisites:
- name: VI005
modifiers: [sunz_corrected]
- name: VI008
modifiers: [sunz_corrected]
standard_name: toa_bidirectional_reflectance
fractions: [0.85, 0.15]

green:
compositor: !!python/name:satpy.composites.ahi.GreenCorrector
prerequisites:
- name: VI005
modifiers: [sunz_corrected, rayleigh_corrected]
- name: VI008
modifiers: [sunz_corrected]
standard_name: toa_bidirectional_reflectance
fractions: [0.85, 0.15]

true_color_raw:
compositor: !!python/name:satpy.composites.SelfSharpenedRGB
prerequisites:
- name: VI006
modifiers: [sunz_corrected]
- name: green_raw
- name: VI004
modifiers: [sunz_corrected]
standard_name: true_color

true_color:
compositor: !!python/name:satpy.composites.SelfSharpenedRGB
prerequisites:
- name: VI006
modifiers: [sunz_corrected, rayleigh_corrected]
- name: green
- name: VI004
modifiers: [sunz_corrected, rayleigh_corrected]
standard_name: true_color

overview:
compositor: !!python/name:satpy.composites.GenericCompositor
prerequisites:
- 0.65
- 0.85
- 10.4
standard_name: overview

natural_color:
compositor: !!python/name:satpy.composites.SelfSharpenedRGB
prerequisites:
- name: NR016
modifiers: [sunz_corrected] #, rayleigh_corrected]
- name: VI008
modifiers: [sunz_corrected] #, rayleigh_corrected]
- name: VI006
modifiers: [sunz_corrected] #, rayleigh_corrected]
high_resolution_band: blue
standard_name: natural_color

day_microphysics_eum:
compositor: !!python/name:satpy.composites.GenericCompositor
prerequisites:
- wavelength: 0.86
- wavelength: 3.9
modifiers: [nir_reflectance]
- wavelength: 10.4
standard_name: day_microphysics

cloud_phase_distinction:
compositor: !!python/name:satpy.composites.GenericCompositor
prerequisites:
- wavelength: 10.4
- wavelength: 0.64
- wavelength: 1.6
standard_name: cloud_phase_distinction

water_vapors1:
compositor: !!python/name:satpy.composites.GenericCompositor
prerequisites:
- wavelength: 10.4
- wavelength: 6.2
- wavelength: 7.3
standard_name: water_vapors1

mid_vapor:
compositor: !!python/name:satpy.composites.DifferenceCompositor
prerequisites:
- wavelength: 7.3
- wavelength: 6.2
standard_name: mid_vapor

water_vapors2:
compositor: !!python/name:satpy.composites.GenericCompositor
prerequisites:
- name: mid_vapor
- wavelength: 7.3
- wavelength: 6.2
standard_name: water_vapors2

convection:
compositor: !!python/name:satpy.composites.GenericCompositor
prerequisites:
- compositor: !!python/name:satpy.composites.DifferenceCompositor
prerequisites:
- WV069
- WV073
- compositor: !!python/name:satpy.composites.DifferenceCompositor
prerequisites:
- SW038
- IR105
- compositor: !!python/name:satpy.composites.DifferenceCompositor
prerequisites:
- NR016
- VI006
standard_name: convection

ir_cloud_day:
standard_name: ir_cloud_day
compositor: !!python/name:satpy.composites.CloudCompositor
prerequisites:
- name: IR112

airmass:
compositor: !!python/name:satpy.composites.GenericCompositor
prerequisites:
- compositor: !!python/name:satpy.composites.DifferenceCompositor
prerequisites:
- name: WV063
- name: WV073
- compositor: !!python/name:satpy.composites.DifferenceCompositor
prerequisites:
- name: IR096
- name: IR105
- name: WV063
standard_name: airmass

ash:
compositor: !!python/name:satpy.composites.GenericCompositor
prerequisites:
- compositor: !!python/name:satpy.composites.DifferenceCompositor
prerequisites:
- IR123
- IR112
- compositor: !!python/name:satpy.composites.DifferenceCompositor
prerequisites:
- IR112
- IR087
- IR112
standard_name: ash
Loading