casys.computation.storage
Diagnostics storage classes.
Classes
|
Abstract class representing properties related to the storage of a binning diagnostic. |
|
Abstract class representing properties related to the storage of a 2d binning diagnostic. |
|
Abstract class representing properties related to the storage of a crossovers diagnostic. |
|
Abstract class representing properties related to the storage of a crossovers diagnostic. |
|
Abstract class representing properties related to the storage of a geobox diagnostic. |
|
Abstract class representing properties related to the storage of a histogram diagnostic. |
|
Abstract class representing properties related to the storage |
|
Abstract class representing properties related to the storage |
|
Abstract class representing properties related to the storage of a scatter diagnostic. |
|
Abstract class representing properties related to the storage of a section analysis diagnostic. |
|
Abstract class representing properties related to the storage of a spectral analysis diagnostic. |
|
Abstract class representing properties related to the storage of a spectral analysis diagnostic. |
|
Abstract class representing properties related to the storage of a spectral analysis diagnostic. |
|
Class representing parameters of a storage group. |
|
Abstract class representing properties related to the storage of a diagnostic. |
|
Abstract class representing properties related to the storage of a temporal diagnostic. |
- class casys.computation.storage.Binned2dStorageProperties(name, group, field_x, indexer, res_x, field_y=None, *, field_z, res_y)
Bases:
BinnedStorageProperties
Abstract class representing properties related to the storage of a 2d binning diagnostic.
- Parameters:
name (str) – Name of the data.
group (str) – Storage group.
field_x (Field) – Field used for x axes.
field_y (Field | None) – Field used for y axes.
field_z (Field) – Field used for z axes.
indexer (ong_indexer.PassIndexer | None)
res_x (DataResolution)
res_y (DataResolution)
- DTYPE: ClassVar[DiagnosticType] = 10
- align_bins(index, stored, analyse_type)
Align provided index to use the stored values for matching bins.
- extended_dates(index, analyse_type, analyse_date)
Compute diagnostic extended dates to allow the reading of stored data that might be dated outside these dates.
- Parameters:
index (
ndarray
[Any
,dtype
[datetime64
]]) – Starting date.analyse_type (
FreqType
) – Type of period covered by this analyse (cycle, pass or custom). It’s used to determine the type of storage group to create.analyse_date (
datetime64
|None
) – Date used to reference stored data.
- Return type:
- Returns:
Extended dates including all requested bins.
- field_x: Field
- field_y: Field | None = None
- field_z: Field
- property fields_stored: DiagnosticFields
List of fields used when storing data.
- group: str
- group_parameters(diag_meta, analyse_type, group=None)
Returns the storage group parameters matching these properties.
- Parameters:
diag_meta (
DiagnosticMeta
) – Diagnostic metadata.analyse_type (
FreqType
) – Type of period covered by this analyse (cycle, pass or custom). It’s used to determine the type of storage group to create.
- Return type:
- Returns:
Storage group parameters.
- indexer: ong_indexer.PassIndexer | None
- name: str
- res_x: DataResolution
- res_y: DataResolution
- store_data(store, stat, data, group)
Format and store provided data using this storage properties.
- Parameters:
store (
DiagnosticStore
) – DataStore in which to store.stat (
StatType
) – Statistic to store.data (
Dataset
) – Data to store.group (
str
) – DataStore group in which to store.
- store_group(group=None)
Returns the name of the group in the store for the diagnostic.
- to_diagnostic_data(data)
Transform the data read from the store to the correct diagnostic results format.
- to_store_data(data, analyse_date)
Formats the diagnostic data to be written to the store.
- Parameters:
data (
Dataset
) – Data from the diagnostic to format.analyse_date (
datetime64
) – Date representing the set of data used in this analyse. It’s used to determine at which timestamp to store non-temporal diagnostics.
- Return type:
- Returns:
Formatted data ready for storage.
- class casys.computation.storage.BinnedStorageProperties(name, group, field_x, indexer, res_x, field_y=None)
Bases:
StorageProperties
Abstract class representing properties related to the storage of a binning diagnostic.
- Parameters:
name (str) – Name of the data.
group (str) – Storage group.
field_x (Field) – Field used for x axes.
field_y (Field | None) – Field used for y axes.
indexer (ong_indexer.PassIndexer | None)
res_x (DataResolution)
- DTYPE: ClassVar[DiagnosticType] = 9
- align_bins(index, stored, analyse_type)
Align provided index to use the stored values for matching bins.
- extended_dates(index, analyse_type, analyse_date)
Compute diagnostic extended dates to allow the reading of stored data that might be dated outside these dates.
- Parameters:
index (
ndarray
[Any
,dtype
[datetime64
]]) – Starting date.analyse_type (
FreqType
) – Type of period covered by this analyse (cycle, pass or custom). It’s used to determine the type of storage group to create.analyse_date (
datetime64
|None
) – Date used to reference stored data.
- Return type:
- Returns:
Extended dates including all requested bins.
- field_x: Field
- field_y: Field | None = None
- property fields_stored: DiagnosticFields
List of fields used when storing data.
- group: str
- group_parameters(diag_meta, analyse_type, group=None)
Returns the storage group parameters matching these properties.
- Parameters:
diag_meta (
DiagnosticMeta
) – Diagnostic metadata.analyse_type (
FreqType
) – Type of period covered by this analyse (cycle, pass or custom). It’s used to determine the type of storage group to create.
- Return type:
- Returns:
Storage group parameters.
- indexer: ong_indexer.PassIndexer | None
- name: str
- res_x: DataResolution
- store_data(store, stat, data, group)
Format and store provided data using this storage properties.
- Parameters:
store (
DiagnosticStore
) – DataStore in which to store.stat (
StatType
) – Statistic to store.data (
Dataset
) – Data to store.group (
str
) – DataStore group in which to store.
- store_group(group=None)
Returns the name of the group in the store for the diagnostic.
- to_diagnostic_data(data)
Transform the data read from the store to the correct diagnostic results format.
- to_store_data(data, analyse_date)
Formats the diagnostic data to be written to the store.
- Parameters:
data (
Dataset
) – Data from the diagnostic to format.analyse_date (
datetime64
) – Date representing the set of data used in this analyse. It’s used to determine at which timestamp to store non-temporal diagnostics.
- Return type:
- Returns:
Formatted data ready for storage.
- class casys.computation.storage.CrossoverStorageProperties(name, group, field_x, indexer, field_y, field_z, time, time_delta)
Bases:
StorageProperties
Abstract class representing properties related to the storage of a crossovers diagnostic.
- Parameters:
name (str) – Name of the data.
group (str) – Storage group.
field_x (Field) – Field used for x axes.
field_y (Field) – Field used for y axes.
field_z (Field) – Field used for z axes.
time (str) – Field used the time.
time_delta (str) – Field used the time delta.
indexer (ong_indexer.PassIndexer | None)
- DTYPE: ClassVar[DiagnosticType] = 12
- FIELD_TIME_DELTA: ClassVar[str] = 'TIME_DELTA'
- align_bins(index, stored, analyse_type)
Align provided index to use the stored values for matching bins.
- extended_dates(index, analyse_type, analyse_date)
Compute diagnostic extended dates to allow the reading of stored data that might be dated outside these dates.
- Parameters:
index (
ndarray
[Any
,dtype
[datetime64
]]) – Starting date.analyse_type (
FreqType
) – Type of period covered by this analyse (cycle, pass or custom). It’s used to determine the type of storage group to create.analyse_date (
datetime64
|None
) – Date used to reference stored data.
- Return type:
- Returns:
Extended dates including all requested bins.
- field_x: Field
- field_y: Field
- field_z: Field
- property fields_stored: DiagnosticFields
List of fields used when storing data.
- group: str
- group_parameters(diag_meta, analyse_type, group=None)
Returns the storage group parameters matching these properties.
- Parameters:
diag_meta (
DiagnosticMeta
) – Diagnostic metadata.analyse_type (
FreqType
) – Type of period covered by this analyse (cycle, pass or custom). It’s used to determine the type of storage group to create.
- Return type:
- Returns:
Storage group parameters.
- indexer: ong_indexer.PassIndexer | None
- name: str
- store_data(store, stat, data, group)
Format and store provided data using this storage properties.
- Parameters:
store (
DiagnosticStore
) – DataStore in which to store.stat (
StatType
) – Statistic to store.data (
Dataset
) – Data to store.group (
str
) – DataStore group in which to store.
- store_group(group=None)
Returns the name of the group in the store for the diagnostic.
- time: str
- time_delta: str
- to_diagnostic_data(data)
Transform the data read from the store to the correct diagnostic results format.
- to_store_data(data, analyse_date)
Formats the diagnostic data to be written to the store.
- Parameters:
data (
Dataset
) – Data from the diagnostic to format.analyse_date (
datetime64
) – Date representing the set of data used in this analyse. It’s used to determine at which timestamp to store non-temporal diagnostics.
- Return type:
- Returns:
Formatted data ready for storage.
- class casys.computation.storage.CrossoverSwathStorageProperties(name, group, field_x, indexer, field_y, field_z, time, time_delta, main_dim, diamond_reduction)
Bases:
CrossoverStorageProperties
Abstract class representing properties related to the storage of a crossovers diagnostic.
- Parameters:
name (str) – Name of the data.
group (str) – Storage group.
field_x (Field) – Field used for x axes.
field_y (Field) – Field used for y axes.
field_z (Field) – Field used for z axes.
time (str) – Field used the time.
time_delta (str) – Field used the time delta.
main_dim (
str
) – Main dimension of the data to store.diamond_reduction (
StatType
) – Statistic type used to reduce the data on the crossover diamond.indexer (ong_indexer.PassIndexer | None)
- DTYPE: ClassVar[DiagnosticType] = 12
- FIELD_TIME_DELTA: ClassVar[str] = 'TIME_DELTA'
- align_bins(index, stored, analyse_type)
Align provided index to use the stored values for matching bins.
- extended_dates(index, analyse_type, analyse_date)
Compute diagnostic extended dates to allow the reading of stored data that might be dated outside these dates.
- Parameters:
index (
ndarray
[Any
,dtype
[datetime64
]]) – Starting date.analyse_type (
FreqType
) – Type of period covered by this analyse (cycle, pass or custom). It’s used to determine the type of storage group to create.analyse_date (
datetime64
|None
) – Date used to reference stored data.
- Return type:
- Returns:
Extended dates including all requested bins.
- field_x: Field
- field_y: Field
- field_z: Field
- property fields_stored: DiagnosticFields
List of fields used when storing data.
- group: str
- group_parameters(diag_meta, analyse_type, group=None)
Returns the storage group parameters matching these properties.
- Parameters:
diag_meta (
DiagnosticMeta
) – Diagnostic metadata.analyse_type (
FreqType
) – Type of period covered by this analyse (cycle, pass or custom). It’s used to determine the type of storage group to create.
- Return type:
- Returns:
Storage group parameters.
- indexer: ong_indexer.PassIndexer | None
- name: str
- store_data(store, stat, data, group)
Format and store provided data using this storage properties.
- Parameters:
store (
DiagnosticStore
) – DataStore in which to store.stat (
StatType
) – Statistic to store.data (
Dataset
) – Data to store.group (
str
) – DataStore group in which to store.
- store_group(group=None)
Returns the name of the group in the store for the diagnostic.
- time: str
- time_delta: str
- to_diagnostic_data(data)
Transform the data read from the store to the correct diagnostic results format.
- to_store_data(data, analyse_date)
Formats the diagnostic data to be written to the store.
- Parameters:
data (
Dataset
) – Data from the diagnostic to format.analyse_date (
datetime64
) – Date representing the set of data used in this analyse. It’s used to determine at which timestamp to store non-temporal diagnostics.
- Return type:
- Returns:
Formatted data ready for storage.
- class casys.computation.storage.GeoBoxStorageProperties(name, group, field_x, indexer, res_x, field_y=None, *, field_z, res_y)
Bases:
Binned2dStorageProperties
Abstract class representing properties related to the storage of a geobox diagnostic.
- Parameters:
name (str) – Name of the data.
group (str) – Storage group.
field_x (Field) – Field used for x axes.
field_y (Field | None) – Field used for y axes.
field_z (Field) – Field used for z axes.
indexer (ong_indexer.PassIndexer | None)
res_x (DataResolution)
res_y (DataResolution)
- DTYPE: ClassVar[DiagnosticType] = 6
- align_bins(index, stored, analyse_type)
Align provided index to use the stored values for matching bins.
- extended_dates(index, analyse_type, analyse_date)
Compute diagnostic extended dates to allow the reading of stored data that might be dated outside these dates.
- Parameters:
index (
ndarray
[Any
,dtype
[datetime64
]]) – Starting date.analyse_type (
FreqType
) – Type of period covered by this analyse (cycle, pass or custom). It’s used to determine the type of storage group to create.analyse_date (
datetime64
|None
) – Date used to reference stored data.
- Return type:
- Returns:
Extended dates including all requested bins.
- field_x: Field
- field_y: Field | None = None
- field_z: Field
- property fields_stored: DiagnosticFields
List of fields used when storing data.
- group: str
- group_parameters(diag_meta, analyse_type, group=None)
Returns the storage group parameters matching these properties.
- Parameters:
diag_meta (
DiagnosticMeta
) – Diagnostic metadata.analyse_type (
FreqType
) – Type of period covered by this analyse (cycle, pass or custom). It’s used to determine the type of storage group to create.
- Return type:
- Returns:
Storage group parameters.
- indexer: ong_indexer.PassIndexer | None
- name: str
- res_x: DataResolution
- res_y: DataResolution
- store_data(store, stat, data, group)
Format and store provided data using this storage properties.
- Parameters:
store (
DiagnosticStore
) – DataStore in which to store.stat (
StatType
) – Statistic to store.data (
Dataset
) – Data to store.group (
str
) – DataStore group in which to store.
- store_group(group=None)
Returns the name of the group in the store for the diagnostic.
- to_diagnostic_data(data)
Transform the data read from the store to the correct diagnostic results format.
- to_store_data(data, analyse_date)
Formats the diagnostic data to be written to the store.
- Parameters:
data (
Dataset
) – Data from the diagnostic to format.analyse_date (
datetime64
) – Date representing the set of data used in this analyse. It’s used to determine at which timestamp to store non-temporal diagnostics.
- Return type:
- Returns:
Formatted data ready for storage.
- class casys.computation.storage.HistogramStorageProperties(name, group, field_x, indexer, res_x, field_y=None)
Bases:
BinnedStorageProperties
Abstract class representing properties related to the storage of a histogram diagnostic.
- Parameters:
name (str) – Name of the data.
group (str) – Storage group.
field_x (Field) – Field used for x axes.
field_y (Field | None) – Field used for y axes.
indexer (ong_indexer.PassIndexer | None)
res_x (DataResolution)
- DTYPE: ClassVar[DiagnosticType] = 7
- align_bins(index, stored, analyse_type)
Align provided index to use the stored values for matching bins.
- extended_dates(index, analyse_type, analyse_date)
Compute diagnostic extended dates to allow the reading of stored data that might be dated outside these dates.
- Parameters:
index (
ndarray
[Any
,dtype
[datetime64
]]) – Starting date.analyse_type (
FreqType
) – Type of period covered by this analyse (cycle, pass or custom). It’s used to determine the type of storage group to create.analyse_date (
datetime64
|None
) – Date used to reference stored data.
- Return type:
- Returns:
Extended dates including all requested bins.
- field_x: Field
- field_y: Field | None = None
- property fields_stored: DiagnosticFields
List of fields used when storing data.
- group: str
- group_parameters(diag_meta, analyse_type, group=None)
Returns the storage group parameters matching these properties.
- Parameters:
diag_meta (
DiagnosticMeta
) – Diagnostic metadata.analyse_type (
FreqType
) – Type of period covered by this analyse (cycle, pass or custom). It’s used to determine the type of storage group to create.
- Return type:
- Returns:
Storage group parameters.
- indexer: ong_indexer.PassIndexer | None
- name: str
- res_x: DataResolution
- store_data(store, stat, data, group)
Format and store provided data using this storage properties.
- Parameters:
store (
DiagnosticStore
) – DataStore in which to store.stat (
StatType
) – Statistic to store.data (
Dataset
) – Data to store.group (
str
) – DataStore group in which to store.
- store_group(group=None)
Returns the name of the group in the store for the diagnostic.
- to_diagnostic_data(data)
Transform the data read from the store to the correct diagnostic results format.
- to_store_data(data, analyse_date)
Formats the diagnostic data to be written to the store.
- Parameters:
data (
Dataset
) – Data from the diagnostic to format.analyse_date (
datetime64
) – Date representing the set of data used in this analyse. It’s used to determine at which timestamp to store non-temporal diagnostics.
- Return type:
- Returns:
Formatted data ready for storage.
- class casys.computation.storage.MissingPointsStorageProperties(name, group, field_x, indexer, field_y, time, mp_missing, mp_groups)
Bases:
StorageProperties
- Abstract class representing properties related to the storage
of a missing points diagnostic.
- Parameters:
name (str) – Name of the data.
group (str) – Storage group.
field_x (Field) – Field used for x axes.
field_y (Field) – Field used for y axes.
indexer (ong_indexer.PassIndexer | None)
time (str)
mp_missing (str)
mp_groups (str)
- DTYPE: ClassVar[DiagnosticType] = 13
- FIELD_GROUPS: ClassVar[str] = 'MP_GROUPS'
- FIELD_MISSING: ClassVar[str] = 'MP_MISSING'
- align_bins(index, stored, analyse_type)
Align provided index to use the stored values for matching bins.
- extended_dates(index, analyse_type, analyse_date)
Compute diagnostic extended dates to allow the reading of stored data that might be dated outside these dates.
- Parameters:
index (
ndarray
[Any
,dtype
[datetime64
]]) – Starting date.analyse_type (
FreqType
) – Type of period covered by this analyse (cycle, pass or custom). It’s used to determine the type of storage group to create.analyse_date (
datetime64
|None
) – Date used to reference stored data.
- Return type:
- Returns:
Extended dates including all requested bins.
- field_x: Field
- field_y: Field
- property fields_stored: DiagnosticFields
List of fields used when storing data.
- group: str
- group_parameters(diag_meta, analyse_type, group=None)
Returns the storage group parameters matching these properties.
- Parameters:
diag_meta (
DiagnosticMeta
) – Diagnostic metadata.analyse_type (
FreqType
) – Type of period covered by this analyse (cycle, pass or custom). It’s used to determine the type of storage group to create.
- Return type:
- Returns:
Storage group parameters.
- indexer: ong_indexer.PassIndexer | None
- mp_groups: str
- mp_missing: str
- name: str
- store_data(store, stat, data, group)
Format and store provided data using this storage properties.
- Parameters:
store (
DiagnosticStore
) – DataStore in which to store.stat (
StatType
) – Statistic to store.data (
Dataset
) – Data to store.group (
str
) – DataStore group in which to store.
- store_group(group=None)
Returns the name of the group in the store for the diagnostic.
- time: str
- to_diagnostic_data(data)
Transform the data read from the store to the correct diagnostic results format.
- to_store_data(data, analyse_date)
Formats the diagnostic data to be written to the store.
- Parameters:
data (
Dataset
) – Data from the diagnostic to format.analyse_date (
datetime64
) – Date representing the set of data used in this analyse. It’s used to determine at which timestamp to store non-temporal diagnostics.
- Return type:
- Returns:
Formatted data ready for storage.
- class casys.computation.storage.PeriodogramStorageProperties(name, group, field_x, indexer, field_y, nbr_periods)
Bases:
StorageProperties
- Abstract class representing properties related to the storage
of a periodogram diagnostic.
- Parameters:
name (str) – Name of the data.
group (str) – Storage group.
field_x (Field) – Field used for x axes.
field_y (Field) – Field used for y axes.
nbr_periods (int) – Number of periods.
indexer (ong_indexer.PassIndexer | None)
- DTYPE: ClassVar[DiagnosticType] = 5
- align_bins(index, stored, analyse_type)
Align provided index to use the stored values for matching bins.
- extended_dates(index, analyse_type, analyse_date)
Compute diagnostic extended dates to allow the reading of stored data that might be dated outside these dates.
- Parameters:
index (
ndarray
[Any
,dtype
[datetime64
]]) – Starting date.analyse_type (
FreqType
) – Type of period covered by this analyse (cycle, pass or custom). It’s used to determine the type of storage group to create.analyse_date (
datetime64
|None
) – Date used to reference stored data.
- Return type:
- Returns:
Extended dates including all requested bins.
- field_x: Field
- field_y: Field
- property fields_stored: DiagnosticFields
List of fields used when storing data.
- group: str
- group_parameters(diag_meta, analyse_type, group=None)
Returns the storage group parameters matching these properties.
- Parameters:
diag_meta (
DiagnosticMeta
) – Diagnostic metadata.analyse_type (
FreqType
) – Type of period covered by this analyse (cycle, pass or custom). It’s used to determine the type of storage group to create.
- Return type:
- Returns:
Storage group parameters.
- indexer: ong_indexer.PassIndexer | None
- name: str
- nbr_periods: int
- store_data(store, stat, data, group)
Format and store provided data using this storage properties.
- Parameters:
store (
DiagnosticStore
) – DataStore in which to store.stat (
StatType
) – Statistic to store.data (
Dataset
) – Data to store.group (
str
) – DataStore group in which to store.
- store_group(group=None)
Returns the name of the group in the store for the diagnostic.
- to_diagnostic_data(data)
Transform the data read from the store to the correct diagnostic results format.
- to_store_data(data, analyse_date)
Formats the diagnostic data to be written to the store.
- Parameters:
data (
Dataset
) – Data from the diagnostic to format.analyse_date (
datetime64
) – Date representing the set of data used in this analyse. It’s used to determine at which timestamp to store non-temporal diagnostics.
- Return type:
- Returns:
Formatted data ready for storage.
- class casys.computation.storage.ScatterStorageProperties(name, group, field_x, indexer, res_x, field_y=None, *, field_z, res_y)
Bases:
Binned2dStorageProperties
Abstract class representing properties related to the storage of a scatter diagnostic.
- Parameters:
name (str) – Name of the data.
group (str) – Storage group.
field_x (Field) – Field used for x axes.
field_y (Field | None) – Field used for y axes.
indexer (ong_indexer.PassIndexer | None)
res_x (DataResolution)
field_z (Field)
res_y (DataResolution)
- DTYPE: ClassVar[DiagnosticType] = 8
- align_bins(index, stored, analyse_type)
Align provided index to use the stored values for matching bins.
- extended_dates(index, analyse_type, analyse_date)
Compute diagnostic extended dates to allow the reading of stored data that might be dated outside these dates.
- Parameters:
index (
ndarray
[Any
,dtype
[datetime64
]]) – Starting date.analyse_type (
FreqType
) – Type of period covered by this analyse (cycle, pass or custom). It’s used to determine the type of storage group to create.analyse_date (
datetime64
|None
) – Date used to reference stored data.
- Return type:
- Returns:
Extended dates including all requested bins.
- field_x: Field
- field_y: Field | None = None
- field_z: Field
- property fields_stored: DiagnosticFields
List of fields used when storing data.
- group: str
- group_parameters(diag_meta, analyse_type, group=None)
Returns the storage group parameters matching these properties.
- Parameters:
diag_meta (
DiagnosticMeta
) – Diagnostic metadata.analyse_type (
FreqType
) – Type of period covered by this analyse (cycle, pass or custom). It’s used to determine the type of storage group to create.
- Return type:
- Returns:
Storage group parameters.
- indexer: ong_indexer.PassIndexer | None
- name: str
- res_x: DataResolution
- res_y: DataResolution
- store_data(store, stat, data, group)
Format and store provided data using this storage properties.
- Parameters:
store (
DiagnosticStore
) – DataStore in which to store.stat (
StatType
) – Statistic to store.data (
Dataset
) – Data to store.group (
str
) – DataStore group in which to store.
- store_group(group=None)
Returns the name of the group in the store for the diagnostic.
- to_diagnostic_data(data)
Transform the data read from the store to the correct diagnostic results format.
- to_store_data(data, analyse_date)
Formats the diagnostic data to be written to the store.
- Parameters:
data (
Dataset
) – Data from the diagnostic to format.analyse_date (
datetime64
) – Date representing the set of data used in this analyse. It’s used to determine at which timestamp to store non-temporal diagnostics.
- Return type:
- Returns:
Formatted data ready for storage.
- class casys.computation.storage.SectionAnalysesStorageProperties(name, group, field_x, indexer, field_y)
Bases:
StorageProperties
Abstract class representing properties related to the storage of a section analysis diagnostic.
- Parameters:
name (str) – Name of the data.
group (str) – Storage group.
field_x (Field) – Field used for x axes.
field_y (Field) – Field used for y axes.
indexer (ong_indexer.PassIndexer | None)
- DTYPE: ClassVar[DiagnosticType] = 15
- align_bins(index, stored, analyse_type)
Align provided index to use the stored values for matching bins.
- extended_dates(index, analyse_type, analyse_date)
Compute diagnostic extended dates to allow the reading of stored data that might be dated outside these dates.
- Parameters:
index (
ndarray
[Any
,dtype
[datetime64
]]) – Starting date.analyse_type (
FreqType
) – Type of period covered by this analyse (cycle, pass or custom). It’s used to determine the type of storage group to create.analyse_date (
datetime64
|None
) – Date used to reference stored data.
- Return type:
- Returns:
Extended dates including all requested bins.
- field_x: Field
- field_y: Field
- property fields_stored: DiagnosticFields
List of fields used when storing data.
- group: str
- group_parameters(diag_meta, analyse_type, group=None)
Returns the storage group parameters matching these properties.
- Parameters:
diag_meta (
DiagnosticMeta
) – Diagnostic metadata.analyse_type (
FreqType
) – Type of period covered by this analyse (cycle, pass or custom). It’s used to determine the type of storage group to create.
- Return type:
- Returns:
Storage group parameters.
- indexer: ong_indexer.PassIndexer | None
- name: str
- store_data(store, stat, data, group)
Format and store provided data using this storage properties.
- Parameters:
store (
DiagnosticStore
) – DataStore in which to store.stat (
StatType
) – Statistic to store.data (
Dataset
) – Data to store.group (
str
) – DataStore group in which to store.
- store_group(group=None)
Returns the name of the group in the store for the diagnostic.
- to_diagnostic_data(data)
Transform the data read from the store to the correct diagnostic results format.
- to_store_data(data, analyse_date)
Formats the diagnostic data to be written to the store.
- Parameters:
data (
Dataset
) – Data from the diagnostic to format.analyse_date (
datetime64
) – Date representing the set of data used in this analyse. It’s used to determine at which timestamp to store non-temporal diagnostics.
- Return type:
- Returns:
Formatted data ready for storage.
- class casys.computation.storage.SegmentsAnalysisStorageProperties(name, group, field_x, indexer, field_y, field_z, time)
Bases:
StorageProperties
Abstract class representing properties related to the storage of a spectral analysis diagnostic.
- Parameters:
name (str) – Name of the data.
group (str) – Storage group.
field_x (Field) – Field used for x axes.
field_y (Field) – Field used for y axes.
indexer (ong_indexer.PassIndexer | None)
field_z (Field)
time (str)
- DTYPE: ClassVar[DiagnosticType] = 16
- align_bins(index, stored, analyse_type)
Align provided index to use the stored values for matching bins.
- extended_dates(index, analyse_type, analyse_date)
Compute diagnostic extended dates to allow the reading of stored data that might be dated outside these dates.
- Parameters:
index (
ndarray
[Any
,dtype
[datetime64
]]) – Starting date.analyse_type (
FreqType
) – Type of period covered by this analyse (cycle, pass or custom). It’s used to determine the type of storage group to create.analyse_date (
datetime64
|None
) – Date used to reference stored data.
- Return type:
- Returns:
Extended dates including all requested bins.
- field_x: Field
- field_y: Field
- field_z: Field
- property fields_stored: DiagnosticFields
List of fields used when storing data.
- group: str
- group_parameters(diag_meta, analyse_type, group=None)
Returns the storage group parameters matching these properties.
- Parameters:
diag_meta (
DiagnosticMeta
) – Diagnostic metadata.analyse_type (
FreqType
) – Type of period covered by this analyse (cycle, pass or custom). It’s used to determine the type of storage group to create.
- Return type:
- Returns:
Storage group parameters.
- indexer: ong_indexer.PassIndexer | None
- name: str
- store_data(store, stat, data, group)
Format and store provided data using this storage properties.
- Parameters:
store (
DiagnosticStore
) – DataStore in which to store.stat (
StatType
) – Statistic to store.data (
Dataset
) – Data to store.group (
str
) – DataStore group in which to store.
- store_group(group=None)
Returns the name of the group in the store for the diagnostic.
- time: str
- to_diagnostic_data(data)
Transform the data read from the store to the correct diagnostic results format.
- to_store_data(data, analyse_date)
Formats the diagnostic data to be written to the store.
- Parameters:
data (
Dataset
) – Data from the diagnostic to format.analyse_date (
datetime64
) – Date representing the set of data used in this analyse. It’s used to determine at which timestamp to store non-temporal diagnostics.
- Return type:
- Returns:
Formatted data ready for storage.
- class casys.computation.storage.SpectralAnalysisStorageProperties(name, group, field_x, indexer, field_y, field_z, time, wn, spectral_names)
Bases:
StorageProperties
Abstract class representing properties related to the storage of a spectral analysis diagnostic.
- Parameters:
name (str) – Name of the data.
group (str) – Storage group.
field_x (Field) – Field used for x axes.
field_y (Field) – Field used for y axes.
indexer (ong_indexer.PassIndexer | None)
field_z (Field)
time (str)
wn (str)
spectral_names (list[str])
- DTYPE: ClassVar[DiagnosticType] = 16
- align_bins(index, stored, analyse_type)
Align provided index to use the stored values for matching bins.
- extended_dates(index, analyse_type, analyse_date)
Compute diagnostic extended dates to allow the reading of stored data that might be dated outside these dates.
- Parameters:
index (
ndarray
[Any
,dtype
[datetime64
]]) – Starting date.analyse_type (
FreqType
) – Type of period covered by this analyse (cycle, pass or custom). It’s used to determine the type of storage group to create.analyse_date (
datetime64
|None
) – Date used to reference stored data.
- Return type:
- Returns:
Extended dates including all requested bins.
- field_x: Field
- field_y: Field
- field_z: Field
- property fields_stored: DiagnosticFields | None
List of fields used when storing data.
- group: str
- group_parameters(diag_meta, analyse_type, group=None)
Returns the storage group parameters matching these properties.
- Parameters:
diag_meta (
DiagnosticMeta
) – Diagnostic metadata.analyse_type (
FreqType
) – Type of period covered by this analyse (cycle, pass or custom). It’s used to determine the type of storage group to create.
- Return type:
- Returns:
Storage group parameters.
- indexer: ong_indexer.PassIndexer | None
- name: str
- spectral_names: list[str]
- store_data(store, stat, data, group)
Format and store provided data using this storage properties.
- Parameters:
store (
DiagnosticStore
) – DataStore in which to store.stat (
StatType
) – Statistic to store.data (
Dataset
) – Data to store.group (
str
) – DataStore group in which to store.
- store_group(group=None)
Returns the name of the group in the store for the diagnostic.
- time: str
- to_diagnostic_data(data)
Transform the data read from the store to the correct diagnostic results format.
- to_store_data(data, analyse_date)
Formats the diagnostic data to be written to the store.
- Parameters:
data (
Dataset
) – Data from the diagnostic to format.analyse_date (
datetime64
) – Date representing the set of data used in this analyse. It’s used to determine at which timestamp to store non-temporal diagnostics.
- Return type:
- Returns:
Formatted data ready for storage.
- wn: str
- class casys.computation.storage.SpectralCurvesStorageProperties(name, group, field_x, indexer, field_y, field_z, time, wn, spectral_names)
Bases:
SegmentsAnalysisStorageProperties
Abstract class representing properties related to the storage of a spectral analysis diagnostic.
- Parameters:
name (str) – Name of the data.
group (str) – Storage group.
field_x (Field) – Field used for x axes.
field_y (Field) – Field used for y axes.
indexer (ong_indexer.PassIndexer | None)
field_z (Field)
time (str)
wn (str)
spectral_names (list[str])
- DTYPE: ClassVar[DiagnosticType] = 16
- align_bins(index, stored, analyse_type)
Align provided index to use the stored values for matching bins.
- extended_dates(index, analyse_type, analyse_date)
Compute diagnostic extended dates to allow the reading of stored data that might be dated outside these dates.
- Parameters:
index (
ndarray
[Any
,dtype
[datetime64
]]) – Starting date.analyse_type (
FreqType
) – Type of period covered by this analyse (cycle, pass or custom). It’s used to determine the type of storage group to create.analyse_date (
datetime64
|None
) – Date used to reference stored data.
- Return type:
- Returns:
Extended dates including all requested bins.
- field_x: Field
- field_y: Field
- field_z: Field
- property fields_stored: DiagnosticFields
List of fields used when storing data.
- group: str
- group_parameters(diag_meta, analyse_type, group=None)
Returns the storage group parameters matching these properties.
- Parameters:
diag_meta (
DiagnosticMeta
) – Diagnostic metadata.analyse_type (
FreqType
) – Type of period covered by this analyse (cycle, pass or custom). It’s used to determine the type of storage group to create.
- Return type:
- Returns:
Storage group parameters.
- indexer: ong_indexer.PassIndexer | None
- name: str
- spectral_names: list[str]
- store_data(store, stat, data, group)
Format and store provided data using this storage properties.
- Parameters:
store (
DiagnosticStore
) – DataStore in which to store.stat (
StatType
) – Statistic to store.data (
Dataset
) – Data to store.group (
str
) – DataStore group in which to store.
- store_group(group=None)
Returns the name of the group in the store for the diagnostic.
- time: str
- to_diagnostic_data(data)
Transform the data read from the store to the correct diagnostic results format.
- to_store_data(data, analyse_date)
Formats the diagnostic data to be written to the store.
- Parameters:
data (
Dataset
) – Data from the diagnostic to format.analyse_date (
datetime64
) – Date representing the set of data used in this analyse. It’s used to determine at which timestamp to store non-temporal diagnostics.
- Return type:
- Returns:
Formatted data ready for storage.
- wn: str
- class casys.computation.storage.StorageGroupParams(name, meta, model, fields, index, time_gap=np.timedelta64(0), gap_tolerance=1, dims=<factory>, parameters=<factory>)
Bases:
object
Class representing parameters of a storage group.
- Parameters:
name (
str
) – Name of the group.meta (
DiagnosticMeta
) – Group’s metadata.model (
type
[DiagnosticModel
]) – Generic model for diagnostic stores.fields (
DiagnosticFields
) – Sets of diagnostic fields.index (
str
) – Diagnostic index name.time_gap (
timedelta64
) – Expected time gap between two values.gap_tolerance (
float
) – Tolerance between actual time gap and the expected one (default: 5%). This value is expressed as a percentage between 0 (no tolerance) and 1 (100% tolerance).dims (
list
[tuple
[str
,int
]]) – Diagnostic dimensions as a list of Tuple(name, size).parameters (
dict
[str
,Any
]) – Additional parameters specific to some diagnostics store model (pass_name, cycle_name, indexer, time_policy).
- declare_to_store(store)
Declare this group to the provided diagnostic store.
- Parameters:
store (
DiagnosticStore
) – Diagnostic Store.
-
fields:
DiagnosticFields
- merge(other)
Merge provided parameters to the current ones.
- Parameters:
other (
StorageGroupParams
) – Storage parameters to merge.
-
meta:
DiagnosticMeta
-
model:
type
[DiagnosticModel
]
-
time_gap:
timedelta64
= np.timedelta64(0)
- class casys.computation.storage.StorageProperties(name, group, field_x, indexer)
Bases:
ABC
Abstract class representing properties related to the storage of a diagnostic.
- Parameters:
name (
str
) – Name of the data.group (
str
) – Storage group.field_x (
Field
) – Field used for x axes.field_y – Field used for y axes.
indexer (
PassIndexer
|None
)
-
DTYPE:
ClassVar
[DiagnosticType
]
- align_bins(index, stored, analyse_type)
Align provided index to use the stored values for matching bins.
- extended_dates(index, analyse_type, analyse_date)
Compute diagnostic extended dates to allow the reading of stored data that might be dated outside these dates.
- Parameters:
index (
ndarray
[Any
,dtype
[datetime64
]]) – Starting date.analyse_type (
FreqType
) – Type of period covered by this analyse (cycle, pass or custom). It’s used to determine the type of storage group to create.analyse_date (
datetime64
|None
) – Date used to reference stored data.
- Return type:
- Returns:
Extended dates including all requested bins.
- abstract property fields_stored: DiagnosticFields
List of fields used when storing data.
- abstract group_parameters(diag_meta, analyse_type, group=None)
Returns the storage group parameters matching these properties.
- Parameters:
diag_meta (
DiagnosticMeta
) – Diagnostic metadata.analyse_type (
FreqType
) – Type of period covered by this analyse (cycle, pass or custom). It’s used to determine the type of storage group to create.
- Return type:
- Returns:
Storage group parameters.
-
indexer:
PassIndexer
|None
- store_data(store, stat, data, group)
Format and store provided data using this storage properties.
- Parameters:
store (
DiagnosticStore
) – DataStore in which to store.stat (
StatType
) – Statistic to store.data (
Dataset
) – Data to store.group (
str
) – DataStore group in which to store.
- store_group(group=None)
Returns the name of the group in the store for the diagnostic.
- to_diagnostic_data(data)
Transform the data read from the store to the correct diagnostic results format.
- to_store_data(data, analyse_date)
Formats the diagnostic data to be written to the store.
- Parameters:
data (
Dataset
) – Data from the diagnostic to format.analyse_date (
datetime64
) – Date representing the set of data used in this analyse. It’s used to determine at which timestamp to store non-temporal diagnostics.
- Return type:
- Returns:
Formatted data ready for storage.
- class casys.computation.storage.TemporalStorageProperties(name, group, field_x, indexer, res_x, field_y=None, *, frequency)
Bases:
BinnedStorageProperties
Abstract class representing properties related to the storage of a temporal diagnostic.
- Parameters:
name (str) – Name of the data.
group (str) – Storage group.
field_x (Field) – Field used for x axes.
field_y (Field | None) – Field used for y axes.
frequency (FrequencyHandler) – Frequency (day, pass, cycle).
indexer (ong_indexer.PassIndexer | None)
res_x (DataResolution)
- DTYPE: ClassVar[DiagnosticType] = 4
- align_bins(index, stored, analyse_type)
Align provided index to use the stored values for matching bins.
- extended_dates(index, analyse_type, analyse_date)
Compute diagnostic extended dates to allow the reading of stored data that might be dated outside these dates.
- Parameters:
index (
ndarray
[Any
,dtype
[datetime64
]]) – Starting date.analyse_type (
FreqType
) – Type of period covered by this analyse (cycle, pass or custom). It’s used to determine the type of storage group to create.analyse_date (
datetime64
|None
) – Date used to reference stored data.
- Return type:
- Returns:
Extended dates including all requested bins.
- field_x: Field
- field_y: Field | None = None
- property fields_stored: DiagnosticFields
List of fields used when storing data.
- frequency: FrequencyHandler
- group: str
- group_parameters(diag_meta, analyse_type, group=None)
Returns the storage group parameters matching these properties.
- Parameters:
diag_meta (
DiagnosticMeta
) – Diagnostic metadata.analyse_type (
FreqType
) – Type of period covered by this analyse (cycle, pass or custom). It’s used to determine the type of storage group to create.
- Return type:
- Returns:
Storage group parameters.
- indexer: ong_indexer.PassIndexer | None
- name: str
- res_x: DataResolution
- store_data(store, stat, data, group)
Format and store provided data using this storage properties.
- Parameters:
store (
DiagnosticStore
) – DataStore in which to store.stat (
StatType
) – Statistic to store.data (
Dataset
) – Data to store.group (
str
) – DataStore group in which to store.
- store_group(group=None)
Returns the name of the group in the store for the diagnostic.
- to_diagnostic_data(data)
Transform the data read from the store to the correct diagnostic results format.
- to_store_data(data, analyse_date)
Formats the diagnostic data to be written to the store.
- Parameters:
data (
Dataset
) – Data from the diagnostic to format.analyse_date (
datetime64
) – Date representing the set of data used in this analyse. It’s used to determine at which timestamp to store non-temporal diagnostics.
- Return type:
- Returns:
Formatted data ready for storage.