-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
created new tests for winds, GUI, SARS, and binaries
- Loading branch information
Greg Blumberg
committed
Jan 11, 2019
1 parent
96344ed
commit 3cbb28e
Showing
11 changed files
with
225 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__all__ = ['sars', 'pwv', 'inset_data'] | ||
__all__ = ['sars', 'pwv', 'inset_data', 'sars_cal'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import sars | ||
import numpy as np | ||
from datetime import datetime | ||
|
||
supercell_db = np.loadtxt('sars_supercell.txt', skiprows=1, dtype=bytes, comments="%%%%") | ||
hail_db = np.loadtxt('sars_hail.txt', skiprows=1, dtype=bytes) | ||
print(supercell_db) | ||
print(hail_db) | ||
|
||
for f in supercell_db[:,0]: | ||
f = f.decode("utf-8") | ||
try: | ||
raw = sars.getSounding(str(f), 'supercell') | ||
except: | ||
print("NO DATA FILE FOR:", f) | ||
continue | ||
lines = open(raw, 'r').readlines() | ||
title = lines[1] | ||
loc = f.split('.')[1] | ||
print(title.strip(), f, loc) | ||
if 'RUC' in title.strip(): | ||
#print("it's a model") | ||
new_title = title.replace(loc.lower(), '') | ||
new_title = new_title.replace('RUC', loc) | ||
new_title = new_title.replace('F000', '') | ||
new_title = new_title.replace(';', ',') | ||
elif "MRF" in title.strip(): | ||
new_title = title.replace("MRF", loc.upper()) | ||
fname = f.split('.')[0] | ||
new_title = loc.upper() + ' ' + fname[:6] + '/' + fname[6:8] + '00\n\n' | ||
else: | ||
continue | ||
note = '\n----- Note -----\nOld Title: ' + title + '\n' | ||
#print("MODIFY:") | ||
#print("Old Title:", title) | ||
#print("New Title:", new_title) | ||
print("BEFORE:") | ||
print(''.join(lines)) | ||
lines[1] = " " + new_title | ||
new_data = ''.join(lines) + note | ||
|
||
print("AFTER:") | ||
print(new_data) | ||
#if "MRF" in title: | ||
# break | ||
f = open(raw, 'w') | ||
f.write(new_data) | ||
f.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,25 @@ | ||
import os | ||
import sys | ||
import pytest | ||
import glob | ||
import sharppy.databases.sars as sars | ||
import numpy as np | ||
full_gui = pytest.importorskip('runsharp.full_gui') | ||
|
||
@pytest.mark.skipif("DISPLAY_AVAIL" in os.environ and os.environ["DISPLAY_AVAIL"] == 'NO', reason="DISPLAY not set") | ||
def test_main_entry_pt(): | ||
#sys.argv = [] | ||
#print(full_gui.sys.argv) | ||
#full_gui.sys.argv.append('examples/data/14061619.OAX') | ||
full_gui.test('examples/data/14061619.OAX') | ||
hail_files = glob.glob(sars.get_sars_dir('hail') + '*') | ||
supercell_files = glob.glob(sars.get_sars_dir('supercell') + '*') | ||
#print(hail_files + supercell_files) | ||
sars_files = np.asarray(hail_files + supercell_files) | ||
idx = np.random.randint(0, len(sars_files), 10) | ||
files = list(sars_files[idx]) + ['examples/data/14061619.OAX'] | ||
print(files) | ||
full_gui.test(files) | ||
|
||
#test_main_entry_pt() | ||
|
||
test_main_entry_pt() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.