wcc-etc 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- wcc_etc/__init__.py +92 -0
- wcc_etc/airy.py +597 -0
- wcc_etc/astro.py +47 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/AA_README_BROWN +153 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/arp_118_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/arp_256_n_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/arp_256_s_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/cgcg_049-057_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/cgcg_436-030_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/cgcg_453-062_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/haro_06_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ic_0691_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ic_0860_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ic_0883_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ic_4051_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ic_4553_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ic_5298_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ii_zw_096_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/iii_zw_035_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/iras_08572+3915_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/iras_17208-0014_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/mrk_0331_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/mrk_0475_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/mrk_0930_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/mrk_1450_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/mrk_1490_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/mrk_33_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_0337_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_0474_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_0520_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_0584_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_0628_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_0660_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_0695_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_0750_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_0855_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_1068_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_1144_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_1275_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_1614_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_2388_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_2403_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_2537_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_2623_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_2798_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_3049_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_3079_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_3190_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_3198_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_3265_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_3310_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_3351_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_3379_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_3521_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_3627_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_3690_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_3773_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_3870_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_3938_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_4088_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_4125_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_4138_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_4168_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_4194_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_4254_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_4321_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_4365_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_4385_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_4387_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_4450_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_4458_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_4473_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_4486_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_4536_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_4550_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_4551_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_4552_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_4559_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_4569_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_4579_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_4594_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_4621_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_4625_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_4631_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_4660_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_4670_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_4676_a_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_4725_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_4826_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_4860_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_4889_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_4926_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_5033_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_5055_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_5104_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_5194_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_5195_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_5256_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_5257_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_5258_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_5653_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_5713_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_5866_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_5953_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_5992_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_6052_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_6090_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_6240_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_7331_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_7585_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_7591_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_7592_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_7673_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_7674_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_7679_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_7714_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ngc_7771_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ugc_04881_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ugc_05101_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ugc_06665_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ugc_06850_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ugc_08335_nw_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ugc_08335_se_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ugc_08696_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ugc_09618_n_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ugc_09618_s_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ugc_09618_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ugc_12150_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ugca_166_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ugca_208_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ugca_219_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/ugca_410_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/galaxies/brown/um_461_spec.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/README.md +1 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk.fits +1 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_1.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_10.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_100.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_101.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_102.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_103.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_104.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_105.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_106.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_107.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_108.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_109.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_11.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_110.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_111.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_112.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_113.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_114.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_115.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_116.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_117.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_118.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_119.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_12.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_120.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_121.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_122.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_123.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_124.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_125.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_126.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_127.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_128.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_129.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_13.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_130.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_131.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_14.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_15.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_16.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_17.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_18.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_19.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_2.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_20.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_21.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_22.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_23.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_24.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_25.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_26.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_27.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_28.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_29.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_3.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_30.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_31.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_32.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_33.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_34.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_35.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_36.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_37.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_38.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_39.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_4.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_40.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_41.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_42.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_43.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_44.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_45.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_46.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_47.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_48.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_49.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_5.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_50.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_51.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_52.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_53.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_54.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_55.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_56.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_57.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_58.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_59.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_6.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_60.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_61.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_62.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_63.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_64.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_65.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_66.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_67.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_68.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_69.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_7.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_70.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_71.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_72.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_73.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_74.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_75.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_76.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_77.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_78.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_79.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_8.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_80.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_81.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_82.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_83.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_84.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_85.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_86.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_87.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_88.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_89.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_9.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_90.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_91.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_92.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_93.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_94.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_95.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_96.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_97.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_98.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/dat_uvk/pickles_uk_99.fits +0 -0
- wcc_etc/data/astr_obj_models/stars/pickles_models/pickles_mapping.csv +80 -0
- wcc_etc/data/astrophysics/README.md +6 -0
- wcc_etc/data/astrophysics/alpha_lyr_stis_011.fits +668 -5
- wcc_etc/data/astrophysics/hsiao07.dat +2402 -0
- wcc_etc/data/astrophysics/zodiacal_model_001.fits +0 -0
- wcc_etc/data/config/astro.toml +2 -0
- wcc_etc/data/config/lazuli.toml +9 -0
- wcc_etc/data/config/qcmos.toml +22 -0
- wcc_etc/data/config/zwo.toml +14 -0
- wcc_etc/data/psfs/CAD_1-waves-defocus_500nm_Huygens-PSF-Data_Linear.fits +0 -0
- wcc_etc/data/psfs/CAD_2-waves-defocus_500nm_Huygens-PSF-Data_Linear.fits +0 -0
- wcc_etc/data/sensors/README.md +1 -0
- wcc_etc/data/sensors/ZWO_ASI6200MM/ZWO_ASI6200MM_Pro_Dark_Current_vs_Sensor_Temperature.csv +22 -0
- wcc_etc/data/sensors/ZWO_ASI6200MM/ZWO_ASI6200MM_Pro_Gain_vs_Gain_Setting.csv +12 -0
- wcc_etc/data/sensors/ZWO_ASI6200MM/ZWO_ASI6200MM_Pro_QE_curve.csv +98 -0
- wcc_etc/data/sensors/ZWO_ASI6200MM/ZWO_ASI6200MM_Pro_QE_curve.fits +0 -0
- wcc_etc/data/sensors/ZWO_ASI6200MM/ZWO_ASI6200MM_Pro_Read_Noise_vs_Gain_Setting.csv +13 -0
- wcc_etc/data/sensors/ZWO_ASI6200MM/ZWO_ASI6200MM_Pro_Well_Depth_vs_Gain_Setting.csv +12 -0
- wcc_etc/data/sensors/ZWO_ASI6200MM/readme.md +8 -0
- wcc_etc/data/sensors/qCMOS/HWK4123_sensor_parameters.txt +13 -0
- wcc_etc/data/sensors/qCMOS/qCMOS_QE.csv +232 -0
- wcc_etc/data/sensors/qCMOS/qCMOS_nonlinearity_scaling.csv +55 -0
- wcc_etc/data/sensors/sony_imx992/sony_qe_digitized.csv +77 -0
- wcc_etc/data/throughput/20260304_wcc_throughputs/20260304_telescope_plus_wcc_various_filters_sensors.csv +162 -0
- wcc_etc/data/throughput/20260304_wcc_throughputs/wcc_hwk_bb_throughput.csv +162 -0
- wcc_etc/data/throughput/20260304_wcc_throughputs/wcc_hwk_g_throughput.csv +162 -0
- wcc_etc/data/throughput/20260304_wcc_throughputs/wcc_hwk_i_throughput.csv +162 -0
- wcc_etc/data/throughput/20260304_wcc_throughputs/wcc_hwk_r_throughput.csv +162 -0
- wcc_etc/data/throughput/20260304_wcc_throughputs/wcc_hwk_u_throughput.csv +162 -0
- wcc_etc/data/throughput/20260304_wcc_throughputs/wcc_hwk_z_throughput.csv +162 -0
- wcc_etc/data/throughput/20260304_wcc_throughputs/wcc_imx_Ha_20nm_EOL.csv +8003 -0
- wcc_etc/data/throughput/20260304_wcc_throughputs/wcc_imx_Ha_2nm_EOL.csv +8003 -0
- wcc_etc/data/throughput/20260304_wcc_throughputs/wcc_imx_Ha_6nm_EOL.csv +8003 -0
- wcc_etc/data/throughput/20260304_wcc_throughputs/wcc_imx_bb_throughput.csv +162 -0
- wcc_etc/data/throughput/20260304_wcc_throughputs/wcc_imx_g_throughput.csv +162 -0
- wcc_etc/data/throughput/20260304_wcc_throughputs/wcc_imx_i_throughput.csv +162 -0
- wcc_etc/data/throughput/20260304_wcc_throughputs/wcc_imx_r_throughput.csv +162 -0
- wcc_etc/data/throughput/20260304_wcc_throughputs/wcc_imx_u_throughput.csv +162 -0
- wcc_etc/data/throughput/20260304_wcc_throughputs/wcc_imx_z_throughput.csv +162 -0
- wcc_etc/data/throughput/other_filters/SLOAN_SDSS.gprime_filter.dat +2231 -0
- wcc_etc/data/throughput/other_filters/SLOAN_SDSS.iprime_filter.dat +2335 -0
- wcc_etc/data/throughput/other_filters/SLOAN_SDSS.rprime_filter.dat +2010 -0
- wcc_etc/data/throughput/other_filters/SLOAN_SDSS.uprime_filter.dat +1045 -0
- wcc_etc/data/throughput/other_filters/SLOAN_SDSS.zprime_filter.dat +5646 -0
- wcc_etc/data/throughput/other_filters/johnson_v_004_syn.fits +0 -0
- wcc_etc/extended.py +123 -0
- wcc_etc/io.py +562 -0
- wcc_etc/lightcurve.py +151 -0
- wcc_etc/meta.py +99 -0
- wcc_etc/plotting.py +998 -0
- wcc_etc/psfsim.py +1977 -0
- wcc_etc/radial_data.py +212 -0
- wcc_etc/scatter_help.py +403 -0
- wcc_etc/scatter_psf.py +1850 -0
- wcc_etc/scene.py +1292 -0
- wcc_etc/sensor.py +434 -0
- wcc_etc/simulation.py +1765 -0
- wcc_etc/spectral.py +217 -0
- wcc_etc/telescope.py +122 -0
- wcc_etc/utils.py +109 -0
- wcc_etc-0.1.0.dist-info/METADATA +158 -0
- wcc_etc-0.1.0.dist-info/RECORD +331 -0
- wcc_etc-0.1.0.dist-info/WHEEL +5 -0
- wcc_etc-0.1.0.dist-info/licenses/LICENSE +28 -0
- wcc_etc-0.1.0.dist-info/top_level.txt +1 -0
wcc_etc/__init__.py
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import importlib.metadata
|
|
2
|
+
|
|
3
|
+
__version__ = importlib.metadata.version(__package__ or "wcc_etc")
|
|
4
|
+
|
|
5
|
+
__all__ = [
|
|
6
|
+
"__version__",
|
|
7
|
+
# scene / instrument / simulation — the Quick Start surface
|
|
8
|
+
"Scene",
|
|
9
|
+
"Sensor",
|
|
10
|
+
"Simulation",
|
|
11
|
+
"Telescope",
|
|
12
|
+
"get_scene",
|
|
13
|
+
"get_scene_element",
|
|
14
|
+
"get_scene_from_file",
|
|
15
|
+
# PSF
|
|
16
|
+
"AiryPSF",
|
|
17
|
+
"CustomPSF",
|
|
18
|
+
"DefocusPSF",
|
|
19
|
+
"PolychromaticPSF",
|
|
20
|
+
"ImageSimulator",
|
|
21
|
+
"SimulatedImage",
|
|
22
|
+
"DEFOCUS_1WAVE_PATH",
|
|
23
|
+
"DEFOCUS_2WAVE_PATH",
|
|
24
|
+
"effective_wavelength",
|
|
25
|
+
"photon_weighted_subbands",
|
|
26
|
+
# config / astro helpers
|
|
27
|
+
"get_moon_magnitude",
|
|
28
|
+
"get_pickles_spectrum_filename",
|
|
29
|
+
"get_sensor_config",
|
|
30
|
+
"read_config",
|
|
31
|
+
# lightcurve
|
|
32
|
+
"FluxModel",
|
|
33
|
+
"TransitModel",
|
|
34
|
+
"LightCurveSimulator",
|
|
35
|
+
"LightCurve",
|
|
36
|
+
"download_exoplanet_archive",
|
|
37
|
+
"load_exoplanet_archive",
|
|
38
|
+
# plotting
|
|
39
|
+
"plot_image_mpl",
|
|
40
|
+
"plot_image_bokeh",
|
|
41
|
+
"plot_image_row_mpl",
|
|
42
|
+
"plot_image_row_bokeh",
|
|
43
|
+
"plot_bandpass_mpl",
|
|
44
|
+
"plot_radial_mpl",
|
|
45
|
+
"plot_radial_bokeh",
|
|
46
|
+
"plot_encircled_energy_mpl",
|
|
47
|
+
"plot_encircled_energy_bokeh",
|
|
48
|
+
"plot_lightcurve_mpl",
|
|
49
|
+
"plot_lightcurve_bokeh",
|
|
50
|
+
"set_wcc_style",
|
|
51
|
+
"WCC_STYLE",
|
|
52
|
+
]
|
|
53
|
+
|
|
54
|
+
from lazuli_exo.transit import download_exoplanet_archive, load_exoplanet_archive
|
|
55
|
+
|
|
56
|
+
# Bind the `airy`, `psfsim` and `spectral` submodules as package attributes,
|
|
57
|
+
# so `wcc_etc.airy` / `wcc_etc.psfsim` / `wcc_etc.spectral` work after a bare
|
|
58
|
+
# `import wcc_etc`.
|
|
59
|
+
from . import airy, extended, psfsim, spectral # noqa: F401 (re-export as package attributes)
|
|
60
|
+
from .astro import get_moon_magnitude
|
|
61
|
+
from .io import get_pickles_spectrum_filename, get_sensor_config, read_config
|
|
62
|
+
from .lightcurve import FluxModel, LightCurve, LightCurveSimulator, TransitModel
|
|
63
|
+
from .plotting import (
|
|
64
|
+
WCC_STYLE,
|
|
65
|
+
plot_bandpass_mpl,
|
|
66
|
+
plot_encircled_energy_bokeh,
|
|
67
|
+
plot_encircled_energy_mpl,
|
|
68
|
+
plot_image_bokeh,
|
|
69
|
+
plot_image_mpl,
|
|
70
|
+
plot_image_row_bokeh,
|
|
71
|
+
plot_image_row_mpl,
|
|
72
|
+
plot_lightcurve_bokeh,
|
|
73
|
+
plot_lightcurve_mpl,
|
|
74
|
+
plot_radial_bokeh,
|
|
75
|
+
plot_radial_mpl,
|
|
76
|
+
set_wcc_style,
|
|
77
|
+
)
|
|
78
|
+
from .psfsim import (
|
|
79
|
+
DEFOCUS_1WAVE_PATH,
|
|
80
|
+
DEFOCUS_2WAVE_PATH,
|
|
81
|
+
AiryPSF,
|
|
82
|
+
CustomPSF,
|
|
83
|
+
DefocusPSF,
|
|
84
|
+
ImageSimulator,
|
|
85
|
+
PolychromaticPSF,
|
|
86
|
+
SimulatedImage,
|
|
87
|
+
)
|
|
88
|
+
from .scene import Scene, get_scene, get_scene_element, get_scene_from_file
|
|
89
|
+
from .sensor import Sensor
|
|
90
|
+
from .telescope import Telescope
|
|
91
|
+
from .simulation import Simulation
|
|
92
|
+
from .spectral import effective_wavelength, photon_weighted_subbands
|
wcc_etc/airy.py
ADDED
|
@@ -0,0 +1,597 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
|
|
3
|
+
import matplotlib.pyplot as plt
|
|
4
|
+
import numpy as np
|
|
5
|
+
import scipy.interpolate
|
|
6
|
+
from scipy.signal import fftconvolve
|
|
7
|
+
from scipy.special import j1
|
|
8
|
+
|
|
9
|
+
# render_detector_psf rounds an even n_pixels up by one (to center the PSF peak).
|
|
10
|
+
# This is routine and happens on most grids, so we note it quietly at most once
|
|
11
|
+
# per session instead of warning on every call (which floods notebooks).
|
|
12
|
+
_ODD_NPIX_NOTIFIED = False
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def get_airy_psf(D, rr, wavelength, normalize=True):
|
|
16
|
+
"""
|
|
17
|
+
Unobscured circular-aperture Airy PSF on grid of radial coords rr [rad].
|
|
18
|
+
|
|
19
|
+
INPUT:
|
|
20
|
+
D - diameter in m
|
|
21
|
+
rr - rad?
|
|
22
|
+
wavelength - in m
|
|
23
|
+
|
|
24
|
+
OUTPUT:
|
|
25
|
+
|
|
26
|
+
EXAMPLE:
|
|
27
|
+
psf2d = wcc_etc.airy.airy_psf(D, rr, k)
|
|
28
|
+
psf2d /= psf2d.sum()
|
|
29
|
+
"""
|
|
30
|
+
# Ensure all arguments are unitless floats
|
|
31
|
+
D = float(D.value) if hasattr(D, "unit") else float(D)
|
|
32
|
+
wavelength = (
|
|
33
|
+
float(wavelength.value) if hasattr(wavelength, "unit") else float(wavelength)
|
|
34
|
+
)
|
|
35
|
+
rr = np.array(rr)
|
|
36
|
+
k = 2.0 * np.pi / wavelength
|
|
37
|
+
x = (k * D * rr) / 2.0
|
|
38
|
+
psf = np.ones_like(x)
|
|
39
|
+
nz = x != 0
|
|
40
|
+
psf[nz] = (2.0 * j1(x[nz]) / x[nz]) ** 2
|
|
41
|
+
if normalize:
|
|
42
|
+
psf = psf / psf.sum()
|
|
43
|
+
return psf
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def get_ee_value_at_radius(r_mas, ee, r_value):
|
|
47
|
+
"""
|
|
48
|
+
Interpolate EE curve to get EE value at a given radius
|
|
49
|
+
"""
|
|
50
|
+
return scipy.interpolate.interp1d(r_mas, ee)([r_value])[0]
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def gaussian_kernel_2d(sigma_pix, size=None):
|
|
54
|
+
"""
|
|
55
|
+
Return normalized 2D Gaussian kernel with given sigma in pixels.
|
|
56
|
+
|
|
57
|
+
INPUT:
|
|
58
|
+
sigma_pix -
|
|
59
|
+
size -
|
|
60
|
+
|
|
61
|
+
OUTPUT:
|
|
62
|
+
kernel -
|
|
63
|
+
|
|
64
|
+
EXAMPLE:
|
|
65
|
+
sigma_pix = sig / px_scale_mean
|
|
66
|
+
ker = gaussian_kernel_2d(sigma_pix)
|
|
67
|
+
psf_blur = fftconvolve(psf2d, ker, mode='same')
|
|
68
|
+
"""
|
|
69
|
+
if sigma_pix <= 0:
|
|
70
|
+
return np.array([[1.0]])
|
|
71
|
+
if size is None:
|
|
72
|
+
size = int(np.ceil(8.0 * sigma_pix))
|
|
73
|
+
size = max(size, 3)
|
|
74
|
+
if size % 2 == 0:
|
|
75
|
+
size += 1
|
|
76
|
+
ax = np.arange(-(size // 2), size // 2 + 1)
|
|
77
|
+
xx, yy = np.meshgrid(ax, ax, indexing="xy")
|
|
78
|
+
ker = np.exp(-(xx**2 + yy**2) / (2.0 * sigma_pix**2))
|
|
79
|
+
ker /= ker.sum()
|
|
80
|
+
return ker
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def psf_to_encircled_energy(psf, pixel_scale_x_mas, pixel_scale_y_mas):
|
|
84
|
+
"""
|
|
85
|
+
Convert a 2D PSF to encircled energy vs radius using annular sums.
|
|
86
|
+
Allows for possibly non-square images by using separate pixel scales in x and y.
|
|
87
|
+
|
|
88
|
+
INPUT:
|
|
89
|
+
psf - input PSF
|
|
90
|
+
pixel_scale_x_mas
|
|
91
|
+
pixel_scale_y_mas
|
|
92
|
+
|
|
93
|
+
OUTPUT:
|
|
94
|
+
r_mas - radii in mas
|
|
95
|
+
ee - encircled energy
|
|
96
|
+
|
|
97
|
+
EXAMPLE:
|
|
98
|
+
|
|
99
|
+
"""
|
|
100
|
+
ny, nx = psf.shape
|
|
101
|
+
# Measure radii from the PSF's true centroid, not the n//2 index. On even
|
|
102
|
+
# grids the rendered+cropped PSF lands on an integer pixel a full pixel from
|
|
103
|
+
# n//2, biasing the curve of growth outward. psf_center shares one convention
|
|
104
|
+
# with psfsim._radial_cumulative so the two reducers can't drift apart.
|
|
105
|
+
from .psfsim import psf_center # lazy import: psfsim imports airy at module load
|
|
106
|
+
|
|
107
|
+
cx, cy = psf_center(psf)
|
|
108
|
+
y, x = np.indices(psf.shape)
|
|
109
|
+
# Anisotropic pixel scale handled here:
|
|
110
|
+
r_mas = np.sqrt(
|
|
111
|
+
((x - cx) * pixel_scale_x_mas) ** 2 + ((y - cy) * pixel_scale_y_mas) ** 2
|
|
112
|
+
)
|
|
113
|
+
# Bin edges at 1 mas resolution based on min pixel scale to get smooth curves
|
|
114
|
+
dr = min(pixel_scale_x_mas, pixel_scale_y_mas)
|
|
115
|
+
r_max = r_mas.max()
|
|
116
|
+
edges = np.arange(0, r_max + dr, dr)
|
|
117
|
+
|
|
118
|
+
# --- KEY CHANGES START HERE ---
|
|
119
|
+
|
|
120
|
+
# 1. Sum of the pixel values (power) in each annular bin
|
|
121
|
+
hist_power, _ = np.histogram(r_mas.ravel(), bins=edges, weights=psf.ravel())
|
|
122
|
+
|
|
123
|
+
# 2. Count of the number of pixels in each annular bin
|
|
124
|
+
hist_counts, _ = np.histogram(r_mas.ravel(), bins=edges)
|
|
125
|
+
|
|
126
|
+
# 3. Calculate the 1D average PSF by dividing the sum by the count
|
|
127
|
+
# We use np.divide to safely handle bins with zero pixels
|
|
128
|
+
psf1d = np.divide(
|
|
129
|
+
hist_power,
|
|
130
|
+
hist_counts,
|
|
131
|
+
out=np.zeros_like(hist_power, dtype=float),
|
|
132
|
+
where=hist_counts != 0,
|
|
133
|
+
)
|
|
134
|
+
psf1d = psf1d / psf1d.max()
|
|
135
|
+
|
|
136
|
+
# --- KEY CHANGES END HERE ---
|
|
137
|
+
|
|
138
|
+
# hist_power, edges = np.histogram(r_mas.ravel(), bins=edges, weights=psf.ravel())
|
|
139
|
+
ee = np.cumsum(hist_power)
|
|
140
|
+
if ee[-1] > 0:
|
|
141
|
+
ee /= ee[-1]
|
|
142
|
+
r_centers = 0.5 * (edges[1:] + edges[:-1])
|
|
143
|
+
return r_centers, psf1d, ee
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
def render_detector_psf(
|
|
147
|
+
wavelength,
|
|
148
|
+
fnum,
|
|
149
|
+
D,
|
|
150
|
+
pixel_size,
|
|
151
|
+
jitter_sigma_mas=0,
|
|
152
|
+
n_pixels=21,
|
|
153
|
+
oversample=11,
|
|
154
|
+
verbose=False,
|
|
155
|
+
):
|
|
156
|
+
"""
|
|
157
|
+
Render the (optionally jittered) Airy PSF onto the detector pixel grid.
|
|
158
|
+
|
|
159
|
+
The PSF is computed on a grid oversampled by ``oversample`` per detector
|
|
160
|
+
pixel, optionally convolved with a Gaussian jitter kernel, then binned down
|
|
161
|
+
to detector pixels. The grid uses an odd number of detector pixels so the
|
|
162
|
+
PSF peak sits on the central pixel (worst case), making the brightest-pixel
|
|
163
|
+
fraction conservative for a saturation check. The result is normalized so
|
|
164
|
+
the rendered window sums to 1.
|
|
165
|
+
|
|
166
|
+
Defocus extension: a defocus kernel can be convolved alongside the jitter
|
|
167
|
+
kernel at the oversampled stage without changing this function's interface.
|
|
168
|
+
|
|
169
|
+
INPUT::
|
|
170
|
+
|
|
171
|
+
wavelength - wavelength in m
|
|
172
|
+
fnum - f-number (focal ratio)
|
|
173
|
+
D - primary diameter in m
|
|
174
|
+
pixel_size - detector pixel size in microns
|
|
175
|
+
jitter_sigma_mas - jitter sigma in mas (0 = none)
|
|
176
|
+
n_pixels - detector pixels per side (forced odd)
|
|
177
|
+
oversample - Sub-pixel sampling factor per detector pixel. Any value
|
|
178
|
+
works (centering is by symmetry); odd values place a
|
|
179
|
+
sample exactly on the PSF peak.
|
|
180
|
+
verbose - print diagnostics
|
|
181
|
+
|
|
182
|
+
OUTPUT::
|
|
183
|
+
|
|
184
|
+
psf_detector - (n_pixels, n_pixels) array summing to 1; its max
|
|
185
|
+
is the brightest-pixel energy fraction
|
|
186
|
+
pscale_mas - detector plate scale in mas/pixel
|
|
187
|
+
"""
|
|
188
|
+
# Strip units to plain floats
|
|
189
|
+
wavelength = (
|
|
190
|
+
float(wavelength.value) if hasattr(wavelength, "unit") else float(wavelength)
|
|
191
|
+
)
|
|
192
|
+
fnum = float(fnum.value) if hasattr(fnum, "unit") else float(fnum)
|
|
193
|
+
D = float(D.value) if hasattr(D, "unit") else float(D)
|
|
194
|
+
pixel_size = (
|
|
195
|
+
float(pixel_size.value) if hasattr(pixel_size, "unit") else float(pixel_size)
|
|
196
|
+
)
|
|
197
|
+
jitter_sigma_mas = (
|
|
198
|
+
float(jitter_sigma_mas.value)
|
|
199
|
+
if hasattr(jitter_sigma_mas, "unit")
|
|
200
|
+
else float(jitter_sigma_mas)
|
|
201
|
+
)
|
|
202
|
+
n_pixels = int(n_pixels)
|
|
203
|
+
oversample = int(oversample)
|
|
204
|
+
|
|
205
|
+
# Force odd pixel count so a pixel is centered on the PSF peak.
|
|
206
|
+
if n_pixels % 2 == 0:
|
|
207
|
+
n_pixels += 1
|
|
208
|
+
global _ODD_NPIX_NOTIFIED
|
|
209
|
+
if not _ODD_NPIX_NOTIFIED:
|
|
210
|
+
_ODD_NPIX_NOTIFIED = True
|
|
211
|
+
print(
|
|
212
|
+
"[wcc_etc] note: even n_pixels is rounded up by 1 to center the "
|
|
213
|
+
"PSF peak (shown once).",
|
|
214
|
+
file=sys.stderr,
|
|
215
|
+
)
|
|
216
|
+
|
|
217
|
+
# Detector and oversampled plate scales (mas/pix)
|
|
218
|
+
pscale_mas = calc_plate_scale_from_flength(fnum * D, pixel_size) * 1000.0
|
|
219
|
+
fine_pscale_mas = pscale_mas / oversample
|
|
220
|
+
|
|
221
|
+
fine_n = (
|
|
222
|
+
n_pixels * oversample
|
|
223
|
+
) # oversampled grid; centering is by symmetry (peak in the central block)
|
|
224
|
+
half = (fine_n - 1) / 2.0
|
|
225
|
+
coord_mas = (np.arange(fine_n) - half) * fine_pscale_mas
|
|
226
|
+
|
|
227
|
+
arcsec_per_radian = 206265.0
|
|
228
|
+
mas_per_radian = arcsec_per_radian * 1000.0
|
|
229
|
+
coord_rad = coord_mas / mas_per_radian
|
|
230
|
+
xx, yy = np.meshgrid(coord_rad, coord_rad, indexing="xy")
|
|
231
|
+
rr = np.sqrt(xx**2 + yy**2)
|
|
232
|
+
|
|
233
|
+
# Raw Airy intensity (do not normalize on the truncated grid)
|
|
234
|
+
psf_fine = get_airy_psf(D, rr, wavelength, normalize=False)
|
|
235
|
+
|
|
236
|
+
# Jitter broadening at the oversampled scale
|
|
237
|
+
if jitter_sigma_mas != 0:
|
|
238
|
+
sigma_pix_fine = jitter_sigma_mas / fine_pscale_mas
|
|
239
|
+
ker = gaussian_kernel_2d(sigma_pix_fine)
|
|
240
|
+
psf_fine = fftconvolve(psf_fine, ker, mode="same")
|
|
241
|
+
|
|
242
|
+
# Bin oversample x oversample blocks into detector pixels
|
|
243
|
+
psf_detector = psf_fine.reshape(n_pixels, oversample, n_pixels, oversample).sum(
|
|
244
|
+
axis=(1, 3)
|
|
245
|
+
)
|
|
246
|
+
|
|
247
|
+
# Normalize the rendered window to 1 (conservative: window truncates wings)
|
|
248
|
+
total = psf_detector.sum()
|
|
249
|
+
if total > 0:
|
|
250
|
+
psf_detector = psf_detector / total
|
|
251
|
+
|
|
252
|
+
if verbose:
|
|
253
|
+
print(
|
|
254
|
+
f"render_detector_psf: pscale={pscale_mas:.3f} mas/pix, "
|
|
255
|
+
f"n_pixels={n_pixels}, oversample={oversample}, "
|
|
256
|
+
f"peak_fraction={psf_detector.max():.4f}"
|
|
257
|
+
)
|
|
258
|
+
|
|
259
|
+
return psf_detector, pscale_mas
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
def calc_plate_scale_from_flength(focal_length, pix_size):
|
|
263
|
+
"""
|
|
264
|
+
Calculate the plate scale from the focal length
|
|
265
|
+
|
|
266
|
+
INPUT:
|
|
267
|
+
focal length in m
|
|
268
|
+
pixel size in microns
|
|
269
|
+
|
|
270
|
+
OUTPUT:
|
|
271
|
+
plate scale in arcsec/pix
|
|
272
|
+
|
|
273
|
+
NOTES:
|
|
274
|
+
focal_length has to be in m
|
|
275
|
+
pix_size is in microns
|
|
276
|
+
"""
|
|
277
|
+
plate_scale_arcsec_pix = 206265.0 / (focal_length * 1000.0) * pix_size / 1000.0
|
|
278
|
+
return plate_scale_arcsec_pix
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
def get_airy_and_ee_curve_pixel_grid(
|
|
282
|
+
wavelength,
|
|
283
|
+
r_aper_mas,
|
|
284
|
+
grid_size=100,
|
|
285
|
+
verbose=False,
|
|
286
|
+
jitter_sigma_mas=0,
|
|
287
|
+
plot=False,
|
|
288
|
+
ax1=None,
|
|
289
|
+
ax2=None,
|
|
290
|
+
pixel_size=3.74,
|
|
291
|
+
fnum=15,
|
|
292
|
+
D=3,
|
|
293
|
+
):
|
|
294
|
+
"""
|
|
295
|
+
INPUT:
|
|
296
|
+
wavelength - wavelength in m
|
|
297
|
+
D - diameter in m
|
|
298
|
+
grid_size -
|
|
299
|
+
extent_mas -
|
|
300
|
+
EXAMPLE:
|
|
301
|
+
r_mas, ee_base = get_ee_curve(wavelength=0.6e-6)
|
|
302
|
+
r_mas, psf1d, ee = wcc_etc.airy.get_airy_and_ee_curve(wavelength=wavelength*1e-6,plot=True,jitter_sigma_mas=JITTER_MAS,ax=ax,r_aper_mas=70)
|
|
303
|
+
"""
|
|
304
|
+
# Strip units from all arguments
|
|
305
|
+
wavelength = (
|
|
306
|
+
float(wavelength.value) if hasattr(wavelength, "unit") else float(wavelength)
|
|
307
|
+
)
|
|
308
|
+
r_aper_mas = (
|
|
309
|
+
float(r_aper_mas.value) if hasattr(r_aper_mas, "unit") else float(r_aper_mas)
|
|
310
|
+
)
|
|
311
|
+
grid_size = int(grid_size)
|
|
312
|
+
# extent_mas = float(extent_mas.value) if hasattr(extent_mas, 'unit') else float(extent_mas)
|
|
313
|
+
jitter_sigma_mas = (
|
|
314
|
+
float(jitter_sigma_mas.value)
|
|
315
|
+
if hasattr(jitter_sigma_mas, "unit")
|
|
316
|
+
else float(jitter_sigma_mas)
|
|
317
|
+
)
|
|
318
|
+
pixel_size = (
|
|
319
|
+
float(pixel_size.value) if hasattr(pixel_size, "unit") else float(pixel_size)
|
|
320
|
+
)
|
|
321
|
+
fnum = float(fnum.value) if hasattr(fnum, "unit") else float(fnum)
|
|
322
|
+
D = float(D.value) if hasattr(D, "unit") else float(D)
|
|
323
|
+
|
|
324
|
+
pscale = calc_plate_scale_from_flength(fnum * D, pixel_size) * 1000 # mas/pix
|
|
325
|
+
extent_mas = pscale * grid_size / 2
|
|
326
|
+
|
|
327
|
+
arcsec_per_radian = 206265.0
|
|
328
|
+
mas_per_radian = arcsec_per_radian * 1000.0
|
|
329
|
+
extent_rad = extent_mas / mas_per_radian
|
|
330
|
+
|
|
331
|
+
x = np.linspace(-extent_rad, extent_rad, grid_size)
|
|
332
|
+
y = np.linspace(-extent_rad, extent_rad, grid_size)
|
|
333
|
+
xx, yy = np.meshgrid(x, y, indexing="xy")
|
|
334
|
+
rr = np.sqrt(xx**2 + yy**2)
|
|
335
|
+
psf2d = get_airy_psf(D, rr, wavelength, normalize=True)
|
|
336
|
+
pixel_scale_mas = (2.0 * extent_mas) / grid_size
|
|
337
|
+
px_scale_x_mas = pixel_scale_mas
|
|
338
|
+
px_scale_y_mas = pixel_scale_mas
|
|
339
|
+
if verbose:
|
|
340
|
+
source_desc = f"Airy PSF (D={D:.2f} m, λ={wavelength * 1e6} μm), grid={grid_size}², px={pixel_scale_mas:.3f} mas"
|
|
341
|
+
print("Source:", source_desc)
|
|
342
|
+
print(
|
|
343
|
+
f"Pixel scales: {px_scale_x_mas:.3f} mas/px (x), {px_scale_y_mas:.3f} mas/px (y)"
|
|
344
|
+
)
|
|
345
|
+
|
|
346
|
+
# Baseline, no jitter
|
|
347
|
+
r_mas, psf1d, ee = psf_to_encircled_energy(psf2d, px_scale_x_mas, px_scale_y_mas)
|
|
348
|
+
|
|
349
|
+
if jitter_sigma_mas != 0:
|
|
350
|
+
if verbose:
|
|
351
|
+
print("Broadening with {}mas".format(jitter_sigma_mas))
|
|
352
|
+
|
|
353
|
+
# Assuming symmetric
|
|
354
|
+
px_scale_mean = np.sqrt(px_scale_x_mas * px_scale_y_mas)
|
|
355
|
+
sigma_pix = jitter_sigma_mas / px_scale_mean
|
|
356
|
+
ker = gaussian_kernel_2d(sigma_pix)
|
|
357
|
+
psf_blur = fftconvolve(psf2d, ker, mode="same")
|
|
358
|
+
s = psf_blur.sum()
|
|
359
|
+
if s > 0:
|
|
360
|
+
psf_blur /= s
|
|
361
|
+
r_mas, psf1d, ee = psf_to_encircled_energy(
|
|
362
|
+
psf_blur, px_scale_x_mas, px_scale_y_mas
|
|
363
|
+
)
|
|
364
|
+
|
|
365
|
+
ee_aper = get_ee_value_at_radius(r_mas, ee, r_aper_mas)
|
|
366
|
+
if plot:
|
|
367
|
+
# EE plot
|
|
368
|
+
if ax1 is None:
|
|
369
|
+
fig, ax1 = plt.subplots()
|
|
370
|
+
ax1.plot(r_mas, ee)
|
|
371
|
+
ax1.set_xlabel("Radius [mas]", fontsize=16)
|
|
372
|
+
ax1.set_ylabel("Encircled Energy", fontsize=16)
|
|
373
|
+
# ax1.axhline(0.9,color='crimson',ls='--')
|
|
374
|
+
ax1.grid(lw=0.3, alpha=0.3)
|
|
375
|
+
ax1.set_title(
|
|
376
|
+
"EE as a function of radius.\nWavelength={:0.3f}micron, Jitter={:0.1f}mas".format(
|
|
377
|
+
wavelength * 1e6, jitter_sigma_mas
|
|
378
|
+
),
|
|
379
|
+
fontsize=14,
|
|
380
|
+
)
|
|
381
|
+
ax1.axvline(
|
|
382
|
+
r_aper_mas,
|
|
383
|
+
color="k",
|
|
384
|
+
ls="--",
|
|
385
|
+
label="EE={:0.3f} at r={:0.1f}mas, r={:0.1f}pixels".format(
|
|
386
|
+
ee_aper, r_aper_mas, r_aper_mas / (1000 * pscale)
|
|
387
|
+
),
|
|
388
|
+
)
|
|
389
|
+
ax1.axhline(ee_aper, color="k", ls="--")
|
|
390
|
+
ax1.legend()
|
|
391
|
+
ax1.set_xlim(0, 300)
|
|
392
|
+
bx = ax1.twiny()
|
|
393
|
+
bx.set_xticks(ax1.get_xticks() / (1000 * pscale))
|
|
394
|
+
bx.set_xlabel("Pixels", fontsize=16)
|
|
395
|
+
|
|
396
|
+
# EE plot
|
|
397
|
+
if ax2 is None:
|
|
398
|
+
fig, ax2 = plt.subplots()
|
|
399
|
+
ax2.plot(r_mas, psf1d)
|
|
400
|
+
ax2.set_xlabel("Radius [mas]", fontsize=16)
|
|
401
|
+
ax2.set_ylabel("Normalized Flux", fontsize=16)
|
|
402
|
+
ax2.set_title(
|
|
403
|
+
"Airy disk as a function of radius.\nWavelength={:0.3f}micron, Jitter={:0.1f}mas".format(
|
|
404
|
+
wavelength * 1e6, jitter_sigma_mas
|
|
405
|
+
),
|
|
406
|
+
fontsize=14,
|
|
407
|
+
)
|
|
408
|
+
# ax2.axhline(0.9,color='crimson',ls='--')
|
|
409
|
+
ax2.grid(lw=0.3, alpha=0.3)
|
|
410
|
+
ax2.axvline(
|
|
411
|
+
r_aper_mas,
|
|
412
|
+
color="k",
|
|
413
|
+
ls="--",
|
|
414
|
+
label="EE={:0.3f} at r={:0.1f}mas, r={:0.1f}pixels".format(
|
|
415
|
+
ee_aper, r_aper_mas, r_aper_mas / (1000 * pscale)
|
|
416
|
+
),
|
|
417
|
+
)
|
|
418
|
+
ax2.legend()
|
|
419
|
+
ax2.set_xlim(0, 300)
|
|
420
|
+
bx = ax2.twiny()
|
|
421
|
+
bx.set_xticks(ax2.get_xticks() / (1000 * pscale))
|
|
422
|
+
bx.set_xlabel("Pixels", fontsize=16)
|
|
423
|
+
|
|
424
|
+
if jitter_sigma_mas == 0:
|
|
425
|
+
psf_blur = psf2d
|
|
426
|
+
|
|
427
|
+
return r_mas, psf1d, ee, ee_aper, psf_blur
|
|
428
|
+
|
|
429
|
+
|
|
430
|
+
def get_airy_and_ee_curve(
|
|
431
|
+
wavelength,
|
|
432
|
+
r_aper_mas,
|
|
433
|
+
grid_size=1024,
|
|
434
|
+
extent_mas=500,
|
|
435
|
+
verbose=False,
|
|
436
|
+
jitter_sigma_mas=0,
|
|
437
|
+
plot=False,
|
|
438
|
+
ax1=None,
|
|
439
|
+
ax2=None,
|
|
440
|
+
pixel_size=3.74,
|
|
441
|
+
fnum=15,
|
|
442
|
+
D=3,
|
|
443
|
+
):
|
|
444
|
+
"""
|
|
445
|
+
Calculate airy curve
|
|
446
|
+
|
|
447
|
+
INPUT:
|
|
448
|
+
wavelength - wavelength in m
|
|
449
|
+
grid_size - number of pixels in the grid (square)
|
|
450
|
+
extent_mas - size of the grid in milliarcseconds
|
|
451
|
+
D - diameter in m
|
|
452
|
+
|
|
453
|
+
EXAMPLE:
|
|
454
|
+
r_mas, ee_base = get_ee_curve(wavelength=0.6e-6)
|
|
455
|
+
r_mas, psf1d, ee = wcc_etc.airy.get_airy_and_ee_curve(wavelength=wavelength*1e-6,plot=True,jitter_sigma_mas=JITTER_MAS,ax=ax,r_aper_mas=70)
|
|
456
|
+
"""
|
|
457
|
+
# Strip units from all arguments
|
|
458
|
+
wavelength = (
|
|
459
|
+
float(wavelength.value) if hasattr(wavelength, "unit") else float(wavelength)
|
|
460
|
+
)
|
|
461
|
+
r_aper_mas = (
|
|
462
|
+
float(r_aper_mas.value) if hasattr(r_aper_mas, "unit") else float(r_aper_mas)
|
|
463
|
+
)
|
|
464
|
+
grid_size = int(grid_size)
|
|
465
|
+
extent_mas = (
|
|
466
|
+
float(extent_mas.value) if hasattr(extent_mas, "unit") else float(extent_mas)
|
|
467
|
+
)
|
|
468
|
+
jitter_sigma_mas = (
|
|
469
|
+
float(jitter_sigma_mas.value)
|
|
470
|
+
if hasattr(jitter_sigma_mas, "unit")
|
|
471
|
+
else float(jitter_sigma_mas)
|
|
472
|
+
)
|
|
473
|
+
pixel_size = (
|
|
474
|
+
float(pixel_size.value) if hasattr(pixel_size, "unit") else float(pixel_size)
|
|
475
|
+
)
|
|
476
|
+
fnum = float(fnum.value) if hasattr(fnum, "unit") else float(fnum)
|
|
477
|
+
D = float(D.value) if hasattr(D, "unit") else float(D)
|
|
478
|
+
|
|
479
|
+
arcsec_per_radian = 206265.0
|
|
480
|
+
mas_per_radian = arcsec_per_radian * 1000.0
|
|
481
|
+
extent_rad = extent_mas / mas_per_radian
|
|
482
|
+
|
|
483
|
+
x = np.linspace(-extent_rad, extent_rad, grid_size)
|
|
484
|
+
y = np.linspace(-extent_rad, extent_rad, grid_size)
|
|
485
|
+
xx, yy = np.meshgrid(x, y, indexing="xy")
|
|
486
|
+
rr = np.sqrt(xx**2 + yy**2)
|
|
487
|
+
psf2d = get_airy_psf(D, rr, wavelength, normalize=True)
|
|
488
|
+
pixel_scale_mas = (2.0 * extent_mas) / grid_size
|
|
489
|
+
px_scale_x_mas = pixel_scale_mas
|
|
490
|
+
px_scale_y_mas = pixel_scale_mas
|
|
491
|
+
if verbose:
|
|
492
|
+
source_desc = f"Airy PSF (D={D:.2f} m, λ={wavelength * 1e6} μm), grid={grid_size}², px={pixel_scale_mas:.3f} mas"
|
|
493
|
+
print("Source:", source_desc)
|
|
494
|
+
print(
|
|
495
|
+
f"Pixel scales: {px_scale_x_mas:.3f} mas/px (x), {px_scale_y_mas:.3f} mas/px (y)"
|
|
496
|
+
)
|
|
497
|
+
|
|
498
|
+
# Baseline, no jitter
|
|
499
|
+
r_mas, psf1d, ee = psf_to_encircled_energy(psf2d, px_scale_x_mas, px_scale_y_mas)
|
|
500
|
+
|
|
501
|
+
if jitter_sigma_mas != 0:
|
|
502
|
+
if verbose:
|
|
503
|
+
print("Broadening with {}mas".format(jitter_sigma_mas))
|
|
504
|
+
|
|
505
|
+
# Assuming symmetric
|
|
506
|
+
px_scale_mean = np.sqrt(px_scale_x_mas * px_scale_y_mas)
|
|
507
|
+
sigma_pix = jitter_sigma_mas / px_scale_mean
|
|
508
|
+
ker = gaussian_kernel_2d(sigma_pix)
|
|
509
|
+
psf_blur = fftconvolve(psf2d, ker, mode="same")
|
|
510
|
+
s = psf_blur.sum()
|
|
511
|
+
if s > 0:
|
|
512
|
+
psf_blur /= s
|
|
513
|
+
r_mas, psf1d, ee = psf_to_encircled_energy(
|
|
514
|
+
psf_blur, px_scale_x_mas, px_scale_y_mas
|
|
515
|
+
)
|
|
516
|
+
|
|
517
|
+
ee_aper = get_ee_value_at_radius(r_mas, ee, r_aper_mas)
|
|
518
|
+
if plot:
|
|
519
|
+
pscale = calc_plate_scale_from_flength(fnum * D, pixel_size) # arcsec/pix
|
|
520
|
+
# EE plot
|
|
521
|
+
if ax1 is None:
|
|
522
|
+
fig, ax1 = plt.subplots()
|
|
523
|
+
ax1.plot(r_mas, ee)
|
|
524
|
+
ax1.set_xlabel("Radius [mas]", fontsize=16)
|
|
525
|
+
ax1.set_ylabel("Encircled Energy", fontsize=16)
|
|
526
|
+
# ax1.axhline(0.9,color='crimson',ls='--')
|
|
527
|
+
ax1.grid(lw=0.3, alpha=0.3)
|
|
528
|
+
ax1.set_title(
|
|
529
|
+
"EE as a function of radius.\nWavelength={:0.3f}micron, Jitter={:0.1f}mas".format(
|
|
530
|
+
wavelength * 1e6, jitter_sigma_mas
|
|
531
|
+
),
|
|
532
|
+
fontsize=14,
|
|
533
|
+
)
|
|
534
|
+
ax1.axvline(
|
|
535
|
+
r_aper_mas,
|
|
536
|
+
color="k",
|
|
537
|
+
ls="--",
|
|
538
|
+
label="EE={:0.3f} at r={:0.1f}mas, r={:0.1f}pixels".format(
|
|
539
|
+
ee_aper, r_aper_mas, r_aper_mas / (1000 * pscale)
|
|
540
|
+
),
|
|
541
|
+
)
|
|
542
|
+
ax1.axhline(ee_aper, color="k", ls="--")
|
|
543
|
+
ax1.legend()
|
|
544
|
+
ax1.set_xlim(0, 300)
|
|
545
|
+
bx = ax1.twiny()
|
|
546
|
+
bx.set_xticks(ax1.get_xticks() / (1000 * pscale))
|
|
547
|
+
bx.set_xlabel("Pixels", fontsize=16)
|
|
548
|
+
|
|
549
|
+
# EE plot
|
|
550
|
+
if ax2 is None:
|
|
551
|
+
fig, ax2 = plt.subplots()
|
|
552
|
+
ax2.plot(r_mas, psf1d)
|
|
553
|
+
ax2.set_xlabel("Radius [mas]", fontsize=16)
|
|
554
|
+
ax2.set_ylabel("Normalized Flux", fontsize=16)
|
|
555
|
+
ax2.set_title(
|
|
556
|
+
"Airy disk as a function of radius.\nWavelength={:0.3f}micron, Jitter={:0.1f}mas".format(
|
|
557
|
+
wavelength * 1e6, jitter_sigma_mas
|
|
558
|
+
),
|
|
559
|
+
fontsize=14,
|
|
560
|
+
)
|
|
561
|
+
# ax2.axhline(0.9,color='crimson',ls='--')
|
|
562
|
+
ax2.grid(lw=0.3, alpha=0.3)
|
|
563
|
+
ax2.axvline(
|
|
564
|
+
r_aper_mas,
|
|
565
|
+
color="k",
|
|
566
|
+
ls="--",
|
|
567
|
+
label="EE={:0.3f} at r={:0.1f}mas, r={:0.1f}pixels".format(
|
|
568
|
+
ee_aper, r_aper_mas, r_aper_mas / (1000 * pscale)
|
|
569
|
+
),
|
|
570
|
+
)
|
|
571
|
+
ax2.legend()
|
|
572
|
+
ax2.set_xlim(0, 300)
|
|
573
|
+
bx = ax2.twiny()
|
|
574
|
+
bx.set_xticks(ax2.get_xticks() / (1000 * pscale))
|
|
575
|
+
bx.set_xlabel("Pixels", fontsize=16)
|
|
576
|
+
|
|
577
|
+
return r_mas, psf1d, ee, ee_aper
|
|
578
|
+
|
|
579
|
+
|
|
580
|
+
# Multi-jitter list
|
|
581
|
+
def jittered_ee_list(psf2d, jitter_sigmas_mas, px_scale_x_mas, px_scale_y_mas):
|
|
582
|
+
"""
|
|
583
|
+
Loop through different PSFs
|
|
584
|
+
"""
|
|
585
|
+
results = {}
|
|
586
|
+
# Use geometric mean pixel scale as a representative scale for isotropic jitter kernel
|
|
587
|
+
px_scale_mean = np.sqrt(px_scale_x_mas * px_scale_y_mas)
|
|
588
|
+
for sig in jitter_sigmas_mas:
|
|
589
|
+
sigma_pix = sig / px_scale_mean
|
|
590
|
+
ker = gaussian_kernel_2d(sigma_pix)
|
|
591
|
+
psf_blur = fftconvolve(psf2d, ker, mode="same")
|
|
592
|
+
s = psf_blur.sum()
|
|
593
|
+
if s > 0:
|
|
594
|
+
psf_blur /= s
|
|
595
|
+
r, psf1d, ee = psf_to_encircled_energy(psf_blur, px_scale_x_mas, px_scale_y_mas)
|
|
596
|
+
results[sig] = (r, ee)
|
|
597
|
+
return results
|