Skip to content

Commit

Permalink
reformat attributes
Browse files Browse the repository at this point in the history
refer #7
  • Loading branch information
pramod committed Feb 25, 2020
1 parent dd4bef6 commit 1a2a33e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def write_ctd_ncfile(filename, ctdcls):
# write full original header, as json dictionary
out.HEADER = json.dumps(ctdcls.get_complete_header(), ensure_ascii=False, indent=False)
# initcreate dimension variable
out.nrec = int(ctdcls.FILE['NUMBER OF RECORDS'])
out.nrec = int(ctdcls.file['NUMBER OF RECORDS'])
# add variable profile_id (dummy variable)
ncfile_var_list = []
ncfile_var_list.append(OceanNcVar('str_id', 'filename', None, None, None, ctdcls.filename.split('/')[-1]))
Expand Down Expand Up @@ -93,8 +93,8 @@ def write_ctd_ncfile(filename, ctdcls):
try:
null_value = ctdcls.channel_details['Pad'][i]
except Exception as e:
if 'PAD' in ctdcls.FILE.keys():
null_value = ctdcls.FILE['PAD'].strip()
if 'PAD' in ctdcls.file.keys():
null_value = ctdcls.file['PAD'].strip()
print("Channel Details missing. Setting Pad value to: ", null_value.strip())
else:
print("Channel Details missing. Setting Pad value to ' ' ...")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def write_mctd_ncfile(filename, ctdcls):
# write full original header, as json dictionary
out.HEADER = json.dumps(ctdcls.get_complete_header(), ensure_ascii=False, indent=False)
# initcreate dimension variable
out.nrec = int(ctdcls.FILE['NUMBER OF RECORDS'])
out.nrec = int(ctdcls.file['NUMBER OF RECORDS'])
# add variable profile_id (dummy variable)
ncfile_var_list = []
# profile_id = random.randint(1, 100000)
Expand Down Expand Up @@ -91,8 +91,8 @@ def write_mctd_ncfile(filename, ctdcls):
try:
null_value = ctdcls.channel_details['Pad'][i]
except Exception as e:
if 'PAD' in ctdcls.FILE.keys():
null_value = ctdcls.FILE['PAD'].strip()
if 'PAD' in ctdcls.file.keys():
null_value = ctdcls.file['PAD'].strip()
print("Channel Details missing. Setting Pad value to: ", null_value.strip())
else:
print("Channel Details missing. Setting Pad value to ' ' ...")
Expand Down

0 comments on commit 1a2a33e

Please sign in to comment.