ctdclient.model.near_real_time_publication module¶
- ctdclient.model.near_real_time_publication.instantiate_near_real_time_target(*args, frequency_of_action='23:59:00', **kwargs)[source]¶
- Return type:
- class ctdclient.model.near_real_time_publication.NRTList(*args, **kwargs)[source]¶
Bases:
UserList
- class ctdclient.model.near_real_time_publication.NearRealTimeTarget(recipient_address, target_file_suffix, target_file_directory='', geo_filter='', email_info={}, file_path='', active=False, **kwargs)[source]¶
Bases:
objectStores information for near-real-time distribution of latest CTD data files. Can work in two modes: email or rsync/copy. Will distinguish between these by checking ‘recipient_adress’ for an ‘@’.
- create_email_message(target_files, to_address='', from_address='', subject='', body='')[source]¶
Creates an email with target files attached.
- create_email_draft(msg, file_path='')[source]¶
Creates an email .eml draft file, that can be opened by common email programs.
- Return type:
Path
- get_target_files(target_file=PosixPath('.'))[source]¶
Creates a list of paths to files that are meant to be published.
- Return type:
list[Path]
- geographic_filter(coordinate_pair)[source]¶
Checks, whether we are inside of a certain polygon. The polygon will usually be the EEZ of a certain country. Does support all data formats that geopandas can handle.
- Return type:
bool
- point_in_polygon(point, polygon)[source]¶
Check if a point is inside a polygon using the Ray Casting Algorithm.
- Parameters:
point – Tuple (x, y) representing the point to check.
polygon – List of tuples [(x1, y1), (x2, y2), …] representing the polygon vertices.
- Returns:
True if the point is inside the polygon, False otherwise.
- class ctdclient.model.near_real_time_publication.DailyPublication(*args, time_to_run_at='23:59:30', single_run=False, **kwargs)[source]¶
Bases:
NearRealTimeTarget