Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cf_writer should append to Convention global attribute if given header_attr #1191

Closed
TAlonglong opened this issue May 7, 2020 · 2 comments · Fixed by #1204
Closed

cf_writer should append to Convention global attribute if given header_attr #1191

TAlonglong opened this issue May 7, 2020 · 2 comments · Fixed by #1204

Comments

@TAlonglong
Copy link
Collaborator

Some times user want to add more than the CF convention to the global attribute Convention

If the user specify eg. the ACDD (http://wiki.esipfed.org/index.php/Attribute_Convention_for_Data_Discovery) in addition to the CF the Convention is overwritten here:
https://github.com/pytroll/satpy/blob/master/satpy/writers/cf_writer.py#L617

Is it possible to append to the Convention global attribute like this

if `Conventions` in root.attrs:
  root.attrs['Conventions'] += ', ' + CF_VERSION
else:
  root.attrs['Conventions'] = CF_VERSION
@djhoese
Copy link
Member

djhoese commented May 7, 2020

Or would it be better to only set the Conventions if not set by the user? Or should we always include the ACDD convention too? What does it take to meet that specification's requirements?

@TAlonglong
Copy link
Collaborator Author

Hm not sure what would be the best. After thinking a bit on it, if the user set his/hers own Conventions he/she should be responsible til add all Conventions. I guess as you suggests.

So if the user does specify the Conventions in his/hers global attributes, satpy only add this.

I guess I need to PR this.

You can see here for the recommendations for the ACDD http://wiki.esipfed.org/index.php/Attribute_Convention_for_Data_Discovery

There is also a nice site which can check you netcdf file: https://compliance.ioos.us/index.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants