Read IASI L1C with Python

Latest version (v15JAN24): [read_iasi_l1c.py]
05FEB26

Contents

Overview

read_iasi_l1c.py is a self-contained Python class for reading an IASI L1C .nat file (equivalent to an orbit of data). This works for the v5 format files which have been distributed since around 2010.

By default this will read in every spectrum in the file, which takes up a lot of memory. Optional arguments can be used to select a part of the spectrum, and/or select by geographical location, cloud-cover, etc; or to just read the location data (with method get_spec then used to extract matching spectra).

The spectra are normally extracted as radiance (in nW/(cm2 sr cm-1)), but with an option to return these as brightness temperature (K).

Example of usage

l1cfil='IASI_xxx_1C_M02_20180830223000Z_20180831001455Z_N_O_20180831001058Z.nat' from read_iasi_l1c import Read_Iasi_L1c import matplotlib.pyplot as plt # Use this form to directly read spectra, eg between specific lat range l1c = Read_Iasi_L1c ( l1cfil, latlim=[30,35] ) # Plot to screen plt.plot(l1c.wno,l1c.spec[0]) # plot 1st spectrum plt.show() # Use this form to defer reading in spectra until later l1c = Read_Iasi_L1c ( l1cfil, loc_only=True ) # Extract 1st spectrum in file as brightness temperature, limited to 645-1000 cm-1, spec, wno = l1c.get_spec ( 0, wnolim=[645,1000], bright=True ) # Plot to screen plt.plot(wno,spec) plt.show()

Syntax

If l1cfil is the name of an IASI L1C .nat file, data can be loaded into an object, l1c say, with

l1c = Read_Iasi_L1c ( l1cfil, [options] )

Options Type Default Description Range
avhrr Boo False [?] True = include AVHRR cluster analysis data, False=exclude
bright Boo False [?] True = spectra returned as brightness temp, False=radiance spectra
chkqal Boo(3) True [?] True = Exclude data with bad quality flag for each band, False = include
cldlim Flt(2) None [?] (min,max) cloud cover percentages for inclusion 0 : 100
latlim Flt(2) None [?] (min,max) latitude for inclusion −90 : +90
lndlim Flt(2) None [?] (min,max) land (ie not ocean) cover percentages for inclusion 0 : 100
loc_only Boo False [?] True = only set location data (without spectra)
lonlim Flt(2) None [?] (min,max) longitude for inclusion −180 : +180
mph_only Boo False [?] True = only set Main Product Header data
szalim Flt(2) None [?] (min,max) solar zenith angle for inclusion (<90=day-time) 0 : 180
wnolim Flt(2) (645.0,2760.0) [?] (min,max) wavenumber limits (cm-1) for inclusion 645 : 2760
zenlim Flt(2) None [?] (min,max) satellite zenith angle for inclusion 0 : 90

NB 'None' in the above list means that these arguments are set, by default, to the Python 'None' object (rather than there being no default). In other words, the default behaviour is not to perform any selection using this parameter.

Options

avhrr=False
For each IASI field-of-view (12km diameter at nadir) a clusted analysis is performed of the colocated 6-channel AVHRR image (1km resolution). Setting this argument True to include the cluster statistics in the output. This will add to the output size as well as read-time.

bright=False
The file contains spectra as radiances R(ν). Setting this argument True converts these internally to brightness temperature T(ν) (K)using:
T(ν) = c2 ν / ln [ 1 + c1 ν3/R(ν) ]
where c2 = 1.439 K/cm-1, c1 = 1.191 ×10-3 nW/(cm2 sr (cm-1)4), ν is wavenumber in cm-1 and R is radiance in nW/(cm2 sr cm-1). This slightly increases the time taken.

chkqal=(True,True,True)
Associated with each spectrum are three quality flags (GQisFlagQual), one for each band, 645–1210, 1210–2000, 2000–2760 cm-1. A value GQisFlagQual=0 indicates nominal data and 1 indicates bad data (although this is stored as a byte, it is effectively a Boolean variable). The default behaviour is to ignore spectra for which any of these 3 flags are non-zero, and this option allows the user to override this. For example if you only want spectra from 645–1210 cm-1 you may choose (True,False,False). The GQisFlagQual values are always included as part of the output (as qal) so the user can also perform screening after extraction.

cldlim=None
Associated with each spectrum is a cloud fraction (GEUMAvhrr1BCldFrac), based on analysis of the AVHRR data. The default behaviour is to ignore this, although the value, converted to a percentage, is always included in the output. Set this argument to (0,0) if only spectra classified as 'cloud-free' are required, (0,10) if up to 10% cloud-cover is acceptable, (50,100) for more than 50% cloud cover, etc.

latlim=None
The default is to extract spectra from any location so Use this to restrict the spectra to a specific latitude band, eg (-20,20) to within ±20° of the equator.

lndlim=None
Associated with each spectrum is a land (as opposed to ocean) fraction (GEUMAvhrr1BLandFrac), based on analysis of the AVHRR data. The default behaviour is to ignore this, although the value, converted to a percentage, is always included in the output. Set this argument to (0,0) if only spectra classified as 'land' are required, (1000,100) for only ocean, etc.

loc_only=False
The default behaviour is to extract location data as well as the associated spectra. Set this flag True to extract just the location data, omitting the spectra. This is much quicker and requires much less memory if you just want to analyse the location data for an orbit, or if you want to apply more complex selection criteria than available with the standard options (spectra can then be added subsequently using the ??? method).

lonlim=None
The default is to extract spectra from any location so Use this to restrict the spectra to a specific longitude sector, eg (-20,20) to within ±20° of the prime meridian. Reverse the limits for longitudes spanning ±180°, eg (20,-20) will include all longitudes except within ±20° of the prime meridian (the same actually applies to all options which specify a (min,max) pair, but probably only useful for longitude).

mph_only=False
The Main Product Header is a series of text strings of the form PARAMETER=VALUE common to all Eumetsat .nat files. Set this argument True if this is the only part of the file that is required, eg to examine data on processing version or orbit number. This is very fast and occupies litte memory since it just reads the MPH part of the file.

szalim=None
The solar zenith angle is the angle between the sun and the vertical at the surface location. Because of MetOp's orbit, the sun is never overhead (0°) but this flag can be used to select just day-time (0,90) or just night-time (90,180) data, which, apart from high latitudes, are, respectively good proxies for descending (southgoing) and ascending (northgoing) parts of the orbit.

wnolim=(645.0,2760.0)
The default is to extract the full IASI spectra from 645–2760 cm-1. This argument can be used to limit the spectral range of the output, which mostly reduces the memory size required but also has a moderate impact on computation time.

zenlim=None
The satellite zenith angle is the angle between the satellite and the vertical, so 0° for points along the sub-satellite track. Values extend to almost 60° — significantly larger than the ±48.5° scan angle for the instrument due to the curvature of the Earth's surface. For example, setting (0,45) will exclude all locations towards the edge of the swath.

Data Structure

If called, for example with l1c = read_l1c (...) the following data objects are returned, eg as l1c.errmsg.

Variable Type Description
errmsg Str Text message describing error if fail=True
fail Boo True=fatal error reading data, False=data read OK.
file Str Name of input L1C .nat file
mph {Str} Dictionary of Main Product Header items
nloc Int No. of pixel locations selected
scale [Flt] List of Spectral scale factors, size NWNO
stats {int} Dictionary of stats on bad data
mdruse [Boo] List of flags, True = usable MDR, size TOTAL_MDR
wno [Flt] List of wavenumber values [cm-1] for returned spectra size NWNO
The following are lists of size nloc
day [Int] Day# since 1 Jan 2000 (= Day 0)
msc [Int] Milliseconds into day
daylin [Int] Day# at start of scan line
msclin [Int] Milliseconds at start of scan line
lin [i2] Scan line/MDR# within file (1:≈760)
stp [i1] Scan line/MDR# within file (1:30)
pix [i1] Pixel# within FOV (1:4)
iof [ui4] Byte offset of spectrum within file
qal [3*i1] Quality flags for each band (0=OK, 1=bad)
lat [Flt] Latitude (-90:90)
lon [Flt] Longitude (-180:180)
sza [Flt] Solar Zenith Angle [0:180]
zen [Flt] Satellite Zenith Angle [0:90]
cld [Flt] Percentage Cloud Cover [0:100]
lnd [Flt] Percentage Land Cover [0:100]
spc [nwno*Flt] Spectrum (radiance or brightness temperature)
The following are set if avhrr=True
ncl [i1] No. of clusters identified
pct [Flt(7)] Fraction of IASI pixel described by cluster
rav [Flt(7,6)] Average radiance for each AVHRR cluster,channel
rsd [Flt(7,6)] S.D. for each AVHRR cluster,channel
* For AVHRR Ch1,2,3a radiances in W/(m2.sr)
For Ch3b,4,5 radiances in nW/(cm2.sr.cm-1)

Methods

get_spec
The l1c.get_spec method can be used to extract the spectrum corresponding to a particular location, assuming read_l1c has first been run (usually with option loc_only=True). This method re-opens the original file using the filename information l1cfile stored in the l1c object. It also makes use of the byte offsets iof, stored within the l1c object from the initial read.

spectrum = l1c.get_spec( iloc, [wnolim=(645,2760), bright=False] )

Options Type Description
iloc Int Index of pixel within location data, range 0:nloc -1
wnolim 2*Flt Same as above
bright Boo Same as above

Version History

31OCT23
Renamed from Iasi_L1c to Read_Iasi_L1c. Prefix private method names with '_'
18DEC20
Original. Adapted from IDL code.