pysiral.core.helper
Created on Tue Jul 21 18:04:43 2015
@author: Stefan TODO: Is this still being used?
Classes
Functions
Break down an array in chunks for multiprocessing. The rule |
|
|
Converts a time string to a datetime object using dateutils |
|
Get the index in array of the first occurance of |
|
Get the index in array of the last occurance of |
|
run length encoding. Partial credit to R rle function. |
|
returns an iterator over months |
|
returns an iterator over all days in given month |
|
Returns the a start and stop datetime object for a given month |
|
Module Contents
- pysiral.core.helper.get_multiprocessing_1d_array_chunks(array_size: int, n_processes: int) Tuple[List[Tuple[int, int]], int]
Break down an array in chunks for multiprocessing. The rule is one chunk per process/CPU.
- Parameters:
array_size – The number of elements to be distributed to chunks
n_processes – The number processes/CPU’s/chunks
- Returns:
List with start and end index for each chunk and number of (viable) processes
- pysiral.core.helper.parse_datetime_str(dtstr)
Converts a time string to a datetime object using dateutils
- pysiral.core.helper.get_first_array_index(array, value)
Get the index in array of the first occurance of
value
- pysiral.core.helper.get_last_array_index(array, value)
Get the index in array of the last occurance of
value
- pysiral.core.helper.rle(inarray)
run length encoding. Partial credit to R rle function. Multi datatype arrays catered for including non Numpy returns: tuple (runlengths, startpositions, values)
- from: http://stackoverflow.com/questions/1066758/find-length-of-sequences-
of-identical-values-in-a-numpy-array
- pysiral.core.helper.month_iterator(start_year, start_month, end_year, end_month)
returns an iterator over months
- pysiral.core.helper.days_iterator(year, month)
returns an iterator over all days in given month
- pysiral.core.helper.get_month_time_range(year, month)
Returns the a start and stop datetime object for a given month
- pysiral.core.helper.validate_year_month_list(year_month_list, label)