Activity for Xin Zhang

  • Xin Zhang Xin Zhang posted a comment on discussion Open Discussion

    Thanks! It works well. I was using ncks -O -x -C -g */*/Lightning in.nc out.nc and failed.

  • Xin Zhang Xin Zhang posted a comment on discussion Open Discussion

    My temporary solution using Python: import os from netCDF4 import Dataset filename = 'myfile.nc' rootGrp = Dataset(filename) # get the group names of Cases cases = list(sorted(rootGrp.groups.keys())) grps = [] for case in cases: swaths = list(rootGrp[case].groups.keys()) grp = [case+'/'+swath+'/Lightning' for swath in swaths] grps.extend(grp) savename = filename.replace('.nc', '_subset.nc') print(f'Deleted the "Lightning" subgroups and saved to {savename}') os.system(f"ncks -O -x -C -g {','.join(grps)}...

  • Xin Zhang Xin Zhang posted a comment on discussion Open Discussion

    Hi, I have one netcdf file which has multiple subgroups: --Case0 ----Swath08833 ------Lightning ------S5P ----Swath08834 ------Lightning ------S5P --Case1 ----Swath09512 ------Lightning ------S5P ----Swath09513 ------Lightning ------S5P Briefly, the Lightning is the third level subgroup. I know how to delete them manually: ncks -O -x -C -g Case0/Swath08833/Lightning,Case0/Swath08834/Lightning ./file.nc test.nc Is it possible to delete all subgroup named Lightning automatically?

1
MongoDB Logo MongoDB