diff --git a/.gitignore b/.gitignore index df147be..decc376 100644 --- a/.gitignore +++ b/.gitignore @@ -18,7 +18,10 @@ lisflood_lisvap.egg-info/ !tests/data/tests_cordex.xml !/tests/data/tests_glofas.xml !tests/data/tests_efas_1arcmin.xml +!tests/data/tests_efas_1arcmin_6hourly.xml +!tests/data/tests_efas_1arcmin_hourly.xml !tests/data/tests_efas_1arcmin_yearly.xml +!tests/data/tests_efas_1arcmin_yearly_output.xml !tests/data/tests_efas_1arcmin_360days_calendar.xml # unignoring reference and input data for tests diff --git a/Dockerfile b/Dockerfile index 6ffad36..83dd4cd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ -FROM python:3.7-stretch -MAINTAINER Domenico Nappo +FROM python:3.7-buster +MAINTAINER Goncalo Gomes ENV no_proxy=jrc.it,localhost,ies.jrc.it,127.0.0.1,jrc.ec.europa.eu ENV ftp_proxy=http://10.168.209.72:8012 @@ -24,12 +24,13 @@ RUN wget -q http://pcraster.geo.uu.nl/pcraster/4.2.1/pcraster-4.2.1.tar.bz2 && t COPY requirements.txt / RUN /usr/local/bin/pip3.7 install -U pip && /usr/local/bin/pip3.7 install -r /requirements.txt \ - && cd /usr/lib/x86_64-linux-gnu/ && ln -s libboost_python-py35.so libboost_python3.so + && cd /usr/lib/x86_64-linux-gnu/ && [ ! -f libboost_python3.so ] && ln -s libboost_python-py35.so libboost_python3.so || true WORKDIR /opt/pcraster-4.2.1/build RUN cmake -DFERN_BUILD_ALGORITHM:BOOL=TRUE -DCMAKE_INSTALL_PREFIX:PATH=/opt/pcraster -DPYTHON_EXECUTABLE:FILEPATH=/usr/local/bin/python3.7 ../ \ && cmake --build ./ && make install +WORKDIR / COPY tests/. /tests/ COPY basemaps/. /basemaps/ COPY src/. / diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 3981a6f..16c4a6d 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -6,7 +6,7 @@ if [[ "$1" = 'usecases' ]]; then mkdir -p /input/efas mkdir -p /input/basemaps echo "Copying basemaps to /input/..." - cp /basemaps/* /input/basemaps/ + cp -r /basemaps/* /input/basemaps/ echo "copy input files to /input/cordex......" cp /tests/data/input/cordex/*.nc /input/cordex/ echo "copy cordex settings to /input/..." diff --git a/settings_tpl.xml b/settings_tpl.xml index 15e6ef6..2e23764 100644 --- a/settings_tpl.xml +++ b/settings_tpl.xml @@ -35,7 +35,7 @@ You can use $(SettingsDir) or $(SettingsPath) to refer directory containing the - time step [seconds] ALWAYS USE 86400!! + time step [seconds] USE 86400 for daily, 43200 for 12hourly, 21600 for 6hourly and 3600 for hourly!! diff --git a/src/lisvap/__init__.py b/src/lisvap/__init__.py index 1eb9af9..e437b1f 100644 --- a/src/lisvap/__init__.py +++ b/src/lisvap/__init__.py @@ -1,7 +1,7 @@ -version = version = (1, 2, 9) +version = version = (1, 3, 0) __authors__ = "Peter Burek, Johan van der Knijff, Ad de Roo" __version__ = '.'.join(list(map(str, version))) -__date__ = "22/01/2024" +__date__ = "07/03/2024" __copyright__ = "Copyright 2020, Lisflood Open Source" __maintainers__ = "Goncalo Gomes, Domenico Nappo, Valerio Lorini, Lorenzo Mentaschi, Lorenzo Alfieri" __status__ = "Operation" diff --git a/src/lisvap/lisvapdynamic.py b/src/lisvap/lisvapdynamic.py index c690152..8fce013 100644 --- a/src/lisvap/lisvapdynamic.py +++ b/src/lisvap/lisvapdynamic.py @@ -135,7 +135,7 @@ def dynamic(self): # CM: get time for operation "Start dynamic" tp.timemeasure('Start dynamic') # CM: date corresponding to the model time step (yyyy-mm-dd hh:mm:ss) - self.calendar_date = self.calendar_day_start + datetime.timedelta(days=(self.currentTimeStep()) * self.DtDay) + self.calendar_date = self.calendar_day_start + datetime.timedelta(seconds=(self.currentTimeStep()) * self.DtSec) # CM: day of the year corresponding to the model time step self.calendar_day = int(self.calendar_date.strftime("%j")) @@ -146,7 +146,7 @@ def dynamic(self): self.time_since_start = self.currentTimeStep() - self.firstTimeStep() + 1 if settings.flags['loud']: - print("%-6i %10s" % (self.currentTimeStep(), self.calendar_date.strftime("%d/%m/%Y"))) + print("%-6i %10s" % (self.currentTimeStep(), self.calendar_date.strftime("%d/%m/%Y %H:%M"))) elif not settings.flags['checkfiles']: if settings.flags['quiet'] and not settings.flags['veryquiet']: sys.stdout.write(".") diff --git a/src/lisvap/utils/readers.py b/src/lisvap/utils/readers.py index d3f7dd5..4ef3076 100644 --- a/src/lisvap/utils/readers.py +++ b/src/lisvap/utils/readers.py @@ -275,9 +275,17 @@ def netcdf_step(averageyearflag, nf1, timestampflag, timestep, splitIO=False): # Time step, expressed as fraction of day (same as self.var.DtSec and self.var.DtDay) # get date of current simulation step current_date = calendar(timestep) + if not isinstance(current_date, datetime.datetime): - current_date_number = date2num(begin, units=t_unit, calendar=t_cal) + ((current_date - 1) * DtDay) - current_date = num2date(current_date_number, t_unit, t_cal) + current_date_number = current_date * int(settings.binding['internal.time.frequency']) + init_t_unit = settings.binding['internal.time.unit'] + init_t_cal = settings.binding['internal.time.calendar'] + begin_date_number = date2num(begin, units=init_t_unit, calendar=init_t_cal) + cur_date = num2date(current_date_number, init_t_unit, init_t_cal) + next_date = cur_date - datetime.timedelta(seconds=DtSec) + cur_step = date2num(next_date, units=init_t_unit, calendar=init_t_cal) + current_date_number = begin_date_number + cur_step + current_date = num2date(current_date_number, init_t_unit, init_t_cal) # if reading from an average year NetCDF stack, ignore the year in current simulation date and change it to the netCDF time unit year if averageyearflag: # CM: get year from time unit in case average year is used diff --git a/src/lisvap/utils/tools.py b/src/lisvap/utils/tools.py index 9fc6b22..57b310e 100644 --- a/src/lisvap/utils/tools.py +++ b/src/lisvap/utils/tools.py @@ -29,6 +29,7 @@ from pcraster.operations import scalar, defined, maptotal, ifthenelse, mapminimum, mapmaximum from . import LisfloodError +from . import LisSettings from .decorators import counted @@ -97,10 +98,16 @@ def get_calendar_configuration(netcdf_file_obj, settings=None): except AttributeError: # Attribute does not exist t_unit = u'hours since 1990-01-01 06:00:00' t_cal = u'gregorian' # Use standard calendar + try: + t_frequency = int(netcdf_file_obj.variables['time'].frequency) # get frequency + except AttributeError: # Attribute does not exist + t_frequency = 1 if settings is not None and not ('internal.time.unit' in settings.binding and - 'internal.time.calendar' in settings.binding): + 'internal.time.calendar' in settings.binding and + 'internal.time.frequency' in settings.binding): settings.binding['internal.time.unit'] = t_unit settings.binding['internal.time.calendar'] = t_cal + settings.binding['internal.time.frequency'] = t_frequency return t_unit, t_cal @@ -142,7 +149,6 @@ def date_to_int(date_in, both=False): the number of steps as integer is returned :return: number of steps as integer and input date as string """ - from lisvap.utils import LisSettings settings = LisSettings.instance() binding = settings.binding # CM: get reference date to be used with step numbers from 'CalendarDayStart' in Settings.xml file @@ -175,7 +181,6 @@ def checkdate(start, end): :param start: start date for model run (# or date as string) :param end: end date for model run (# or date as string) """ - from . import LisSettings settings = LisSettings.instance() binding = settings.binding # CM: calendar date start (CalendarDayStart) diff --git a/src/lisvap/utils/writers.py b/src/lisvap/utils/writers.py index 3f2536f..d7e86c7 100644 --- a/src/lisvap/utils/writers.py +++ b/src/lisvap/utils/writers.py @@ -63,55 +63,53 @@ def coordinates_range(start=0, nelems=1, step=1): return elem_array -def get_output_parameters_monthly(start_date, timestep, current_output_index): +def get_output_parameters_monthly(start_date, timestep, time_frequency, timestep_stride, current_output_index): output_index = current_output_index - start_yearmonth = start_date.strftime('%Y%m') - current_date = start_date + datetime.timedelta(days=timestep-1) - current_yearmonth = current_date.strftime('%Y%m') - filename_suffix = current_yearmonth - if start_yearmonth != current_yearmonth: - first_day_current_month = current_date.replace(day=1, hour=0, minute=0, second=0, microsecond=0) - current_day = current_date.replace(hour=0, minute=0, second=0, microsecond=0) - days_between = (current_day - first_day_current_month).days - if days_between == 0: - # Get last month because the 1st of the month belongs in the last month file - last_day_last_month = first_day_current_month - datetime.timedelta(days=1) - filename_suffix = (last_day_last_month).strftime('%Y%m') - num_days_last_month = last_day_last_month.day - # If last month was complete the idx needs to be set to the last idx of the previous file - if output_index > num_days_last_month: - output_index = num_days_last_month - 1 - else: - # Since the 1st day belongs to the last year file, the remaining days need to start on index 0... - output_index = days_between - 1 + current_date = start_date + datetime.timedelta(seconds=((timestep - 1) * timestep_stride)) + filename_suffix = current_date.strftime('%Y%m') + + first_date_current_month = start_date.replace(year=current_date.year, month=current_date.month) + seconds_between = (current_date - first_date_current_month).total_seconds() + num_steps_done_in_current_month = int(seconds_between / timestep_stride) + 1 + last_date_last_month = first_date_current_month - datetime.timedelta(seconds=timestep_stride) + day_inside_last_month = last_date_last_month - datetime.timedelta(seconds=timestep_stride) + + if current_date == first_date_current_month: + output_index = 0 + elif current_date == last_date_last_month: + filename_suffix = day_inside_last_month.strftime('%Y%m') + first_date_last_month = day_inside_last_month.replace(day=1) + datetime.timedelta(seconds=(2 * timestep_stride)) + num_steps_done_in_last_month = int((last_date_last_month - first_date_last_month).total_seconds() / timestep_stride) + 1 + output_index = num_steps_done_in_last_month + elif current_output_index >= num_steps_done_in_current_month: + output_index = num_steps_done_in_current_month - 1 return filename_suffix, output_index -def get_output_parameters_yearly(start_date, timestep, current_output_index): +def get_output_parameters_yearly(start_date, timestep, time_frequency, timestep_stride, current_output_index): output_index = current_output_index - start_year = start_date.strftime('%Y') - current_date = start_date + datetime.timedelta(days=timestep-1) - current_year = current_date.strftime('%Y') - filename_suffix = current_year - if start_year != current_year: - first_day_current_year = current_date.replace(month=1, day=1, hour=0, minute=0, second=0, microsecond=0) - current_day = current_date.replace(hour=0, minute=0, second=0, microsecond=0) - days_between = (current_day - first_day_current_year).days - if days_between == 0: - # Get last year because the 1st of January belongs in the last year file - last_day_last_year = first_day_current_year - datetime.timedelta(days=1) - filename_suffix = (last_day_last_year).strftime('%Y') - num_days_last_year = last_day_last_year.timetuple().tm_yday - # If last year was complete the idx needs to be set to the last idx of the previous file - if output_index > num_days_last_year: - output_index = num_days_last_year - 1 - else: - # Since the 1st day belongs to the last year file, the remaining days need to start on index 0... - output_index = days_between - 1 + current_date = start_date + datetime.timedelta(seconds=((timestep - 1) * timestep_stride)) + filename_suffix = current_date.strftime('%Y') + + first_date_current_year = start_date.replace(year=current_date.year) + seconds_between = (current_date - first_date_current_year).total_seconds() + num_steps_done_in_current_year = int(seconds_between / timestep_stride) + 1 + last_date_last_year = first_date_current_year - datetime.timedelta(seconds=timestep_stride) + day_inside_last_year = last_date_last_year - datetime.timedelta(seconds=timestep_stride) + + if current_date == first_date_current_year: + output_index = 0 + elif current_date == last_date_last_year: + filename_suffix = day_inside_last_year.strftime('%Y') + first_date_last_year = first_date_current_year.replace(year=current_date.year - 1) + num_steps_done_in_last_year = int((last_date_last_year - first_date_last_year).total_seconds() / timestep_stride) + 1 + output_index = num_steps_done_in_last_year - 1 + elif current_output_index >= num_steps_done_in_current_year: + output_index = num_steps_done_in_current_year - 1 return filename_suffix, output_index -def get_output_parameters(settings, netcdf_output_file, start_date, timestep, current_output_index): +def get_output_parameters(settings, netcdf_output_file, start_date, timestep, time_frequency, timestep_stride, current_output_index): output_index = current_output_index p = Path(netcdf_output_file) netfile = Path(p.parent) / Path('{}.nc'.format(p.name) if not p.name.endswith('.nc') else p.name) @@ -120,9 +118,9 @@ def get_output_parameters(settings, netcdf_output_file, start_date, timestep, cu if splitIO: monthlyIO = settings.get_option('monthlyOutput') if monthlyIO: - filename_suffix, output_index = get_output_parameters_monthly(start_date, timestep, current_output_index) + filename_suffix, output_index = get_output_parameters_monthly(start_date, timestep, time_frequency, timestep_stride, current_output_index) else: - filename_suffix, output_index = get_output_parameters_yearly(start_date, timestep, current_output_index) + filename_suffix, output_index = get_output_parameters_yearly(start_date, timestep, time_frequency, timestep_stride, current_output_index) netfile = Path(p.parent) / Path('{}_{}.nc'.format(p.name, filename_suffix) if not p.name.endswith('.nc') else p.name) return prefix, netfile, output_index @@ -140,6 +138,16 @@ def set_time_dimension(settings, netcdf_obj, time_variable_name, start_date, var start_date_6hourly = start_date - datetime.timedelta(hours=18) time.units = 'hours since %s' % start_date_6hourly.strftime('%Y-%m-%d %H:%M:%S.0') time.frequency = 6 + elif 'internal.time.unit' in settings.binding: + internal_time_units = settings.binding['internal.time.unit'] + # Separate the different parts of time units, ex: + # "seconds since 1970-01-01 00:00:00" + # "days since 1970-01-01 00:00:00" + # "hours since 1970-01-01 00:00:00" + # "minutes since 1970-01-01 00:00:00" + time_units_parts = internal_time_units.split(' ') + time.units = '%s since %s' % (time_units_parts[0], start_date.strftime('%Y-%m-%d %H:%M:%S.0')) + time.frequency = int(settings.binding['internal.time.frequency']) else: time.units = 'days since %s' % start_date.strftime('%Y-%m-%d %H:%M:%S.0') time.frequency = 1 @@ -276,19 +284,21 @@ def writenet(current_output_index, inputmap, netcdf_output_file, current_timeste netfile: output netcdf filename timestep: """ - start_date = calendar_day_start + datetime.timedelta(days=1) + settings = LisSettings.instance() + + timestep_stride = int(settings.binding['DtSec']) + time_frequency = int(settings.binding['internal.time.frequency']) + start_date = calendar_day_start + datetime.timedelta(seconds=timestep_stride) timestep = current_timestep cutmap = CutMap.instance() nrows = np.abs(cutmap.cuts[3] - cutmap.cuts[2]) ncols = np.abs(cutmap.cuts[1] - cutmap.cuts[0]) - settings = LisSettings.instance() - time_variable = 'time' output6hourly = settings.get_option('output6hourly') - prefix, netfile, output_index = get_output_parameters(settings, netcdf_output_file, start_date, - timestep, current_output_index) + prefix, netfile, output_index = get_output_parameters(settings, netcdf_output_file, start_date, timestep, + time_frequency, timestep_stride, current_output_index) # Create and setup the netcdf file when the first map needs to be stored if output_index == 0 or not netfile.exists(): @@ -304,7 +314,7 @@ def writenet(current_output_index, inputmap, netcdf_output_file, current_timeste mapnp[np.isnan(mapnp)] = (nan_value - add_offset) * scale_factor if flag_time: # In case output6hourly==True, replicate four daily maps to get the 6 hourly output (EFCC-2316) - # The timestep need to increase by 4 + # The timestep needs to increase by 4 if output6hourly: time_frequency = 6 for i in range(4): @@ -312,7 +322,7 @@ def writenet(current_output_index, inputmap, netcdf_output_file, current_timeste nf1.variables[time_variable][map_idx] = (timestep * 4 - 4 + i) * time_frequency nf1.variables[prefix][map_idx, :, :] = mapnp else: # Generate daily output - nf1.variables[time_variable][output_index] = timestep - 1 + nf1.variables[time_variable][output_index] = (timestep - 1) * time_frequency # timestep - time_frequency nf1.variables[prefix][output_index, :, :] = mapnp else: nf1.variables[prefix][:, :] = mapnp diff --git a/src/lisvap1.py b/src/lisvap1.py index 7977428..6600413 100644 --- a/src/lisvap1.py +++ b/src/lisvap1.py @@ -50,10 +50,11 @@ def lisvapexe(settings): tp = TimeProfiler() step_start = settings.binding['StepStart'] step_end = settings.binding['StepEnd'] + timestep_stride = int(settings.binding['DtSec']) start_date, end_date = datetime.datetime.strptime(step_start, '%d/%m/%Y %H:%M'), datetime.datetime.strptime(step_end, '%d/%m/%Y %H:%M') start_date_simulation = datetime.datetime.strptime(settings.binding['CalendarDayStart'], '%d/%m/%Y %H:%M') - timestep_start = (start_date - start_date_simulation).days + 1 - timestep_end = (end_date - start_date_simulation).days + 1 + timestep_start = int((start_date - start_date_simulation).total_seconds() / timestep_stride) + 1 + timestep_end = int((end_date - start_date_simulation).total_seconds() / timestep_stride) + 1 checkdate('StepStart', 'StepEnd') print('Start date: {} ({}) - End date: {} ({})'.format(step_start, timestep_start, step_end, timestep_end)) diff --git a/tests/__init__.py b/tests/__init__.py index be65125..da28884 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -47,11 +47,32 @@ class TestLis(object): 'es': os.path.join(current_dir, 'data/reference/efas_1arcmin/es_1_15'), 'et': os.path.join(current_dir, 'data/reference/efas_1arcmin/et_1_15'), }, + 'efas_1arcmin_6hourly': { + 'e0_202112': os.path.join(current_dir, 'data/reference/efas_1arcmin_6hourly/e0_202112'), + 'es_202112': os.path.join(current_dir, 'data/reference/efas_1arcmin_6hourly/es_202112'), + 'et_202112': os.path.join(current_dir, 'data/reference/efas_1arcmin_6hourly/et_202112'), + 'e0_202201': os.path.join(current_dir, 'data/reference/efas_1arcmin_6hourly/e0_202201'), + 'es_202201': os.path.join(current_dir, 'data/reference/efas_1arcmin_6hourly/es_202201'), + 'et_202201': os.path.join(current_dir, 'data/reference/efas_1arcmin_6hourly/et_202201'), + }, + 'efas_1arcmin_hourly': { + 'e0': os.path.join(current_dir, 'data/reference/efas_1arcmin_hourly/e0'), + 'es': os.path.join(current_dir, 'data/reference/efas_1arcmin_hourly/es'), + 'et': os.path.join(current_dir, 'data/reference/efas_1arcmin_hourly/et'), + }, 'efas_1arcmin_yearly': { 'e0': os.path.join(current_dir, 'data/reference/efas_1arcmin_yearly/e0'), 'es': os.path.join(current_dir, 'data/reference/efas_1arcmin_yearly/es'), 'et': os.path.join(current_dir, 'data/reference/efas_1arcmin_yearly/et'), }, + 'efas_1arcmin_yearly_output': { + 'e0_2015': os.path.join(current_dir, 'data/reference/efas_1arcmin_yearly_output/e0_2015'), + 'es_2015': os.path.join(current_dir, 'data/reference/efas_1arcmin_yearly_output/es_2015'), + 'et_2015': os.path.join(current_dir, 'data/reference/efas_1arcmin_yearly_output/et_2015'), + 'e0_2016': os.path.join(current_dir, 'data/reference/efas_1arcmin_yearly_output/e0_2016'), + 'es_2016': os.path.join(current_dir, 'data/reference/efas_1arcmin_yearly_output/es_2016'), + 'et_2016': os.path.join(current_dir, 'data/reference/efas_1arcmin_yearly_output/et_2016'), + }, 'efas_1arcmin_360days_calendar': { 'e0': os.path.join(current_dir, 'data/reference/efas_1arcmin_360days_calendar/e0_1_15'), 'es': os.path.join(current_dir, 'data/reference/efas_1arcmin_360days_calendar/es_1_15'), @@ -91,11 +112,11 @@ def teardown_class(cls): cdf_flags['end'] = 0 @classmethod - def check_var_step(cls, var, step): + def check_var_step(cls, var, step, variable_file_sufix=''): settings = LisSettings.instance() output_path = settings.binding['PathOut'] - output_nc = os.path.join(output_path, var) - reference = pcr2numpy(readnetcdf(cls.reference_files[cls.domain][var], step, variable_name=var), -9999) + output_nc = os.path.join(output_path, var + variable_file_sufix) + reference = pcr2numpy(readnetcdf(cls.reference_files[cls.domain][var + variable_file_sufix], step, variable_name=var), -9999) current_output = pcr2numpy(readnetcdf(output_nc, step, variable_name=var), -9999) same_size = reference.size == current_output.size diff_values = np.abs(reference - current_output) @@ -133,13 +154,13 @@ def netcdf_steps(cls, netfile): return len(t_steps) @classmethod - def listest(cls, variable): + def listest(cls, variable, variable_file_sufix=''): settings = LisSettings.instance() output_path = settings.binding['PathOut'] - output_nc = os.path.join(output_path, variable) - print('\n\n>>> Reference: {} - Current Output: {}'.format(cls.reference_files[cls.domain][variable], output_nc)) + output_nc = os.path.join(output_path, variable + variable_file_sufix) + print('\n\n>>> Reference: {} - Current Output: {}'.format(cls.reference_files[cls.domain][variable + variable_file_sufix], output_nc)) results = [] - numsteps = cls.netcdf_steps(cls.reference_files[cls.domain][variable]) + numsteps = cls.netcdf_steps(cls.reference_files[cls.domain][variable + variable_file_sufix]) for step in range(0, numsteps): - results.append(cls.check_var_step(variable, step)) + results.append(cls.check_var_step(variable, step, variable_file_sufix)) assert all(results) diff --git a/tests/data/input/efas_1arcmin_6hourly/pd_202112.nc b/tests/data/input/efas_1arcmin_6hourly/pd_202112.nc new file mode 100644 index 0000000..89a4969 --- /dev/null +++ b/tests/data/input/efas_1arcmin_6hourly/pd_202112.nc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fe96593a5a1526b9021feac1ff70efc4f41545bfcb6ee5b6449a287b4444b05e +size 9071687 diff --git a/tests/data/input/efas_1arcmin_6hourly/pd_202201.nc b/tests/data/input/efas_1arcmin_6hourly/pd_202201.nc new file mode 100644 index 0000000..89ac660 --- /dev/null +++ b/tests/data/input/efas_1arcmin_6hourly/pd_202201.nc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2bcfecf5ea71731654a1e32bb79c92100ec2f6c3da3164292a4875e868c900f6 +size 4289597 diff --git a/tests/data/input/efas_1arcmin_6hourly/rg_202112.nc b/tests/data/input/efas_1arcmin_6hourly/rg_202112.nc new file mode 100644 index 0000000..272714d --- /dev/null +++ b/tests/data/input/efas_1arcmin_6hourly/rg_202112.nc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a203c6064b8ce49bcd39b56caa46d27a15c609484cba01349818967424e65a54 +size 21774499 diff --git a/tests/data/input/efas_1arcmin_6hourly/rg_202201.nc b/tests/data/input/efas_1arcmin_6hourly/rg_202201.nc new file mode 100644 index 0000000..b76e8c6 --- /dev/null +++ b/tests/data/input/efas_1arcmin_6hourly/rg_202201.nc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7a9304fa1808d09c71b6f2f8d65899b61e0c9b755b2c14551c4194451ef67544 +size 11748567 diff --git a/tests/data/input/efas_1arcmin_6hourly/tn_202112.nc b/tests/data/input/efas_1arcmin_6hourly/tn_202112.nc new file mode 100644 index 0000000..45ff4e5 --- /dev/null +++ b/tests/data/input/efas_1arcmin_6hourly/tn_202112.nc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:18c29e9478135d6f849f0ba52369568554ea108bebc27756140182522c27baa3 +size 26972426 diff --git a/tests/data/input/efas_1arcmin_6hourly/tn_202201.nc b/tests/data/input/efas_1arcmin_6hourly/tn_202201.nc new file mode 100644 index 0000000..2def3d5 --- /dev/null +++ b/tests/data/input/efas_1arcmin_6hourly/tn_202201.nc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:81ec1fe8c8171b4a57243e40bdd94bcf49120055867d4d9b99e83ba43711323d +size 11770220 diff --git a/tests/data/input/efas_1arcmin_6hourly/tx_202112.nc b/tests/data/input/efas_1arcmin_6hourly/tx_202112.nc new file mode 100644 index 0000000..e6a69d5 --- /dev/null +++ b/tests/data/input/efas_1arcmin_6hourly/tx_202112.nc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:613608f7cb7ee30683463360d9f0e1c1df69886ab6e5aa85165f3c0e5397c965 +size 27031712 diff --git a/tests/data/input/efas_1arcmin_6hourly/tx_202201.nc b/tests/data/input/efas_1arcmin_6hourly/tx_202201.nc new file mode 100644 index 0000000..766a55e --- /dev/null +++ b/tests/data/input/efas_1arcmin_6hourly/tx_202201.nc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:db5ea9d308cae22c7cee5278970acc9aaa8b7cc09e4dd3cd8806b0d6c0989bb2 +size 11620609 diff --git a/tests/data/input/efas_1arcmin_6hourly/ws_202112.nc b/tests/data/input/efas_1arcmin_6hourly/ws_202112.nc new file mode 100644 index 0000000..eedfdfa --- /dev/null +++ b/tests/data/input/efas_1arcmin_6hourly/ws_202112.nc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b4617b762a7a3b0b547bc9f3041cd08a416db225984b60fd27cfdf67e725b038 +size 8557883 diff --git a/tests/data/input/efas_1arcmin_6hourly/ws_202201.nc b/tests/data/input/efas_1arcmin_6hourly/ws_202201.nc new file mode 100644 index 0000000..a1e8589 --- /dev/null +++ b/tests/data/input/efas_1arcmin_6hourly/ws_202201.nc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c7d6244a640581e58b23e59ec3baffe60efb3e7b264e908b2faf1064d29e6dbc +size 4211792 diff --git a/tests/data/input/efas_1arcmin_hourly/pd_202112.nc b/tests/data/input/efas_1arcmin_hourly/pd_202112.nc new file mode 100644 index 0000000..b622e69 --- /dev/null +++ b/tests/data/input/efas_1arcmin_hourly/pd_202112.nc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ac4fefb3cc4e14d165479a7be0bcfecd3e6f43da535f35ab3f14a18db71fb119 +size 47489105 diff --git a/tests/data/input/efas_1arcmin_hourly/pd_202201.nc b/tests/data/input/efas_1arcmin_hourly/pd_202201.nc new file mode 100644 index 0000000..4c1f5c1 --- /dev/null +++ b/tests/data/input/efas_1arcmin_hourly/pd_202201.nc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:971353b6bfd2e5b136625dac15594f0e0186bc55b09f56cd23b96c5e10552445 +size 27293250 diff --git a/tests/data/input/efas_1arcmin_hourly/rg_202112.nc b/tests/data/input/efas_1arcmin_hourly/rg_202112.nc new file mode 100644 index 0000000..d1c6f6f --- /dev/null +++ b/tests/data/input/efas_1arcmin_hourly/rg_202112.nc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fef22efee202a716e1791668ef14a315c17b0f96cb2786d1497f52b88f5f485e +size 117265586 diff --git a/tests/data/input/efas_1arcmin_hourly/rg_202201.nc b/tests/data/input/efas_1arcmin_hourly/rg_202201.nc new file mode 100644 index 0000000..be03c31 --- /dev/null +++ b/tests/data/input/efas_1arcmin_hourly/rg_202201.nc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6e798a7d87ea308628185bae649c9f412ee59bd4d495f1e9ef54ca4f3104972c +size 73818631 diff --git a/tests/data/input/efas_1arcmin_hourly/tn_202112.nc b/tests/data/input/efas_1arcmin_hourly/tn_202112.nc new file mode 100644 index 0000000..805c348 --- /dev/null +++ b/tests/data/input/efas_1arcmin_hourly/tn_202112.nc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8b05b8dadebe23a05a100df34642bb3448509d94aa1066544275d952a8143d14 +size 141973626 diff --git a/tests/data/input/efas_1arcmin_hourly/tn_202201.nc b/tests/data/input/efas_1arcmin_hourly/tn_202201.nc new file mode 100644 index 0000000..b946abb --- /dev/null +++ b/tests/data/input/efas_1arcmin_hourly/tn_202201.nc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:11e83129e6a994f3a390cd8f98f3d6a48f6142f3306c4794e455e86d349fdde3 +size 73925104 diff --git a/tests/data/input/efas_1arcmin_hourly/tx_202112.nc b/tests/data/input/efas_1arcmin_hourly/tx_202112.nc new file mode 100644 index 0000000..b8ff210 --- /dev/null +++ b/tests/data/input/efas_1arcmin_hourly/tx_202112.nc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a19eaae62d617154a33f2adbba1bacdf327295c1bf01e8c67072f2f2f56bea12 +size 142225259 diff --git a/tests/data/input/efas_1arcmin_hourly/tx_202201.nc b/tests/data/input/efas_1arcmin_hourly/tx_202201.nc new file mode 100644 index 0000000..69718af --- /dev/null +++ b/tests/data/input/efas_1arcmin_hourly/tx_202201.nc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1fe9604bc9dea23d14304acd586edbd662bc5384e6e5cce2eb406192d8c302cf +size 73815044 diff --git a/tests/data/input/efas_1arcmin_hourly/ws_202112.nc b/tests/data/input/efas_1arcmin_hourly/ws_202112.nc new file mode 100644 index 0000000..dedb4b1 --- /dev/null +++ b/tests/data/input/efas_1arcmin_hourly/ws_202112.nc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ad3ca5967465b3796bfce444a0633e7f1a15111e028f655594c5a69f864c0a41 +size 44290486 diff --git a/tests/data/input/efas_1arcmin_hourly/ws_202201.nc b/tests/data/input/efas_1arcmin_hourly/ws_202201.nc new file mode 100644 index 0000000..c373a97 --- /dev/null +++ b/tests/data/input/efas_1arcmin_hourly/ws_202201.nc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cc51e3c1f2bc88aa45d7f3171beed53ddf373a57cbdcf9b168756f8400731e5e +size 25836777 diff --git a/tests/data/output/efas_1arcmin_6hourly/.gitignore b/tests/data/output/efas_1arcmin_6hourly/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/tests/data/output/efas_1arcmin_6hourly/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/tests/data/output/efas_1arcmin_hourly/.gitignore b/tests/data/output/efas_1arcmin_hourly/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/tests/data/output/efas_1arcmin_hourly/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/tests/data/output/efas_1arcmin_yearly_output/.gitignore b/tests/data/output/efas_1arcmin_yearly_output/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/tests/data/output/efas_1arcmin_yearly_output/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/tests/data/reference/efas_1arcmin_6hourly/e0_202112.nc b/tests/data/reference/efas_1arcmin_6hourly/e0_202112.nc new file mode 100644 index 0000000..6cef6cd --- /dev/null +++ b/tests/data/reference/efas_1arcmin_6hourly/e0_202112.nc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:be409a4072011d186ff4df1f93313dcd85648ee464c5e023a0a292ec7e3ba789 +size 36805185 diff --git a/tests/data/reference/efas_1arcmin_6hourly/e0_202201.nc b/tests/data/reference/efas_1arcmin_6hourly/e0_202201.nc new file mode 100644 index 0000000..1302e3d --- /dev/null +++ b/tests/data/reference/efas_1arcmin_6hourly/e0_202201.nc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9d0be8490d17d88c2f4ad3e524b01a38acf8cb2d7fd3ba6d045252f192ded22a +size 15798307 diff --git a/tests/data/reference/efas_1arcmin_6hourly/es_202112.nc b/tests/data/reference/efas_1arcmin_6hourly/es_202112.nc new file mode 100644 index 0000000..265c740 --- /dev/null +++ b/tests/data/reference/efas_1arcmin_6hourly/es_202112.nc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0670820fee0024405ad1e243e3d4c23432334fbee6a6cf5be9e19e2e50e38311 +size 37230331 diff --git a/tests/data/reference/efas_1arcmin_6hourly/es_202201.nc b/tests/data/reference/efas_1arcmin_6hourly/es_202201.nc new file mode 100644 index 0000000..cb46196 --- /dev/null +++ b/tests/data/reference/efas_1arcmin_6hourly/es_202201.nc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3d034b7068829fef77c97033791cb2f8a776117ab193382d8f0a2c4c9dd2fe71 +size 16029242 diff --git a/tests/data/reference/efas_1arcmin_6hourly/et_202112.nc b/tests/data/reference/efas_1arcmin_6hourly/et_202112.nc new file mode 100644 index 0000000..158779e --- /dev/null +++ b/tests/data/reference/efas_1arcmin_6hourly/et_202112.nc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e5a8f7c3eb025d265e523c00d2094579df9f3e0926135248624697c80cc89d27 +size 37686866 diff --git a/tests/data/reference/efas_1arcmin_6hourly/et_202201.nc b/tests/data/reference/efas_1arcmin_6hourly/et_202201.nc new file mode 100644 index 0000000..eb74380 --- /dev/null +++ b/tests/data/reference/efas_1arcmin_6hourly/et_202201.nc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4fed61110f8ec8ff0910b4e504c8597960acc19f44d3c02715ea1dd325fc077d +size 16262360 diff --git a/tests/data/reference/efas_1arcmin_hourly/e0.nc b/tests/data/reference/efas_1arcmin_hourly/e0.nc new file mode 100644 index 0000000..c92de36 --- /dev/null +++ b/tests/data/reference/efas_1arcmin_hourly/e0.nc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:09ea68c826adb5ecfc9334b2415fce90bb4733316e071b00370cc4787a793302 +size 297470553 diff --git a/tests/data/reference/efas_1arcmin_hourly/es.nc b/tests/data/reference/efas_1arcmin_hourly/es.nc new file mode 100644 index 0000000..4e109d5 --- /dev/null +++ b/tests/data/reference/efas_1arcmin_hourly/es.nc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:246f9d75a812129d652cc37c3ddf7a6702c43470ace2628d9a991196da755332 +size 301150684 diff --git a/tests/data/reference/efas_1arcmin_hourly/et.nc b/tests/data/reference/efas_1arcmin_hourly/et.nc new file mode 100644 index 0000000..e189ff4 --- /dev/null +++ b/tests/data/reference/efas_1arcmin_hourly/et.nc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8d923abc654cdccd85328d66b6001503f405037fde0caa30f32bfa9e8f21c1a3 +size 304991514 diff --git a/tests/data/reference/efas_1arcmin_yearly_output/e0_2015.nc b/tests/data/reference/efas_1arcmin_yearly_output/e0_2015.nc new file mode 100644 index 0000000..a655316 --- /dev/null +++ b/tests/data/reference/efas_1arcmin_yearly_output/e0_2015.nc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3f24a0569b4febe8937945115295e30cc9d7f03a572870d37f5f20cb6098ea97 +size 7916851 diff --git a/tests/data/reference/efas_1arcmin_yearly_output/e0_2016.nc b/tests/data/reference/efas_1arcmin_yearly_output/e0_2016.nc new file mode 100644 index 0000000..e8f6dae --- /dev/null +++ b/tests/data/reference/efas_1arcmin_yearly_output/e0_2016.nc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2415aa4fa38876da8955f25bf0018b279938c034d819ad35cc5cbe00350aa8ec +size 15174962 diff --git a/tests/data/reference/efas_1arcmin_yearly_output/es_2015.nc b/tests/data/reference/efas_1arcmin_yearly_output/es_2015.nc new file mode 100644 index 0000000..3bb1cc3 --- /dev/null +++ b/tests/data/reference/efas_1arcmin_yearly_output/es_2015.nc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f209b52e069a4dc9980af39b9901ebbdae4a753b499505cc7ac4cb728e52f0ff +size 8218270 diff --git a/tests/data/reference/efas_1arcmin_yearly_output/es_2016.nc b/tests/data/reference/efas_1arcmin_yearly_output/es_2016.nc new file mode 100644 index 0000000..c6f4b06 --- /dev/null +++ b/tests/data/reference/efas_1arcmin_yearly_output/es_2016.nc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:89099d9891568965a8b8f9fba3bc4b1c68d0d6b1a064222c383224fd9268a4fe +size 15747940 diff --git a/tests/data/reference/efas_1arcmin_yearly_output/et_2015.nc b/tests/data/reference/efas_1arcmin_yearly_output/et_2015.nc new file mode 100644 index 0000000..fe7ab41 --- /dev/null +++ b/tests/data/reference/efas_1arcmin_yearly_output/et_2015.nc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b661de8a149063c690d31560398bd758a23c2ddae181c735728e5df63f1cf7eb +size 8511807 diff --git a/tests/data/reference/efas_1arcmin_yearly_output/et_2016.nc b/tests/data/reference/efas_1arcmin_yearly_output/et_2016.nc new file mode 100644 index 0000000..10e4ff8 --- /dev/null +++ b/tests/data/reference/efas_1arcmin_yearly_output/et_2016.nc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3652c38b991204a0227f4aac0d205309ad8de9a4f0e5bf92d3ef06b800767d6d +size 16262206 diff --git a/tests/data/tests_efas_1arcmin_6hourly.xml b/tests/data/tests_efas_1arcmin_6hourly.xml new file mode 100644 index 0000000..8cce2fa --- /dev/null +++ b/tests/data/tests_efas_1arcmin_6hourly.xml @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:441c99cb4803e8839714df584f766d1a814662496ac0f152ba793b6ce32928b6 +size 15001 diff --git a/tests/data/tests_efas_1arcmin_hourly.xml b/tests/data/tests_efas_1arcmin_hourly.xml new file mode 100644 index 0000000..5f83dfb --- /dev/null +++ b/tests/data/tests_efas_1arcmin_hourly.xml @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a3202429385eaa7982588838a67ce703279c31ed2827d4cac16cb97a8f5d106a +size 14990 diff --git a/tests/data/tests_efas_1arcmin_yearly_output.xml b/tests/data/tests_efas_1arcmin_yearly_output.xml new file mode 100644 index 0000000..9f54685 --- /dev/null +++ b/tests/data/tests_efas_1arcmin_yearly_output.xml @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5f2b157ebe1b88cccf0b9d99e7d76aa57789470c063165998d75d7efa4875881 +size 14930 diff --git a/tests/regression_tests.py b/tests/regression_tests.py index 75c845b..ef0fb15 100644 --- a/tests/regression_tests.py +++ b/tests/regression_tests.py @@ -64,6 +64,66 @@ def test_et(self): return self.listest('et') +class TestEFAS1arcminHourly(TestLis): + domain = 'efas_1arcmin_hourly' + settings_path = os.path.join(current_dir, 'data/tests_efas_1arcmin_hourly.xml') + + def test_e0(self): + return self.listest('e0') + + def test_es(self): + return self.listest('es') + + def test_et(self): + return self.listest('et') + + +class TestEFAS1arcmin6Hourly(TestLis): + domain = 'efas_1arcmin_6hourly' + settings_path = os.path.join(current_dir, 'data/tests_efas_1arcmin_6hourly.xml') + + def test_e0_202112(self): + return self.listest('e0', '_202112') + + def test_es_202112(self): + return self.listest('es', '_202112') + + def test_et_202112(self): + return self.listest('et', '_202112') + + def test_e0_202201(self): + return self.listest('e0', '_202201') + + def test_es_202201(self): + return self.listest('es', '_202201') + + def test_et_202201(self): + return self.listest('et', '_202201') + + +class TestEFAS1arcminYearlyOutput(TestLis): + domain = 'efas_1arcmin_yearly_output' + settings_path = os.path.join(current_dir, 'data/tests_efas_1arcmin_yearly_output.xml') + + def test_e0_2015(self): + return self.listest('e0', '_2015') + + def test_es_2015(self): + return self.listest('es', '_2015') + + def test_et_2015(self): + return self.listest('et', '_2015') + + def test_e0_2016(self): + return self.listest('e0', '_2016') + + def test_es_2016(self): + return self.listest('es', '_2016') + + def test_et_2016(self): + return self.listest('et', '_2016') + + class TestEFAS1arcmin360DaysCalendar(TestLis): domain = 'efas_1arcmin_360days_calendar' settings_path = os.path.join(current_dir, 'data/tests_efas_1arcmin_360days_calendar.xml')