Project

General

Profile

Revision 929:0ad059426223

ID0ad059426223
Parent 928:98695bc76fc6
Child 930:49b7575baad5

Added by Maarten Sneep 9 months ago

Update version number in TM5_profile.py, print time of slice

View differences:

src/TM5_profile.py
10 10
#
11 11
# One of the species can be selected: NO2, SO2 or HCHO.
12 12

  
13
__version__ = "1.0.0"
14
__date__ = "January 2021" 
13
__version__ = "1.0.1"
14
__date__ = "February 2022" 
15 15
DownloadURL = "http://www.tropomi.eu/data-products/nitrogen-dioxide/"
16 16
 
17 17
# =====================================        
......
87 87
            f_times = netCDF4.num2date(times, time_units)
88 88
        
89 89
        quarter = datetime.timedelta(minutes=15)
90
        second  = datetime.timedelta(seconds=1)
91
        extra = quarter - second
90 92

  
91
        if t < f_times[0] - quarter or t > f_times[-1] + quarter:
93
        if t < f_times[0] - extra or t > f_times[-1] + extra:
92 94
            raise RuntimeError("Requested time not covered in CTM file.")
93 95
        else:
94 96
            self.slice_index = np.argmin([np.fabs((t - tt).total_seconds()) for tt in f_times])
95
        return self.slice_index
97
        self.slice_time = f_times[self.slice_index]
98
        return self.slice_index,self.slice_time
96 99
        
97 100
    def find_indices_weights(self, latitude, longitude):
98 101
        """Find indices and weights for the spatial interpolation
......
339 342
        print(f"pressure_bottom\tpressure_top\tpressure_mid\ttemperature\t{species}_vmr\n# hPa\t# hPa \t# hPa\t# K\t# 1")
340 343
    else:
341 344
        print(f"pressure_bottom\tpressure_top\tpressure_mid\ttemperature\t{species}_partial_columns\n# hPa\t# hPa \t# hPa\t# K\t# mol/m2 in layer")
342
    print(f"# time: {time:%Y-%m-%dT%H:%M:%SZ}, latitude: {geo_point[1]}, longitude: {geo_point[0]}")
345
    print(f"# time_slice: {ctmobj.slice_time:%Y-%m-%dT%H:%M:%SZ}, latitude: {geo_point[1]}, longitude: {geo_point[0]}")
346
    print(f"# requested_time: {time:%Y-%m-%dT%H:%M:%SZ}")
343 347
    print(f"# source: {os.path.basename(ctm)}")
344 348
    print(f"# tropopause pressure: {tropopause_pressure[0]/100} hPa")
345 349
    

Also available in: Unified diff