From 6901f52d5a032e33232a3bbd093e21e5ae20701a Mon Sep 17 00:00:00 2001 From: Marshall Perrin Date: Mon, 2 Mar 2020 17:04:43 -0500 Subject: [PATCH] avoid f-string formatting, to support py3.5 --- webbpsf/optics.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/webbpsf/optics.py b/webbpsf/optics.py index 4b415488..e873a046 100644 --- a/webbpsf/optics.py +++ b/webbpsf/optics.py @@ -1695,14 +1695,14 @@ def __init__(self, instrument, field_points_file=None, phasemap_file=None, # Figure out the closest field point telcoords_am = self.tel_coords.to(units.arcmin).value - print(f"Requested field point has coord {telcoords_am}") + print("Requested field point has coord {telcoords_am}".format(telcoords_am=telcoords_am)) v2 = self.table['V2'] v3 = self.table['V3'] r = np.sqrt((telcoords_am[0] - v2) ** 2 + (telcoords_am[1] - v3) ** 2) closest = np.argmin(r) # if there are two field points with identical coords or equal distance just one is returned - print(f"Closest field point is row {closest}: {self.table[closest]} ") + print("Closest field point is row {}: {} ".format(closest, self.table[closest])) # Save closest ISIM CV3 WFE measured field point for reference self.row = self.table[closest] @@ -1750,7 +1750,7 @@ def __init__(self, instrument, field_points_file=None, phasemap_file=None, coeffs = poppy.zernike.opd_expand_nonorthonormal(self.opd, aperture=apmask, nterms=3) ptt_only = poppy.zernike.opd_from_zernikes(coeffs, aperture=apmask, npix=self.opd.shape[0], outside=0) self.opd -= ptt_only - print(f"Removing piston, tip, tilt from the input wavefront. Coeffs for {self.instr_name}: {coeffs},") + print("Removing piston, tip, tilt from the input wavefront. Coeffs for {}: {},".format(self.instr_name, coeffs)) if add_mimf_defocus: self.instrument.options['defocus_waves'] = 0.8 @@ -1770,7 +1770,7 @@ def header_keywords(self): from collections import OrderedDict keywords = OrderedDict() keywords['SIWFETYP'] = self.si_wfe_type - keywords['SIWFEFPT'] = ( f"{self.row['V2']:.3f}, {self.row['V3']:.3f}", "Closest lookup table meas. field point") + keywords['SIWFEFPT'] = ( "{:.3f}, {:.3f}".format(self.row['V2'], self.row['V3'], "Closest lookup table meas. field point")) return keywords # wrapper just to change default vmax