Canfar new#283
Conversation
…into canfar_debug
…into canfar_debug
…into canfar_debug
…into canfar_debug
Canfar debug
…x, [pixel scale, PSF init guess, more output fields], make_catalogue [entire file copied].
|
@aguinot should probably also review this merge... |
sfarrens
left a comment
There was a problem hiding this comment.
Overall it looks fine to me. There are just a couple of points that I think need clarification.
| # def save_galsim_shapes(final_cat_file, galsim_cat_path): | ||
| # """ Save ngmix data | ||
| # | ||
| # Save the ngmix catalog into the final one. | ||
| # | ||
| # Parameters | ||
| # ---------- | ||
| # final_cat_file : io.FITSCatalog | ||
| # Final catalog. | ||
| # ngmix_cat_path : str | ||
| # Path to ngmix catalog to save. | ||
| # | ||
| # """ | ||
| # | ||
| # final_cat_file.open() | ||
| # obj_id = np.copy(final_cat_file.get_data()['NUMBER']) | ||
| # | ||
| # galsim_cat_file = io.FITSCatalog(galsim_cat_path) | ||
| # galsim_cat_file.open() | ||
| # galsim_id = galsim_cat_file.get_data()['id'] | ||
| # # max_epoch = np.max(ngmix_n_epoch) | ||
| # | ||
| # output_dict = {'GALSIM_GAL_ELL': np.ones((len(obj_id), 2)) * -10., | ||
| # 'GALSIM_GAL_ELL_ERR': np.ones(len(obj_id)) * -1., | ||
| # 'GALSIM_GAL_SIGMA': np.zeros(len(obj_id)), | ||
| # 'GALSIM_GAL_FLAG': np.ones(len(obj_id), dtype='int16'), | ||
| # 'GALSIM_GAL_ELL_U': np.ones((len(obj_id), 2)) * -10., | ||
| # 'GALSIM_GAL_RES': np.ones(len(obj_id)) * -1., | ||
| # 'GALSIM_PSF_ELL': np.ones((len(obj_id), 2)) * -10., | ||
| # 'GALSIM_PSF_SIGMA': np.zeros(len(obj_id)), | ||
| # 'GALSIM_PSF_FLAG': np.ones(len(obj_id), dtype='int16')} | ||
| # for i, id_tmp in enumerate(obj_id): | ||
| # ind = np.where(id_tmp == galsim_id)[0] | ||
| # if len(ind) > 0: | ||
| # output_dict['GALSIM_GAL_ELL'][i][0] = galsim_cat_file.get_data()['gal_g1'][ind[0]] | ||
| # output_dict['GALSIM_GAL_ELL'][i][1] = galsim_cat_file.get_data()['gal_g2'][ind[0]] | ||
| # output_dict['GALSIM_GAL_ELL_ERR'][i] = galsim_cat_file.get_data()['gal_g1_err'][ind[0]] | ||
| # output_dict['GALSIM_GAL_SIGMA'][i] = galsim_cat_file.get_data()['gal_sigma'][ind[0]] | ||
| # output_dict['GALSIM_GAL_FLAG'][i] = galsim_cat_file.get_data()['gal_flag'][ind[0]] | ||
| # output_dict['GALSIM_GAL_RES'][i] = galsim_cat_file.get_data()['gal_resolution'][ind[0]] | ||
| # output_dict['GALSIM_GAL_ELL_U'][i][0] = galsim_cat_file.get_data()['gal_uncorr_g1'][ind[0]] | ||
| # output_dict['GALSIM_GAL_ELL_U'][i][1] = galsim_cat_file.get_data()['gal_uncorr_g2'][ind[0]] | ||
| # output_dict['GALSIM_PSF_ELL'][i][0] = galsim_cat_file.get_data()['psf_g1'][ind[0]] | ||
| # output_dict['GALSIM_PSF_ELL'][i][1] = galsim_cat_file.get_data()['psf_g2'][ind[0]] | ||
| # output_dict['GALSIM_PSF_SIGMA'][i] = galsim_cat_file.get_data()['psf_sigma'][ind[0]] | ||
| # | ||
| # for key in output_dict.keys(): | ||
| # final_cat_file.add_col(key, output_dict[key]) | ||
| # | ||
| # final_cat_file.close() | ||
| # galsim_cat_file.close() |
There was a problem hiding this comment.
Is this function being saved for later?
There was a problem hiding this comment.
It looks like this is used when galsim instead of ngmix is used to measure shapes on the tiles. I think @aguinot should check whether this function is needed.
There was a problem hiding this comment.
This function was there when I was running galsim without the metacal. I think you can remove it.
|
Hi @martinkilbinger I think we can merge this after the following things have been resolved:
|
|
PEP errors and empty return are resolved. Is the commented function ok as it is? I don't know what Axel recommended. If yes, we can merge. |
This branch is running on canfar, and provides consistent results with Axel's previous runs on candide. This might be the one!