mpop.readers package

Submodules

mpop.readers.eps_l1b module

mpop.readers.mipp_xrit module

mpop.readers.viirs_sdr module

Interface to VIIRS SDR format

Format documentation: http://npp.gsfc.nasa.gov/science/sciencedocuments/082012/474-00001-03_CDFCBVolIII_RevC.pdf

class mpop.readers.viirs_sdr.HDF5MetaData(filename, **kwargs)

Bases: object

Small class for inspecting a HDF5 file and retrieve its metadata/header data.

collect_metadata(name, obj)
class mpop.readers.viirs_sdr.SDRFileReader(file_type, filename, file_keys, **kwargs)

Bases: mpop.readers.GenericFileReader

VIIRS HDF5 File Reader

adjust_scaling_factors(factors, file_units, output_units)
begin_orbit_number
create_file_handle(filename, **kwargs)
end_orbit_number
geofilename
get_file_units(item)
get_shape(item)
get_swath_data(item, data_out=None, mask_out=None, dataset_id=None)

Get swath data, apply proper scalings, and apply proper masks.

platform_name
ring_lonlats()
scale_swath_data(data, mask, scaling_factors)

Scale swath data using scaling factors and offsets.

Multi-granule (a.k.a. aggregated) files will have more than the usual two values.

sensor_name
class mpop.readers.viirs_sdr.VIIRSSDRReader(default_file_reader=<class 'mpop.readers.viirs_sdr.SDRFileReader'>, default_config_filename='readers/viirs_sdr.cfg', **kwargs)

Bases: mpop.readers.ConfigBasedReader

Module contents

Shared objects of the various reader classes.

class mpop.readers.ConfigBasedReader(default_file_reader=None, **kwargs)

Bases: mpop.readers.Reader

file_key_class

alias of FileKey

identify_file_types(filenames, default_file_reader=None)

Identify the type of a file by its filename or by its contents.

Uses previously loaded information from the configuration file.

load(datasets_to_load, metadata=None, **dataset_info)
load_metadata(datasets_to_load, metadata_to_load)

Load the specified metadata for the specified datasets.

Returns:dictionary of dictionaries
load_section_calibration(section_name, section_options)
load_section_file_key(section_name, section_options)
load_section_file_type(section_name, section_options)
load_section_navigation(section_name, section_options)
splittable_dataset_options = ['file_patterns', 'navigation', 'standard_name', 'units', 'file_type', 'file_key']
class mpop.readers.DatasetDict(*args, **kwargs)

Bases: dict

Special dictionary object that can handle dict operations based on dataset name, wavelength, or DatasetID

Note: Internal dictionary keys are DatasetID objects.

__setitem__(key, value)

Support assigning ‘Projectable’ objects or dictionaries of metadata.

get_item(name_or_wl, resolution=None, polarization=None, calibration=None)
get_key(key)
get_keys(name_or_wl, resolution=None, polarization=None, calibration=None)
get_keys_by_datasetid(did)
keys(names=False, wavelengths=False)
mpop.readers.DatasetID

alias of Dataset

class mpop.readers.FileKey

Bases: mpop.readers.FileKey

class mpop.readers.GenericFileReader(file_type, filename, file_keys, **kwargs)

Bases: object

begin_orbit_number
create_file_handle(filename, **kwargs)
end_orbit_number
end_time
geofilename
get_file_units(item)
get_shape(item)
get_swath_data(item, data_out=None, mask_out=None, dataset_id=None)
get_units(item)
platform_name
ring_lonlats
sensor_name
start_time
class mpop.readers.MultiFileReader(file_type, file_readers, file_keys, **kwargs)

Bases: object

begin_orbit_number
end_orbit_number
end_time
filenames
geofilenames
get_swath_data(item, filename=None, dataset_id=None)
get_units(item)
load_metadata(item, join_method='append', axis=0)
platform_name
sensor_name
start_time
class mpop.readers.Reader(name=None, file_patterns=None, filenames=None, description='', start_time=None, end_time=None, area=None, sensor=None, **kwargs)

Bases: mpop.plugin_base.Plugin

Reader plugins. They should have a pformat attribute, and implement the load method. This is an abstract class to be inherited.

add_filenames(*filenames)
dataset_names

Names of all datasets configured for this reader.

get_dataset_key(key, calibration=None, resolution=None, polarization=None, aslist=False)

Get the fully qualified dataset corresponding to key, either by name or centerwavelength.

If key is a DatasetID object its name is searched if it exists, otherwise its wavelength is used.

load(datasets_to_load)

Loads the datasets_to_load into the scene object.

load_metadata(datasets_to_load, metadata_to_load)

Load the specified metadata for the specified datasets.

Returns:dictionary of dictionaries
load_section_dataset(section_name, section_options)
load_section_metadata(section_name, section_options)
load_section_reader(section_name, section_options)
sensor_names

Sensors supported by this reader.

splittable_dataset_options = ['file_patterns', 'navigation', 'standard_name', 'units']
class mpop.readers.ReaderFinder(ppp_config_dir=None, base_dir=None, **info)

Bases: object

Finds readers given a scene, filenames, sensors, and/or a reader_name

static assign_matching_files(reader_info, *files, **kwargs)

Assign files to the reader_info

get_filenames(reader_info, base_dir=None)

Get the filenames from disk given the patterns in reader_info. This assumes that the scene info contains start_time at least (possibly end_time too).