Skip to content

Commit a302273

Browse files
committed
Replace Length per octetCount and remove it from the xml
1 parent b88e9a1 commit a302273

File tree

3 files changed

+14028
-18302
lines changed

3 files changed

+14028
-18302
lines changed

scripts/create_master_lists.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,11 @@ def process_files(files,pattern,writers,title_prefix):
166166

167167

168168

169-
# For Template rows, add computed Length
169+
# For Template rows, add computed OctetNumer
170170
if pattern == 'GRIB2_Template':
171171
for row in rows:
172172
octet_str = row.get("OctetNo", "")
173-
row["Length"] = parse_octet_length(octet_str)
173+
row["OctetCount"] = parse_octet_length(octet_str)
174174

175175
for row in rows:
176176
for writer in writers:
@@ -207,11 +207,11 @@ def process_files(files,pattern,writers,title_prefix):
207207
# Template tables
208208
template_files = load_files("GRIB2_Template",basedir=".")
209209

210-
# Added "Length" to both fieldnames and xml_elements
211-
fieldnames=["Title_en","OctetNo","Contents_en","Note_en","noteIDs","codeTable","flagTable","Length","Status"]
210+
# Added "OctetCount" to both fieldnames
211+
fieldnames=["Title_en","OctetNo","Contents_en","Note_en","noteIDs","codeTable","flagTable","OctetCount","Status"]
212212
csv_writer = CSVWriter("txt/Template.txt",fieldnames)
213213

214-
xml_elements=["Title_en","OctetNo","Contents_en","Note_en","noteIDs","codeTable","flagTable","Length","Status"]
214+
xml_elements=["Title_en","OctetNo","Contents_en","Note_en","noteIDs","codeTable","flagTable","Status"]
215215
xml_writer = XMLWriter("xml/Template.xml",xml_elements,"GRIB2_Template_en")
216216

217217
writers = [csv_writer,xml_writer]

txt/Template.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Title_en,OctetNo,Contents_en,Note_en,noteIDs,codeTable,flagTable,Length,Status
1+
Title_en,OctetNo,Contents_en,Note_en,noteIDs,codeTable,flagTable,OctetCount,Status
22
Identification template 1.0 - calendar definition,24,Type of calendar,(see Code table 1.6),,1.6,,1,Operational
33
Identification template 1.1 - paleontological offset,24-25,Number of tens of thousands of years of offset,,,,,2,Operational
44
Identification template 1.2 - calendar definition and paleontological offset,24,Type of calendar,(see Code table 1.6),,1.6,,1,Operational

0 commit comments

Comments
 (0)