Beispiel #1
0
          'please convert to big-endian with command line utility "bigend".'
    raise ValueError(msg.format(filename))


FORMAT_AGENT = FormatAgent()
FORMAT_AGENT.__doc__ = "The FORMAT_AGENT is responsible for identifying the " \
                       "format of a given URI. New formats can be added " \
                       "with the **add_spec** method."

#
# PP files.
#
FORMAT_AGENT.add_spec(
    FormatSpecification('UM Post Processing file (PP)',
                        MagicNumber(4),
                        0x00000100,
                        pp.load_cubes,
                        priority=5,
                        constraint_aware_handler=True))

FORMAT_AGENT.add_spec(
    FormatSpecification('UM Post Processing file (PP) little-endian',
                        MagicNumber(4),
                        0x00010000,
                        _pp_little_endian,
                        priority=3,
                        constraint_aware_handler=True))

#
# GRIB files.
#
# NB. Because this is such a "fuzzy" check, we give this a very low
Beispiel #2
0
__all__ = ["FORMAT_AGENT"]

FORMAT_AGENT = FormatAgent()
FORMAT_AGENT.__doc__ = ("The FORMAT_AGENT is responsible for identifying the "
                        "format of a given URI. New formats can be added "
                        "with the **add_spec** method.")

#
# PP files.
#
FORMAT_AGENT.add_spec(
    FormatSpecification(
        "UM Post Processing file (PP)",
        MagicNumber(4),
        0x00000100,
        pp.load_cubes,
        priority=5,
        constraint_aware_handler=True,
    ))

FORMAT_AGENT.add_spec(
    FormatSpecification(
        "UM Post Processing file (PP) little-endian",
        MagicNumber(4),
        0x00010000,
        pp.load_cubes_little_endian,
        priority=3,
        constraint_aware_handler=True,
    ))