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

Missing attribute #64

Open
zxdawn opened this issue Jan 1, 2023 · 2 comments
Open

Missing attribute #64

zxdawn opened this issue Jan 1, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@zxdawn
Copy link
Owner

zxdawn commented Jan 1, 2023

  File "/student/zhangxin/papers/Arctic/S5P_LNOx/main/s5p_lno2_utils.py", line 377, in save_data
    'time_coverage_start': scn['nitrogendioxide_tropospheric_column'].attrs['time_coverage_start'],
@zxdawn zxdawn added the bug Something isn't working label Jan 1, 2023
@zxdawn zxdawn self-assigned this Jan 1, 2023
@zxdawn
Copy link
Owner Author

zxdawn commented Jan 1, 2023

This is related to satpy tropomi reader. I have created a PR for this.

@zxdawn
Copy link
Owner Author

zxdawn commented Jan 1, 2023

To save the attribute to a group,

# set group attributes
group_attrs = {'s5p_filename': scn.attrs['s5p_filename'],
'time_coverage_start': scn['nitrogendioxide_tropospheric_column'].attrs['time_coverage_start'],
'time_coverage_end': scn['nitrogendioxide_tropospheric_column'].attrs['time_coverage_end'],
'description': 'Subset of official TROPOMI L2 data'
}
# set compression
comp = dict(zlib=True, complevel=7)
logging.debug(' '*8 + 'Saving S5P products ...')
scn.save_datasets(filename=output_file,
datasets=s5p_vnames,
groups={'S5P': s5p_vnames},
compute=True,
group_attrs=group_attrs,
writer='cf',
engine='netcdf4',
compression=comp,
)

I have to finish another PR of satpy:

pytroll/satpy#1914

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant