<jupyter_start><jupyter_text>TAT-C: Collect Observations Core Functions ExampleDr. <NAME>, <NAME>, <NAME>Collective Design (CoDe) LabStevens Institute of Technology, School of Systems and EnterprisesThis example demonstrates how to use direct function calls of the low-level TAT-C library to model observations of single point  by a single satellite using an orbit derived from an existing Two Line Element (TLE) set. Dependencies Standard Python LibrariesThis example is compatible with python 3.8.10 and makes use of the standard python `datetime` library for setting mission duration.<jupyter_code># Import datetime library objects for seting mission duration
from datetime import datetime, timezone, timedelta<jupyter_output><empty_output><jupyter_text>TAT-C LibraryAdditionally, this example makes use of the low-level `tatc` library. If you do not have this installed, navigate to the main `tatc-v3` file and make sure you have followed all the instructions for installation of TAT-C.<jupyter_code># Import tatc core functions and schemas
from tatc.analysis.coverage import collect_observations, reduce_observations
from tatc.schemas.satellite import Satellite
from tatc.schemas.instrument import Instrument
from tatc.schemas.orbit import TwoLineElements
from tatc.schemas.point import Point<jupyter_output><empty_output><jupyter_text>Establish the Mission Architecture and Key InformationThe first step in modeling a mission with TAT-C is to establish the key mission parameters -- specifically the satellites, the mission time frame and points on the ground for observation.  Modeling Satellite ArchitectureFirst we define the satellites for a mission. In this example we define one satellite (NOAA-1) with a single instrument and an orbit derived from a known two-line element set (TLE). This uses the `TwoLineElements` class from `tatc.schemas.orbit` and the `Instrument` class from `tatc.schemas.instrument`.<jupyter_code># Save the NOAA-1 TLE as a list where the first element of the list is the first line
# of the TLE and the second list element is the second line
tle = ['1 04793U 70106A   22044.41526573 -.00000035  00000+0  54783-4 0  9991',
        '2 04793 101.5750 111.2777 0031771 203.0437 167.8944 12.54003052342042']

# Derive the satellite orbit from the TLE
orbit = TwoLineElements(type='tle',
                        tle=tle)

# Initialize the instrument for the satellite to make observations
instrument = Instrument(name='Lead Instrument', field_of_regard=180)

# Define the satellite from the orbit and instrument
sat = Satellite(name='NOAA1',
                type='satellite',
                orbit=orbit,
                instruments=[instrument])<jupyter_output><empty_output><jupyter_text>Modeling Mission ParametersNext we define the mission parameters, specifically the target point -- using the `Point` class from `tatc.schemas.point` -- and the start and end time of the mission window -- using the `datetime` and `timedelta` objects from the python `datetime` module.<jupyter_code># Define a target points for observations
point = Point(id=0, latitude=40.74259, longitude=-74.02686)

# Set the start date to be January, 1, 2021 at noon (12 pm) UTC
start = datetime(year=2021, month=1, day=1, hour=12, minute=0, second=0, tzinfo=timezone.utc)

# Set the end date to be 30 days after the start date
end = start + timedelta(days=30)<jupyter_output><empty_output><jupyter_text>Calling Analysis FunctionsFinally, we call the core analysis function `collect_observations` function from `tatc.analysis.coverage` to determine all the opportunities for the satellite to observe the point with the specified instrument over the mission duration. Collect Observations<jupyter_code># Collect and display the observation events for the point over the mission duration
results = collect_observations(point, sat, instrument, start, end, omit_solar=False)
results<jupyter_output><empty_output><jupyter_text>Reducing ObservationsWe can also utilize the `reduce_observations` function from `tatc.analysis.coverage` to generate coverage statistics -- total access time, average revisit time, and the number of observations for the point over the mission duration.<jupyter_code># Calculate and displace coverage statistics for the point over the mission duration
reduced_results = reduce_observations(results)
reduced_results<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.06312900274473925, 'fraction_numerical': 0.03499542543458371, 'mean_word_length': 5.3653566229985445, 'pattern_counts': {'":': 0, '<': 28, '<?xml version=': 0, '>': 28, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '74913', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 1282, 'n_tokens_neox': 1135, 'n_words': 506, 'path': 'examples/Compute Coverage/Core Functions.ipynb', 'repo_name': 'code-lab-org/tatc-app', 'size': '4399'}