lsst-ts / ts_phosim

High-Level Module to Perturb the PhoSim
GNU General Public License v3.0
0 stars 1 forks source link

FilterTypeRef 'ref' not supported by ts_ofc #61

Open suberlak opened 2 years ago

suberlak commented 2 years ago

Despite https://github.com/lsst-ts/ts_phosim/blob/467a40d106d41c82c2d561a4593b33221f9b6ff3/python/lsst/ts/phosim/CloseLoopTask.py#L420 allowing for filterTypeName in {"", "ref"}

the ts_ofc does not allow that; when passing to closeLoopTask filterTypeName='ref' I get

File /project/scichris/aos/ts_ofc/python/lsst/ts/ofc/ofc_data/ofc_data.py:288, in OFCData.get_intrinsic_zk(self, filter_name, field_idx)
    271 """Return reformated instrisic zernike coefficients.
    272 
    273 Parameters
   (...)
    285     If `filter_name` not valid.
    286 """
    287 if filter_name not in self.intrinsic_zk:
--> 288     raise RuntimeError(
    289         f"Invalid filter name {filter_name}. Must be one of {self.intrinsic_zk.keys()}."
    290     )
    292 _field_idx = (
    293     field_idx
    294     if field_idx is not None
    295     else np.arange(self.intrinsic_zk[filter_name].shape[0])
    296 )
    298 return (
    299     self.intrinsic_zk[filter_name][
    300         np.ix_(
   (...)
    305     * self.eff_wavelength[filter_name]
    306 )

RuntimeError: Invalid filter name ref. Must be one of dict_keys(['U', 'R', 'Z', '', 'G', 'I', 'Y']).

This is probably because the default for closeLoopTask is filterTypeName = ''. One solution is dropping option of allowing ref string in ts_phosim for filterTypeName

teweitsai commented 2 years ago

The reference wavelength is 500 nm, which should belong to G band (?, need to check). Some parameters Bo provided have the specific fitting for this wavelength, and some are not.