@@ -0,0 +1,2072 @@
+from satpy import Scene%0Aimport xarray as xr%0Aimport pandas as pd%0A%0Afrom .common import expects_file_info, FileHandler%0A%0A__all__ = %5B%0A    'TROPOMI',%0A%5D%0A%0Aclass TROPOMI(FileHandler):%0A    %22%22%22File handler for TROPOMI data using Satpy reader%0A    %22%22%22%0A%0A    # This file handler always wants to return at least time, lat and lon%0A    # fields. These fields are required for this:%0A    standard_fields = %7B%0A        'latitude',%0A        'longitude',%0A        'time_utc',%0A    %7D%0A%0A    # Map the standard fields to standard names:%0A    mapping = %7B %0A        %22latitude%22: %22lat%22,%0A        %22longitude%22: %22lon%22,%0A        %22time_utc%22: %22time%22,%0A    %7D   %0A%0A    def __init__(self, **kwargs):%0A        super().__init__(**kwargs)%0A        self.satpy_reader = 'tropomi_l2'%0A%0A    @expects_file_info()%0A    def read(self, filename, **kwargs):%0A        scene = Scene(reader=self.satpy_reader, filenames=%5Bfilename.path%5D)%0A%0A        # We need to import at least the standard fields%0A        user_fields = kwargs.pop(%22fields%22, %7B%7D) %0A        fields = self.standard_fields %7C set(user_fields)%0A%0A        # If the user has not passed any fields to us, we load all per default.%0A        if fields is None:%0A            fields = scene.available_dataset_ids()%0A%0A        # Load all selected fields%0A        scene.load(fields, **kwargs)%0A%0A        # convert into dataset%0A        dataset = scene.to_xarray_dataset()%0A%0A        # convert string array to datetime array%0A        dataset%5B'time_utc'%5D = dataset%5B'time_utc'%5D.astype(%22datetime64%5Bns%5D%22)%0A%0A        # delete useless coords%0A        dataset = dataset.drop_vars(%5B'time', 'crs'%5D)%0A        # rename standard variables%0A        dataset = dataset.rename(self.mapping)%0A%0A        # We catch the user mapping here, since we do not want to deal with%0A        # user-defined names in the further processing. Instead, we use our own%0A        # mapping%0A        user_mapping = kwargs.pop(%22mapping%22, None)%0A        if user_mapping is not None:%0A            dataset = dataset.rename(user_mapping)%0A%0A        # clean attributes%0A        for var in dataset.data_vars:%0A            dataset%5Bvar%5D.attrs = %5B%5D%0A%0A        return dataset%0A%0A

add TROPOMI file handler