File tree Expand file tree Collapse file tree
src/lightcurvelynx/obstable
tests/lightcurvelynx/obstable Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -226,6 +226,10 @@ def copy(self):
226226 ** new_survey_values ,
227227 )
228228
229+ def head (self , n = 5 ):
230+ """Return the first n rows of the observation table."""
231+ return self ._table .head (n )
232+
229233 def uses_footprint (self ):
230234 """Return whether the ObsTable uses a detector footprint for filtering."""
231235 return self ._detector_footprint is not None
Original file line number Diff line number Diff line change @@ -61,6 +61,10 @@ def test_create_obs_table():
6161 # Without a filters column we cannot access the filters.
6262 assert len (ops_data .filters ) == 0
6363
64+ # Check the head function.
65+ assert len (ops_data .head (3 )) == 3
66+ assert len (ops_data .head (10 )) == 5
67+
6468 # We can create an ObsTable directly from the dictionary as well.
6569 ops_data2 = ObsTable (pdf )
6670 assert len (ops_data2 ) == 5
You can’t perform that action at this time.
0 commit comments