Skip to content

Commit

Permalink
Fix depr warning in fringing variation level
Browse files Browse the repository at this point in the history
  • Loading branch information
jmeyers314 committed Mar 19, 2024
1 parent 2a0f1e4 commit 7237452
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
Binary file added data/fringing_data/skyline_var.fits
Binary file not shown.
Binary file removed data/fringing_data/skyline_var.pkl
Binary file not shown.
20 changes: 13 additions & 7 deletions imsim/sky_model.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

from astropy.io import fits
import copy
import warnings
import numpy as np
import galsim
import pickle
from galsim.config import InputLoader, RegisterInputType, RegisterValueType
from scipy.interpolate import RegularGridInterpolator
from scipy.interpolate import RegularGridInterpolator, RectBivariateSpline
import os
from .meta_data import data_dir

Expand Down Expand Up @@ -198,11 +198,17 @@ def fringe_variation_level(self):

if self.spatial_vary:
# Load 2d interpolator for OH spatial variation
filename = os.path.join(data_dir, 'fringing_data',
'skyline_var.pkl')
with open(filename, 'rb') as f:
interp = pickle.load(f)

filename = os.path.join(
data_dir,
'fringing_data',
'skyline_var.fits'
)
hdu = fits.open(filename)[0]
z = hdu.data
nx, ny = z.shape
x = np.linspace(hdu.header['XMIN'], hdu.header['XMAX'], nx)
y = np.linspace(hdu.header['YMIN'], hdu.header['YMAX'], ny)
interp = RectBivariateSpline(x, y, z)
dx, dy = self.boresight.project(self.true_center)
# calculated OH flux level wrst the center of focal plane.
level = interp(dx.deg,dy.deg)/interp(0,0)
Expand Down

0 comments on commit 7237452

Please sign in to comment.