propose.domain_layer.services package

Submodules

propose.domain_layer.services.check_pdf module

type propose.domain_layer.services.check_pdf.Errors = tuple[bool, list[str]]
class propose.domain_layer.services.check_pdf.PdfChecker(file: Path, max_pages: int = 1, margin: int = 1, font_size: int = 11, minimum_font_size_usage_ratio: float = 0.95)

Bases: object

PdfChecker checks PDF files for various kinds of evil behavior on the part of proposers, including:

  • Having more than a prescribed set of pages

  • Using narrow margins to fit more content onto a single page

  • Using small fonts to fit more content onto a single page

Parameters:
  • file – Path to the file (or FileLike, as required by pdfplumber.open)

  • max_pages – Maximum number of pages to permit

  • margin – The expected minimum margin, in inches

  • font_size – The expected font size, in points

  • minimum_font_size_usage_ratio – The minimum ratio of the expected font size to everything else (float between 0 and 1)

check() → Errors

Checks the PDF file we were given against all the rules that this class understands.

check_fontsizes() → Errors

Checks that the font sizes used by this PDF are reasonable.

check_margins() → tuple[bool, list[str]]

Checks that the margins in this PDF are reasonable.

check_page_count() → Errors

Checks that the page count of the PDF is reasonable.

static combine_errors(*args: Errors) → Errors

Combines a number of Errors into a single Errors.

static points_to_inches(points: int | float) → float
propose.domain_layer.services.check_pdf.check_pdf(file: Path, max_pages: int = 1)

propose.domain_layer.services.observation_planner_factories_service module

propose.domain_layer.services.observation_specification_generator_service module

propose.domain_layer.services.permissions_service module

propose.domain_layer.services.proposal_validator_service module

propose.domain_layer.services.reference_target_generator_service module

propose.domain_layer.services.scheduling_strategy_service module

propose.domain_layer.services.science_target_list_generator_service module

propose.domain_layer.services.serialize_field_sources_to_csv_service module

propose.domain_layer.services.serialize_spectral_specifications_to_csv_service module

propose.domain_layer.services.slew_time_calculator_services module

propose.domain_layer.services.slew_time_calculator_services.calculate_slew_time_gbt(start_point: SkyCoord, end_point: SkyCoord) → float

This is a toy slew time calculator for the GBT, used to calculate the amount of time it takes a given facility to aim at a different part of the sky. The initial implementation returns a constant value in seconds.

Parameters:
  • start_point – The starting position of the telescope

  • end_point – The ending position of the telescope

Returns:

Slew time in seconds

propose.domain_layer.services.slew_time_calculator_services.calculate_slew_time_vla(start_point: SkyCoord, end_point: SkyCoord) → float

This is a toy slew time calculator for the VLA, used to calculate the amount of time it takes a given facility to aim at a different part of the sky. The initial implementation returns a constant value in seconds.

Parameters:
  • start_point – The starting position of the telescope

  • end_point – The ending position of the telescope

Returns:

Slew time in seconds

propose.domain_layer.services.slew_time_calculator_services.choose_slew_time_calculator(facility_type: FacilityType | None) → Callable[[SkyCoord, SkyCoord], float]

Provide the slew-time calculator to use for a given facility type

Parameters:

facility_type – The FacilityType to select the slew-time-calculator for

Returns:

A function to calculate slew time for the given facility type

Module contents