Skip to content

Commit 12a933e

Browse files
committed
fixed "latest"; it needed the "bands" argument
1 parent 81c4ee4 commit 12a933e

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

goes2go/NEW.py

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ def __init__(
5656
product=config["timerange"].get("product"),
5757
domain=config["timerange"].get("domain"),
5858
bands=None,
59+
channel=None,
5960
):
6061
"""Initialize a GOES object for a desired satellite and product.
6162
@@ -76,14 +77,27 @@ def __init__(
7677
- M = Mesoscale sector (both)
7778
- M1 = Mesoscale sector 1
7879
- M2 = Mesoscale sector 2
79-
band : None, int, or list
80+
bands : None, int, or list
8081
Specify the ABI channels to retrieve. *Only used if the
8182
product requested has unique bands.*
83+
For example, ``bands=2`` for channel 2 or ``bands=[1,2,3]``
84+
for channels 1, 2 and 3.
85+
channel : None, int, or list
86+
Alias for "bands" argument. If channel is not None, then
87+
"bands" is not use.
88+
89+
Note: I don't like the name of "bands", but the NetCDF file
90+
uses the term "band" instead of "channel" in reference to
91+
the ABI products, so I'll stick with "band" for now.
8292
"""
8393
self.satellite = satellite
8494
self.product = product
8595
self.domain = domain
86-
self.bands = bands
96+
97+
if channel is not None:
98+
self.bands = channel
99+
else:
100+
self.bands = bands
87101

88102
if self.product.startswith("ABI") and self.product in _product:
89103
# Sometimes the user might inavertantly give the domain
@@ -161,7 +175,11 @@ def __repr__(self):
161175
def latest(self, **kwargs):
162176
"""Get the latest available GOES data."""
163177
return goes_latest(
164-
satellite=self.satellite, product=self.product, domain=self.domain, **kwargs
178+
satellite=self.satellite,
179+
product=self.product,
180+
domain=self.domain,
181+
bands=self.bands,
182+
**kwargs,
165183
)
166184

167185
def nearesttime(

0 commit comments

Comments
 (0)