NEP 2.7.0
NetCDF Extension Pack
Loading...
Searching...
No Matches
Macros
Format Magic Numbers

Macros

#define NEP_MAGIC_GEOTIFF_STANDARD   "II*"
 
#define NEP_MAGIC_GEOTIFF_BIGTIFF   "II+"
 
#define NEP_MAGIC_CDF   "\xCD\xF3\x00\x01"
 
#define NEP_MAGIC_GRIB2   "GRIB"
 
#define NEP_MAGIC_FITS   "SIMPLE"
 
#define NEP_MAGIC_PDS4   "<?xml"
 

Detailed Description

Each NEP format handler is identified by a short byte sequence (magic number) at the start of the file. NetCDF-C compares the first bytes of any file opened with nc_open() against each registered magic string to select the correct UDF handler. All magic strings are null-terminated C strings except NEP_MAGIC_CDF, which contains embedded null bytes and must be matched by length.

Macro Value Format Notes
NEP_MAGIC_GEOTIFF_STANDARD "II*" GeoTIFF standard TIFF Little-endian TIFF byte-order mark
NEP_MAGIC_GEOTIFF_BIGTIFF "II+" GeoTIFF BigTIFF Little-endian BigTIFF marker
NEP_MAGIC_GRIB2 "GRIB" GRIB2 All GRIB editions share this magic
NEP_MAGIC_FITS "SIMPLE" FITS First 6 bytes of every FITS file
NEP_MAGIC_CDF \xCD\xF3\x00\x01 NASA CDF 4-byte binary signature
NEP_MAGIC_PDS4 "<?xml" PDS4 XML declaration; namespace checked

Macro Definition Documentation

◆ NEP_MAGIC_CDF

#define NEP_MAGIC_CDF   "\xCD\xF3\x00\x01"

NASA CDF magic number: 0xCDF30001

◆ NEP_MAGIC_FITS

#define NEP_MAGIC_FITS   "SIMPLE"

FITS magic number: "SIMPLE" (first 6 bytes of a FITS file)

◆ NEP_MAGIC_GEOTIFF_BIGTIFF

#define NEP_MAGIC_GEOTIFF_BIGTIFF   "II+"

GeoTIFF BigTIFF magic number: "II+"

◆ NEP_MAGIC_GEOTIFF_STANDARD

#define NEP_MAGIC_GEOTIFF_STANDARD   "II*"

GeoTIFF standard TIFF magic number: "II*"

◆ NEP_MAGIC_GRIB2

#define NEP_MAGIC_GRIB2   "GRIB"

GRIB2 magic number: "GRIB"

◆ NEP_MAGIC_PDS4

#define NEP_MAGIC_PDS4   "<?xml"

PDS4 magic number: XML label files begin with "<?xml"