import harp
import numpy as np
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
from cmcrameri import cm
import eofetch
import os
import matplotlib.ticker as mticker
from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER
os.chdir(“E:/t_3/”)
operations = “;”.join([
“CH4_column_volume_mixing_ratio_dry_air_validity>50”,
“keep(latitude_bounds,longitude_bounds,datetime_start,datetime_length,CH4_column_volume_mixing_ratio_dry_air)”,
“derive(datetime_stop {time} [days since 2000-01-01])”,
“derive(datetime_start [days since 2000-01-01])”,
“exclude(datetime_length)”,
“bin_spatial(1801,-90,0.1,3601,-180,0.1)”,
“derive(latitude {latitude})”,
“derive(longitude {longitude})”,
])
reduce_operations = “squash(time, (latitude, longitude, latitude_bounds, longitude_bounds));bin()”
filenames = “S5P_OFFL_L2__CH4*.nc”
merged = harp.import_product(filenames, operations, reduce_operations=reduce_operations)
#print(merged)
harp.export_product(merged, ‘s5p-ch4_L3_3_2023.nc’)
I successfully merged the 2022 S5P data of CH4 using this code, but when I try to merge the 2023, 2021, or even 2020 data, I get a “CLibraryError,” which may be the result of a few files that aren’t suitable for merging. If you could provide me a bypass, that would allow it to skip over any files that it finds incompatible and proceed with the merge instead of throwing me various errors when I try to add the try-catch block, that would be great. Please fix this issue and provide me the revised code; I’ll be appreciative.
Thank You