I was trying out coda.fetch on a S5P L2 file, following the documentation at CODA Python. Unfortunately I don’t fully grasp the documentation, especially the optional use of the integers and a bit the terminology.
Would “datasetname” correspond to a netCDF variable name ?
I got the following commands to work:
s5p_rec = coda.fetch(path2file) # fetch entire file
s5p_rec_product = coda.fetch(path2file, "PRODUCT") # fetch everything below group PRODUCT
s5p_rec_cf = coda.fetch(path2file, "PRODUCT/cloud_fraction") # fetch 1 variable. Output is a numpy array.
s5p_rec_cf0 = coda.fetch(path2file, "PRODUCT/cloud_fraction[0]") # get 1 value of that variable
However, I don’t got the examples with the following syntax to work
coda.fetch(pf, "datasetname", 0)
coda.fetch(pf, "datasetname", -1, "dsr_time")
E.g., the following
s5p_rec_cf0 = coda.fetch(path2file, "PRODUCT/cloud_fraction", 0)
coda.fetch(pf, "PRODUCT/cloud_fraction", -1, 'scanline', 0) # Inspired by example here: Problem with HARP/Python within a loop - #3 by corisanucci
both return an error ValueError: number of specified indices does not match the dimensionality of the array
Part of the problem might be that I don’t know how the terms ‘dataset’, ‘field’, ‘dimension’ translate to the S5P L2 file.
If you could give working examples that would help my understanding of coda!