def add_variables(dataset, width, height): tu.add_geolocation_variables(dataset, width, height, chunksizes=CHUNKING) tu.add_quality_flags(dataset, width, height, chunksizes=CHUNKING) default_array = DefaultData.create_default_vector( height, np.int32, fill_value=4294967295) variable = Variable(["y"], default_array) tu.add_fill_value(variable, 4294967295) variable.attrs["standard_name"] = "time" variable.attrs[ "long_name"] = "Acquisition time in seconds since 1970-01-01 00:00:00" tu.add_units(variable, "s") dataset["time"] = variable default_array = DefaultData.create_default_array(width, height, np.float32, fill_value=np.NaN) variable = Variable(["y", "x"], default_array) tu.add_fill_value(variable, np.NaN) variable.attrs["coordinates"] = "longitude latitude" dataset["aot"] = variable dataset["u_independent_aot"] = tu.create_CDR_uncertainty( width, height, "Uncertainty of aot due to independent effects") dataset["u_structured_aot"] = tu.create_CDR_uncertainty( width, height, "Uncertainty of aot due to structured effects") dataset["u_common_aot"] = tu.create_CDR_uncertainty( width, height, "Uncertainty of aot due to common effects")
def add_variables(dataset, width, height): # @todo 1 tb/tb add geolocation 2018-06-25 tu.add_quality_flags(dataset, width, height, chunksizes=CHUNKING) default_array = DefaultData.create_default_vector(height, np.int32, fill_value=-1) variable = Variable(["y"], default_array) tu.add_fill_value(variable, -1) variable.attrs["standard_name"] = "time" variable.attrs[ "long_name"] = "Acquisition time in seconds since 1970-01-01 00:00:00" tu.add_units(variable, "s") dataset["time"] = variable default_array = DefaultData.create_default_array(width, height, np.float32, fill_value=np.NaN) variable = Variable(["y", "x"], default_array) tu.add_fill_value(variable, np.NaN) variable.attrs["standard_name"] = "surface_albedo" variable.attrs["coordinates"] = "longitude latitude" tu.add_chunking(variable, CHUNKING) dataset["surface_albedo"] = variable dataset["u_independent_surface_albedo"] = tu.create_CDR_uncertainty( width, height, "Uncertainty of surface_albedo due to independent effects") dataset["u_structured_surface_albedo"] = tu.create_CDR_uncertainty( width, height, "Uncertainty of surface_albedo due to structured effects") dataset["u_common_surface_albedo"] = tu.create_CDR_uncertainty( width, height, "Uncertainty of surface_albedo due to common effects")
def add_variables(dataset, width, height): WriterUtils.add_gridded_global_attributes(dataset) tu.add_gridded_geolocation_variables(dataset, width, height) tu.add_quality_flags(dataset, width, height) dataset["time_ranges_ascend"] = UTH._create_time_ranges_variable( height, width, "Minimum and maximum seconds of day pixel contribution time, ascending nodes" ) dataset["time_ranges_descend"] = UTH._create_time_ranges_variable( height, width, "Minimum and maximum seconds of day pixel contribution time, descending nodes" ) dataset[ "observation_count_ascend"] = UTH._create_observation_counts_variable( height, width, "Number of UTH/brightness temperature observations in a grid box for ascending passes" ) dataset[ "observation_count_descend"] = UTH._create_observation_counts_variable( height, width, "Number of UTH/brightness temperature observations in a grid box for descending passes" ) dataset["overpass_count_ascend"] = UTH._create_overpass_counts_variable( height, width, "Number of satellite overpasses in a grid box for ascending passes" ) dataset["overpass_count_descend"] = UTH._create_overpass_counts_variable( height, width, "Number of satellite overpasses in a grid box for descending passes" ) dataset["uth_ascend"] = UTH._create_uth_variable( width, height, description= "Monthly average of all UTH retrievals in a grid box for ascending passes (calculated from daily averages)", ) dataset["uth_descend"] = UTH._create_uth_variable( width, height, description= "Monthly average of all UTH retrievals in a grid box for descending passes (calculated from daily averages)" ) dataset["u_independent_uth_ascend"] = tu.create_CDR_uncertainty( width, height, "Uncertainty of UTH due to independent effects for ascending passes", coordinates="lon lat") dataset["u_independent_uth_descend"] = tu.create_CDR_uncertainty( width, height, "Uncertainty of UTH due to independent effects for descending passes", coordinates="lon lat") dataset["u_structured_uth_ascend"] = tu.create_CDR_uncertainty( width, height, "Uncertainty of UTH due to structured effects for ascending passes", coordinates="lon lat") dataset["u_structured_uth_descend"] = tu.create_CDR_uncertainty( width, height, "Uncertainty of UTH due to structured effects for descending passes", coordinates="lon lat") dataset["u_common_uth_ascend"] = tu.create_CDR_uncertainty( width, height, "Uncertainty of UTH due to common effects for ascending passes", coordinates="lon lat") dataset["u_common_uth_descend"] = tu.create_CDR_uncertainty( width, height, "Uncertainty of UTH due to common effects for descending passes", coordinates="lon lat") dataset["uth_inhomogeneity_ascend"] = tu.create_CDR_uncertainty( width, height, "Standard deviation of all daily UTH averages which were used to calculate the monthly UTH average in a grid box for ascending passes", coordinates="lon lat") dataset["uth_inhomogeneity_descend"] = tu.create_CDR_uncertainty( width, height, "Standard deviation of all daily UTH averages which were used to calculate the monthly UTH average in a grid box for descending passes", coordinates="lon lat") dataset["BT_ascend"] = UTH._create_bt_variable( width, height, description= "Monthly average of all brightness temperatures which were used to retrieve UTH in a grid box for ascending passes (calculated from daily averages)" ) dataset["BT_descend"] = UTH._create_bt_variable( width, height, description= "Monthly average of all brightness temperatures which were used to retrieve UTH in a grid box for descending passes (calculated from daily averages)" ) dataset["u_independent_BT_ascend"] = tu.create_CDR_uncertainty( width, height, "Uncertainty of brightness temperature due to independent effects for ascending passes", coordinates="lon lat", units="K") dataset["u_independent_BT_descend"] = tu.create_CDR_uncertainty( width, height, "Uncertainty of brightness temperature due to independent effects for descending passes", coordinates="lon lat", units="K") dataset["u_structured_BT_ascend"] = tu.create_CDR_uncertainty( width, height, "Uncertainty of brightness temperature due to structured effects for ascending passes", coordinates="lon lat", units="K") dataset["u_structured_BT_descend"] = tu.create_CDR_uncertainty( width, height, "Uncertainty of brightness temperature due to structured effects for descending passes", coordinates="lon lat", units="K") dataset["u_common_BT_ascend"] = tu.create_CDR_uncertainty( width, height, "Uncertainty of brightness temperature due to common effects for ascending passes", coordinates="lon lat", units="K") dataset["u_common_BT_descend"] = tu.create_CDR_uncertainty( width, height, "Uncertainty of brightness temperature due to common effects for descending passes", coordinates="lon lat", units="K") dataset["BT_inhomogeneity_ascend"] = tu.create_CDR_uncertainty( width, height, "Standard deviation of all daily brightness temperature averages which were used to calculate the monthly brightness temperature average for ascending passes", coordinates="lon lat", units="K") dataset["BT_inhomogeneity_descend"] = tu.create_CDR_uncertainty( width, height, "Standard deviation of all daily brightness temperature averages which were used to calculate the monthly brightness temperature average for descending passes", coordinates="lon lat", units="K") dataset[ "observation_count_all_ascend"] = UTH._create_observation_counts_variable( height, width, "Number of all observations in a grid box for ascending passes - no filtering done" ) dataset[ "observation_count_all_descend"] = UTH._create_observation_counts_variable( height, width, "Number of all observations in a grid box for descending passes - no filtering done" )