Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def read_domain(domain_dict):
print('reading domain file: {0}'.format(domain_dict['filename']))
f = Dataset(domain_dict['filename'])
domain = {'lon': NcVar(f, domain_dict['longitude_var']),
'lat': NcVar(f, domain_dict['latitude_var'])}
if domain_dict['copy_vars']:
for varname in domain_dict['copy_vars']:
domain[varname] = NcVar(f, varname)
f.close()
return domain
# -------------------------------------------------------------------- #
def read_domain(domain_dict):
print('reading domain file: {0}'.format(domain_dict['filename']))
f = Dataset(domain_dict['filename'])
domain = {'lon': NcVar(f, domain_dict['longitude_var']),
'lat': NcVar(f, domain_dict['latitude_var'])}
if domain_dict['copy_vars']:
for varname in domain_dict['copy_vars']:
domain[varname] = NcVar(f, varname)
f.close()
return domain
# -------------------------------------------------------------------- #
def read_domain(domain_dict):
print('reading domain file: {0}'.format(domain_dict['filename']))
f = Dataset(domain_dict['filename'])
domain = {'lon': NcVar(f, domain_dict['longitude_var']),
'lat': NcVar(f, domain_dict['latitude_var'])}
if domain_dict['copy_vars']:
for varname in domain_dict['copy_vars']:
domain[varname] = NcVar(f, varname)
f.close()
return domain
# -------------------------------------------------------------------- #