Skip to content

"ncdump -h" like repr? #1150

Closed
Closed
@fmaussion

Description

@fmaussion

Sometimes it could be useful to have a view of all variables attributes at a glance. For example, this is the repr for ERA-Interim energy fluxes data:

(...)
Data variables:
    slhf     (month, latitude, longitude) float64 0.02852 0.02852 0.02852 ...
    tsr      (month, latitude, longitude) float64 -0.0001912 -0.0001912 ...
    strd     (month, latitude, longitude) float64 166.6 166.6 166.6 166.6 ...
    strc     (month, latitude, longitude) float64 -66.23 -66.23 -66.23 ...
    tisr     (month, latitude, longitude) float64 0.0 0.0 0.0 0.0 0.0 0.0 ...
    ssrd     (month, latitude, longitude) float64 -0.0003951 -0.0003951 ...
    ssrc     (month, latitude, longitude) float64 0.0 0.0 0.0 0.0 0.0 0.0 ...
    str      (month, latitude, longitude) float64 -40.65 -40.65 -40.65 ...
    ttr      (month, latitude, longitude) float64 -171.5 -171.5 -171.5 ...
    tsrc     (month, latitude, longitude) float64 0.0 0.0 0.0 0.0 0.0 0.0 ...
    sshf     (month, latitude, longitude) float64 10.46 10.46 10.46 10.46 ...
    ssr      (month, latitude, longitude) float64 0.0 0.0 0.0 0.0 0.0 0.0 ...
    ttrc     (month, latitude, longitude) float64 -174.9 -174.9 -174.9 ...
(...)

This is what my students will see when they explore the dataset for the first time. It could be nice to have a utility function (e.g. dumph or something) which would have a style closer to ncdump -h:

(...)
	double ttr(month, latitude, longitude) ;
		ttr:least_significant_digit = 2L ;
		ttr:units = "J m**-2" ;
		ttr:long_name = "Top net thermal radiation" ;
		ttr:standard_name = "toa_outgoing_longwave_flux" ;
	double tsrc(month, latitude, longitude) ;
		tsrc:least_significant_digit = 2L ;
		tsrc:units = "J m**-2" ;
		tsrc:long_name = "Top net solar radiation, clear sky" ;
	double sshf(month, latitude, longitude) ;
		sshf:least_significant_digit = 2L ;
		sshf:units = "J m**-2" ;
		sshf:long_name = "Surface sensible heat flux" ;
		sshf:standard_name = "surface_upward_sensible_heat_flux" ;
	double ssr(month, latitude, longitude) ;
		ssr:least_significant_digit = 2L ;
		ssr:units = "J m**-2" ;
		ssr:long_name = "Surface net solar radiation" ;
		ssr:standard_name = "surface_net_downward_shortwave_flux" ;
	double ttrc(month, latitude, longitude) ;
		ttrc:least_significant_digit = 2L ;
		ttrc:units = "J m**-2" ;
		ttrc:long_name = "Top net thermal radiation, clear sky" ;
(...)

Or is there something like this already?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions