spacepy.toolbox.assemble — SpacePy v0.1.5 Manual

### Navigation

- index
- modules |
- modules |
- next |
- previous |
- homepage|
- search|
- documentation »
- toolbox - Toolbox of various functions and generic utilities »

# spacepy.toolbox.assemble

`spacepy.toolbox.` `assemble`(fln_pattern, outfln, sortkey='ticks', verbose=True)

  assembles all pickled files matching fln_pattern into single file and save as outfln. Pattern may contain simple shell-style wildcards *? a la fnmatch file will be assembled along time axis given by Ticktock (key: ‘ticks’) in dictionary If sortkey = None, then nothing will be sorted

  Parameters: | fln_pattern : string pattern to match filenames outfln : string filename to save combined files to
  Returns: | out : dict dictionary with combined values

  Examples

      >>> import spacepy.toolbox as tb
      >>> a, b, c = {'ticks':[1,2,3]}, {'ticks':[4,5,6]}, {'ticks':[7,8,9]}
      >>> tb.savepickle('input_files_2001.pkl', a)
      >>> tb.savepickle('input_files_2002.pkl', b)
      >>> tb.savepickle('input_files_2004.pkl', c)
      >>> a = tb.assemble('input_files_*.pkl', 'combined_input.pkl')
      ('adding ', 'input_files_2001.pkl')
      ('adding ', 'input_files_2002.pkl')
      ('adding ', 'input_files_2004.pkl')
      ('\n writing: ', 'combined_input.pkl')
      >>> print(a)
      {'ticks': array([1, 2, 3, 4, 5, 6, 7, 8, 9])}

### Navigation

- index
- modules |
- modules |
- next |
- previous |
- homepage|
- search|
- documentation »
- toolbox - Toolbox of various functions and generic utilities »