Package glue :: Module pipeline :: Class ScienceData
[hide private]
[frames] | no frames]

Class ScienceData

source code

An object that can contain all the science data used in an analysis. Can contain multiple ScienceSegments and has a method to generate these from a text file produces by the LIGOtools segwizard program.

Instance Methods [hide private]
 
__getitem__(self, i)
Allows direct access to or iteration over the ScienceSegments associated with the ScienceData.
source code
 
__init__(self) source code
 
__len__(self)
Returns the number of ScienceSegments associated with the ScienceData.
source code
 
__repr__(self) source code
 
append_from_tuple(self, seg_tuple) source code
 
coalesce(self)
Coalesces any adjacent ScienceSegments.
source code
 
intersect_3(self, second, third)
Intersection routine for three inputs.
source code
 
intersect_4(self, second, third, fourth)
Intersection routine for four inputs.
source code
 
intersection(self, other)
Replaces the ScienceSegments contained in this instance of ScienceData with the intersection of those in the instance other.
source code
 
invert(self)
Inverts the ScienceSegments in the class (i.e.
source code
 
make_chunks(self, length, overlap=0, play=0, sl=0, excl_play=0, pad_data=0)
Divide each ScienceSegment contained in this object into AnalysisChunks.
source code
 
make_chunks_from_unused(self, length, trig_overlap, play=0, min_length=0, sl=0, excl_play=0, pad_data=0)
Create an extra chunk that uses up the unused data in the science segment.
source code
 
make_optimised_chunks(self, min_length, max_length, pad_data=0)
Splits ScienceSegments up into chunks, of a given maximum length.
source code
 
make_short_chunks_from_unused(self, min_length, overlap=0, play=0, sl=0, excl_play=0)
Create a chunk that uses up the unused data in the science segment
source code
 
play(self)
Keep only times in ScienceSegments which are in the playground
source code
 
read(self, filename, min_length, slide_sec=0, buffer=0)
Parse the science segments from the segwizard output contained in file.
source code
 
split(self, dt)
Split the segments in the list is subsegments at least as long as dt
source code
 
tama_read(self, filename)
Parse the science segments from a tama list of locked segments contained in file.
source code
 
union(self, other)
Replaces the ScienceSegments contained in this instance of ScienceData with the union of those in the instance other.
source code
Method Details [hide private]

coalesce(self)

source code 

Coalesces any adjacent ScienceSegments. Returns the number of ScienceSegments in the coalesced list.

intersect_3(self, second, third)

source code 

Intersection routine for three inputs. Built out of the intersect, coalesce and play routines

intersection(self, other)

source code 

Replaces the ScienceSegments contained in this instance of ScienceData with the intersection of those in the instance other. Returns the number of segments in the intersection.

Parameters:
  • other - ScienceData to use to generate the intersection

invert(self)

source code 

Inverts the ScienceSegments in the class (i.e. set NOT). Returns the number of ScienceSegments after inversion.

make_chunks(self, length, overlap=0, play=0, sl=0, excl_play=0, pad_data=0)

source code 

Divide each ScienceSegment contained in this object into AnalysisChunks.

Parameters:
  • length - length of chunk in seconds.
  • overlap - overlap between segments.
  • play - if true, only generate chunks that overlap with S2 playground data.
  • sl - slide by sl seconds before determining playground data.
  • excl_play - exclude the first excl_play second from the start and end of the chunk when computing if the chunk overlaps with playground.

make_chunks_from_unused(self, length, trig_overlap, play=0, min_length=0, sl=0, excl_play=0, pad_data=0)

source code 

Create an extra chunk that uses up the unused data in the science segment.

Parameters:
  • length - length of chunk in seconds.
  • trig_overlap - length of time start generating triggers before the start of the unused data.
  • play -
    • 1 : only generate chunks that overlap with S2 playground data.
    • 2 : as 1 plus compute trig start and end times to coincide with the start/end of the playground
  • min_length - the unused data must be greater than min_length to make a chunk.
  • sl - slide by sl seconds before determining playground data.
  • excl_play - exclude the first excl_play second from the start and end of the chunk when computing if the chunk overlaps with playground.
  • pad_data - exclude the first and last pad_data seconds of the segment when generating chunks

make_optimised_chunks(self, min_length, max_length, pad_data=0)

source code 

Splits ScienceSegments up into chunks, of a given maximum length. The length of the last two chunks are chosen so that the data utilisation is optimised.

Parameters:
  • min_length - minimum chunk length.
  • max_length - maximum chunk length.
  • pad_data - exclude the first and last pad_data seconds of the segment when generating chunks

make_short_chunks_from_unused(self, min_length, overlap=0, play=0, sl=0, excl_play=0)

source code 

Create a chunk that uses up the unused data in the science segment

Parameters:
  • min_length - the unused data must be greater than min_length to make a chunk.
  • overlap - overlap between chunks in seconds.
  • play - if true, only generate chunks that overlap with S2 playground data.
  • sl - slide by sl seconds before determining playground data.
  • excl_play - exclude the first excl_play second from the start and end of the chunk when computing if the chunk overlaps with playground.

read(self, filename, min_length, slide_sec=0, buffer=0)

source code 

Parse the science segments from the segwizard output contained in file.

Parameters:
  • filename - input text file containing a list of science segments generated by segwizard.
  • min_length - only append science segments that are longer than min_length.
  • slide_sec - Slide each ScienceSegment by:
     delta > 0:
       [s,e] -> [s+delta,e].
     delta < 0:
       [s,e] -> [s,e-delta].
    
  • buffer - shrink the ScienceSegment:
     [s,e] -> [s+buffer,e-buffer]
    

tama_read(self, filename)

source code 

Parse the science segments from a tama list of locked segments contained in
            file.
@param filename: input text file containing a list of tama segments.

union(self, other)

source code 

Replaces the ScienceSegments contained in this instance of ScienceData with the union of those in the instance other. Returns the number of ScienceSegments in the union.

Parameters:
  • other - ScienceData to use to generate the intersection