Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when running auto_script.generate_fit_params( ) #244

Open
weiwwqeo opened this issue Aug 22, 2024 · 12 comments
Open

Error when running auto_script.generate_fit_params( ) #244

weiwwqeo opened this issue Aug 22, 2024 · 12 comments

Comments

@weiwwqeo
Copy link

--> obj = photoz.eazy_photoz(field_root, object_only=True,
3946 apply_prior=False, beta_prior=True, aper_ix=aper_ix-1,
3947 force=True,
3948 get_external_photometry=False, compute_residuals=False,
3949 total_flux=total_flux)
--> 397 self = eazy.photoz.PhotoZ(param_file=None, translate_file='zphot.translate', zeropoint_file=zpfile, params=params, load_prior=True, load_products=load_products)
--> 301 self.read_catalog()
303 if self.NFILT < 1:
304 print('\n!! No filters found, maybe a problem with'
305 ' the translate file?\n')
File ~/miniconda3/envs/grism/lib/python3.9/site-packages/eazy/photoz.py:744, in PhotoZ.read_catalog(self, verbose)
739 if len(self.f_numbers) == 0:
740 msg = ('No valid filters found in {0}! Check that all flux ' +
741 'and uncertainty columns are specified / translated ' +
742 'correctly.')
--> 744 raise ValueError(msg.format(self.param['CATALOG_FILE']))

ValueError: No valid filters found in {root}_phot_apcorr.fits! Check that all flux and uncertainty columns are specified / translated correctly.

I am a beginner and I have no idea how to resolve this problem.

@TheSkyentist
Copy link
Contributor

Would you be able to provide more details on the dataset you are working on and the steps you have run prior to getting this error?

@weiwwqeo
Copy link
Author

I begin with a series of *rate.fits (JWST data) , then run set_jwst_to_hst_keywords and parse_visits() .
Then make_combined_mosaics() , make_filter_combinations and multiband_catalog.
Until grism_prep and grp.drizzle_grism_models(), everything works well. I have got a series of {root}-ir.[cat,seg].fits,*GrismFLT.fits ,{root}_phot.fits ,{root}_phot_apcorr.fits so far.
Then this error appear when it comes to generate_fit_params( ).
Here's the code I am running:

files = glob.glob('*grism*png')
if len(files) == 0:
    _ = grp.drizzle_grism_models(root=root, scale=0.08)
if not os.path.exists('fit_args.npy'):
    pline={'kernel': 'square', 'pixfrac': 0.5, 'pixscale': 0.04, 'size': 8, 'wcs': None}
    args = auto_script.generate_fit_params(pline=pline, field_root=root, min_sens=0.0, min_mask=0.0)

And the output:

Read default param file: /miniconda3/envs/grism/lib/python3.9/site-packages/eazy/data/zphot.param.default
Read CATALOG_FILE: {root}_phot_apcorr.fits
   >>> NOBJ = 8486
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In[148], line 3
      1 if not os.path.exists('fit_args.npy'):
      2     pline={'kernel': 'square', 'pixfrac': 0.5, 'pixscale': 0.04, 'size': 8, 'wcs': None}
----> 3     args = auto_script.generate_fit_params(pline=pline, field_root=root, min_sens=0.0, min_mask=0.0)

File [~/miniconda3/envs/grism/lib/python3.9/site-packages/grizli/pipeline/auto_script.py:3945](http://localhost:9997/lab/tree/jwst_test/root/~/miniconda3/envs/grism/lib/python3.9/site-packages/grizli/pipeline/auto_script.py#line=3944), in generate_fit_params(field_root, fitter, prior, MW_EBV, pline, fit_only_beams, run_fit, poly_order, fsps, min_sens, sys_err, fcontam, zr, dz, fwhm, lorentz, include_photometry, use_phot_obj, save_file, fit_trace_shift, full_line_list, **kwargs)
   3942 utils.set_warnings()
   3944 total_flux = 'flux_auto'
-> 3945 obj = photoz.eazy_photoz(field_root, object_only=True,
   3946           apply_prior=False, beta_prior=True, aper_ix=aper_ix-1,
   3947           force=True,
   3948           get_external_photometry=False, compute_residuals=False,
   3949           total_flux=total_flux)
   3951 cat = obj.cat
   3953 #apcorr = cat['flux_iso']/(cat['flux_auto']*cat['tot_corr'])

File [~/miniconda3/envs/grism/lib/python3.9/site-packages/grizli/pipeline/photoz.py:397](http://localhost:9997/lab/tree/jwst_test/root/~/miniconda3/envs/grism/lib/python3.9/site-packages/grizli/pipeline/photoz.py#line=396), in eazy_photoz(root, force, object_only, apply_background, aper_ix, apply_prior, beta_prior, get_external_photometry, external_limits, external_sys_err, external_timeout, sys_err, z_step, z_min, z_max, total_flux, auto_corr, compute_residuals, dummy_prior, extra_rf_filters, quiet, aperture_indices, zpfile, extra_params, filter_trans, extra_translate, force_apcorr, ebv, absmag_filters, save_pickle, **kwargs)
    387             print("""
    388 The filter file ``FILTER.RES.latest`` and ``templates`` directory were not
    389 found in the working directory and the automatic command to retrieve them
   (...)
    393 
    394 Run it with ``path`` pointing to the location of the ``eazy-photoz`` repository.""")
    395             return False
--> 397     self = eazy.photoz.PhotoZ(param_file=None, translate_file='zphot.translate', zeropoint_file=zpfile, params=params, load_prior=True, load_products=load_products)
    399     if quiet:
    400         self.param.params['VERBOSITY'] = 1.

File [~/miniconda3/envs/grism/lib/python3.9/site-packages/eazy/photoz.py:301](http://localhost:9997/lab/tree/jwst_test/root/~/miniconda3/envs/grism/lib/python3.9/site-packages/eazy/photoz.py#line=300), in PhotoZ.__init__(self, param_file, translate_file, zeropoint_file, load_prior, load_products, params, n_proc, cosmology, compute_tef_lnp, tempfilt, tempfilt_data, random_seed, random_draws, **kwargs)
    297 self.fixed_cols = {}        
    299 self.RES = filters_code.FilterFile(self.param['FILTERS_RES'])
--> 301 self.read_catalog()
    303 if self.NFILT < 1:
    304     print('\n!! No filters found, maybe a problem with'
    305           ' the translate file?\n')

File [~/miniconda3/envs/grism/lib/python3.9/site-packages/eazy/photoz.py:744](http://localhost:9997/lab/tree/jwst_test/root/~/miniconda3/envs/grism/lib/python3.9/site-packages/eazy/photoz.py#line=743), in PhotoZ.read_catalog(self, verbose)
    739 if len(self.f_numbers) == 0:
    740     msg = ('No valid filters found in {0}!  Check that all flux ' +
    741           'and uncertainty columns are specified / translated ' +  
    742           'correctly.')
--> 744     raise ValueError(msg.format(self.param['CATALOG_FILE']))
    746 # Initialize flux arrays
    747 self.fnu = np.zeros((self.NOBJ, self.NFILT), dtype=self.ARRAY_DTYPE)

ValueError: No valid filters found in {root}_phot_apcorr.fits!  Check that all flux and uncertainty columns are specified / translated correctly.

@TheSkyentist
Copy link
Contributor

TheSkyentist commented Aug 22, 2024 via email

@weiwwqeo
Copy link
Author

It's NIRCAM data.

@TheSkyentist
Copy link
Contributor

Can you show the contents of the {root}_phot_apcorr.fits file?

@weiwwqeo
Copy link
Author

weiwwqeo commented Aug 23, 2024

Sure!
Here are the info and header:

Filename: {root}_phot_apcorr.fits
No.    Name      Ver    Type      Cards   Dimensions   Format
  0  PRIMARY       1 PrimaryHDU       4   ()      
  1                1 BinTableHDU    544   8486R x 165C   [J, D, K, K, K, K, K, K, D, D, D, D, D, D, D, D, D, D, D, D, D, D, D, D, D, D, K, K, K, K, K, D, D, J, D, D, D, D, D, D, K, D, D, D, D, D, D, K, D, I, D, D, D, D, D, D, D, D, I, D, D, D, D, I, D, D, D, D, I, D, D, D, D, I, D, D, D, D, I, D, D, D, D, I, D, D, D, D, I, D, D, D, D, I, D, D, D, D, I, D, D, D, D, I, D, D, D, D, I, D, D, D, D, I, D, D, D, D, I, D, D, D, D, I, D, D, D, D, D, D, D, D, D, D, D, D, D, D, D, D, D, D, D, D, D, D, D, D, D, D, D, D, D, D, D, D, D, D, D, D, D, D, D, D, D]   
None
SIMPLE  =                    T / conforms to FITS standard                      BITPIX  =                    8 / array data type                                NAXIS   =                    0 / number of array dimensions                     EXTEND  =                    T                                                  END                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
XTENSION= 'BINTABLE'           / binary table extension                         BITPIX  =                    8 / array data type                                NAXIS   =                    2 / number of array dimensions                     NAXIS1  =                 1222 / length of dimension 1                          NAXIS2  =                 8486 / length of dimension 2                          PCOUNT  =                    0 / number of group parameters                     GCOUNT  =                    1 / number of groups                               TFIELDS =                  165 / number of table fields                         TTYPE1  = 'id      '                                                            TFORM1  = 'J       '                                                            TNULL1  =               999999                                                  TTYPE2  = 'thresh  '                                                            TFORM2  = 'D       '                                                            TTYPE3  = 'npix    '                                                            TFORM3  = 'K       '                                                            TNULL3  =               999999                                                  TTYPE4  = 'tnpix   '                                                            TFORM4  = 'K       '                                                            TNULL4  =               999999                                                  TTYPE5  = 'xmin    '                                                            TFORM5  = 'K       '                                                            TNULL5  =               999999                                                  TTYPE6  = 'xmax    '                                                            TFORM6  = 'K       '                                                            TNULL6  =               999999                                                  TTYPE7  = 'ymin    '                                                            TFORM7  = 'K       '                                                            TNULL7  =               999999                                                  TTYPE8  = 'ymax    '                                                            TFORM8  = 'K       '                                                            TNULL8  =               999999                                                  TTYPE9  = 'x       '                                                            TFORM9  = 'D       '                                                            TTYPE10 = 'y       '                                                            TFORM10 = 'D       '                                                            TTYPE11 = 'x2_image'                                                            TFORM11 = 'D       '                                                            TTYPE12 = 'y2_image'                                                            TFORM12 = 'D       '                                                            TTYPE13 = 'xy_image'                                                            TFORM13 = 'D       '                                                            TTYPE14 = 'errx2   '                                                            TFORM14 = 'D       '                                                            TTYPE15 = 'erry2   '                                                            TFORM15 = 'D       '                                                            TTYPE16 = 'errxy   '                                                            TFORM16 = 'D       '                                                            TTYPE17 = 'a_image '                                                            TFORM17 = 'D       '                                                            TTYPE18 = 'b_image '                                                            TFORM18 = 'D       '                                                            TTYPE19 = 'theta_image'                                                         TFORM19 = 'D       '                                                            TTYPE20 = 'cxx_image'                                                           TFORM20 = 'D       '                                                            TTYPE21 = 'cyy_image'                                                           TFORM21 = 'D       '                                                            TTYPE22 = 'cxy_image'                                                           TFORM22 = 'D       '                                                            TTYPE23 = 'cflux   '                                                            TFORM23 = 'D       '                                                            TUNIT23 = 'uJy     '                                                            TTYPE24 = 'flux    '                                                            TFORM24 = 'D       '                                                            TUNIT24 = 'uJy     '                                                            TTYPE25 = 'cpeak   '                                                            TFORM25 = 'D       '                                                            TUNIT25 = 'uJy     '                                                            TTYPE26 = 'peak    '                                                            TFORM26 = 'D       '                                                            TUNIT26 = 'uJy     '                                                            TTYPE27 = 'xcpeak  '                                                            TFORM27 = 'K       '                                                            TNULL27 =               999999                                                  TTYPE28 = 'ycpeak  '                                                            TFORM28 = 'K       '                                                            TNULL28 =               999999                                                  TTYPE29 = 'xpeak   '                                                            TFORM29 = 'K       '                                                            TNULL29 =               999999                                                  TTYPE30 = 'ypeak   '                                                            TFORM30 = 'K       '                                                            TNULL30 =               999999                                                  TTYPE31 = 'flag    '                                                            TFORM31 = 'K       '                                                            TNULL31 =               999999                                                  TTYPE32 = 'x_image '                                                            TFORM32 = 'D       '                                                            TTYPE33 = 'y_image '                                                            TFORM33 = 'D       '                                                            TTYPE34 = 'number  '                                                            TFORM34 = 'J       '                                                            TNULL34 =               999999                                                  TTYPE35 = 'ra      '                                                            TFORM35 = 'D       '                                                            TUNIT35 = 'deg     '                                                            TTYPE36 = 'dec     '                                                            TFORM36 = 'D       '                                                            TUNIT36 = 'deg     '                                                            TTYPE37 = 'x_world '                                                            TFORM37 = 'D       '                                                            TUNIT37 = 'deg     '                                                            TTYPE38 = 'y_world '                                                            TFORM38 = 'D       '                                                            TUNIT38 = 'deg     '                                                            TTYPE39 = 'flux_iso'                                                            TFORM39 = 'D       '                                                            TUNIT39 = 'uJy     '                                                            TTYPE40 = 'fluxerr_iso'                                                         TFORM40 = 'D       '                                                            TUNIT40 = 'uJy     '                                                            TTYPE41 = 'area_iso'                                                            TFORM41 = 'K       '                                                            TNULL41 =               999999                                                  TTYPE42 = 'mag_iso '                                                            TFORM42 = 'D       '                                                            TUNIT42 = 'uJy     '                                                            TTYPE43 = 'kron_radius'                                                         TFORM43 = 'D       '                                                            TUNIT43 = 'pix     '                                                            TTYPE44 = 'kron_rcirc'                                                          TFORM44 = 'D       '                                                            TUNIT44 = 'pix     '                                                            TTYPE45 = 'flux_auto'                                                           TFORM45 = 'D       '                                                            TUNIT45 = 'uJy     '                                                            TTYPE46 = 'fluxerr_auto'                                                        TFORM46 = 'D       '                                                            TUNIT46 = 'uJy     '                                                            TTYPE47 = 'bkg_auto'                                                            TFORM47 = 'D       '                                                            TUNIT47 = 'uJy     '                                                            TTYPE48 = 'flag_auto'                                                           TFORM48 = 'K       '                                                            TNULL48 =               999999                                                  TTYPE49 = 'area_auto'                                                           TFORM49 = 'D       '                                                            TTYPE50 = 'flux_radius_flag'                                                    TFORM50 = 'I       '                                                            TNULL50 =                16959                                                  TTYPE51 = 'flux_radius_20'                                                      TFORM51 = 'D       '                                                            TTYPE52 = 'flux_radius'                                                         TFORM52 = 'D       '                                                            TTYPE53 = 'flux_radius_90'                                                      TFORM53 = 'D       '                                                            TTYPE54 = 'tot_corr'                                                            TFORM54 = 'D       '                                                            TUNIT54 = 'pix     '                                                            TTYPE55 = 'mag_auto'                                                            TFORM55 = 'D       '                                                            TUNIT55 = 'uJy     '                                                            TTYPE56 = 'magerr_auto'                                                         TFORM56 = 'D       '                                                            TUNIT56 = 'uJy     '                                                            TTYPE57 = 'flux_aper_0'                                                         TFORM57 = 'D       '                                                            TUNIT57 = 'uJy     '                                                            TTYPE58 = 'fluxerr_aper_0'                                                      TFORM58 = 'D       '                                                            TUNIT58 = 'uJy     '                                                            TTYPE59 = 'flag_aper_0'                                                         TFORM59 = 'I       '                                                            TNULL59 =                16959                                                  TTYPE60 = 'bkg_aper_0'                                                          TFORM60 = 'D       '                                                            TUNIT60 = 'uJy     '                                                            TTYPE61 = 'mask_aper_0'                                                         TFORM61 = 'D       '                                                            TTYPE62 = 'flux_aper_1'                                                         TFORM62 = 'D       '                                                            TUNIT62 = 'uJy     '                                                            TTYPE63 = 'fluxerr_aper_1'                                                      TFORM63 = 'D       '                                                            TUNIT63 = 'uJy     '                                                            TTYPE64 = 'flag_aper_1'                                                         TFORM64 = 'I       '                                                            TNULL64 =                16959                                                  TTYPE65 = 'bkg_aper_1'                                                          TFORM65 = 'D       '                                                            TUNIT65 = 'uJy     '                                                            TTYPE66 = 'mask_aper_1'                                                         TFORM66 = 'D       '                                                            TTYPE67 = 'flux_aper_2'                                                         TFORM67 = 'D       '                                                            TUNIT67 = 'uJy     '                                                            TTYPE68 = 'fluxerr_aper_2'                                                      TFORM68 = 'D       '                                                            TUNIT68 = 'uJy     '                                                            TTYPE69 = 'flag_aper_2'                                                         TFORM69 = 'I       '                                                            TNULL69 =                16959                                                  TTYPE70 = 'bkg_aper_2'                                                          TFORM70 = 'D       '                                                            TUNIT70 = 'uJy     '                                                            TTYPE71 = 'mask_aper_2'                                                         TFORM71 = 'D       '                                                            TTYPE72 = 'flux_aper_3'                                                         TFORM72 = 'D       '                                                            TUNIT72 = 'uJy     '                                                            TTYPE73 = 'fluxerr_aper_3'                                                      TFORM73 = 'D       '                                                            TUNIT73 = 'uJy     '                                                            TTYPE74 = 'flag_aper_3'                                                         TFORM74 = 'I       '                                                            TNULL74 =                16959                                                  TTYPE75 = 'bkg_aper_3'                                                          TFORM75 = 'D       '                                                            TUNIT75 = 'uJy     '                                                            TTYPE76 = 'mask_aper_3'                                                         TFORM76 = 'D       '                                                            TTYPE77 = 'flux_aper_4'                                                         TFORM77 = 'D       '                                                            TUNIT77 = 'uJy     '                                                            TTYPE78 = 'fluxerr_aper_4'                                                      TFORM78 = 'D       '                                                            TUNIT78 = 'uJy     '                                                            TTYPE79 = 'flag_aper_4'                                                         TFORM79 = 'I       '                                                            TNULL79 =                16959                                                  TTYPE80 = 'bkg_aper_4'                                                          TFORM80 = 'D       '                                                            TUNIT80 = 'uJy     '                                                            TTYPE81 = 'mask_aper_4'                                                         TFORM81 = 'D       '                                                            TTYPE82 = 'flux_aper_5'                                                         TFORM82 = 'D       '                                                            TUNIT82 = 'uJy     '                                                            TTYPE83 = 'fluxerr_aper_5'                                                      TFORM83 = 'D       '                                                            TUNIT83 = 'uJy     '                                                            TTYPE84 = 'flag_aper_5'                                                         TFORM84 = 'I       '                                                            TNULL84 =                16959                                                  TTYPE85 = 'bkg_aper_5'                                                          TFORM85 = 'D       '                                                            TUNIT85 = 'uJy     '                                                            TTYPE86 = 'mask_aper_5'                                                         TFORM86 = 'D       '                                                            TTYPE87 = 'flux_aper_6'                                                         TFORM87 = 'D       '                                                            TUNIT87 = 'uJy     '                                                            TTYPE88 = 'fluxerr_aper_6'                                                      TFORM88 = 'D       '                                                            TUNIT88 = 'uJy     '                                                            TTYPE89 = 'flag_aper_6'                                                         TFORM89 = 'I       '                                                            TNULL89 =                16959                                                  TTYPE90 = 'bkg_aper_6'                                                          TFORM90 = 'D       '                                                            TUNIT90 = 'uJy     '                                                            TTYPE91 = 'mask_aper_6'                                                         TFORM91 = 'D       '                                                            TTYPE92 = 'f356w_flux_aper_0'                                                   TFORM92 = 'D       '                                                            TUNIT92 = 'uJy     '                                                            TTYPE93 = 'f356w_fluxerr_aper_0'                                                TFORM93 = 'D       '                                                            TUNIT93 = 'uJy     '                                                            TTYPE94 = 'f356w_flag_aper_0'                                                   TFORM94 = 'I       '                                                            TNULL94 =                16959                                                  TTYPE95 = 'f356w_bkg_aper_0'                                                    TFORM95 = 'D       '                                                            TUNIT95 = 'uJy     '                                                            TTYPE96 = 'f356w_mask_aper_0'                                                   TFORM96 = 'D       '                                                            TTYPE97 = 'f356w_flux_aper_1'                                                   TFORM97 = 'D       '                                                            TUNIT97 = 'uJy     '                                                            TTYPE98 = 'f356w_fluxerr_aper_1'                                                TFORM98 = 'D       '                                                            TUNIT98 = 'uJy     '                                                            TTYPE99 = 'f356w_flag_aper_1'                                                   TFORM99 = 'I       '                                                            TNULL99 =                16959                                                  TTYPE100= 'f356w_bkg_aper_1'                                                    TFORM100= 'D       '                                                            TUNIT100= 'uJy     '                                                            TTYPE101= 'f356w_mask_aper_1'                                                   TFORM101= 'D       '                                                            TTYPE102= 'f356w_flux_aper_2'                                                   TFORM102= 'D       '                                                            TUNIT102= 'uJy     '                                                            TTYPE103= 'f356w_fluxerr_aper_2'                                                TFORM103= 'D       '                                                            TUNIT103= 'uJy     '                                                            TTYPE104= 'f356w_flag_aper_2'                                                   TFORM104= 'I       '                                                            TNULL104=                16959                                                  TTYPE105= 'f356w_bkg_aper_2'                                                    TFORM105= 'D       '                                                            TUNIT105= 'uJy     '                                                            TTYPE106= 'f356w_mask_aper_2'                                                   TFORM106= 'D       '                                                            TTYPE107= 'f356w_flux_aper_3'                                                   TFORM107= 'D       '                                                            TUNIT107= 'uJy     '                                                            TTYPE108= 'f356w_fluxerr_aper_3'                                                TFORM108= 'D       '                                                            TUNIT108= 'uJy     '                                                            TTYPE109= 'f356w_flag_aper_3'                                                   TFORM109= 'I       '                                                            TNULL109=                16959                                                  TTYPE110= 'f356w_bkg_aper_3'                                                    TFORM110= 'D       '                                                            TUNIT110= 'uJy     '                                                            TTYPE111= 'f356w_mask_aper_3'                                                   TFORM111= 'D       '                                                            TTYPE112= 'f356w_flux_aper_4'                                                   TFORM112= 'D       '                                                            TUNIT112= 'uJy     '                                                            TTYPE113= 'f356w_fluxerr_aper_4'                                                TFORM113= 'D       '                                                            TUNIT113= 'uJy     '                                                            TTYPE114= 'f356w_flag_aper_4'                                                   TFORM114= 'I       '                                                            TNULL114=                16959                                                  TTYPE115= 'f356w_bkg_aper_4'                                                    TFORM115= 'D       '                                                            TUNIT115= 'uJy     '                                                            TTYPE116= 'f356w_mask_aper_4'                                                   TFORM116= 'D       '                                                            TTYPE117= 'f356w_flux_aper_5'                                                   TFORM117= 'D       '                                                            TUNIT117= 'uJy     '                                                            TTYPE118= 'f356w_fluxerr_aper_5'                                                TFORM118= 'D       '                                                            TUNIT118= 'uJy     '                                                            TTYPE119= 'f356w_flag_aper_5'                                                   TFORM119= 'I       '                                                            TNULL119=                16959                                                  TTYPE120= 'f356w_bkg_aper_5'                                                    TFORM120= 'D       '                                                            TUNIT120= 'uJy     '                                                            TTYPE121= 'f356w_mask_aper_5'                                                   TFORM121= 'D       '                                                            TTYPE122= 'f356w_flux_aper_6'                                                   TFORM122= 'D       '                                                            TUNIT122= 'uJy     '                                                            TTYPE123= 'f356w_fluxerr_aper_6'                                                TFORM123= 'D       '                                                            TUNIT123= 'uJy     '                                                            TTYPE124= 'f356w_flag_aper_6'                                                   TFORM124= 'I       '                                                            TNULL124=                16959                                                  TTYPE125= 'f356w_bkg_aper_6'                                                    TFORM125= 'D       '                                                            TUNIT125= 'uJy     '                                                            TTYPE126= 'f356w_mask_aper_6'                                                   TFORM126= 'D       '                                                            TTYPE127= 'f356w_tot_corr'                                                      TFORM127= 'D       '                                                            TUNIT127= 'pix     '                                                            TTYPE128= 'apcorr_0'                                                            TFORM128= 'D       '                                                            TUNIT128= 'uJy     '                                                            TTYPE129= 'f356w_corr_0'                                                        TFORM129= 'D       '                                                            TUNIT129= 'uJy     '                                                            TTYPE130= 'f356w_ecorr_0'                                                       TFORM130= 'D       '                                                            TUNIT130= 'uJy     '                                                            TTYPE131= 'f356w_tot_0'                                                         TFORM131= 'D       '                                                            TUNIT131= 'uJy     '                                                            TTYPE132= 'f356w_etot_0'                                                        TFORM132= 'D       '                                                            TUNIT132= 'uJy     '                                                            TTYPE133= 'apcorr_1'                                                            TFORM133= 'D       '                                                            TUNIT133= 'uJy     '                                                            TTYPE134= 'f356w_corr_1'                                                        TFORM134= 'D       '                                                            TUNIT134= 'uJy     '                                                            TTYPE135= 'f356w_ecorr_1'                                                       TFORM135= 'D       '                                                            TUNIT135= 'uJy     '                                                            TTYPE136= 'f356w_tot_1'                                                         TFORM136= 'D       '                                                            TUNIT136= 'uJy     '                                                            TTYPE137= 'f356w_etot_1'                                                        TFORM137= 'D       '                                                            TUNIT137= 'uJy     '                                                            TTYPE138= 'apcorr_2'                                                            TFORM138= 'D       '                                                            TUNIT138= 'uJy     '                                                            TTYPE139= 'f356w_corr_2'                                                        TFORM139= 'D       '                                                            TUNIT139= 'uJy     '                                                            TTYPE140= 'f356w_ecorr_2'                                                       TFORM140= 'D       '                                                            TUNIT140= 'uJy     '                                                            TTYPE141= 'f356w_tot_2'                                                         TFORM141= 'D       '                                                            TUNIT141= 'uJy     '                                                            TTYPE142= 'f356w_etot_2'                                                        TFORM142= 'D       '                                                            TUNIT142= 'uJy     '                                                            TTYPE143= 'apcorr_3'                                                            TFORM143= 'D       '                                                            TUNIT143= 'uJy     '                                                            TTYPE144= 'f356w_corr_3'                                                        TFORM144= 'D       '                                                            TUNIT144= 'uJy     '                                                            TTYPE145= 'f356w_ecorr_3'                                                       TFORM145= 'D       '                                                            TUNIT145= 'uJy     '                                                            TTYPE146= 'f356w_tot_3'                                                         TFORM146= 'D       '                                                            TUNIT146= 'uJy     '                                                            TTYPE147= 'f356w_etot_3'                                                        TFORM147= 'D       '                                                            TUNIT147= 'uJy     '                                                            TTYPE148= 'apcorr_4'                                                            TFORM148= 'D       '                                                            TUNIT148= 'uJy     '                                                            TTYPE149= 'f356w_corr_4'                                                        TFORM149= 'D       '                                                            TUNIT149= 'uJy     '                                                            TTYPE150= 'f356w_ecorr_4'                                                       TFORM150= 'D       '                                                            TUNIT150= 'uJy     '                                                            TTYPE151= 'f356w_tot_4'                                                         TFORM151= 'D       '                                                            TUNIT151= 'uJy     '                                                            TTYPE152= 'f356w_etot_4'                                                        TFORM152= 'D       '                                                            TUNIT152= 'uJy     '                                                            TTYPE153= 'apcorr_5'                                                            TFORM153= 'D       '                                                            TUNIT153= 'uJy     '                                                            TTYPE154= 'f356w_corr_5'                                                        TFORM154= 'D       '                                                            TUNIT154= 'uJy     '                                                            TTYPE155= 'f356w_ecorr_5'                                                       TFORM155= 'D       '                                                            TUNIT155= 'uJy     '                                                            TTYPE156= 'f356w_tot_5'                                                         TFORM156= 'D       '                                                            TUNIT156= 'uJy     '                                                            TTYPE157= 'f356w_etot_5'                                                        TFORM157= 'D       '                                                            TUNIT157= 'uJy     '                                                            TTYPE158= 'apcorr_6'                                                            TFORM158= 'D       '                                                            TUNIT158= 'uJy     '                                                            TTYPE159= 'f356w_corr_6'                                                        TFORM159= 'D       '                                                            TUNIT159= 'uJy     '                                                            TTYPE160= 'f356w_ecorr_6'                                                       TFORM160= 'D       '                                                            TUNIT160= 'uJy     '                                                            TTYPE161= 'f356w_tot_6'                                                         TFORM161= 'D       '                                                            TUNIT161= 'uJy     '                                                            TTYPE162= 'f356w_etot_6'                                                        TFORM162= 'D       '                                                            TUNIT162= 'uJy     '                                                            TTYPE163= 'z_spec  '                                                            TFORM163= 'D       '                                                            TTYPE164= 'dummy_err'                                                           TFORM164= 'D       '                                                            TTYPE165= 'dummy_flux'                                                          TFORM165= 'D       '                                                            TUNIT165= 'uJy     '                                                            VERSION = '1.2.1   '                                                            MINAREA =                    9                                                  CLEAN   =                    T                                                  DEBCONT =                0.001                                                  DEBTHRSH=                   32                                                  HIERARCH FILTER_TYPE = 'conv    '                                               HIERARCH THRESHOLD = 1.8                                                        KRONFACT=                  2.5                                                  KRON0   =                  2.4                                                  KRON1   =                  3.8                                                  MINKRON =    7.000000000000253                                                  TOTCFILT= 'F356W   '                                                            TOTCWAVE=    35682.27763839694                                                  ZP      =     26.4767915513492                                                  PLAM    =    35682.27763839694                                                  FNU     =  9.3171562656984E-08                                                  FLAM    = 2.18801065033598E-21                                                  UJY2DN  =   10.732239891180923                                                  DRZ_FILE= '{root}-ir_drz_sci.fits'                                       WHT_FILE= '{root}-ir_drz_wht.fits'                                       GET_BACK=                    T                                                  BACK_BW =                   64                                                  BACK_BH =                   64                                                  BACK_FW =                    3                                                  BACK_FH =                    3                                                  HIERARCH BACK_PIXEL_SCALE = 0.06                                                HIERARCH ERR_SCALE = 0.00016574512                                              RESCALEW=                    T                                                  APERMASK=                    T                                                  GAIN    =               2000.0                                                  APER_0  =     7.20000000000026                                                  ASEC_0  =                 0.36                                                  APER_1  =    10.00002000000036                                                  ASEC_1  =   0.5000009999999999                                                  APER_2  =   14.000004000000505                                                  ASEC_2  =            0.7000002                                                  APER_3  =    20.00000400000072                                                  ASEC_3  =            1.0000002                                                  APER_4  =   24.000000000000867                                                  ASEC_4  =                  1.2                                                  APER_5  =   30.000000000001084                                                  ASEC_5  =                  1.5                                                  APER_6  =    60.00000000000217                                                  ASEC_6  =                  3.0                                                  HIERARCH F356W_VERSION = '1.2.1   '                                             F356W_ZP=     26.4767915513492                                                  HIERARCH F356W_PLAM = 35682.27763839694                                         HIERARCH F356W_FNU = 9.3171562656984E-08                                        HIERARCH F356W_FLAM = 2.18801065033598E-21                                      HIERARCH F356W_uJy2dn = 10.732239891180923                                      HIERARCH F356W_DRZ_FILE = '{root}-f356w_drz_sci.fits'                    HIERARCH F356W_WHT_FILE = '{root}-f356w_drz_wht.fits'                    HIERARCH F356W_GET_BACK = T                                                     HIERARCH F356W_BACK_BW = 64                                                     HIERARCH F356W_BACK_BH = 64                                                     HIERARCH F356W_BACK_FW = 3                                                      HIERARCH F356W_BACK_FH = 3                                                      HIERARCH F356W_BACK_PIXEL_SCALE = 0.06                                          HIERARCH F356W_ERR_SCALE = 0.00016574512                                        HIERARCH F356W_RESCALEW = T                                                     HIERARCH F356W_APERMASK = T                                                     HIERARCH F356W_GAIN = 2000.0                                                    HIERARCH F356W_aper_0 = 7.20000000000026                                        HIERARCH F356W_asec_0 = 0.36                                                    HIERARCH F356W_aper_1 = 10.00002000000036                                       HIERARCH F356W_asec_1 = 0.5000009999999999                                      HIERARCH F356W_aper_2 = 14.000004000000505                                      HIERARCH F356W_asec_2 = 0.7000002                                               HIERARCH F356W_aper_3 = 20.00000400000072                                       HIERARCH F356W_asec_3 = 1.0000002                                               HIERARCH F356W_aper_4 = 24.000000000000867                                      HIERARCH F356W_asec_4 = 1.2                                                     HIERARCH F356W_aper_5 = 30.000000000001084                                      HIERARCH F356W_asec_5 = 1.5                                                     HIERARCH F356W_aper_6 = 60.00000000000217                                       HIERARCH F356W_asec_6 = 3.0                                                     TOTALCOL= 'flux_auto'          / Column for total flux                          EE_CORR =                    F                                                  END          

@weiwwqeo
Copy link
Author

And here is the hdu[1].data:

FITS_rec([(   1, 1.800000e+30,  73,  0,    0,   24,    0,    2,    8.078514, 1.010497e+00,   32.392352, 0.622661, 0.04248 , 0.      , 0.      , 0.      ,  5.691433, 0.789052, 1.337135e-03, 0.030874, 1.606155, -4.212737e-03, 0.000135, 0.000208, 3.710147e-06, 5.511264e-06,    2,    1,    0,    2, 2,    9.078514, 2.010497e+00,    1, 189.234264, 62.149756, 189.234264, 62.149756, 0.      , 0.      ,  0,       inf, 2.4,  5.085984,      nan,      nan,      nan, 48, 153.93804 , 48, 0.      , 0.      , 0.      , 1.,       nan,      nan,      nan,      nan, 48,      nan, 30.904984,      nan,      nan, 48,      nan, 54.142055,      nan,      nan, 48,      nan, 97.950748,      nan,      nan, 48,      nan, 180.141119,      nan,      nan, 48,      nan, 237.468531,      nan,      nan, 48,      nan, 333.562526,      nan,      nan, 48,      nan, 1018.91579 ,      nan,      nan, 48,      nan, 30.904984,      nan,      nan, 48,      nan, 54.142055,      nan,      nan, 48,      nan, 97.950748,      nan,      nan, 48,      nan, 180.141119,      nan,      nan, 48,      nan, 237.468531,      nan,      nan, 48,      nan, 333.562526,      nan,      nan, 48,      nan, 1018.91579 , 1.,      nan, -9.900000e+01, -9.900000e+01, -9.900000e+01, -9.900000e+01,      nan, -9.900000e+01, -9.900000e+01, -9.900000e+01, -9.900000e+01, nan, -9.900000e+01, -9.900000e+01, -9.900000e+01, -9.900000e+01,      nan, -9.900000e+01, -9.900000e+01, -9.900000e+01, -9.900000e+01,      nan, -9.900000e+01, -9.900000e+01, -9.900000e+01, -9.900000e+01,      nan, -9.900000e+01, -9.900000e+01, -9.900000e+01, -9.900000e+01,      nan, -9.900000e+01, -9.90000e+01, -9.900000e+01, -9.90000e+01, -1., 2290867.652768,      nan),
          (   2, 1.800000e+30, 470,  0,  810,  966,    0,    2,  891.040651, 9.981140e-01, 1174.444207, 0.622709, 0.043857, 0.      , 0.      , 0.      , 34.270164, 0.789118, 3.736287e-05, 0.000851, 1.605891, -1.199378e-04, 0.002165, 0.003204, 8.140744e-06, 1.074598e-05,  894,    1,  893,    0, 2,  892.040651, 1.998114e+00,    2, 189.208013, 62.149772, 189.208013, 62.149772, 0.      , 0.      ,  0,       inf, 2.4, 12.480739,      nan,      nan,      nan, 32, 489.362243, 48, 0.      , 0.      , 0.      , 1.,       nan,      nan,      nan,      nan, 48,      nan, 30.823985,      nan,      nan, 48,      nan, 54.023964,      nan,      nan, 48,      nan, 97.781439,      nan,      nan, 48,      nan, 186.929525,      nan,      nan, 48,      nan, 262.055791,      nan,      nan, 48,      nan, 398.297764,      nan,      nan, 48,      nan, 1503.566162,      nan,      nan, 48,      nan, 30.823985,      nan,      nan, 48,      nan, 54.023964,      nan,      nan, 48,      nan, 97.781439,      nan,      nan, 48,      nan, 186.929525,      nan,      nan, 48,      nan, 262.055791,      nan,      nan, 48,      nan, 398.297764,      nan,      nan, 48,      nan, 1503.566162, 1.,      nan, -9.900000e+01, -9.900000e+01, -9.900000e+01, -9.900000e+01,      nan, -9.900000e+01, -9.900000e+01, -9.900000e+01, -9.900000e+01, nan, -9.900000e+01, -9.900000e+01, -9.900000e+01, -9.900000e+01,      nan, -9.900000e+01, -9.900000e+01, -9.900000e+01, -9.900000e+01,      nan, -9.900000e+01, -9.900000e+01, -9.900000e+01, -9.900000e+01,      nan, -9.900000e+01, -9.900000e+01, -9.900000e+01, -9.900000e+01,      nan, -9.900000e+01, -9.90000e+01, -9.900000e+01, -9.90000e+01, -1., 2290867.652768,      nan),
          (   3, 1.800000e+30, 220,  0, 1228, 1301,    0,    2, 1262.936476, 9.897968e-01,  253.940231, 0.622623, 0.027107, 0.      , 0.      , 0.      , 15.935502, 0.789063, 1.070073e-04, 0.003938, 1.606116, -3.428893e-04, 0.000436, 0.000646, 3.545459e-06, 4.814342e-06, 1260,    1, 1259,    0, 2, 1263.936476, 1.989797e+00,    3, 189.196956, 62.149776, 189.196956, 62.149776, 0.      , 0.      ,  0,       inf, 2.4,  8.510399,      nan,      nan,      nan, 32, 227.535767, 48, 0.      , 0.      , 0.      , 1.,       nan,      nan,      nan,      nan, 48,      nan, 30.7695  ,      nan,      nan, 48,      nan, 53.944591,      nan,      nan, 48,      nan, 97.667681,      nan,      nan, 48,      nan, 186.765047,      nan,      nan, 48,      nan, 261.85773 ,      nan,      nan, 48,      nan, 398.049488,      nan,      nan, 48,      nan, 1503.067748,      nan,      nan, 48,      nan, 30.7695  ,      nan,      nan, 48,      nan, 53.944591,      nan,      nan, 48,      nan, 97.667681,      nan,      nan, 48,      nan, 186.765047,      nan,      nan, 48,      nan, 261.85773 ,      nan,      nan, 48,      nan, 398.049488,      nan,      nan, 48,      nan, 1503.067748, 1.,      nan, -9.900000e+01, -9.900000e+01, -9.900000e+01, -9.900000e+01,      nan, -9.900000e+01, -9.900000e+01, -9.900000e+01, -9.900000e+01, nan, -9.900000e+01, -9.900000e+01, -9.900000e+01, -9.900000e+01,      nan, -9.900000e+01, -9.900000e+01, -9.900000e+01, -9.900000e+01,      nan, -9.900000e+01, -9.900000e+01, -9.900000e+01, -9.900000e+01,      nan, -9.900000e+01, -9.900000e+01, -9.900000e+01, -9.900000e+01,      nan, -9.900000e+01, -9.90000e+01, -9.900000e+01, -9.90000e+01, -1., 2290867.652768,      nan),
          ...,
          (8484, 1.468299e-03,  25, 22, 3637, 3643, 5334, 5339, 3639.765077, 5.336575e+03,    1.907352, 1.704639, 0.302385, 0.012242, 0.011305, 0.001982,  1.457709, 1.219457, 6.236885e-01, 0.539458, 0.60361 , -1.913886e-01, 0.005158, 0.00653 , 2.927193e-04, 4.644745e-04, 3640, 5337, 3640, 5337, 0, 3640.765077, 5.337575e+03, 8484, 189.12626 , 62.223893, 189.12626 , 62.223893, 0.005965, 0.000369, 22, 29.461056, 3.8,  5.066432, 0.011529, 0.001015, 0.002156,  0, 153.93804 , 32, 1.344777, 2.634968, 5.115999, 1., 28.745532, 0.095573, 0.007643, 0.000781,  0, 0.00057 ,  0.      , 0.010229, 0.000984,  0, 0.0011  ,  0.      , 0.011529, 0.001252,  0, 0.002156,  0.      , 0.015472, 0.001672, 32, 0.004404,   0.      , 0.016048, 0.001929, 32, 0.006347,   0.      , 0.016384, 0.00232 , 32, 0.009931,   0.      , 0.045878, 0.008098, 32, 0.039349,  229.747374, 0.051478, 0.003729,  0, 0.003838,  0.      , 0.068895, 0.005052,  0, 0.007412,  0.      , 0.077652, 0.007095,  0, 0.01452 ,  0.      , 0.104213, 0.009949, 32, 0.029661,   0.      , 0.108089, 0.011826, 32, 0.042753,   0.      , 0.110352, 0.014654, 32, 0.06689 ,   0.      , 0.309007, 0.053783, 32, 0.265036,  229.747374, 1., 1.508456,  7.765169e-02,  5.624815e-03,  7.765169e-02,  5.624815e-03, 1.1271  ,  7.765169e-02,  5.694002e-03,  7.765169e-02,  5.694002e-03,  1.,  7.765167e-02,  7.095067e-03,  7.765167e-02,  7.095067e-03, 0.745126,  7.765165e-02,  7.413575e-03,  7.765165e-02,  7.413575e-03, 0.718404,  7.765162e-02,  8.496016e-03,  7.765162e-02,  8.496016e-03, 0.703673,  7.765158e-02,  1.031174e-02,  7.765158e-02,  1.031174e-02, 0.251294,  7.765153e-02,  1.35154e-02,  7.765153e-02,  1.35154e-02, -1., 2290867.652768, 0.011529),
          (8485, 1.493883e-03,  52, 44, 3648, 3656, 5338, 5345, 3651.51224 , 5.341561e+03,    3.819873, 2.802106, 0.62723 , 0.006883, 0.005004, 0.001415,  2.029455, 1.582179, 4.445960e-01, 0.271778, 0.370492, -1.216709e-01, 0.015509, 0.017368, 5.862125e-04, 9.282941e-04, 3652, 5342, 3652, 5342, 0, 3652.51224 , 5.342561e+03, 8485, 189.12591 , 62.223962, 189.12591 , 62.223962, 0.016882, 0.000549, 48, 28.331466, 3.8,  6.809279, 0.022709, 0.000981, 0.002079,  0, 153.93804 , 32, 1.386909, 2.60292 , 5.819956, 1., 28.009501, 0.046919, 0.015417, 0.000987,  0, 0.000551,  0.      , 0.018917, 0.001171,  0, 0.001059,  0.      , 0.022709, 0.001422,  0, 0.002081,  0.      , 0.03065 , 0.001851, 32, 0.004243,   0.      , 0.038157, 0.002157, 32, 0.006116,   0.      , 0.04294 , 0.002591, 32, 0.009553,   0.656573, 0.068152, 0.007662, 32, 0.03819 ,  597.756753, 0.103838, 0.004058,  0, 0.003712,  0.      , 0.127413, 0.005309,  0, 0.007135,  0.      , 0.152955, 0.007128,  0, 0.014016,  0.      , 0.206441, 0.010014, 32, 0.028581,   0.      , 0.257002, 0.011929, 32, 0.041194,   0.      , 0.289218, 0.015078, 32, 0.064347,   0.656573, 0.459032, 0.050404, 32, 0.257227,  597.756753, 1., 1.473011,  1.529549e-01,  5.977502e-03,  1.529549e-01,  5.977502e-03, 1.200462,  1.529549e-01,  6.373087e-03,  1.529549e-01,  6.373087e-03,  1.,  1.529549e-01,  7.128486e-03,  1.529549e-01,  7.128486e-03, 0.740913,  1.529549e-01,  7.419564e-03,  1.529549e-01,  7.419564e-03, 0.59515 ,  1.529549e-01,  7.099780e-03,  1.529549e-01,  7.099780e-03, 0.528857,  1.529549e-01,  7.974286e-03,  1.529549e-01,  7.974286e-03, 0.333212, -9.900000e+01, -9.90000e+01, -9.900000e+01, -9.90000e+01, -1., 2290867.652768, 0.022709),
          (8486, 1.524254e-03,  16,  9, 3578, 3585, 5357, 5360, 3582.79716 , 5.358809e+03,    2.818219, 1.093399, 0.614067, 0.028832, 0.011117, 0.006064,  1.736232, 0.947163, 3.093790e-01, 0.40431 , 1.042102, -4.541308e-01, 0.003476, 0.004855, 3.303603e-04, 1.081322e-03, 3582, 5359, 3583, 5359, 1, 3583.79716 , 5.359809e+03, 8486, 189.127957, 62.224202, 189.127957, 62.224202, 0.004299, 0.00029 , 11, 29.816669, 3.8,  4.873037, 0.012822, 0.007972, 0.002744, 32, 153.93804 , 32, 1.144179, 2.879078, 4.861995, 1., 28.630121, 0.675015, 0.008866, 0.008117, 32, 0.000722,  3.      , 0.011604, 0.008049, 32, 0.001393,  3.      , 0.012822, 0.008009, 32, 0.002743,  3.      , 0.015212, 0.008047, 32, 0.00559 ,   3.      , 0.01433 , 0.008088, 32, 0.00805 ,   3.      , 0.015495, 0.010417, 32, 0.012575,  16.796273, 0.018644, 0.113797, 32, 0.049089, 1036.079836, 0.059713, 0.054522, 32, 0.004865,  3.      , 0.07816 , 0.054019, 32, 0.009379,  3.      , 0.086361, 0.053729, 32, 0.018475,  3.      , 0.102462, 0.053944, 32, 0.037648,   3.      , 0.096517, 0.054236, 32, 0.054223,   3.      , 0.104365, 0.069963, 32, 0.0847  ,  16.796273, 0.125578, 0.766447, 32, 0.330636, 1036.079836, 1., 1.446258,  8.636056e-02,  7.885361e-02,  8.636056e-02,  7.885361e-02, 1.10492 ,  8.636056e-02,  5.968639e-02,  8.636056e-02,  5.968639e-02,  1.,  8.636055e-02,  5.372883e-02,  8.636055e-02,  5.372883e-02, 0.842852,  8.636054e-02,  4.546693e-02,  8.636054e-02,  4.546693e-02, 0.894773,  8.636052e-02,  4.852862e-02,  8.636052e-02,  4.852862e-02, 0.827486,  8.636050e-02,  5.789352e-02,  8.636050e-02,  5.789352e-02, 0.687704, -9.900000e+01, -9.90000e+01, -9.900000e+01, -9.90000e+01, -1., 2290867.652768, 0.012822)],
         dtype=(numpy.record, [('id', '>i4'), ('thresh', '>f8'), ('npix', '>i8'), ('tnpix', '>i8'), ('xmin', '>i8'), ('xmax', '>i8'), ('ymin', '>i8'), ('ymax', '>i8'), ('x', '>f8'), ('y', '>f8'), ('x2_image', '>f8'), ('y2_image', '>f8'), ('xy_image', '>f8'), ('errx2', '>f8'), ('erry2', '>f8'), ('errxy', '>f8'), ('a_image', '>f8'), ('b_image', '>f8'), ('theta_image', '>f8'), ('cxx_image', '>f8'), ('cyy_image', '>f8'), ('cxy_image', '>f8'), ('cflux', '>f8'), ('flux', '>f8'), ('cpeak', '>f8'), ('peak', '>f8'), ('xcpeak', '>i8'), ('ycpeak', '>i8'), ('xpeak', '>i8'), ('ypeak', '>i8'), ('flag', '>i8'), ('x_image', '>f8'), ('y_image', '>f8'), ('number', '>i4'), ('ra', '>f8'), ('dec', '>f8'), ('x_world', '>f8'), ('y_world', '>f8'), ('flux_iso', '>f8'), ('fluxerr_iso', '>f8'), ('area_iso', '>i8'), ('mag_iso', '>f8'), ('kron_radius', '>f8'), ('kron_rcirc', '>f8'), ('flux_auto', '>f8'), ('fluxerr_auto', '>f8'), ('bkg_auto', '>f8'), ('flag_auto', '>i8'), ('area_auto', '>f8'), ('flux_radius_flag', '>i2'), ('flux_radius_20', '>f8'), ('flux_radius', '>f8'), ('flux_radius_90', '>f8'), ('tot_corr', '>f8'), ('mag_auto', '>f8'), ('magerr_auto', '>f8'), ('flux_aper_0', '>f8'), ('fluxerr_aper_0', '>f8'), ('flag_aper_0', '>i2'), ('bkg_aper_0', '>f8'), ('mask_aper_0', '>f8'), ('flux_aper_1', '>f8'), ('fluxerr_aper_1', '>f8'), ('flag_aper_1', '>i2'), ('bkg_aper_1', '>f8'), ('mask_aper_1', '>f8'), ('flux_aper_2', '>f8'), ('fluxerr_aper_2', '>f8'), ('flag_aper_2', '>i2'), ('bkg_aper_2', '>f8'), ('mask_aper_2', '>f8'), ('flux_aper_3', '>f8'), ('fluxerr_aper_3', '>f8'), ('flag_aper_3', '>i2'), ('bkg_aper_3', '>f8'), ('mask_aper_3', '>f8'), ('flux_aper_4', '>f8'), ('fluxerr_aper_4', '>f8'), ('flag_aper_4', '>i2'), ('bkg_aper_4', '>f8'), ('mask_aper_4', '>f8'), ('flux_aper_5', '>f8'), ('fluxerr_aper_5', '>f8'), ('flag_aper_5', '>i2'), ('bkg_aper_5', '>f8'), ('mask_aper_5', '>f8'), ('flux_aper_6', '>f8'), ('fluxerr_aper_6', '>f8'), ('flag_aper_6', '>i2'), ('bkg_aper_6', '>f8'), ('mask_aper_6', '>f8'), ('f356w_flux_aper_0', '>f8'), ('f356w_fluxerr_aper_0', '>f8'), ('f356w_flag_aper_0', '>i2'), ('f356w_bkg_aper_0', '>f8'), ('f356w_mask_aper_0', '>f8'), ('f356w_flux_aper_1', '>f8'), ('f356w_fluxerr_aper_1', '>f8'), ('f356w_flag_aper_1', '>i2'), ('f356w_bkg_aper_1', '>f8'), ('f356w_mask_aper_1', '>f8'), ('f356w_flux_aper_2', '>f8'), ('f356w_fluxerr_aper_2', '>f8'), ('f356w_flag_aper_2', '>i2'), ('f356w_bkg_aper_2', '>f8'), ('f356w_mask_aper_2', '>f8'), ('f356w_flux_aper_3', '>f8'), ('f356w_fluxerr_aper_3', '>f8'), ('f356w_flag_aper_3', '>i2'), ('f356w_bkg_aper_3', '>f8'), ('f356w_mask_aper_3', '>f8'), ('f356w_flux_aper_4', '>f8'), ('f356w_fluxerr_aper_4', '>f8'), ('f356w_flag_aper_4', '>i2'), ('f356w_bkg_aper_4', '>f8'), ('f356w_mask_aper_4', '>f8'), ('f356w_flux_aper_5', '>f8'), ('f356w_fluxerr_aper_5', '>f8'), ('f356w_flag_aper_5', '>i2'), ('f356w_bkg_aper_5', '>f8'), ('f356w_mask_aper_5', '>f8'), ('f356w_flux_aper_6', '>f8'), ('f356w_fluxerr_aper_6', '>f8'), ('f356w_flag_aper_6', '>i2'), ('f356w_bkg_aper_6', '>f8'), ('f356w_mask_aper_6', '>f8'), ('f356w_tot_corr', '>f8'), ('apcorr_0', '>f8'), ('f356w_corr_0', '>f8'), ('f356w_ecorr_0', '>f8'), ('f356w_tot_0', '>f8'), ('f356w_etot_0', '>f8'), ('apcorr_1', '>f8'), ('f356w_corr_1', '>f8'), ('f356w_ecorr_1', '>f8'), ('f356w_tot_1', '>f8'), ('f356w_etot_1', '>f8'), ('apcorr_2', '>f8'), ('f356w_corr_2', '>f8'), ('f356w_ecorr_2', '>f8'), ('f356w_tot_2', '>f8'), ('f356w_etot_2', '>f8'), ('apcorr_3', '>f8'), ('f356w_corr_3', '>f8'), ('f356w_ecorr_3', '>f8'), ('f356w_tot_3', '>f8'), ('f356w_etot_3', '>f8'), ('apcorr_4', '>f8'), ('f356w_corr_4', '>f8'), ('f356w_ecorr_4', '>f8'), ('f356w_tot_4', '>f8'), ('f356w_etot_4', '>f8'), ('apcorr_5', '>f8'), ('f356w_corr_5', '>f8'), ('f356w_ecorr_5', '>f8'), ('f356w_tot_5', '>f8'), ('f356w_etot_5', '>f8'), ('apcorr_6', '>f8'), ('f356w_corr_6', '>f8'), ('f356w_ecorr_6', '>f8'), ('f356w_tot_6', '>f8'), ('f356w_etot_6', '>f8'), ('z_spec', '>f8'), ('dummy_err', '>f8'), ('dummy_flux', '>f8')]))

There's some nan in it. Would this matter?

@weiwwqeo
Copy link
Author

I have fixed the nan's and the inf's to 0, but it still does not work.
I notice the there is nothing in file 'zphot.translate'.

@weiwwqeo
Copy link
Author

In the grizli/grizli/pipeline/photoz.py, I try to see the source code of photoz.eazy_photoz.
I notice there is a dic. called FILTER_TRANS. There is no filters like "f356w" "f210m" which the NIRCam use.
Should I manually make some changes in this dic?

FILTER_TRANS = {'f098m': 201, 'f105w': 202, 'f110w': 241, 'f125w': 203, 'f140w': 204, 'f160w': 205, 'f435w': 233, 'f475w': 234, 'f555w': 235, 'f606w': 236, 'f625w': 237, 'f775w': 238, 'f814w': 239, 'f850lp': 240, 'f702w': 15, 'f600lpu': 243, 'f225wu': 207, 'f275wu': 208, 'f336wu': 209, 'f350lpu': 339, 'f438wu': 211, 'f475wu': 212, 'f475xu': 242, 'f555wu': 213, 'f606wu': 214, 'f625wu': 215, 'f775wu': 216, 'f814wu': 217, 'f390wu': 210, 'ch1': 18, 'ch2': 19, 'f336w':209, 'f350lp':339, 'f115wn': 309, 'f150wn': 310, 'f200wn': 311, }

So in the translate step, there's nothing comes out.

    # Translate
    fp = open('zphot.translate', 'w')
    for f in filters:
        if f in filter_trans:
            fp.write('{0}_tot_{1} F{2}\n'.format(f, aper_ix, filter_trans[f]))
            fp.write('{0}_etot_{1} E{2}\n'.format(f, aper_ix, filter_trans[f]))
    
    extra_filters = {'hscg':314, 'hscr':315, 'hsci':316, 
                     'hscz':317, 'hscy':318, 
                     'irac_ch1':18, 'irac_ch2':19, 
                     'irac_ch3':20, 'irac_ch4':21}
    
    for c in extra_filters:
        if f'{c}_flux' in cat.colnames:
            fp.write(f'{c}_flux F{extra_filters[c]}\n')
            fp.write(f'{c}_err  E{extra_filters[c]}\n')

    # fp.write('irac_ch1_flux F18\n')
    # fp.write('irac_ch1_err  E18\n')
    # 
    # fp.write('irac_ch2_flux F19\n')
    # fp.write('irac_ch2_err  E19\n')
    # 
    # fp.write('irac_ch3_flux F20\n')
    # fp.write('irac_ch3_err  E20\n')
    # 
    # fp.write('irac_ch4_flux F21\n')
    # fp.write('irac_ch4_err  E21\n')

    for k in extra_translate:
        fp.write('{0} {1}\n'.format(k, extra_translate[k]))

    # For zeropoint
    if dummy_prior:
        fp.write('dummy_flux F205x\n')
        fp.write('dummy_err  E205x\n')

    fp.close()

@TheSkyentist
Copy link
Contributor

My gut is telling me that you might be associating the incorrect direct image with the dispersed filter. But I don't work enough with NIRCam data to say much further. What is your observational set up?

@Sherlockhomel
Copy link

Hello! I am weiwwqeo's partner. We add the filters of the direct images such as 'f210m':205 to the FILTER_TRANS in the photoz.py, and the codes run successfully. We are coping with the data products of FRESCO:The First Reionization Epoch Spectroscopic COmplete Survey. And here is some information:

FILE FILTER DETECTOR
jw01895001001_02101_00001_nrca1_rate.fits NRCA1-F210M-CLEAR NRCA1
jw01895001001_02101_00001_nrca2_rate.fits NRCA2-F210M-CLEAR NRCA2
jw01895001001_02101_00001_nrca3_rate.fits NRCA3-F210M-CLEAR NRCA3
jw01895001001_02101_00001_nrca4_rate.fits NRCA4-F210M-CLEAR NRCA4
jw01895001001_02101_00001_nrcalong_rate.fits NRCA5-F444W-GRISMR NRCALONG

@TheSkyentist
Copy link
Contributor

Great! Perhaps you can submit a PR with these fixes? @gbrammer are there missing filters that could cause this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants