EXT.01 · AHI B03
rad / rfc / rfyGEOSTATIONARY SATELLITE GRIDDED DATA
This page is a product guide to the regular latitude–longitude grids generated as AMATERASS intermediate files by applying geolocation correction to Himawari-8/9 AHI Full Disk observations. The data are distributed by the Center for Environmental Remote Sensing (CEReS), Chiba University, as the CEReS Gridded Format (precisely geometrically corrected data on a regular latitude–longitude coordinate system), and this page is their primary information source, provided by the developer.

PRODUCT AT A GLANCE
All 16 AHI bands can be compared as Full Disk images on a common latitude–longitude grid, revealing wavelength-dependent information on clouds, the surface, water vapour, ozone, and other atmospheric features.
The observation time is 03:00 UTC on 7 July 2019. B01–B06 show Reflectivity and B07–B16 show brightness temperature (TBB). The plotted ranges are selected for visualization and do not define the valid ranges of the data.

CHANNEL & PRODUCT DIRECTORY
The table below maps AHI band numbers to AMATERASS grid channel names, native resolutions, and suffixes used by the 4 km subproducts.
EXT.01 · AHI B03
rad / rfc / rfyVIS.01–03 · B01/B02/B04
rad / rfc / rfySIR.01–02 · B05/B06
rad / rfc / rfyTIR.01–10 · B07–B16
rad / tbb| AMATERASS grid name | AHI | Central wavelength | Native grid | 4 km suffixes |
|---|---|---|---|---|
VIS.01vis.01 | B01 | 0.47 µm | 12,000 × 12,000 / 0.01° | rad / rfc / rfy |
VIS.02vis.02 | B02 | 0.51 µm | 12,000 × 12,000 / 0.01° | rad / rfc / rfy |
EXT.01ext.01 | B03 | 0.64 µm | 24,000 × 24,000 / 0.005° | rad / rfc / rfy |
VIS.03vis.03 | B04 | 0.86 µm | 12,000 × 12,000 / 0.01° | rad / rfc / rfy |
SIR.01sir.01 | B05 | 1.6 µm | 6,000 × 6,000 / 0.02° | rad / rfc / rfy |
SIR.02sir.02 | B06 | 2.3 µm | 6,000 × 6,000 / 0.02° | rad / rfc / rfy |
TIR.05tir.05 | B07 | 3.9 µm | 6,000 × 6,000 / 0.02° | rad / tbb |
TIR.06tir.06 | B08 | 6.2 µm | 6,000 × 6,000 / 0.02° | rad / tbb |
TIR.07tir.07 | B09 | 6.9 µm | 6,000 × 6,000 / 0.02° | rad / tbb |
TIR.08tir.08 | B10 | 7.3 µm | 6,000 × 6,000 / 0.02° | rad / tbb |
TIR.09tir.09 | B11 | 8.6 µm | 6,000 × 6,000 / 0.02° | rad / tbb |
TIR.10tir.10 | B12 | 9.6 µm | 6,000 × 6,000 / 0.02° | rad / tbb |
TIR.01tir.01 | B13 | 10.4 µm | 6,000 × 6,000 / 0.02° | rad / tbb |
TIR.02tir.02 | B14 | 11.2 µm | 6,000 × 6,000 / 0.02° | rad / tbb |
TIR.03tir.03 | B15 | 12.4 µm | 6,000 × 6,000 / 0.02° | rad / tbb |
TIR.04tir.04 | B16 | 13.3 µm | 6,000 × 6,000 / 0.02° | rad / tbb |
Channel numbers within each group are separate from AHI band numbers. For example, EXT.01 corresponds to AHI B03, while TIR.01 corresponds to AHI B13.
NATIVE DN GRID, COVERAGE & QUICKLOOK
Himawari-8/9 Full Disk observations are scanned images whose pixels are arranged in the satellite projection. Individual pixels are not directly assigned to a regular latitude–longitude grid, and coordinates derived only from orbit, attitude, and scan geometry retain observation-dependent geolocation errors. This product estimates and corrects those errors from the imagery before mapping the observations to regular latitude–longitude grids.
Pixels are recorded by line and column in the satellite projection, not directly by latitude and longitude.
Visible imagery is matched against terrain-derived landmark references to determine line and column displacement.
Corrected pixels are mapped to common coordinates, producing DN grids with stable correspondence to the surface.

Phase-only correlation (POC)Two-dimensional fast Fourier transforms estimate image displacement rapidly without an iterative search.
References derived from SRTM 1-arcsecond dataVisible-channel observations are matched against landmark reference images constructed from terrain data.
Many control points at high cadenceThe Himawari-8 demonstration processed 22,709 points for each 10-minute Full Disk observation and 5,826 points for each 2.5-minute regional observation.
Native-resolution DN gridsCorrected observations are written to regular latitude–longitude grids at 0.005°, 0.01°, and 0.02° spacing.
This is not merely a coordinate transformation. It estimates residual geolocation error for each observation by registering the observed image against a geographic reference image.
Input disk pixels are not directly linked to latitude and longitude. Correction and gridding produce foundational data with geographic coordinates registered to the observations.
Elevation is combined with water and ocean masks to construct landmark reference imagery in the normalized geostationary projection.
Phase-only correlation needs no iterative search; a clear peak in the correlation surface yields line and column displacement. Accuracy was maintained even in the presence of cloud disturbance.
The 22,709-point Full Disk calculation ran in approximately 10 seconds using 88 threads, demonstrating performance suitable for 10- and 2.5-minute quasi-real-time analysis.
coff and loffColumn and line offsets are estimated for each observation. Their statistics also revealed characteristic time-varying geolocation errors in the standard data.
The corrections support gridding of all 16 channels and provide a basis for physical retrievals, ground validation, and parallax correction. The method has also been applied to NASA GeoNEX.
Validation of satellite estimates such as surface solar radiation requires the selected pixel to correspond correctly to the ground instrument.
Suppressing nonphysical spatial variability caused by geolocation error stabilizes time-series analysis of clouds and heterogeneous surfaces.
It prevents retrieval-algorithm, sensor-calibration, and geolocation errors from being conflated during physical-product evaluation.
This product is not a mechanical reprojection of a Full Disk image onto a prescribed map. Observation-specific geolocation errors are estimated from the imagery itself and corrected before the data are gridded. The resulting geographic correspondence forms a foundation for quantitative atmospheric and land analysis, validation against ground observations, and parallax correction.
coff / loffThe YYYYMMDDHHMN.ext.fld.coff.txt.bz2 and YYYYMMDDHHMN.ext.fld.loff.txt.bz2 files in the EXT collection record column- and line-direction corrections generated by Geolocation Correction. They are not required for ordinary DN use.
For each native resolution, the coverage and grid structure are followed by a representative quicklook and the corresponding data specification.

EXT.01 · B030.64 µm Reflectivity
EXT.01(AHI B03)
PNG/WebP files are quicklooks for visual inspection. Use the corresponding binary file for numerical analysis.

VIS.03 · B040.86 µm Reflectivity
VIS.01 / 02 / 03(AHI B01 / 02 / 04)
PNG/WebP files are quicklooks for visual inspection. Use the corresponding binary file for numerical analysis.

TIR.01 · B1310.4 µm Brightness temperature
SIR.01–02 / TIR.01–10(AHI B05–B16)
PNG/WebP files are quicklooks for visual inspection. Use the corresponding binary file for numerical analysis.
The domain extends from 85°E to 155°W and from 60°N to 60°S. Pixels are placed on regular latitude–longitude grids, with coastlines matched to each resolution.
NATIVE DN FILENAME ANATOMY
YYYYMMDDHHMN.{ext|vis|sir|tir}.NN.fld.geoss.bz2Braces denote alternatives and NN is the two-digit channel number within a group. Braces and vertical bars do not appear in actual filenames.
201907070300.ext.01.fld.geoss.bz2YYYY MM DD HH MN; the example is 2019-07-07 03:00 UTC
ext 500 m; vis 1 km; sir/tir 2 km
Fixed at two digits; separate from the AHI band number
Corrected Full Disk grid; bzip2-compressed UInt16
ext.01 = B03, vis.03 = B04, and tir.01 = B13. The number 01 alone does not identify an AHI band.
fld.geossfld denotes the Full Disk domain used in this guide. geoss is the fixed token used by this DN product series.
.bz2 is the outer compression layerDecompression leaves a headerless Big-endian UInt16 file ending in .fld.geoss. There is no .bin suffix.
201907070300.ext.01.fld.geoss.bz2201907070300.vis.03.fld.geoss.bz2201907070300.tir.01.fld.geoss.bz2Valid channel identifiers are ext.01, vis.01–03, sir.01–02, and tir.01–10. See the 16-channel table above for the complete mapping to AHI bands.
NATIVE DN STORAGE ORDER & MISSING VALUE
row × NX + columnHeaderless, row-major storage65535Pixels left unfilled after geometric correctionAnalysis note: 65535 is not a valid observation DN. Exclude it as missing before computing statistics or converting to physical quantities.
NATIVE DN READER SAMPLES
Languages suited to sustained processing of large files are listed first. Decompress each file with bzip2 -dk FILE.bz2 or an equivalent command before running a sample.
This reader is written specifically for the native DN grid. It reads a headerless, row-major, big-endian binary file and verifies the value count and file size.
import java.io.BufferedInputStream;
import java.io.DataInputStream;
import java.io.EOFException;
import java.nio.file.Files;
import java.nio.file.Path;
public class ReadAmaterassDn {
private record Grid(int nx, int ny) {}
private static Grid gridFromName(String name) {
String lower = name.toLowerCase();
if (lower.contains(".ext.")) return new Grid(24000, 24000);
if (lower.contains(".vis.")) return new Grid(12000, 12000);
if (lower.contains(".sir.") || lower.contains(".tir.")) return new Grid(6000, 6000);
throw new IllegalArgumentException("filename must contain .ext., .vis., .sir., or .tir.");
}
public static void main(String[] args) throws Exception {
if (args.length != 1) throw new IllegalArgumentException("usage: java ReadAmaterassDn FILE");
Path path = Path.of(args[0]);
Grid grid = gridFromName(path.getFileName().toString());
long count = (long) grid.nx * grid.ny;
long expectedBytes = count * 2L;
if (Files.size(path) != expectedBytes)
throw new IllegalArgumentException("unexpected file size: " + Files.size(path) + " bytes");
int first = -1, minimum = 65535, maximum = 0;
long missing = 0, valid = 0;
try (DataInputStream in = new DataInputStream(new BufferedInputStream(Files.newInputStream(path)))) {
for (long i = 0; i < count; i++) {
int value;
try { value = in.readUnsignedShort(); }
catch (EOFException e) { throw new EOFException("unexpected end of file at value " + i); }
if (i == 0) first = value;
if (value == 65535) { missing++; continue; }
valid++;
minimum = Math.min(minimum, value);
maximum = Math.max(maximum, value);
}
if (in.read() != -1) throw new IllegalArgumentException("file is larger than expected");
}
System.out.printf("grid = %d x %d%n", grid.nx, grid.ny);
System.out.printf("first = %d DN%nmissing = %d pixels (DN 65535)%n", first, missing);
if (valid > 0) System.out.printf("valid min = %d DN%nvalid max = %d DN%n", minimum, maximum);
}
}javac ReadAmaterassDn.java java ReadAmaterassDn 201907070300.vis.02.fld.geoss
This reader is written specifically for the native DN grid. It reads a headerless, row-major, big-endian binary file and verifies the value count and file size.
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
static int grid_size(const char *name) {
if (strstr(name, ".ext.")) return 24000;
if (strstr(name, ".vis.")) return 12000;
if (strstr(name, ".sir.") || strstr(name, ".tir.")) return 6000;
fprintf(stderr, "filename must contain .ext., .vis., .sir., or .tir.\n");
exit(EXIT_FAILURE);
}
int main(int argc, char **argv) {
if (argc != 2) { fprintf(stderr, "usage: %s FILE\n", argv[0]); return EXIT_FAILURE; }
int n = grid_size(argv[1]);
uint64_t count = (uint64_t)n * (uint64_t)n, expected = count * 2u;
struct stat info;
if (stat(argv[1], &info) != 0) { perror(argv[1]); return EXIT_FAILURE; }
if ((uint64_t)info.st_size != expected) {
fprintf(stderr, "unexpected file size: %lld bytes\n", (long long)info.st_size);
return EXIT_FAILURE;
}
FILE *fp = fopen(argv[1], "rb");
if (!fp) { perror(argv[1]); return EXIT_FAILURE; }
uint16_t first = 0, minimum = UINT16_MAX, maximum = 0;
uint64_t missing = 0, valid = 0;
for (uint64_t i = 0; i < count; i++) {
uint8_t b[2];
if (fread(b, 1, 2, fp) != 2) { fprintf(stderr, "unexpected end of file\n"); return EXIT_FAILURE; }
uint16_t value = (uint16_t)(((uint16_t)b[0] << 8) | b[1]);
if (i == 0) first = value;
if (value == UINT16_MAX) { missing++; continue; }
valid++;
if (value < minimum) minimum = value;
if (value > maximum) maximum = value;
}
fclose(fp);
printf("grid = %d x %d\nfirst = %u DN\nmissing = %llu pixels (DN 65535)\n",
n, n, first, (unsigned long long)missing);
if (valid > 0) printf("valid min = %u DN\nvalid max = %u DN\n", minimum, maximum);
return EXIT_SUCCESS;
}cc -O3 -std=c11 read_amaterass_dn.c -o read_dn ./read_dn 201907070300.vis.02.fld.geoss
This reader is written specifically for the native DN grid. It reads a headerless, row-major, big-endian binary file and verifies the value count and file size.
program read_amaterass_dn
use iso_fortran_env, only: int16, int32, int64
implicit none
character(len=1024) :: path
integer :: nx, ny, unit, row, column, stat
integer(int64) :: bytes, expected, missing, valid
integer(int16), allocatable :: raw(:)
integer(int32) :: value, first, minimum, maximum
if (command_argument_count() /= 1) error stop 'usage: read_dn FILE'
call get_command_argument(1, path)
if (index(path, '.ext.') > 0) then
nx=24000
else if (index(path, '.vis.') > 0) then
nx=12000
else if (index(path, '.sir.') > 0 .or. index(path, '.tir.') > 0) then
nx=6000
else
error stop 'filename must contain .ext., .vis., .sir., or .tir.'
end if
ny=nx
inquire(file=trim(path), size=bytes)
expected=int(nx,int64)*int(ny,int64)*2_int64
if (bytes /= expected) error stop 'unexpected file size'
allocate(raw(nx))
open(newunit=unit,file=trim(path),access='stream',form='unformatted', &
status='old',action='read',convert='big_endian')
minimum=65535; maximum=0; first=-1; missing=0; valid=0
do row=1,ny
read(unit,iostat=stat) raw
if (stat /= 0) error stop 'unexpected end of file'
do column=1,nx
value=iand(int(raw(column),int32),int(z'FFFF',int32))
if (row == 1 .and. column == 1) first=value
if (value == 65535) then
missing=missing+1
cycle
end if
valid=valid+1
minimum=min(minimum,value); maximum=max(maximum,value)
end do
end do
close(unit)
print '(A,I0,A,I0)', 'grid = ',nx,' x ',ny
print '(A,I0,A)', 'first = ',first,' DN'
print '(A,I0,A)', 'missing = ',missing,' pixels (DN 65535)'
if (valid > 0) then
print '(A,I0,A)', 'valid min = ',minimum,' DN'
print '(A,I0,A)', 'valid max = ',maximum,' DN'
end if
end program read_amaterass_dngfortran -O3 read_amaterass_dn.f90 -o read_dn ./read_dn 201907070300.vis.02.fld.geoss
This reader is written specifically for the native DN grid. It reads a headerless, row-major, big-endian binary file and verifies the value count and file size.
from pathlib import Path
import sys
import numpy as np
def grid_size(name: str) -> int:
name = name.lower()
if ".ext." in name:
return 24000
if ".vis." in name:
return 12000
if ".sir." in name or ".tir." in name:
return 6000
raise ValueError("filename must contain .ext., .vis., .sir., or .tir.")
def main() -> None:
if len(sys.argv) != 2:
raise SystemExit(f"usage: {Path(sys.argv[0]).name} FILE")
path = Path(sys.argv[1])
n = grid_size(path.name)
values = np.fromfile(path, dtype=">u2")
if values.size != n * n:
raise ValueError(f"unexpected value count: {values.size}")
grid = values.reshape(n, n)
valid = grid != 65535
valid_values = grid[valid]
print(f"grid = {n} x {n}")
print(f"first = {int(grid[0, 0])} DN")
print(f"missing = {int((~valid).sum())} pixels (DN 65535)")
if valid_values.size:
print(f"valid min = {int(valid_values.min())} DN")
print(f"valid max = {int(valid_values.max())} DN")
if __name__ == "__main__":
main()python3 read_amaterass_dn.py 201907070300.vis.02.fld.geoss
Input handled by these samples: The DN readers infer 24,000 × 24,000, 12,000 × 12,000, or 6,000 × 6,000 from ext / vis / sir / tir in the filename and read unsigned 16-bit integers.
4 KM PHYSICAL QUANTITY PRODUCTS
These products convert all 16 bands to physical quantities on a common 3000 × 3000 grid. Radiance is provided for every channel; Reflectance and Reflectivity are additionally provided for B01–B06, and brightness temperature (TBB) for B07–B16.
The native 500 m, 1 km, and 2 km DN grids use big-endian UInt16. Each 4 km physical quantity is provided as a separate big-endian Float32 file whose uncompressed size is 36,000,000 bytes.
Radiance is common to all 16 bands; the additional quantities differ between the shortwave and infrared bands.
rad + rfc + rfyradRadianceSpectral radiance
rfcReflectanceNormalized by cos(SZA)
rfyReflectivityNot normalized by cos(SZA)
rad + tbbradRadianceSpectral radiance
tbbBrightness temperatureBrightness temperature [K]
rad · RadianceVIS.02 · B02 · 2019-07-07 03:00 UTC
rad · VIS.02 · B020.51 µm Radiance
201907070300.vis.02.rad.fld.4km.bin.bz2
This tmap rendering is a quicklook for visual inspection. Use the corresponding binary file for numerical analysis.
rfc · ReflectanceVIS.02 · B02 · 2019-07-07 03:00 UTC
rfc · VIS.02 · B020.51 µm Reflectance
201907070300.vis.02.rfc.fld.4km.bin.bz2
This tmap rendering is a quicklook for visual inspection. Use the corresponding binary file for numerical analysis.
rfy · ReflectivityVIS.02 · B02 · 2019-07-07 03:00 UTC
rfy · VIS.02 · B020.51 µm Reflectivity
201907070300.vis.02.rfy.fld.4km.bin.bz2
This tmap rendering is a quicklook for visual inspection. Use the corresponding binary file for numerical analysis.
tbb · Brightness temperatureTIR.03 · B15 · 2019-07-07 03:00 UTC
tbb · TIR.03 · B1512.4 µm Brightness temperature
201907070300.tir.03.tbb.fld.4km.bin.bz2
This tmap rendering is a quicklook for visual inspection. Use the corresponding binary file for numerical analysis.
SHORTWAVE NORMALIZATION
Let L be spectral radiance, E₀ the band-specific solar irradiance used for conversion, and SZA the solar zenith angle. rfc includes cos(SZA) in the denominator; rfy does not.
rfy = 100 × πL / E₀No normalization by cos(SZA). File values are expressed in percent.
rfc = πL / (E₀ cos(SZA))Normalized by solar zenith angle; dimensionless.
FILENAME ANATOMY
YYYYMMDDHHMN.GROUP.NN.QUANTITY.fld.4km.bin.bz2GROUP.NN is the AMATERASS grid identifier and QUANTITY names the converted physical quantity.
201907070300.vis.02.rfy.fld.4km.bin.bz2YYYYMMDDHHMN · UTC
VIS group channel 02 · AHI B02
rad / rfc / rfy / tbb
Full Disk · 3,000 × 3,000
Float32 · bzip2
radRadiance, generated for all 16 bands in EXT, VIS, SIR, and TIR.
rfc / rfyReflectance and Reflectivity, available only for EXT, VIS, and SIR.
tbbBrightness temperature, available for the ten TIR bands.
YYYYMMDDHHMN.VARIABLE.fld.4km.bin.bz2Channel-independent grid and viewing-geometry fields replace GROUP.NN.QUANTITY with variables such as lat, lng, sun.azm, sat.zth, or grd.time.mjd.hms.
Even after conversion to 4 km, filenames retain AMATERASS grid channel names such as vis.02 and tir.03. Their mapping to AHI band numbers is given in the 16-channel table above.
AMATERASS 4 KM INTERMEDIATE PRODUCTS
These gridded coordinate, observation-time, and viewing-geometry fields are generated in the AMATERASS fld.4km preprocessing stage before radiative-transfer calculations. Every field shares the same 3000 × 3000 pixel correspondence as the physical-quantity products.
Headerless big-endian Float32 in row-major order. Each row is written west to east, and rows advance north to south.
| Variable in filename | Quantity | Unit | Definition and note |
|---|---|---|---|
lat | Latitude | degree | Decimal degrees; positive north |
lng | Longitude | degree | Decimal degrees; 85°E to 205°E (155°W) |
grd.time.mjd.hms | Pixel observation time | UTC day fraction | Normalized to 0–1; 12:00 UTC is 0.5. An approximate rather than exact scan time |
sun.zth | Solar zenith angle | degree | Zero at zenith |
sun.azm | Solar azimuth angle | degree | Zero at due south; increases clockwise |
sat.zth | Satellite zenith angle | degree | Zero at zenith |
sat.azm | Satellite azimuth angle | degree | Zero at due south; increases clockwise |
Azimuth convention: This guide uses due south as 0° with angles increasing clockwise for sun.azm and sat.azm. AMATERASS radiative-transfer calculations use the relative azimuth between the Sun and satellite.
4 KM FLOAT32 READER SAMPLES
Languages suited to sustained processing of large files are listed first. Decompress each file with bzip2 -dk FILE.bz2 or an equivalent command before running a sample.
This reader is written specifically for the 4 km physical-quantity product. It reads a headerless, row-major, big-endian binary file and verifies the value count and file size.
import java.io.BufferedInputStream;
import java.io.DataInputStream;
import java.io.EOFException;
import java.nio.file.Files;
import java.nio.file.Path;
public class ReadAmaterass4km {
private static final int NX = 3000, NY = 3000;
public static void main(String[] args) throws Exception {
if (args.length != 1) throw new IllegalArgumentException("usage: java ReadAmaterass4km FILE");
Path path = Path.of(args[0]);
long count = (long) NX * NY, expectedBytes = count * 4L;
if (Files.size(path) != expectedBytes)
throw new IllegalArgumentException("unexpected file size: " + Files.size(path) + " bytes");
float first = Float.NaN, minimum = Float.POSITIVE_INFINITY, maximum = Float.NEGATIVE_INFINITY;
long finite = 0;
try (DataInputStream in = new DataInputStream(new BufferedInputStream(Files.newInputStream(path)))) {
for (long i = 0; i < count; i++) {
float value;
try { value = in.readFloat(); }
catch (EOFException e) { throw new EOFException("unexpected end of file at value " + i); }
if (i == 0) first = value;
if (Float.isFinite(value)) {
finite++;
minimum = Math.min(minimum, value);
maximum = Math.max(maximum, value);
}
}
if (in.read() != -1) throw new IllegalArgumentException("file is larger than expected");
}
System.out.printf("grid = %d x %d%n", NX, NY);
System.out.printf("first = %.7g%nfinite = %d%nmin = %.7g%nmax = %.7g%n",
first, finite, minimum, maximum);
}
}javac ReadAmaterass4km.java java ReadAmaterass4km 201907070300.vis.02.rfy.fld.4km.bin
This reader is written specifically for the 4 km physical-quantity product. It reads a headerless, row-major, big-endian binary file and verifies the value count and file size.
#include <math.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#define NX 3000
#define NY 3000
int main(int argc, char **argv) {
if (argc != 2) { fprintf(stderr, "usage: %s FILE\n", argv[0]); return EXIT_FAILURE; }
const uint64_t count = (uint64_t)NX * NY, expected = count * 4u;
struct stat info;
if (stat(argv[1], &info) != 0) { perror(argv[1]); return EXIT_FAILURE; }
if ((uint64_t)info.st_size != expected) {
fprintf(stderr, "unexpected file size: %lld bytes\n", (long long)info.st_size);
return EXIT_FAILURE;
}
FILE *fp = fopen(argv[1], "rb");
if (!fp) { perror(argv[1]); return EXIT_FAILURE; }
float first = NAN, minimum = INFINITY, maximum = -INFINITY;
uint64_t finite = 0;
for (uint64_t i = 0; i < count; i++) {
uint8_t b[4];
if (fread(b, 1, 4, fp) != 4) { fprintf(stderr, "unexpected end of file\n"); return EXIT_FAILURE; }
uint32_t bits = ((uint32_t)b[0] << 24) | ((uint32_t)b[1] << 16) |
((uint32_t)b[2] << 8) | (uint32_t)b[3];
float value;
memcpy(&value, &bits, sizeof value);
if (i == 0) first = value;
if (isfinite(value)) {
finite++;
if (value < minimum) minimum = value;
if (value > maximum) maximum = value;
}
}
fclose(fp);
printf("grid = %d x %d\nfirst = %.7g\nfinite = %llu\nmin = %.7g\nmax = %.7g\n",
NX, NY, first, (unsigned long long)finite, minimum, maximum);
return EXIT_SUCCESS;
}cc -O3 -std=c11 read_amaterass_4km.c -o read_4km ./read_4km 201907070300.vis.02.rfy.fld.4km.bin
This reader is written specifically for the 4 km physical-quantity product. It reads a headerless, row-major, big-endian binary file and verifies the value count and file size.
program read_amaterass_4km
use iso_fortran_env, only: int64, real32
use, intrinsic :: ieee_arithmetic, only: ieee_is_finite
implicit none
integer, parameter :: nx=3000, ny=3000
character(len=1024) :: path
integer :: unit, row, column, stat
integer(int64) :: bytes, expected, finite
real(real32), allocatable :: values(:)
real(real32) :: value, first, minimum, maximum
if (command_argument_count() /= 1) error stop 'usage: read_4km FILE'
call get_command_argument(1, path)
inquire(file=trim(path), size=bytes)
expected=int(nx,int64)*int(ny,int64)*4_int64
if (bytes /= expected) error stop 'unexpected file size'
allocate(values(nx))
open(newunit=unit,file=trim(path),access='stream',form='unformatted', &
status='old',action='read',convert='big_endian')
minimum=huge(minimum); maximum=-huge(maximum); finite=0; first=0.0_real32
do row=1,ny
read(unit,iostat=stat) values
if (stat /= 0) error stop 'unexpected end of file'
do column=1,nx
value=values(column)
if (row == 1 .and. column == 1) first=value
if (ieee_is_finite(value)) then
finite=finite+1; minimum=min(minimum,value); maximum=max(maximum,value)
end if
end do
end do
close(unit)
print '(A,I0,A,I0)', 'grid = ',nx,' x ',ny
print '(A,ES14.6)', 'first = ',first
print '(A,I0)', 'finite = ',finite
print '(A,ES14.6)', 'min = ',minimum
print '(A,ES14.6)', 'max = ',maximum
end program read_amaterass_4kmgfortran -O3 read_amaterass_4km.f90 -o read_4km ./read_4km 201907070300.vis.02.rfy.fld.4km.bin
This reader is written specifically for the 4 km physical-quantity product. It reads a headerless, row-major, big-endian binary file and verifies the value count and file size.
from pathlib import Path
import sys
import numpy as np
NX, NY = 3000, 3000
def main() -> None:
if len(sys.argv) != 2:
raise SystemExit(f"usage: {Path(sys.argv[0]).name} FILE")
path = Path(sys.argv[1])
values = np.fromfile(path, dtype=">f4")
if values.size != NX * NY:
raise ValueError(f"unexpected value count: {values.size}")
grid = values.reshape(NY, NX)
finite = np.isfinite(grid)
print(f"grid = {NX} x {NY}")
print(f"first = {float(grid[0, 0]):.7g}")
print(f"finite = {int(finite.sum())}")
print(f"min = {float(grid[finite].min()):.7g}")
print(f"max = {float(grid[finite].max()):.7g}")
if __name__ == "__main__":
main()python3 read_amaterass_4km.py 201907070300.vis.02.rfy.fld.4km.bin
Input handled by these samples: The 4 km readers load 3,000 × 3,000 32-bit floating-point values. The storage format is common to rad / rfc / rfy / tbb.
DATA AVAILABILITY
These products are published by the Center for Environmental Remote Sensing (CEReS), Chiba University, in the CEReS Gridded Format as precisely geometrically corrected data on a regular latitude–longitude coordinate system. They are essentially intermediate files produced by AMATERASS.