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 {
	col_dim = 450 ;
	spectral_dim = 497 ;
	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 = ";;" ;
		:measurement_date = "01/01/2022" ;
		:fillValue = 9.96921e+36f ;

You can save this template as “rar.cdl” and create an empty netCDF file with “ncgen rar.cdl -o”. 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" ;

  	n_wavelength = 6501 ;
  	dim_y = 450 ;
  	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" ;

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.