Skip to content

Commit

Permalink
nproc optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
JarronL committed May 19, 2020
1 parent f99e1d1 commit 128fb40
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pynrc/nrc_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1456,7 +1456,7 @@ def wfed_coeff(filter_or_bp, force=False, save=True, save_name=None, nsplit=None
except:
coron_obs = False
if nsplit is None:
nsplit = nproc_use(kwargs['fov_pix'], kwargs['oversample'], 50, coron=coron_obs)
nsplit = nproc_use(kwargs['fov_pix'], kwargs['oversample'], nwfe, coron=coron_obs)

# Create worker arguments with kwargs as an argument input
worker_args = []
Expand Down Expand Up @@ -1631,6 +1631,7 @@ def field_coeff_resid(filter_or_bp, coeff0, force=False, save=True, save_name=No
igood = v3_all > v3_min
v2_all = np.append(v2_all[igood], [v2_min, v2_max, v2_min, v2_max])
v3_all = np.append(v3_all[igood], [v3_min, v3_min, v3_max, v3_max])
npos = len(v2_all)

# First is default value
#kwargs['detector'] = None
Expand All @@ -1639,15 +1640,14 @@ def field_coeff_resid(filter_or_bp, coeff0, force=False, save=True, save_name=No
#cf0 = gen_psf_coeff(filter, **kwargs)
kwargs['include_si_wfe'] = True


# Split over multiple processors?
try:
pupil = kwargs['pupil']
coron_obs = (pupil is not None) and ('LYOT' in pupil)
except:
coron_obs = False
if nsplit is None:
nsplit = nproc_use(kwargs['fov_pix'], kwargs['oversample'], 50, coron=coron_obs)
nsplit = nproc_use(kwargs['fov_pix'], kwargs['oversample'], npos, coron=coron_obs)

# Create worker arguments with kwargs as an input dict
worker_args = []
Expand Down

0 comments on commit 128fb40

Please sign in to comment.