Lab Exercise: LSCsegFind

Purpose:

The LSCsegFind command queries an LSCsegFindServer to obtain GPS time intervals or segments which lie in a given time range and correspond to one or more types or instrumental behavior. The names of the types are derived from the interferometer state vector which described the state of a detector at any given time. The most familiar state is named Science which corresponds to data which is suitable for scientific analysis. There are other state types, such as Injection which indicates that hardware injections are being performed in the interferometer.

LSCsegFind can request segments of more than one type. If several types are specified, then segments corresponding to the union of all the types is returned. This allows users to request segments that correspond to science or injection mode data, for example.

One or more interferometers must be specified when calling LSCsegFind. If only one interferometer is given then the segments of the requested type(s) for that interferometer are returned. If more than one interferometer is specified, then LSCsegFind returns the intersection of the segments. This means that if a user requests science mode data for H1, H2 and L1 then segments corresponding to triple coincident science mode data are returned.

Note that the union of types is done before the intersection of interferometers, so a query that requests Science and Injection from H1 and H2 will return segments for which both H1 and H2 coincidence in either science or injection mode.

During this lab the user will become familiar with the LSCsegFind tool:

  1. Installing Glue
  2. Checking the LSCsegFind Server
  3. Showing Interferometers and Types
  4. Searching for Segments

Additional documentation can be found at http://www.lsc-group.phys.uwm.edu/lscdatagrid/doc/quicktools.html#lscsegfind

 

Installing Glue

LSCsegFind is distributed as part of Glue. Glue is a pure python package, so installation is very simple. It has no pre-required software, although some tools may exit with an error if the LSCdataGrid client or server is not correctly installed on your machine. Since you have already installed the LSCdataGrid client, you can simply follow the Glue README file to install Glue.

The Glue README is available from the Glue home page at http://www.lsc-group.phys.uwm.edu/daswg/projects/glue.html

  1. Follow steps one and two of the README to download the Glue source into ${HOME}/src/glue
  2. In step three of the README, you should chose ${HOME} as your GLUE_LOCATION and not /opt/glue as in the example. Chosing ${HOME} will install Glue into your home directory.
  3. Follow step four of the README to set up your environment. Remember that GLUE_LOCATION should be set to ${HOME}. Don't forget to log out and log back in after completing step four.

Checking the LSCsegFind Server

  1. First make sure you can connect and that everything is up and running.
$ LSCsegFind --server ldas.ligo-la.caltech.edu --ping

LSCsegFindServer at ldas.ligo-la.caltech.edu is alive

The --ping command pings the segment server that you specify with the --server option.

Finding other sites: http://www.lsc-group.phys.uwm.edu/lscdatagrid/resources/index.html

  1. The environment variable LSC_SEGFIND_SERVER can be set to avoid the need to specify the --server argument on every command line:
$ export LSC_SEGFIND_SERVER=ldas.ligo-la.caltech.edu

$ LSCsegFind --ping

LSCsegFindServer at ldas.ligo-la.caltech.edu is alive

Obviously, the export command is a good candidate to consider adding to ~/.bash_profile if you're working with a single LSCsegFind server most of the time.

 

Showing Interferometers and Types

  1. We can look at a listing of what interferometers have segments on the server we have chosen using the --show-interferometers option.

$ LSCsegFind --server=ldas.ligo-la.caltech.edu --show-interferometers

L1
$

  1. The LSCsegFind servers at the observatories currently only have segment information for the interferometers at that observatory. To obtain information about all the interferometers from a single server, use --show-interferometers and query the central server at Caltech.

$ LSCsegFind --server=ldas-cit.ligo.caltech.edu --show-interferometers

H1
H2
L1
$

  1. We can also use LSCsegFind to list of the types of segment that are available.

$ LSCsegFind --server=ldas.ligo-la.caltech.edu --show-types

Commissioning_Up
Injection
Science
Science_Conlog
Science_Loss
Science_Up
$


 

Searching for Segments

  1. Let's find the list of segments we need based upon some selection criteria.  We will specify a server, an interferometer and a type.  Along with this we will give a start and end time to limit the range of the data that will be looked at. 

Let's start with the following command:

$ LSCsegFind --server=ldas.ligo-la.caltech.edu --interferometer L1 --type Science --gps-start-time 793756813 --gps-end-time 794102413

793756813 793761885
793763207 793767231
793767680 793784113
793784732 793787382
793788056 793796486
793805514 793805694
793808248 793831885
793831896 793832532
793832579 793873836
793877308 793879457
793879839 793881136
793881409 793895968
793898250 793908888
793930051 793950156
793951442 793958125
793958931 793975740
793976166 793985941
793986885 794001768
794004919 794011738
794018389 794027186
794028147 794088934
794096014 794102413

LSCsegFind returns the GPS times of the segments in the format

start end
  1. Some tools (such as the pipeline tools described later in the workshop) expect the list of segments to be in "segwizard format". Try adding the option --output-format segwizard
$ LSCsegFind --server=ldas.ligo-la.caltech.edu --interferometer L1 --type Science --gps-start-time 793756813 --gps-end-time 794102413 --output-format segwizard

0 793756813 793761885 5072
1 793763207 793767231 4024
2 793767680 793784113 16433
3 793784732 793787382 2650
4 793788056 793796486 8430
5 793805514 793805694 180
6 793808248 793831885 23637
7 793831896 793832532 636
8 793832579 793873836 41257
9 793877308 793879457 2149
10 793879839 793881136 1297
11 793881409 793895968 14559
12 793898250 793908888 10638
13 793930051 793950156 20105
14 793951442 793958125 6683
15 793958931 793975740 16809
16 793976166 793985941 9775
17 793986885 794001768 14883
18 794004919 794011738 6819
19 794018389 794027186 8797
20 794028147 794088934 60787
21 794096014 794102413 6399

LSCsegFind now returns the GPS times of the segments in the format

id start end duration

where id numbers the returned segments sequentially, starting at zero, and duration is the duration of the segment in seconds.

  1. The --type option expects a comma separated list of segment types. If we want to obtain the segments for which L1 is in either Science or Injection mode, we can specify --type Science,Injection
$ LSCsegFind --server=ldas.ligo-la.caltech.edu --interferometer L1 --type Science,Injection --gps-start-time 793756813 --gps-end-time 794102413 --output-format segwizard

0 793756813 793761885 5072
1 793763207 793767231 4024
2 793767680 793784113 16433
3 793784732 793787382 2650
4 793788056 793796486 8430
5 793805514 793805694 180
6 793808248 793831885 23637
7 793831896 793832532 636
8 793832579 793873836 41257
9 793877308 793879457 2149
10 793879839 793881136 1297
11 793881409 793895968 14559
12 793898250 793908888 10638
13 793930051 793950156 20105
14 793951442 793958125 6683
15 793958931 793975740 16809
16 793976166 793985941 9775
17 793986885 794001768 14883
18 794004919 794011738 6819
19 794013134 794013140 6
20 794013199 794013199 0
21 794013672 794013673 1
22 794013674 794013674 0
23 794013711 794013712 1
24 794013869 794013870 1
25 794018389 794027186 8797
26 794028147 794088934 60787
27 794096014 794102413 6399
  1. There are two other output format option available besides the default and segwizard formats. You may sepecify --output-format tcl to obtain segments formatted as a TCL list or --output-format python to obtain segments formatted as a python list.
  2. To query for double or triple coincident segments, you can specify a comma separated list of interferometer names to the --interferometer option. Note that for coincident segments, you must specify the central server at Caltech. To obtain segments for which L1 and H1 were in double coincident science mode use the command
$ LSCsegFind --server=ldas-cit.ligo.caltech.edu --interferometer L1,H1 --type Science --gps-start-time 793756813 --gps-end-time 794102413

793764485 793767231
793767680 793784113
793784732 793787382
793788056 793796238
793805514 793805694
793808248 793823482
793823568 793831885
793831896 793832532
793832579 793832727
793839576 793840045
793841043 793842838
793843889 793845928
793845947 793847429
793849817 793855200
793856139 793873836
793877308 793879457
793879839 793881136
793881409 793888445
793890759 793895968
793898250 793907660
793907693 793908888
793931292 793950156
793951442 793958125
793958931 793975740
793976166 793985941
793986885 794001768
794004919 794011738
794018389 794022353
794024535 794027186
794028147 794042973
794046531 794058252
794059712 794063622
794068099 794074559
794076100 794080564
794082718 794085619
794088369 794088934
794096014 794099839
794101270 794102413

You will notice that the number of segments returned is larger, but the total time returned is smaller, since long L1 segments have been split up by loss of lock in H1.

  1. To obtain triple coincident segments, simply specify all three interferometer names:
$ LSCsegFind --server=ldas-cit.ligo.caltech.edu --interferometer L1,H1,H2 --type Science --gps-start-time 793756813 --gps-end-time 794102413

793764485 793767231
793767680 793784113
793784732 793787382
793788056 793796226
793808248 793811521
793812190 793823482
793823570 793831885
793831896 793832532
793832579 793832727
793839576 793840045
793841043 793842752
793843889 793845928
793845947 793847429
793849817 793855200
793856139 793873836
793877308 793879457
793879839 793881136
793881409 793888440
793890759 793895968
793898386 793902706
793903533 793907660
793907693 793908888
793931292 793950156
793951442 793958125
793958931 793960838
793963081 793970376
793971041 793975740
793976166 793978778
793979514 793985941
793986885 794001768
794004919 794011738
794018389 794022350
794024535 794027186
794028147 794042970
794046531 794056796
794057806 794058228
794059712 794063605
794068099 794072418
794073182 794074544
794076100 794080510
794082718 794085617
794088369 794088934
794096014 794096703
794097295 794099839
794101270 794102413
  1. Although Science and Injection are probably the most interesting segments, users wishing to run their codes between runs during the astrowatch periods may be interested in the segments Science_Up and Commissioning_Up. In these states the interfereometer is locked and powered up, with the activity set to science or commissioning respectively, however the "conlog stable" and "operator go" bits are not set in the state vector, so the data is not true science mode data.