def createTemplateEasy(sensorType, height, srf_size=None, corr_dx=None, corr_dy=None, lut_size=None): """ Create a template dataset in EASY FCDR format for the sensor given as argument. :param sensorType: the sensor type to create the template for :param height: the height in pixels of the data product :param srf_size: if set, the length of the spectral response function in frequency steps :param corr_dx: correlation length across track :param corr_dy: correlation length along track :param lut_size: size of a BT/radiance conversion lookup table :return the template dataset """ dataset = xr.Dataset() WriterUtils.add_standard_global_attributes(dataset) template_factory = TemplateFactory() sensor_template = template_factory.get_sensor_template(sensorType) sensor_template.add_original_variables(dataset, height, srf_size) sensor_template.add_easy_fcdr_variables(dataset, height, corr_dx, corr_dy, lut_size) sensor_template.add_template_key(dataset) return dataset
def createTemplateFull(sensorType, height): """ Create a template dataset in FULL FCDR format for the sensor given as argument. :param sensorType: the sensor type to create the template for :param height the hheight in pixels of the data product :return the template dataset """ dataset = xr.Dataset() WriterUtils.add_standard_global_attributes(dataset) template_factory = TemplateFactory() sensor_template = template_factory.get_sensor_template(sensorType) sensor_template.add_original_variables(dataset, height) sensor_template.add_full_fcdr_variables(dataset, height) sensor_template.add_template_key(dataset) return dataset
def createTemplate(data_type, width, height, num_samples=None): """ Create a template dataset in CDR format for the data type given as argument. :param data_type: the data type to create the template for :param width: the width in pixels of the data product :param height: the height in pixels of the data product :return the template dataset """ dataset = xr.Dataset() WriterUtils.add_standard_global_attributes(dataset) WriterUtils.add_cdr_global_attributes(dataset) template_factory = CDR_TemplateFactory() sensor_template = template_factory.get_cdr_template(data_type) if num_samples is None: sensor_template.add_variables(dataset, width, height) else: sensor_template.add_variables(dataset, width, height, num_samples) return dataset
def test_add_standard_global_attributes(self): dataset = xr.Dataset() WriterUtils.add_standard_global_attributes(dataset) Assertions.assert_global_attributes(self, dataset.attrs)