Input data format for tropomi inversion using qdoas

I have a problem with using qdoas for tropomi inversion, I don’t know the format of the slit function file required by qdoas because the tropomi satellite has 450 pixels and the sample provided in the guidance does not match. Also I don’t know the file format (variable names, dimension names, etc.) for using the mean radiation as a second reference file, I would appreciate a template or other solution, thank you very much.

Dear Jie Li,

you can use a netCDF file for the radiance reference. The following cdl template describes the expected file structure:

netcdf S5p_RaR_20220101 {
dimensions:
	col_dim = 450 ;
	spectral_dim = 497 ;
variables:
	double reference_radiance(col_dim, spectral_dim) ;
	double reference_wavelength(col_dim, spectral_dim) ;
	byte use_row(col_dim) ;
	short number_radiances(col_dim) ;

// global attributes:
		:title = "Reference file created by RAD_AS_REF for QDOAS Python script." ;
		:description = "Radiance as reference file in APEX format for QDOAS based on daily averaged radiances." ;
		:created = "Thu Jun  2 14:41:29 2022" ;
		:lat_bound = -15, 15 ;
		:lon_bound = 180., 240. ;
		:inputfiles = "S5P_OFFL_L1B_RA_BD4_20220101T004639_20220101T022809_21858_02_020000_20220101T041750.nc; S5P_OFFL_L1B_RA_BD4_20220101T210439_20220101T224610_21870_02_020000_20220102T003259.nc; S5P_OFFL_L1B_RA_BD4_20220101T224610_20220102T002740_21871_02_020000_20220102T021418.nc" ;
		:measurement_date = "01/01/2022" ;
		:fillValue = 9.96921e+36f ;
data:
}

You can save this template as “rar.cdl” and create an empty netCDF file with “ncgen rar.cdl -o rar.nc”. Then fill the variables “reference_radiance” and “reference_wavelength” with the appropriate data.

For the slit function, QDOAS does not directly support slit function files with multiple detector rows. For instruments such as OMI and TROPOMI, what we usually do is:

  • Take the key data slit function from the center of the instrument (i.e. around row 225 for Tropomi), and fit a left/right stretch factor to tune this slit function for each instrument row, or
  • Convolve cross sections for each row as a separate preprocessing step (e.g. using the QDOAS convolution tool), and use multi-column convolved cross sections and pre-convolved solar reference file as input (setting “slit function” to none in the project properties, and disabling fitting of SFP in the calibration)

The following cdl template describes the netCDF format for pre-convolved cross sections:

netcdf O4293_thalman_volkamer_293K_Reformat_S5P_OPT_SFP {

// global attributes:
		:File_generated_on = "2019-03-08 13:24:47.707617" ;
		:doas_cl_version = "MOLECULAR_RING" ;
		:input_cross_section = "/path/to/input.xs" ;
		:config_file = "path/to/config/file" ;
		:convolution_type = "standard" ;
		:binning_scheme = "NOMOPS_BF2bd2-6_flipped" ;

group: QDOAS_CROSS_SECTION_FILE {
  dimensions:
  	n_wavelength = 6501 ;
  	dim_y = 450 ;
  variables:
  	float wavelength(n_wavelength) ;
  		wavelength:_FillValue = NaNf ;
  		wavelength:units = "nm" ;
  		wavelength:long_name = "wavelength" ;
  	double cross_section(n_wavelength, dim_y) ;
  		cross_section:_FillValue = NaN ;
  		cross_section:units = "molec/cm**2" ;
  		cross_section:long_name = "cross section" ;
  data:
  } // group QDOAS_CROSS_SECTION_FILE
}

Thanks for your detailed reply. May I ask what data should be filled for “use_row” and “number_radiances”? According to the template, I just fill “reference_radiance” and “reference_wavelength” with the appropriate data, and after executing the analysis, no ref1/ref2 results are shown.

use_row should be 1 for every row for which you have a valid reference radiance (so likely, all = 1 in your case). This can be used to skip some rows if radiance reference construction failed for some rows of the detector. number_radiances can be used to keep track of how many spectra were averaged to construct the reference for that row, but it is not read by qdoas.

Thank you very much for your reply. According to your instruction, I use the slit function of each row to convolve with the cross section, set the “wavelength” variable inside the template file of the pre-convolution cross section to 330-380 with 0.2 interval (my inversion band is 335-375), and then merge them to form a multi-column cross section.
Is the above steps correct? I am looking forward to your reply.

Yes that looks correct. The wavelength variable should contain the wavelength grid of the convolved cross sections (330-308 with 0.2 interval seems reasonable, though it can’t hurt to sample at slightly finer resolution, like 0.1nm perhaps?), and the n_wavelength dimension should be adjusted accordingly.

Thank you very much for your reply, I have been able to run it properly. However, I am now experiencing a new problem, I will open another topic to ask you a question and look forward to your attention.