dartobsgen.trim_obs_seq#

dartobsgen.trim_obs_seq(input_file, polygon, output_file=None)[source]#

Trim observations in a DART obs_seq file to those inside a polygon.

Uses pydartdiags.ObsSequence to read and write the file, so this function is data-source agnostic — it works on any obs_seq file regardless of how it was produced.

A fast bounding-box pre-filter is applied first; only points surviving the bbox check are tested with the exact shapely.contains_xy call.

Parameters:
Returns:

True if at least one observation survived the trim and the output file was written; False if no observations fell inside the polygon.

Return type:

bool