comet-toolkit / obsarray

Measurement uncertainty handling in Python
GNU Lesser General Public License v3.0
7 stars 1 forks source link

Help wanted: troubleshoot reproducing example with obsarray v0.2.4 #16

Open TomLav opened 1 year ago

TomLav commented 1 year ago

Hello,

I am starting to use punpy and obsarray as part of an ESA project. I am now at the stage where I want to create my first digital effects table. I ran the example linked from the CoMet pages, on google collab:

https://colab.research.google.com/github/comet-toolkit/comet_training/blob/main/defining_digital_effects_table.ipynb

The notebook runs without errors, but I do not understand the resulting obsarray dataset. I do not see that it contains any obsarray-specific attributes to link uncertainty variables together and describe the uncertainty model contained in the effects table.

This is the ncdump -ch that I get when running (a local copy of) the notebook and save the effects table in the last cell (the "more realistic example").

This is with obsarray v0.4.2 and xarray 2023.8.0:

# store example file
ds.to_netcdf("/home/thomasl/Downloads/obsarray_test.nc")
!ncdump -ch /home/thomasl/Downloads/obsarray_test.nc

shows:

netcdf obsarray_test {
dimensions:
    x = 20 ;
    y = 30 ;
    time = 6 ;
variables:
    double temperature(x, y, time) ;
        temperature:_FillValue = 9.96920996838687e+36 ;
        temperature:units = "K" ;
        temperature:u_components = "u_temperature" ;
    double u_ran_temperature(x, y, time) ;
        u_ran_temperature:_FillValue = 9.96920996838687e+36 ;
        u_ran_temperature:units = "K" ;
    double u_sys_temperature(x, y, time) ;
        u_sys_temperature:_FillValue = 9.96920996838687e+36 ;
    double pressure(x, y, time) ;
        pressure:_FillValue = 9.96920996838687e+36 ;
    double u_str_pressure(x, y, time) ;
        u_str_pressure:_FillValue = 9.96920996838687e+36 ;
    double err_corr_str_pressure_y(y, y) ;
        err_corr_str_pressure_y:_FillValue = 9.96920996838687e+36 ;
    double n_moles(x, y, time) ;
        n_moles:_FillValue = 9.96920996838687e+36 ;
    double u_ran_n_moles(x, y, time) ;
        u_ran_n_moles:_FillValue = 9.96920996838687e+36 ;

// global attributes:
        :obsarray_version = "v0.2.4" ;
        :xarray_version = "2023.8.0" ;
}

Is this as expected? As you see there are no obsarray specific attributes such as err_corr_1_form = "random", etc...

TomLav commented 1 year ago

UPDATE: I tried the above (reproducing the example from the google collab notebook) with a local checkout of obsarray.

I get the same results as above (pip installed version) with both the main/master branch of the obsarray repo, and with the repo at v0.2.3 tag.

shunt16 commented 9 months ago

Hi @TomLav - I've just done a big update to the docs (which should solve your issue!). Have a look there and let me know if you still have any trouble :)