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

Feature/jstassi/#98 convert scripts to python3 #99

Merged
merged 2 commits into from
Aug 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion GEOSaana_GridComp/GSI_GridComp/etc/check_satbang.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def check_files(satbang_path=os.curdir,
if sb == satbang and (dcTL["diff"] or dcTL["none"] or dcTL["what"]):
pass
else:
print "No irregularites found in {0}".format(basename)
print("No irregularites found in {0}".format(basename))
continue

# write summary
Expand Down
12 changes: 7 additions & 5 deletions GEOSaana_GridComp/GSI_GridComp/etc/satbang_rst.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,15 @@ def _read(self):

if n != int(recnum):
if self._debug:
print "satbang[{0}] = {1}".format(n, self._data[n])
print("satbang[{}] = {}".format(n, self._data[n]))
raise Exception("inconsistent recnum (%d): %s" % (n, recnum))

#.......................................................................
def _append_record(self, (key, values)):
def _append_record(self, args):
"Append record to self._data"

(key, values) = args

# check for duplicate keys
#-------------------------
if key in dict(self._data):
Expand Down Expand Up @@ -256,7 +258,7 @@ def key_exists(self, key):
input parameter:
=> key: (instrument, channel) tuple of string values
"""
return dict(self._data).has_key(key)
return dict(self._data).__contains__(key)

#.......................................................................
def key_and_values(self, index):
Expand Down Expand Up @@ -412,11 +414,11 @@ def dir_and_file_names(pathname, pattern=False):
elif len(filelist) > 1:
filename = None
while filename == None:
print "\nSelect file to check"
print("\nSelect file to check")
nnn = 1

for sb in filelist:
print "{0}: {1}".format(nnn, sb)
print("{0}: {1}".format(nnn, sb))
nnn += 1

sys.stdout.write("Make selection: ")
Expand Down
2 changes: 1 addition & 1 deletion GEOSaana_GridComp/GSI_GridComp/etc/satinfo_rc.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def key_exists(self, key):
input parameter:
=> key: (instrument, channel) tuple of string values
"""
return dict(self._data).has_key(key)
return dict(self._data).__contains__(key)

#.......................................................................
def keys(self):
Expand Down
2 changes: 1 addition & 1 deletion GEOSaana_GridComp/GSI_GridComp/etc/tlapmean_rc.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def filename(self):

#.......................................................................
def key_exists(self, key):
return dict(self._data).has_key(key)
return dict(self._data).__contains__(key)

#.......................................................................
def value(self, key):
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
=====================
check_satbang summary
=====================
current dir: /gpfsm/dswdev/jstassi/GEOSadas/g5294/src/Components/@GEOSana_GridComp/GEOSaana_GridComp/GSI_GridComp/etc/unittests

satbang_rst: outdir/satbang_alpha_rst
satinfo.rc: input/gmao_global_satinfo.rc
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
=====================
check_satbang summary
=====================
current dir: /gpfsm/dswdev/jstassi/GEOSadas/g5294/src/Components/@GEOSana_GridComp/GEOSaana_GridComp/GSI_GridComp/etc/unittests

satbang_rst: outdir/satbang_default_rst
satinfo.rc: input/gmao_global_satinfo.rc
Expand Down

Large diffs are not rendered by default.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
=====================
check_satbang summary
=====================
current dir: /gpfsm/dswdev/jstassi/GEOSadas/g5294/src/Components/@GEOSana_GridComp/GEOSaana_GridComp/GSI_GridComp/etc/unittests

satbang_rst: outdir/satbang_revert_rst
satinfo.rc: input/gmao_revert_satinfo.rc
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
=====================
check_satbang summary
=====================
current dir: /gpfsm/dswdev/jstassi/GEOSadas/g5294/src/Components/@GEOSana_GridComp/GEOSaana_GridComp/GSI_GridComp/etc/unittests

satbang_rst: outdir/satbang_satbias_rst
satinfo.rc: input/gmao_global_satinfo.rc
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
=====================
check_satbang summary
=====================
current dir: /gpfsm/dswdev/jstassi/GEOSadas/g5294/src/Components/@GEOSana_GridComp/GEOSaana_GridComp/GSI_GridComp/etc/unittests

satbang_rst: outdir/satbang_satinfo_rst
satinfo.rc: input/gmao_global_satinfo.rc
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
=====================
check_satbias summary
=====================
current dir: /gpfsm/dswdev/jstassi/GEOSadas/g5294/src/Components/@GEOSana_GridComp/GEOSaana_GridComp/GSI_GridComp/etc/unittests

satbias_rst: outdir/satbias_alpha_rst
satinfo.rc: input/gmao_global_satinfo.rc
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@

=====================
check_satbias summary
=====================

satbias_rst: outdir/satbias_alpha_rst
satinfo.rc: input/gmao_global_satinfo.rc

22 recs removed because instrument/channel not in satinfo.rc
0 recs added from satinfo.rc

0 recs renamed airs281SUBSET to airs_aqua
281 recs renamed airs281_aqua to airs_aqua
0 recs renamed cris399_npp to cris_npp
616 recs renamed iasi616_metop-a to iasi_metop-a
616 recs renamed iasi616_metop-b to iasi_metop-b

8 recs where seviri_m08 channels were renumbered
- old: (1, 2, 3, 4, 5, 6, 7, 8)
- new: (4, 5, 6, 7, 8, 9, 10, 11)

8 recs where seviri_m09 channels were renumbered
- old: (1, 2, 3, 4, 5, 6, 7, 8)
- new: (4, 5, 6, 7, 8, 9, 10, 11)

8 recs where seviri_m10 channels were renumbered
- old: (1, 2, 3, 4, 5, 6, 7, 8)
- new: (4, 5, 6, 7, 8, 9, 10, 11)

2877 satbias recs before update
2855 satbias recs after update

new satbias file has been written: outdir/satbias_alpha_rst.new
sortflag = "alpha"


The following details are listed below:
=======================================
* records removed; not found in satinfo.rc


* records removed; not found in satinfo.rc
------------------------------------------
('gmi_gpm', '1')
('gmi_gpm', '2')
('gmi_gpm', '3')
('gmi_gpm', '4')
('gmi_gpm', '5')
('gmi_gpm', '6')
('gmi_gpm', '7')
('gmi_gpm', '8')
('gmi_gpm', '9')
('gmi_gpm', '10')
('gmi_gpm', '11')
('gmi_gpm', '12')
('gmi_gpm', '13')
('tmi_trmm', '1')
('tmi_trmm', '2')
('tmi_trmm', '3')
('tmi_trmm', '4')
('tmi_trmm', '5')
('tmi_trmm', '6')
('tmi_trmm', '7')
('tmi_trmm', '8')
('tmi_trmm', '9')
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
=====================
check_satbias summary
=====================
current dir: /gpfsm/dswdev/jstassi/GEOSadas/g5294/src/Components/@GEOSana_GridComp/GEOSaana_GridComp/GSI_GridComp/etc/unittests

satbias_rst: outdir/satbias_default_rst
satinfo.rc: input/gmao_global_satinfo.rc
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@

=====================
check_satbias summary
=====================

satbias_rst: outdir/satbias_default_rst
satinfo.rc: input/gmao_global_satinfo.rc

22 recs removed because instrument/channel not in satinfo.rc
0 recs added from satinfo.rc

0 recs renamed airs281SUBSET to airs_aqua
281 recs renamed airs281_aqua to airs_aqua
0 recs renamed cris399_npp to cris_npp
616 recs renamed iasi616_metop-a to iasi_metop-a
616 recs renamed iasi616_metop-b to iasi_metop-b

8 recs where seviri_m08 channels were renumbered
- old: (1, 2, 3, 4, 5, 6, 7, 8)
- new: (4, 5, 6, 7, 8, 9, 10, 11)

8 recs where seviri_m09 channels were renumbered
- old: (1, 2, 3, 4, 5, 6, 7, 8)
- new: (4, 5, 6, 7, 8, 9, 10, 11)

8 recs where seviri_m10 channels were renumbered
- old: (1, 2, 3, 4, 5, 6, 7, 8)
- new: (4, 5, 6, 7, 8, 9, 10, 11)

2877 satbias recs before update
2855 satbias recs after update

new satbias file has been written: outdir/satbias_default_rst.new
sortflag = "default"


The following details are listed below:
=======================================
* records removed; not found in satinfo.rc


* records removed; not found in satinfo.rc
------------------------------------------
('gmi_gpm', '1')
('gmi_gpm', '2')
('gmi_gpm', '3')
('gmi_gpm', '4')
('gmi_gpm', '5')
('gmi_gpm', '6')
('gmi_gpm', '7')
('gmi_gpm', '8')
('gmi_gpm', '9')
('gmi_gpm', '10')
('gmi_gpm', '11')
('gmi_gpm', '12')
('gmi_gpm', '13')
('tmi_trmm', '1')
('tmi_trmm', '2')
('tmi_trmm', '3')
('tmi_trmm', '4')
('tmi_trmm', '5')
('tmi_trmm', '6')
('tmi_trmm', '7')
('tmi_trmm', '8')
('tmi_trmm', '9')
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
=====================
check_satbias summary
=====================
current dir: /gpfsm/dswdev/jstassi/GEOSadas/g5294/src/Components/@GEOSana_GridComp/GEOSaana_GridComp/GSI_GridComp/etc/unittests

satbias_rst: outdir/satbias_revert_rst
satinfo.rc: input/gmao_revert_satinfo.rc
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

=====================
check_satbias summary
=====================

satbias_rst: outdir/satbias_revert_rst
satinfo.rc: input/gmao_revert_satinfo.rc

0 recs removed because instrument/channel not in satinfo.rc
0 recs added from satinfo.rc

281 recs renamed airs_aqua to airs281_aqua
399 recs renamed cris_npp to cris399_npp
616 recs renamed iasi_metop-a to iasi616_metop-a
616 recs renamed iasi_metop-b to iasi616_metop-b

8 recs where seviri_m08 channels were renumbered
- old: (4, 5, 6, 7, 8, 9, 10, 11)
- new: (1, 2, 3, 4, 5, 6, 7, 8)

8 recs where seviri_m09 channels were renumbered
- old: (4, 5, 6, 7, 8, 9, 10, 11)
- new: (1, 2, 3, 4, 5, 6, 7, 8)

8 recs where seviri_m10 channels were renumbered
- old: (4, 5, 6, 7, 8, 9, 10, 11)
- new: (1, 2, 3, 4, 5, 6, 7, 8)

2855 satbias recs before update
2855 satbias recs after update

new satbias file has been written: outdir/satbias_revert_rst.new
sortflag = "default"


The following details are listed below:
=======================================
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
=====================
check_satbias summary
=====================
current dir: /gpfsm/dswdev/jstassi/GEOSadas/g5294/src/Components/@GEOSana_GridComp/GEOSaana_GridComp/GSI_GridComp/etc/unittests

satbias_rst: outdir/satbias_satbias_rst
satinfo.rc: input/gmao_global_satinfo.rc
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@

=====================
check_satbias summary
=====================

satbias_rst: outdir/satbias_satbias_rst
satinfo.rc: input/gmao_global_satinfo.rc

22 recs removed because instrument/channel not in satinfo.rc
0 recs added from satinfo.rc

0 recs renamed airs281SUBSET to airs_aqua
281 recs renamed airs281_aqua to airs_aqua
0 recs renamed cris399_npp to cris_npp
616 recs renamed iasi616_metop-a to iasi_metop-a
616 recs renamed iasi616_metop-b to iasi_metop-b

8 recs where seviri_m08 channels were renumbered
- old: (1, 2, 3, 4, 5, 6, 7, 8)
- new: (4, 5, 6, 7, 8, 9, 10, 11)

8 recs where seviri_m09 channels were renumbered
- old: (1, 2, 3, 4, 5, 6, 7, 8)
- new: (4, 5, 6, 7, 8, 9, 10, 11)

8 recs where seviri_m10 channels were renumbered
- old: (1, 2, 3, 4, 5, 6, 7, 8)
- new: (4, 5, 6, 7, 8, 9, 10, 11)

2877 satbias recs before update
2855 satbias recs after update

new satbias file has been written: outdir/satbias_satbias_rst.new
sortflag = "satbias"


The following details are listed below:
=======================================
* records removed; not found in satinfo.rc


* records removed; not found in satinfo.rc
------------------------------------------
('gmi_gpm', '1')
('gmi_gpm', '2')
('gmi_gpm', '3')
('gmi_gpm', '4')
('gmi_gpm', '5')
('gmi_gpm', '6')
('gmi_gpm', '7')
('gmi_gpm', '8')
('gmi_gpm', '9')
('gmi_gpm', '10')
('gmi_gpm', '11')
('gmi_gpm', '12')
('gmi_gpm', '13')
('tmi_trmm', '1')
('tmi_trmm', '2')
('tmi_trmm', '3')
('tmi_trmm', '4')
('tmi_trmm', '5')
('tmi_trmm', '6')
('tmi_trmm', '7')
('tmi_trmm', '8')
('tmi_trmm', '9')
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
=====================
check_satbias summary
=====================
current dir: /gpfsm/dswdev/jstassi/GEOSadas/g5294/src/Components/@GEOSana_GridComp/GEOSaana_GridComp/GSI_GridComp/etc/unittests

satbias_rst: outdir/satbias_satinfo_rst
satinfo.rc: input/gmao_global_satinfo.rc
Expand Down
Loading