diff --git a/ObservationSim/Config/Header/ImageHeader.py b/ObservationSim/Config/Header/ImageHeader.py index 02f2c0a2b81b95821d5c8f4fd54dccb55b9732ab..6959253b38494409806d41217bb27e44e77144cb 100644 --- a/ObservationSim/Config/Header/ImageHeader.py +++ b/ObservationSim/Config/Header/ImageHeader.py @@ -385,7 +385,7 @@ def generatePrimaryHeader(xlen = 9216, ylen = 9232, pointNum = '1', ra = 60, dec h_prim['EXPTIME'] = exptime # Define file types - file_type = {'SCI':'SCIE', 'BIAS':'BIAS', 'DARK':'DARK', 'FLAT':'FLAT', 'CRS':'cosmic_ray', 'CRD':'CRD','CALS':'CALS','CALF':'CALF'} + file_type = {'SCI':'SCIE', 'BIAS':'BIAS', 'DARK':'DARK', 'FLAT':'FLAT', 'CRS':'CRS', 'CRD':'CRD','CALS':'CALS','CALF':'CALF'} h_prim['FILETYPE'] = file_type[im_type] co = coord.SkyCoord(ra, dec, unit='deg') diff --git a/ObservationSim/MockObject/__init__.py b/ObservationSim/MockObject/__init__.py index 83febe24fd292052aef8242970e4616db7da7514..8faeb8a8c8736b6603c8dc24f8212d82c6741f9e 100755 --- a/ObservationSim/MockObject/__init__.py +++ b/ObservationSim/MockObject/__init__.py @@ -4,5 +4,5 @@ from .CatalogBase import CatalogBase from .Quasar import Quasar from .Star import Star from .Stamp import Stamp -from .SkybackgroundMap import * +# from .SkybackgroundMap import * # from .CosmicRay import CosmicRay diff --git a/ObservationSim/ObservationSim.py b/ObservationSim/ObservationSim.py index 8bd504bed1fb57cb650e609710925e71aec39075..da3e9f16ae8f973540f01553d46377e621cfefab 100755 --- a/ObservationSim/ObservationSim.py +++ b/ObservationSim/ObservationSim.py @@ -14,7 +14,7 @@ from ObservationSim.Config import config_dir, ChipOutput from ObservationSim.Config.Header import generatePrimaryHeader, generateExtensionHeader from ObservationSim.Instrument import Telescope, Filter, FilterParam, FocalPlane, Chip from ObservationSim.Instrument.Chip import Effects -from ObservationSim.MockObject import calculateSkyMap_split_g +from ObservationSim.Straylight import calculateSkyMap_split_g from ObservationSim.PSF import PSFGauss, FieldDistortion, PSFInterp from ObservationSim._util import get_shear_field, makeSubDir_PointingList from ObservationSim.Astrometry.Astrometry_util import on_orbit_obs_position diff --git a/ObservationSim/MockObject/SkybackgroundMap.py b/ObservationSim/Straylight/SkybackgroundMap.py similarity index 96% rename from ObservationSim/MockObject/SkybackgroundMap.py rename to ObservationSim/Straylight/SkybackgroundMap.py index 3d8d77606f1742121e6866a43aee4c4ac467e48e..2b4e204bf77d5f2783bc193e08dccf66042646b5 100644 --- a/ObservationSim/MockObject/SkybackgroundMap.py +++ b/ObservationSim/Straylight/SkybackgroundMap.py @@ -45,10 +45,10 @@ def calculateSkyMap_split_g(skyMap=None, blueLimit=4200, redLimit=6500, skyfn='s fImg = galsim.Image(fimg) try: - with pkg_resources.files('ObservationSim.MockObject.data').joinpath(skyfn) as data_path: + with pkg_resources.files('ObservationSim.Straylight.data.sky').joinpath(skyfn) as data_path: skySpec = np.loadtxt(data_path) except AttributeError: - with pkg_resources.path('ObservationSim.MockObject.data', skyfn) as data_path: + with pkg_resources.path('ObservationSim.Straylight.data.sky', skyfn) as data_path: skySpec = np.loadtxt(data_path) # skySpec = np.loadtxt(skyfn) spec = Table(np.array([skySpec[:, 0], skySpec[:, 1]]).T, names=('WAVELENGTH', 'FLUX')) @@ -277,10 +277,10 @@ def calculateSkyMap(xLen=9232, yLen=9126, blueLimit=4200, redLimit=6500, fimg = np.zeros_like(skyMap) fImg = galsim.Image(fimg) try: - with pkg_resources.files('ObservationSim.MockObject.data').joinpath(skyfn) as data_path: + with pkg_resources.files('ObservationSim.Straylight.data.sky').joinpath(skyfn) as data_path: skySpec = np.loadtxt(data_path) except AttributeError: - with pkg_resources.path('ObservationSim.MockObject.data', skyfn) as data_path: + with pkg_resources.path('ObservationSim.Straylight.data.sky', skyfn) as data_path: skySpec = np.loadtxt(data_path) # skySpec = np.loadtxt(skyfn) diff --git a/ObservationSim/Straylight/Straylight.py b/ObservationSim/Straylight/Straylight.py index a10881b6dff0a4e2819eef26f7347c5397c9fd0b..ee052579ee7b5375868aa30a12fb1cd0f9dcf382 100644 --- a/ObservationSim/Straylight/Straylight.py +++ b/ObservationSim/Straylight/Straylight.py @@ -110,10 +110,10 @@ class Straylight(object): self.slcdll = ctypes.CDLL(dllFn) elif platForm == 'linux': try: - with pkg_resources.files('ObservationSim.Straylight.so').joinpath('libstraylight.dylib') as dllFn: + with pkg_resources.files('ObservationSim.Straylight.lib').joinpath('libstraylight.so') as dllFn: self.slcdll = ctypes.CDLL(dllFn) except AttributeError: - with pkg_resources.path('ObservationSim.Straylight.so', 'libstraylight.dylib') as dllFn: + with pkg_resources.path('ObservationSim.Straylight.lib', 'libstraylight.so') as dllFn: self.slcdll = ctypes.CDLL(dllFn) # self.slcdll=ctypes.CDLL('./libstraylight.dylib') self.slcdll.Calculate.argtypes = [ctypes.c_double, ctypes.POINTER(ctypes.c_double), diff --git a/ObservationSim/Straylight/__init__.py b/ObservationSim/Straylight/__init__.py index 7e305da25559a952f599e051555298088a250041..becfbaf32858e0bd858405ef22117f86908cffd8 100755 --- a/ObservationSim/Straylight/__init__.py +++ b/ObservationSim/Straylight/__init__.py @@ -1,2 +1,2 @@ from .Straylight import Straylight - +from .SkybackgroundMap import * diff --git a/ObservationSim/MockObject/data/sky_emiss_hubble_50_50_A.dat b/ObservationSim/Straylight/data/sky/sky_emiss_hubble_50_50_A.dat similarity index 100% rename from ObservationSim/MockObject/data/sky_emiss_hubble_50_50_A.dat rename to ObservationSim/Straylight/data/sky/sky_emiss_hubble_50_50_A.dat