Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Himawari-9 over Japan — HSD segments to RGBs and a cloud mask

Open In Colab

You build true colour and day cloud phase images of Japan from raw Himawari Standard Data, then add NOAA’s L2 cloud mask on the same grid. The scene is the Japan area JP01 at 03:00 UTC on 8 October 2026, noon in Tokyo. Every file comes anonymously from NOAA’s public noaa-himawari9 bucket.

What you’ll learn:

  1. List and download HSD segments with geoproducts.himawari.aws, decompressed on the way in.

  2. Read calibrated bands with himawari.Reader, whole or by a lon/lat window.

  3. Read the NOAA cloud mask with himawari.L2Reader.

  4. Put bands at 0.5, 1 and 2 km and the full-disk mask on one grid with geoproducts.stack.

  5. Build true colour and day cloud phase, and mask clouds with himawari.MaskClouds.

The HSD format, calibration and the full preset table are on the Himawari AHI page.

Setup

On Colab the next cell installs geotoolz-products[himawari,operators]; locally, use the workspace environment (make install).

Python implementation: CPython
Python version       : 3.13.16
IPython version      : 9.13.0

numpy      : 2.4.5
matplotlib : 3.10.9
h5py       : 3.16.0
georeader  : unknown
geotoolz   : 0.9.0
geoproducts: 0.3.0
geocloud   : 0.3.0

Compiler    : GCC 13.3.0
OS          : Linux
Release     : 6.18.44-fc-v80
Machine     : x86_64
Processor   : x86_64
CPU cores   : 4
Architecture: 64bit

1. Find the segments

aws.list_segments lists the HSD files of one 10-minute slot. The Japan area is scanned four times per slot (JP01 … JP04), each one file per band; area="JP01" keeps the first.

B01   3.38 MB  HS_H09_20261008_0300_B01_JP01_R10_S0101.DAT.bz2
B02   3.38 MB  HS_H09_20261008_0300_B02_JP01_R10_S0101.DAT.bz2
B03  13.22 MB  HS_H09_20261008_0300_B03_JP01_R05_S0101.DAT.bz2
B04   3.82 MB  HS_H09_20261008_0300_B04_JP01_R10_S0101.DAT.bz2
B05   0.90 MB  HS_H09_20261008_0300_B05_JP01_R20_S0101.DAT.bz2
B06   0.87 MB  HS_H09_20261008_0300_B06_JP01_R20_S0101.DAT.bz2
… 16 bands in all

Six bands cover both recipes and the cloud mask’s display: B01–B04 for true colour, B05 and B13 for day cloud phase. decompress=True stores each segment as plain .DAT, which the reader memory-maps. Downloads go to a temporary directory.

B01    14.4 MB  HS_H09_20261008_0300_B01_JP01_R10_S0101.DAT
B02    14.4 MB  HS_H09_20261008_0300_B02_JP01_R10_S0101.DAT
B03    57.6 MB  HS_H09_20261008_0300_B03_JP01_R05_S0101.DAT
B04    14.4 MB  HS_H09_20261008_0300_B04_JP01_R10_S0101.DAT
B05     3.6 MB  HS_H09_20261008_0300_B05_JP01_R20_S0101.DAT
B13     3.6 MB  HS_H09_20261008_0300_B13_JP01_R20_S0101.DAT

2. Read calibrated bands

himawari.Reader decodes an HSD segment onto its +proj=geos grid. calibration= picks the output: reflectance for B01–B06, brightness temperature for B07–B16. The coefficients come from the file’s own header.

B03  0.64 µm  (1, 4800, 6000)  500 m  1
B13 10.41 µm  (1, 1200, 1500)  2000 m  K
B03 updated visible gain: 0.30901666

The reader is lazy. read_from_bounds decodes only the pixels under a lon/lat box, here Tokyo Bay at B03’s native 0.5 km.

(1, 162, 214) float32
<Figure size 600x500 with 1 Axes>

3. Read the NOAA cloud mask

NOAA runs its cloud algorithms on every full-disk scan and publishes the results as NetCDF-4. himawari.L2Reader places the mask on the 2 km full-disk grid. The file is about 370 MB, the largest download here.

368 MB  AHI-CMSK_v1r1_h09_s202610080300213_e202610080309407_c202610080314124.nc
('CloudMaskBinary', 'CloudMask') (2, 5500, 5500) int8
{0: 'clear', 1: 'probably_clear', 2: 'probably_cloudy', 3: 'cloudy'}

4. Put everything on one grid

geoproducts.stack uses the first reader’s grid, here B13’s 2 km Japan area. Finer bands are averaged down, and the full-disk mask is cut to the area and resampled with mode.

(8, 1200, 1500) float32
('B13', 'B01', 'B02', 'B03', 'B04', 'B05', 'CloudMaskBinary', 'CloudMask')

5. RGB recipes and the cloud mask

himawari.TrueColor() mixes a hybrid green from B02 and B04, because B02 alone makes vegetation too dark. himawari.DayCloudPhase() shows ice tops red and liquid low cloud cyan. himawari.MaskClouds() reads CloudMaskBinary and returns True for cloud.

cloudy: 35.1% of the area

The figures plot every second pixel of the 1200 × 1500 grid. The black corners lie outside the JP01 scan, so the bands are NaN there; the cloud mask, cut from the full disk, still covers them.

<Figure size 1800x500 with 4 Axes>

Clear-sky true colour

gz.mask.ApplyMask with himawari.MaskClouds() blanks the cloudy pixels. Apply it to the bands the recipe reads plus the mask band, then take the true colour. A Sequential chains the three steps:

<Figure size 800x650 with 1 Axes>

Summary

  • himawari.aws.list_segments and download(decompress=True) fetch HSD segments from NOAA’s anonymous bucket, ready to memory-map.

  • himawari.Reader calibrates each band from its own header and reads windows lazily.

  • himawari.L2Reader puts NOAA’s full-disk cloud mask on the AHI grid, and geoproducts.stack cuts it to any area.

  • The presets (TrueColor, DayCloudPhase, MaskClouds) are the GOES ones bound to AHI band names.

Next: the GOES-19 version with parallax correction in GOES-19 mesoscale, and the reader reference on the Himawari AHI page.