File tree Expand file tree Collapse file tree 3 files changed +26
-12
lines changed Expand file tree Collapse file tree 3 files changed +26
-12
lines changed Original file line number Diff line number Diff line change 1
- # 'ecmwf_0100_1h': '../ecmwf/forecast/hourly/0100deg/netcdf_light_REPRO_tree/%Y/%j/ECMWF_FORECAST_0100_%Y%m%d%H%M_10U_10V.nc'
2
- # 'ecmwf_0125_1h': '../ecmwf/0.125deg/1h/forecasts/%Y/%j/ecmwf_%Y%m%d%H%M.nc'
1
+ ' ecmwf_0100_1h ' : ' ../ecmwf/forecast/hourly/0100deg/netcdf_light_REPRO_tree/%Y/%j/ECMWF_FORECAST_0100_%Y%m%d%H%M_10U_10V.nc'
2
+ ' ecmwf_0125_1h ' : ' ../ecmwf/0.125deg/1h/forecasts/%Y/%j/ecmwf_%Y%m%d%H%M.nc'
3
+
4
+
5
+ unit_test_s1_product : ' ./sentinel-1a/L1/IW/S1A_IW_GRDH_1S/2021/252/S1A_IW_GRDH_1SDV_20210909T130650_20210909T130715_039605_04AE83_C34F.SAFE'
6
+ unit_test_rcm_product : ' ./l1/rcm/rcm-1/sclnd/2023/273/RCM1_OK2767220_PK2769320_1_SCLND_20230930_214014_VV_VH_GRD'
7
+ unit_test_rs2_product : ' ./L1/VV_VH/2022/247/RS2_OK141302_PK1242223_DK1208537_SCWA_20220904_093402_VV_VH_SGF'
3
8
4
- ' ecmwf_0100_1h ' : ' /home/datawork-cersat-public/provider/ecmwf/forecast/hourly/0100deg/netcdf_light_REPRO_tree/%Y/%j/ECMWF_FORECAST_0100_%Y%m%d%H%M_10U_10V.nc'
5
- ' ecmwf_0125_1h ' : ' /home/datawork-cersat-intranet/project/ecmwf/0.125deg/1h/forecasts/%Y/%j/ecmwf_%Y%m%d%H%M.nc'
Original file line number Diff line number Diff line change 3
3
import os
4
4
import grdwindinversion
5
5
from yaml import CLoader as Loader
6
- local_config_potential_path = os .path .expanduser (
6
+ local_config_potential_path1 = os .path .expanduser (
7
7
'~/.grdwindinversion/data_config.yaml' )
8
-
9
- if os .path .exists (local_config_potential_path ):
10
- config_path = local_config_potential_path
8
+ local_config_potential_path2 = os .path .join (os .path .dirname (
9
+ grdwindinversion .__file__ ), 'local_data_config.yaml' )
10
+ if os .path .exists (local_config_potential_path1 ):
11
+ config_path = local_config_potential_path1
12
+ elif os .path .exists (local_config_potential_path2 ):
13
+ config_path = local_config_potential_path2
11
14
else :
12
15
config_path = os .path .join (os .path .dirname (
13
16
grdwindinversion .__file__ ), 'data_config.yaml' )
Original file line number Diff line number Diff line change 2
2
import os
3
3
import urllib .request
4
4
from grdwindinversion .inversion import makeL2
5
+ import xsar
6
+ from grdwindinversion .load_config import getConf
5
7
6
8
# What must be done by the tests:
7
9
# - Download L1 data
13
15
# - For recal : download auxiliary files
14
16
#
15
17
16
-
18
+ S1_path = getConf ()['unit_test_s1_product' ]
19
+ rcm_path = getConf ()['unit_test_rcm_product' ]
20
+ rs2_path = getConf ()['unit_test_rs2_product' ]
21
+ print ('S1_path' ,S1_path )
17
22
def test_makeL2_generation ():
18
23
l1_files = [
19
- "./test_data/L1/S1A_IW_GRDH_1SDV_20210909T130650_20210909T130715_039605_04AE83_C34F.SAFE" ,
20
- "./test_data/L1/RCM1_OK2767220_PK2769320_1_SCLND_20230930_214014_VV_VH_GRD" ,
21
- "./test_data/L1/RS2_OK141302_PK1242223_DK1208537_SCWA_20220904_093402_VV_VH_SGF"
24
+ xsar . get_test_file ( S1_path ) ,
25
+ xsar . get_test_file ( rcm_path ) ,
26
+ xsar . get_test_file ( rs2_path )
22
27
]
23
28
24
29
# l1_files = [
@@ -52,3 +57,6 @@ def test_makeL2_generation():
52
57
assert (
53
58
"owiWindSpeed" in dataset .variables
54
59
), "Expected variable 'owiWindSpeed' missing in the dataset"
60
+
61
+ if __name__ == '__main__' :
62
+ test_makeL2_generation ()
You can’t perform that action at this time.
0 commit comments