Skip to content

Commit

Permalink
replace deprecated Tel2Sci with tel_to_sci
Browse files Browse the repository at this point in the history
  • Loading branch information
JarronL committed Apr 8, 2020
1 parent cfa8e14 commit a3b7404
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
6 changes: 5 additions & 1 deletion pynrc/maths/coords.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,11 @@ def Tel2Sci_info(channel, coords, output="Sci"):
cens = []
for apname in apnames:
ap = mysiaf[apname]
cens.append(ap.Tel2Sci(V2, V3))
try:
vals = ap.Tel2Sci(V2, V3)
except AttributeError:
vals = ap.tel_to_sci(V2, V3)
cens.append(vals)
cens = np.array(cens)

# Select that with the closest position
Expand Down
6 changes: 3 additions & 3 deletions pynrc/nrc_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1641,7 +1641,7 @@ def field_coeff(filter, coeff0, force=False, save=True, save_name=None, **kwargs
>>> from pynrc import nrc_utils
>>> fpix, osamp = (128, 4)
>>> coeff = nrc_utils.psf_coeff('F210M', fov_pix=fpix, oversample=osamp)
>>> cf_resid = nrc_utils.field_coeff('F210M', fov_pix=fpix, oversample=osamp)
>>> cf_resid = nrc_utils.field_coeff('F210M', coeff, fov_pix=fpix, oversample=osamp)
>>> # Some (V2,V3) location (arcmin)
>>> v2, v3 = (1.2, -7)
Expand Down Expand Up @@ -1709,12 +1709,12 @@ def field_coeff(filter, coeff0, force=False, save=True, save_name=None, **kwargs

cf_fields = []
for (v2, v3) in values:
_log.debug('Field Coordinates: {}'.format((v2, v3)))

# Get the detector and pixel position
coords = (v2*60, v3*60) # in arcsec
det, det_pos = Tel2Sci_info(channel, coords, output="Sci")

_log.debug('V2/V3 Coordinates and det pixel (sci): ({}), ({})'.format((v2, v3), det_pos))

kwargs['detector'] = det
kwargs['detector_position'] = det_pos

Expand Down
8 changes: 5 additions & 3 deletions pynrc/pynrc_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,10 @@ class NIRCam(object):
Keyword Args
------------
fov_pix : int
Size of the FoV in pixels (real SW or LW pixels).
Size of the PSF FoV in pixels (real SW or LW pixels).
The defaults depend on the type of observation.
Odd number place the PSF on the center of the pixel,
whereas an even number centers it on the "crosshairs."
oversample : int
Factor to oversample during WebbPSF calculations.
Default 2 for coronagraphy and 4 otherwise.
Expand Down Expand Up @@ -823,7 +825,7 @@ def update_from_SIAF(self, apname, pupil=None, **kwargs):
self._ND_acq = ND_acq

# Filter stuff
fsw_def, flw_def = ('F210M', 'F430M')
fsw_def, flw_def = ('F210M', 'F430M') # Defaults
if filter is not None: self._filter = filter
try:
if self._filter is None:
Expand Down Expand Up @@ -1165,7 +1167,7 @@ def update_psf_coeff(self, fov_pix=None, oversample=None,
Parameters
----------
fov_pix : int
Size of the FoV in pixels (real SW or LW pixels).
Size of the PSF FoV in pixels (real SW or LW pixels).
The defaults depend on the type of observation.
Odd number place the PSF on the center of the pixel,
whereas an even number centers it on the "crosshairs."
Expand Down

0 comments on commit a3b7404

Please sign in to comment.