ARPA-SIMC / dballe

Fast on-disk database for meteorological observed and forecast data.
Other
19 stars 6 forks source link

Python API: how can I read Var attributes? #156

Closed edigiacomo closed 5 years ago

edigiacomo commented 5 years ago

I'm reading BUFR messages from a file and I'd like to read the dballe.Var attributes:

    with importer.from_file(sys.stdin) as f:                                       
        for msgs in f:                                                             
            for msg in msgs:                                                       
                with explorer.rebuild() as exp:                                    
                    exp.add_messages(msg)                                          

                for summ in explorer.query_summary_all():                          
                    var = msg.get(summ["level"], summ["trange"], summ["var"])
                    attrs = magic_function_that_reads_var_attrs(var)
spanezz commented 5 years ago

I looked into wreport and it looks like there are no current python bindings to functions to iterate attributes of variables. We can turn this question into a feature request. How urgently do you need it?

edigiacomo commented 5 years ago

Thanks! It's not urgent, but it could be very useful. Should I open a feature request in wreport?

spanezz commented 5 years ago

Yes please!

edigiacomo commented 5 years ago

See arpa-simc/wreport#27