Skip to content

goes

GOES Satellite Reader. Deprecated wrapper — use monetio.load('goes', ...) instead.

The add_goes_bands utility function is not deprecated and remains available here.

add_goes_bands(dset, blue_band='blue', red_band='red', veggie_band='veggie')

Makes true color image from GOES-R satellite. Must have blue, red, veggie bands.

Note: This function modifies the input Dataset in-place by adding the 'tci' variable.

Parameters:

Name Type Description Default
dset Dataset

needs to have at least blue, red, veggie bands as data variables.

required
blue_band str

Name of the blue band variable in the dataset.

'blue'
red_band str

Name of the red band variable in the dataset.

'red'
veggie_band str

Name of the veggie band variable in the dataset.

'veggie'

Returns:

Type Description
Dataset

the original dataset with the true color image array added.

Source code in monetio/sat/goes.py
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
def add_goes_bands(
    dset: xr.Dataset,
    blue_band: str = "blue",
    red_band: str = "red",
    veggie_band: str = "veggie",
) -> xr.Dataset:
    """Makes true color image from GOES-R satellite. Must have blue, red, veggie bands.

    Note: This function modifies the input Dataset in-place by adding the 'tci' variable.

    Parameters
    ----------
    dset : xarray.Dataset
        needs to have at least blue, red, veggie bands as data variables.
    blue_band : str
        Name of the blue band variable in the dataset.
    red_band : str
        Name of the red band variable in the dataset.
    veggie_band : str
        Name of the veggie band variable in the dataset.

    Returns
    -------
    xarray.Dataset
        the original dataset with the true color image array added.
    """
    # make green band
    green = 0.45 * dset[red_band] + 0.1 * dset[veggie_band] + 0.45 * dset[blue_band]

    # Get the dimensions from one of the input bands
    dims = dset[red_band].dims

    # Create the true color image DataArray
    # Stack the bands along a new 'rgb' dimension
    tci = xr.concat([dset[red_band], green, dset[blue_band]], dim="rgb").transpose(
        *(dims + ("rgb",))
    )

    # add to the dataset
    dset["tci"] = tci
    dset["tci"].attrs = {
        "long_name": "GOES-R True Color Image",
        "standard_name": "tci",
    }

    return dset

open_dataset(date=None, filename=None, satellite='16', product=None, **kwargs)

Open GOES data from Amazon S3 or a local file.

Parameters:

Name Type Description Default
date str or datetime - like

Date to retrieve from S3.

None
filename str

Local file path. If provided, date is ignored.

None
satellite str

Satellite identifier (e.g. '16', '17', '18').

'16'
product str

GOES product (e.g. 'ABI-L2-AODF').

None
**kwargs dict

Additional arguments forwarded to GOESReader.open_dataset.

{}

Returns:

Type Description
Dataset
Source code in monetio/sat/goes.py
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
@deprecated_wrapper(
    "monetio.sat.goes.open_dataset",
    'monetio.load("goes", files=...)',
)
def open_dataset(date=None, filename=None, satellite="16", product=None, **kwargs):
    """Open GOES data from Amazon S3 or a local file.

    Parameters
    ----------
    date : str or datetime-like, optional
        Date to retrieve from S3.
    filename : str, optional
        Local file path. If provided, ``date`` is ignored.
    satellite : str, optional
        Satellite identifier (e.g. '16', '17', '18').
    product : str, optional
        GOES product (e.g. 'ABI-L2-AODF').
    **kwargs : dict
        Additional arguments forwarded to ``GOESReader.open_dataset``.

    Returns
    -------
    xarray.Dataset
    """
    reader = GOESReader()
    if filename is not None:
        return reader.open_dataset(files=filename, satellite=satellite, **kwargs)
    else:
        return reader.open_dataset(
            dates=date, satellite=satellite, product=product or "ABI-L2-AODF", **kwargs
        )