bgc_data_processing.features
¶
Transformations to apply to data to create new features.
BaseFeature(var_name, var_unit, var_type, var_default, var_name_format, var_value_format)
¶
Bases: ABC
Base class for added features.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
var_name |
str
|
Name of the added variable. |
required |
var_unit |
str
|
Unit of the added variable. |
required |
var_type |
str
|
Type of the added variable. |
required |
var_default |
Any
|
Default value for the added variable. |
required |
var_name_format |
str
|
Name format for the added variable. |
required |
var_value_format |
str
|
Value format for the added variable. |
required |
Source code in src/bgc_data_processing/features.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
|
variable: NotExistingVar
property
¶
Variable which correspond to the feature.
required_variables: list[ExistingVar | NotExistingVar | ParsedVar]
property
¶
Required variables for the feature computation.
transform(*args)
abstractmethod
¶
Compute the new variable values using all required series.
Source code in src/bgc_data_processing/features.py
85 86 87 |
|
insert_in_storer(storer)
¶
Insert the new feature in a given storer.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
storer |
Storer
|
Storer to include data into. |
required |
Source code in src/bgc_data_processing/features.py
89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
|
copy_var_infos_from_template(template, **kwargs)
classmethod
¶
Create Feature from a variable template.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
template |
TemplateVar
|
Template to use for the variable definition. |
required |
Returns:
Type | Description |
---|---|
BaseFeature
|
Feature. |
Source code in src/bgc_data_processing/features.py
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
|
Pressure(depth_variable, latitude_variable, var_name='PRES', var_unit='[dbars]', var_type=float, var_default=np.nan, var_name_format='%-10s', var_value_format='%10.3f')
¶
Bases: BaseFeature
Pressure feature.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
depth_variable |
ExistingVar | NotExistingVar | ParsedVar
|
Variable for depth. |
required |
latitude_variable |
ExistingVar | NotExistingVar | ParsedVar
|
Variable for latitude. |
required |
var_name |
str
|
Variable Name., by default "PRES" |
'PRES'
|
var_unit |
str
|
Variable unit., by default "[dbars]" |
'[dbars]'
|
var_type |
str
|
Data type., by default float |
float
|
var_default |
Any
|
Default value., by default np.nan |
nan
|
var_name_format |
str
|
Name format for the added variable., by default "%-10s" |
'%-10s'
|
var_value_format |
str
|
Value format for the added variable., by default "%10.3f" |
'%10.3f'
|
Source code in src/bgc_data_processing/features.py
156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 |
|
transform(depth, latitude)
¶
Compute pressure from depth and latitude.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
depth |
Series
|
Depth (in meters). |
required |
latitude |
Series
|
Latitude (in degree). |
required |
Returns:
Type | Description |
---|---|
Series
|
Pressure (in dbars). |
Source code in src/bgc_data_processing/features.py
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 |
|
PotentialTemperature(salinity_variable, temperature_variable, pressure_variable, var_name='PTEMP', var_unit='[deg_C]', var_type=float, var_default=np.nan, var_name_format='%-10s', var_value_format='%10.3f')
¶
Bases: BaseFeature
Potential Temperature feature..
Parameters:
Name | Type | Description | Default |
---|---|---|---|
salinity_variable |
ExistingVar | NotExistingVar | ParsedVar
|
Variable for salinity. |
required |
temperature_variable |
ExistingVar | NotExistingVar | ParsedVar
|
Variable for temperature. |
required |
pressure_variable |
ExistingVar | NotExistingVar | ParsedVar
|
Variable for pressure. |
required |
var_name |
str
|
Variable name., by default "PTEMP" |
'PTEMP'
|
var_unit |
str
|
Variable unit., by default "[deg_C]" |
'[deg_C]'
|
var_type |
str
|
Data type., by default float |
float
|
var_default |
Any
|
Default value, by default np.nan |
nan
|
var_name_format |
str
|
Name format for the added variable., by default "%-10s" |
'%-10s'
|
var_value_format |
str
|
Value format for the added variable., by default "%10.3f" |
'%10.3f'
|
Source code in src/bgc_data_processing/features.py
222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 |
|
transform(salinity, temperature, pressure)
¶
Compute potential temperature from salinity, temperature and pressure.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
salinity |
Series
|
Salinity (in psu). |
required |
temperature |
Series
|
Temperature (in Celsius degree). |
required |
pressure |
Series
|
Pressure (in dbars). |
required |
Returns:
Type | Description |
---|---|
Series
|
Potential Temperature (in Celsisus degree). |
Source code in src/bgc_data_processing/features.py
244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 |
|
SigmaT(salinity_variable, temperature_variable, var_name='SIGT', var_unit='[kg/m3]', var_type=float, var_default=np.nan, var_name_format='%-10s', var_value_format='%10.3f')
¶
Bases: BaseFeature
Sigma T feature.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
salinity_variable |
ExistingVar | NotExistingVar | ParsedVar
|
Variable for slainity. |
required |
temperature_variable |
ExistingVar | NotExistingVar | ParsedVar
|
Variable for temperature. |
required |
var_name |
str
|
Variable name., by default "SIGT" |
'SIGT'
|
var_unit |
str
|
Variable unit., by default "[kg/m3]" |
'[kg/m3]'
|
var_type |
str
|
Data type., by default float |
float
|
var_default |
Any
|
Default value., by default np.nan |
nan
|
var_name_format |
str
|
Name format for the added variable., by default "%-10s" |
'%-10s'
|
var_value_format |
str
|
Value format for the added variable., by default "%10.3f" |
'%10.3f'
|
Source code in src/bgc_data_processing/features.py
294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 |
|
transform(salinity, temperature)
¶
Compute sigma t from salinity and temperature.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
salinity |
Series
|
Salinity (in psu). |
required |
temperature |
Series
|
Temperature (in Celsius degree). |
required |
Returns:
Type | Description |
---|---|
Series
|
Sigma T (in kg/m3). |
Source code in src/bgc_data_processing/features.py
315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 |
|
ChlorophyllFromDiatomFlagellate(diatom_variable, flagellate_variable, var_name='CPHL', var_unit='[mg/m3]', var_type=float, var_default=np.nan, var_name_format='%-10s', var_value_format='%10.3f')
¶
Bases: BaseFeature
Chlorophyll-a feature.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
diatom_variable |
ExistingVar | NotExistingVar | ParsedVar
|
Variable for diatom. |
required |
flagellate_variable |
ExistingVar | NotExistingVar | ParsedVar
|
Variable for flagellate. |
required |
var_name |
str
|
Variable name., by default "CPHL" |
'CPHL'
|
var_unit |
str
|
Variable unit., by default "[mg/m3]" |
'[mg/m3]'
|
var_type |
str
|
Data type., by default float |
float
|
var_default |
Any
|
Default value., by default np.nan |
nan
|
var_name_format |
str
|
Name format for the added variable., by default "%-10s" |
'%-10s'
|
var_value_format |
str
|
Value format for the added variable., by default "%10.3f" |
'%10.3f'
|
Source code in src/bgc_data_processing/features.py
362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 |
|
transform(diatom, flagellate)
¶
Compute chlorophyll-a from diatom and flagellate.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
diatom |
Series
|
Diatoms (in mg/m3). |
required |
flagellate |
Series
|
Flagellates (in mg/m3). |
required |
Returns:
Type | Description |
---|---|
Series
|
Chlorophyll-a (in kg/m3). |
Source code in src/bgc_data_processing/features.py
383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 |
|