コード例 #1
0
            gals = CatalogDBObject.from_objid('galaxyBulge')
            galaxy_phoSim = PhoSimCatalogSersic2D(gals, obs_metadata=obs_metadata)
            break
        except RuntimeError:
            continue
    galaxy_phoSim.write_catalog(filename,write_mode='a',write_header=False,chunk_size=20000)
    print 'bulge'

    while True:
        try:
            gals = CatalogDBObject.from_objid('galaxyDisk')
            galaxy_phoSim = PhoSimCatalogSersic2D(gals, obs_metadata=obs_metadata)
            break
        except RuntimeError:
            continue
    galaxy_phoSim.write_catalog(filename,write_mode='a',write_header=False,chunk_size=20000)
    print 'disk'


    #PhoSimCatalogZPoint is the phoSim input class for extragalactic point sources (there will be no parallax
    #or proper motion)
    while True:
        try:
            gals = CatalogDBObject.from_objid('galaxyAgn')
            galaxy_phoSim = PhoSimCatalogZPoint(gals, obs_metadata=obs_metadata)
            break
        except RuntimeError:
            continue
    galaxy_phoSim.write_catalog(filename,write_mode='a',write_header=False,chunk_size=20000)
    print 'agn'
コード例 #2
0
    stars = CatalogDBObject.from_objid(starName)
    star_phoSim=PhoSimCatalogPoint(stars,obs_metadata=obs_metadata) #the class for phoSim input files
                                                                #containing point sources
    if (doHeader):
        with open("phoSim_example.txt","w") as fh:
            star_phoSim.write_header(fh)
        doHeader = False

    #below, write_header=False prevents the code from overwriting the header just written
    #write_mode = 'a' allows the code to append the new objects to the output file, rather
    #than overwriting the file for each different class of object.
    star_phoSim.write_catalog("phoSim_example.txt",write_mode='a',write_header=False,chunk_size=20000)

gals = CatalogDBObject.from_objid('galaxyBulge')

#now append a bunch of objects with 2D sersic profiles to our output file
galaxy_phoSim = PhoSimCatalogSersic2D(gals, obs_metadata=obs_metadata)
galaxy_phoSim.write_catalog("phoSim_example.txt",write_mode='a',write_header=False,chunk_size=20000)

gals = CatalogDBObject.from_objid('galaxyDisk')
galaxy_phoSim = PhoSimCatalogSersic2D(gals, obs_metadata=obs_metadata)
galaxy_phoSim.write_catalog("phoSim_example.txt",write_mode='a',write_header=False,chunk_size=20000)

gals = CatalogDBObject.from_objid('sprinklerAGN')
#gals = CatalogDBObject.from_objid('galaxyAgn')

#PhoSimCatalogZPoint is the phoSim input class for extragalactic point sources (there will be no parallax
#or proper motion)
galaxy_phoSim = PhoSimCatalogZPoint(gals, obs_metadata=obs_metadata)
galaxy_phoSim.write_catalog("phoSim_example.txt",write_mode='a',write_header=False,chunk_size=20000)
コード例 #3
0
    star_phoSim.write_catalog("phoSim_example.txt",
                              write_mode='a',
                              write_header=False,
                              chunk_size=20000)

gals = CatalogDBObject.from_objid('galaxyBulge')

#now append a bunch of objects with 2D sersic profiles to our output file
galaxy_phoSim = PhoSimCatalogSersic2D(gals, obs_metadata=obs_metadata)
galaxy_phoSim.write_catalog("phoSim_example.txt",
                            write_mode='a',
                            write_header=False,
                            chunk_size=20000)

gals = CatalogDBObject.from_objid('galaxyDisk')
galaxy_phoSim = PhoSimCatalogSersic2D(gals, obs_metadata=obs_metadata)
galaxy_phoSim.write_catalog("phoSim_example.txt",
                            write_mode='a',
                            write_header=False,
                            chunk_size=20000)

gals = CatalogDBObject.from_objid('galaxyAgn')

#PhoSimCatalogZPoint is the phoSim input class for extragalactic point sources (there will be no parallax
#or proper motion)
galaxy_phoSim = PhoSimCatalogZPoint(gals, obs_metadata=obs_metadata)
galaxy_phoSim.write_catalog("phoSim_example.txt",
                            write_mode='a',
                            write_header=False,
                            chunk_size=20000)