remkos / rads

Radar Altimeter Database System (RADS)
Other
37 stars 19 forks source link

metadata: sla calculation details as attribute (or new variable) #146

Open andreustaylor opened 5 years ago

andreustaylor commented 5 years ago

rads2nc: record SLA details

'sla' construction details are only in input xml, not output netcdf

It would be beneficial to include a summary of SLA calculation choices within each netcdf file.

complication

1) When using a hierarchy of xml inputs, how can we be confident exactly which fields were used?

ideas

(A) 'data' xml string as an an attribute

alt range SUB dry_tropo SUB wet_tropo SUB iono SUB dac SUB tide_solid SUB tide_ocean SUB tide_load SUB
        tide_pole SUB ssb SUB mss SUB ref_frame_offset SUB

(C) field codes and factors in two new variables

This is a solution we had in place using rads3 low level functions

dimensions:
    options = 99 ;
variables:
    int options(options) ;
        options:long_name = "RADS options set by input XML" ;
        options:units = "None" ;
    short factors(options) ;
        factors:long_name = "RADS factors set by input XML" ;
        factors:units = "None" ;
 options = 0, 1, 1, 1, 25, -1, 1, 1, 1, 3, 6, 1, 24, 24, 1, 2, 18, 1, 1, -1, 
    2, 1, -5, -2, 0, -16, 1, 0, 2, 2, -2, 0, 0, -1, 0, 0, -1, -1, 1, -1, -1, 
    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ;

 factors = 1, 0, 0, 0, 1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
    0, 0, 0, 0, 0, 0, 0, 0, 0 ;
andreustaylor commented 5 years ago

working solution

https://github.com/andreustaylor/rads/commit/9b8556392d9a18ba8d8c412e93eef4c483c367f5

andreustaylor commented 5 years ago

update solution to use attribute 'method'

https://github.com/andreustaylor/rads/commit/aed44a5de398884c4c37c13b580d582c4f979504

andreustaylor commented 4 years ago

method attribute ambiguity with alias corrections

Flaw in the method attribute implementation on my fork. When the correction is an alias (eg dac) the method string cant identify exactly which flavor/s of the correction were actually accessed. This is shame as the intention was to encode the exact corrections used in the output file.

In the process, created a variant attribute that records the corrections by rads3 field codes rather than long names. No difference for the ambiguity issue though.

Suspect this cant be resolved for the general case without going beyond simple netcdf attributes.

Latest fork version: https://github.com/andreustaylor/rads/commit/c6bca5c839186253d3420d8dcfa47100b51da3a6

more details for a specific correction

sla:method = "RPN=|CNES GDR-F, CNES GDR-E orbital altitude|Ku-band range corrected for instr. effects|SUB|ECMWF dry tropospheric correction|SUB|radiometer, ECMWF wet tropospheric correction|SUB|smoothed dual-frequency, JPL GIM, NIC09 ionospheric correction|SUB|solid earth tide|SUB|FES2014b ocean tide|SUB|FES2014a load tide|SUB|pole tide|SUB|Tran et al. 2012 non-parametric sea state bias|SUB|DTU15 mean sea surface height|SUB|reference frame offset|SUB|MOG2D dynamic atmospheric correction (ERA Interim forcing), MOG2D dynamic atmospheric correction, MOK2D inverse barometer correction|SUB" ;

sla:method_fields = "|   4:  -1|   6:  -1|SUB|   7:  -1|SUB|   8:  -1|SUB|   9:  -1|SUB|1101:  11|SUB|  12:  -1|SUB|  13:  -1|SUB|1401:  14|SUB|  15:  -1|SUB|  16:  -1|SUB|3801:  38|SUB|  10:  -1|SUB" ;