diff --git a/mvcm/cli_mvcm.py b/mvcm/cli_mvcm.py index 02530132e630843aeb63807fd6a3d96e929c1877..9cf9470770f4f33c2999779c9fc781368e9f458a 100644 --- a/mvcm/cli_mvcm.py +++ b/mvcm/cli_mvcm.py @@ -40,15 +40,15 @@ def mvcm(): help='level 1b file name') parser.add_argument('--geolocation', help='geolocation file name') - parser.add_argument('--hires_l1b', + parser.add_argument('--hires-l1b', help='VIIRS IMG02 file name') - parser.add_argument('--hires_geo', + parser.add_argument('--hires-geo', help='VIIRS IMG03 file name') parser.add_argument('-t', '--threshold', help='thresholds file name') - parser.add_argument('--atmos_1', + parser.add_argument('--atmos-1', help='file name of the first GEOS-IT file for atmospheric parameters') - parser.add_argument('--atmos_2', + parser.add_argument('--atmos-2', help='file name of the second GEOS-IT file for atmospheric parameters') parser.add_argument('--land', help='file name of GEOS-IT land parameters') diff --git a/mvcm/main.py b/mvcm/main.py index c226f50928cb851800fb6155760e2469d75a2eb6..dfcbcc4211d335cd74a2a117a3c7f6562f3b17e0 100644 --- a/mvcm/main.py +++ b/mvcm/main.py @@ -165,16 +165,17 @@ def main(satellite: str = 'snpp', _bitlist = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16'] i = 0 temp_bit = np.zeros((18, viirs_data.M11.shape[0], viirs_data.M11.shape[1])) - thr_temp = np.ones(viirs_data.M11.shape) * -12345.6 for scene_name in ['Land_Day', 'Land_Day_Coast', 'Land_Day_Desert', 'Land_Day_Desert_Coast', 'Ocean_Day', 'Ocean_Night', 'Polar_Day_Ocean', 'Polar_Night_Ocean', 'Polar_Day_Land', 'Polar_Day_Coast', 'Polar_Day_Desert', 'Polar_Day_Desert_Coast', 'Polar_Day_Snow', 'Land_Night', 'Polar_Night_Land', 'Polar_Night_Snow', 'Day_Snow', 'Night_Snow']: - # for scene_name in ['Land_Day', 'Land_Day_Coast', 'Land_Day_Desert', 'Land_Day_Desert_Coast', - # 'Ocean_Day']: print(f'Processing {scene_name}') + if np.all(viirs_data[scene_name].values == 0): + logging.info('Skipping, no pixels in scene.') + continue + MyScene = tst.CloudTests(data=viirs_data, scene_name=scene_name, thresholds=thresholds) @@ -201,7 +202,7 @@ def main(satellite: str = 'snpp', cmin_G1, bit['03'] = MyScene.sst_test('M15', 'M16', cmin_G1) cmin_G2, bit['04'] = MyScene.bt_diff_86_11um('M14-M15', cmin_G2) - cmin_G2, bit['05'], thr_temp = MyScene.test_11_12um_diff('M15-M16', cmin_G2, thr_temp) + cmin_G2, bit['05'] = MyScene.test_11_12um_diff('M15-M16', cmin_G2) cmin_G2, bit['07'] = MyScene.bt_difference_11_4um_test_ocean('M15-M12', cmin_G2) # # cmin_G2, bit['08'] = MyScene.bt_difference_11_4um_test_land('M15-M12', cmin_G2) cmin_G2, bit['09'] = MyScene.oceanic_stratus_11_4um_test('M15-M12', cmin_G2) @@ -346,8 +347,8 @@ def main(satellite: str = 'snpp', 'data': bit['14']}, 'bit15': {'dims': ('x', 'y'), 'data': bit['15']}, - 'thr': {'dims': ('x', 'y'), - 'data': thr_temp}, + # 'thr': {'dims': ('x', 'y'), + # 'data': thr_temp}, # 'shallow_water_bits': {'dims': ('x', 'y'), # 'data': sh_water_bits}, # 'b15': {'dims': ('x', 'y'), diff --git a/mvcm/spectral_tests.py b/mvcm/spectral_tests.py index dbdea14299d83f53ff205b1f446c1b071cdffa7f..10dc0a16fa87c887719a924c966161ed0d5c268b 100644 --- a/mvcm/spectral_tests.py +++ b/mvcm/spectral_tests.py @@ -218,7 +218,6 @@ class CloudTests(object): def test_11_12um_diff(self, band: str, cmin: np.ndarray, - thr_temp, **kwargs) -> np.ndarray: threshold = kwargs['thresholds'] @@ -238,8 +237,8 @@ class CloudTests(object): cmin = np.fmin(cmin, kwargs['confidence']) kwargs['test_bit'] = kwargs['test_bit'].reshape(self.data[band].shape) - thr_temp[self.scene_idx] = thr[1, :] - return cmin, restoral_flag(kwargs), thr_temp + + return cmin, restoral_flag(kwargs) # THIS NEEDS TO BE TESTED @run_if_test_exists_for_scene('11-4um_BT_Difference_Test_Ocean') diff --git a/release.sh b/release.sh new file mode 100755 index 0000000000000000000000000000000000000000..8114bfb44b2ad79c48106b26c9cc64502bda73d8 --- /dev/null +++ b/release.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +# Create a release by creating a commit, tagging it, and pushing +set -e + +if [[ -z $1 ]]; then + echo "USAGE: $0 <major|minor|patch>" + exit 1 +fi + +hatch version $1 + +readonly ver=$(hatch version) +if git tag -l | grep -E "^${ver}$" &> /dev/null; then + echo "Whoops!! Tag for version ${ver} already exists" + exit 1 +fi + +git add mvcm/__init__.py +git commit -am "bump version" +git tag -am "bump to ${ver}" ${ver} +git push --follow-tags