merlin.formats

merlin.formats.aux(x, y, locations, dates_fn, specmap, chipmap)[source]

Builds aux formatted timeseries.

Parameters:
  • x – x projection coordinate of chip
  • y – y projection coordinate of chip
  • locations – chip shaped 2d array of projection coordinates
  • dates_fn (fn) – returns dates that should be included in time series
  • specmap (dict) – mapping of keys to specs
  • chipmap (dict) – mapping of keys to chips
Returns:

A tuple of tuples.

The aux format key is `(chip_x, chip_y, x, y)` with a dictionary of sorted numpy arrays representing each spectra plus an additional sorted dates array.

>>> aux(*args)
    (((chip_x, chip_y, x1, y1), {"dates":   [], "nlcd": [],
                                 "nlcdtrn": [], "trends": [],
                                 "mpw":     [], "dem": [],
                                 "posidex": [], "aspect": [],
                                 "slope":   []}),
     ((chip_x, chip_y, x1, y2), {"dates":   [], "nlcd": [],
                                 "nlcdtrn": [], "trends": [],
                                 "mpw":     [], "dem": [],
                                 "posidex": [], "aspect": [],
                                 "slope":   []}))
    ...
merlin.formats.pyccd(x, y, locations, dates_fn, specmap, chipmap)[source]

Builds inputs for the pyccd algorithm.

Parameters:
  • x – x projection coordinate of chip
  • y – y projection coordinate of chip
  • locations – chip shaped 2d array of projection coordinates
  • dates_fn (fn) – returns dates that should be included in time series
  • specmap (dict) – mapping of keys to specs
  • chipmap (dict) – mapping of keys to chips
Returns:

A tuple of tuples.

The pyccd format key is `(chip_x, chip_y, x, y)` with a dictionary of sorted numpy arrays representing each spectra plus an additional sorted dates array.

>>> pyccd_format(*args)
    (((chip_x, chip_y, x1, y1), {"dates":  [],  "reds": [],
                                 "greens": [],  "blues": [],
                                 "nirs1":  [],  "swir1s": [],
                                 "swir2s": [],  "thermals": [],
                                 "qas":    []}),
     ((chip_x, chip_y, x1, y2), {"dates":  [],  "reds": [],
                                 "greens": [],  "blues": [],
                                 "nirs1":  [],  "swir1s": [],
                                 "swir2s": [],  "thermals": [],
                                 "qas":    []}))
    ...