Skip to content

Commit

Permalink
Update nrc_utils.py
Browse files Browse the repository at this point in the history
  • Loading branch information
JarronL committed May 18, 2020
1 parent a7ca083 commit 6791898
Showing 1 changed file with 22 additions and 25 deletions.
47 changes: 22 additions & 25 deletions pynrc/nrc_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1357,6 +1357,15 @@ def gen_webbpsf_siwfe(filter_or_bp, coords, pynrc_mod=True, **kwargs):
return gen_webbpsf_psf(filter, pynrc_mod=pynrc_mod, **kwargs)


def _wrap_wfed_coeff_for_mp(arg):
args, kwargs = arg

wfe = kwargs['wfe_drift']
_log.info('WFE Drift: {} nm'.format(wfe))

cf, _ = gen_psf_coeff(*args, **kwargs)
return cf

def wfed_coeff(filter_or_bp, force=False, save=True, save_name=None, nsplit=None, **kwargs):
"""PSF Coefficient Mod for WFE Drift
Expand Down Expand Up @@ -1403,15 +1412,6 @@ def wfed_coeff(filter_or_bp, force=False, save=True, save_name=None, nsplit=None
>>> psf5nm = nrc_utils.gen_image_coeff('F210M', coeff=cf_new, fov_pix=fpix, oversample=osamp)
"""

def _wrap_wfed_coeff_for_mp(arg):
args, kwargs = arg

wfe = kwargs['wfe_drift']
_log.info('WFE Drift: {} nm'.format(wfe))

cf, _ = gen_psf_coeff(*args, **kwargs)
return cf

kwargs['force'] = True
kwargs['save'] = False
kwargs['save_name'] = None
Expand Down Expand Up @@ -1508,6 +1508,19 @@ def _wrap_wfed_coeff_for_mp(arg):

return cf_fit, lxmap

def _wrap_field_coeff_for_mp(arg):
args, kwargs = arg

apname = kwargs['apname']
det = kwargs['detector']
det_pos = kwargs['detector_position']
v2, v3 = kw['coords']

print('V2/V3 Coordinates and det pixel (sci) on {}/{}: ({:.2f}, {:.2f}), ({:.1f}, {:.1f})'
.format(det, apname, v2/60, v3/60, det_pos[0], det_pos[1]))

cf, _ = gen_psf_coeff(*args, **kwargs)
return cf

def field_coeff_resid(filter_or_bp, coeff0, force=False, save=True, save_name=None,
return_raw=False, nsplit=None, **kwargs):
Expand Down Expand Up @@ -1552,22 +1565,6 @@ def field_coeff_resid(filter_or_bp, coeff0, force=False, save=True, save_name=No

from astropy.table import Table

def _wrap_field_coeff_for_mp(arg):
args, kwargs = arg

apname = kwargs['apname']
det = kwargs['detector']
det_pos = kwargs['detector_position']
v2, v3 = kw['coords']

print('V2/V3 Coordinates and det pixel (sci) on {}/{}: ({:.2f}, {:.2f}), ({:.1f}, {:.1f})'
.format(det, apname, v2/60, v3/60, det_pos[0], det_pos[1]))

cf, _ = gen_psf_coeff(*args, **kwargs)
return cf



kwargs['force'] = True
kwargs['save'] = False
kwargs['save_name'] = None
Expand Down

0 comments on commit 6791898

Please sign in to comment.