Getting channel availability

Channels are not always available. The channel may have a gap in the data for many reasons, including events such as computer and IFO downtime at the observatories (planned and unplanned) and IFO model changes (renaming, adding/removing channges, ...).

NDS2 servers have a listing of when each channel is available and can provide that data to users. NDS1 servers do not currently export this information. As such this section only applies to NDS2 connections.

The connection.get_availability() method is used to retrieve timespans when a channel is available. The call operates on a list of channel names, and returns detailed information regarding the availability of each channel requested. The information includes the start and stop times of segments of data as well as the frame types of the files these segments of data apply to. The detailed list often contains overlapping segments, often science and commissioning frames.

If all you need is a list of timespans that the data is available during, you can convert the detailed availability list to a simpler list that is only gps_start, gps_stop pairs.

Example 4.19. Retrieving H1:GDS-CALIB_STRAIN availability during O1 in python

import nds

conn = nds.connection('', 31200)

# only view the O1 time spans
# we could also do this as
# conn.set_epoch('1126621184-1137258496')
# or
# conn.set_epoch(1126621184, 1137258496)

avail = conn.get_availability(['H1:GDS-CALIB_STRAIN'])

print "Detailed availability - %s" % avail[0].name
for entry in avail[0].data:
	print "%s %d %d" % (entry.frame_type, entry.gps_start, entry.gps_stop)

# convert the detailed list to a simplified list
simple_avail = avail.simple_list()

print "Simplified availability"
for entry in simple_avail[0]:
	print "%d %d" % (entry.gps_start, entry.gps_stop)

This produces the following output (with the output truncated):
Detailed availability - H1:GDS-CALIB_STRAIN
H-H1_HOFT_C00 1126621184 1126988756
H-H1_HOFT_C00 1126989824 1127581128
H-H1_HOFT_C00 1127581340 1127581364
H-H1_HOFT_C00 1127581452 1127581772
H-H1_HOFT_C00 1127581796 1129383148
H-H1_HOFT_C00 1129396152 1129999948
H-H1_HOFT_C00 1130000036 1130014756
Simplified availability
1126621184 1126988756
1126989824 1127581128
1127581340 1127581364
1127581452 1127581772
1127581796 1129383148
1129396152 1129999948
1130000036 1130014756