예제 #1
0
    def setUp(self):
        #Clearly this is nonsense, but we're just testing syntax in a
        # non-functional library...
        self.transients = [{'runcat':'1', 'band':'1'}]

        with open(default_parset_paths['classification.parset']) as f:
            self.parset = parset.read_config_section(f, 'classification')
예제 #2
0
    def test_round_trip(self):
        bufout = StringIO.StringIO()
        parset.write_config_section(bufout, self.section, self.parset)
        bufin = StringIO.StringIO(bufout.getvalue())
        parsed = parset.read_config_section(bufin, self.section)
#        print parsed
        self.assertEqual(self.parset, parsed)
예제 #3
0
파일: inject.py 프로젝트: pombredanne/tkp
def main():
    parset_file, target_files, overwrite = parse_arguments()
    with open(parset_file) as fp:
        parset = read_config_section(fp, "inject")

    for target_file in target_files:
        # Normally accessors.open checks this, but we're going straight
        # to detect here because we don't want to actually open it:
        if not os.path.isfile(target_file) or os.path.isdir(target_file):
            print "File not found: %s (check path is correct?)" % target_file
            continue
        print "injecting data into %s" % target_file
        accessor_class = tkp.accessors.detection.detect(target_file)

        if accessor_class == LofarFitsImage:
            modify_fits_headers(parset, target_file, overwrite)
        elif accessor_class == LofarCasaImage:
            modify_casa_headers(parset, target_file)
        else:
            print "ERROR: %s is in a unknown format" % target_file
예제 #4
0
 def setUpClass(cls):
     cls.dataset_id = db_subs.create_dataset_8images()
     cls.images = [testdata.fits_file]
     cls.extraction_radius = 256
     with open(default_parset_paths['persistence.parset']) as f:
         cls.parset = parset.read_config_section(f, 'persistence')
예제 #5
0
 def setUpClass(cls):
     cls.dataset_id = db_subs.create_dataset_8images(extract_sources=True)
     with open(default_parset_paths['transient_search.parset']) as f:
         cls.parset = parset.read_config_section(f, 'transient_search')
예제 #6
0
 def setUpClass(cls):
     cls.accessor = tkp.accessors.open(testdata.casa_table)
     with open(default_parset_paths['quality_check.parset']) as f:
         cls.parset = parset.read_config_section(f, 'quality_lofar')
예제 #7
0
 def setUpClass(cls):
     cls.dataset_id = db_subs.create_dataset_8images()
     with open(default_parset_paths['source_extraction.parset']) as f:
         cls.parset = parset.read_config_section(f, 'source_extraction')