-
Notifications
You must be signed in to change notification settings - Fork 52
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
Comments
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? |
I begin with a series of
And the output:
|
Is this NIRISS or NIRCAM data?
…On Thu, Aug 22, 2024 at 14:20 喂喂喂企鹅哦 ***@***.***> wrote:
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.
—
Reply to this email directly, view it on GitHub
<#244 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEB6FNAGP67RFVUOABX5OMDZSXJPPAVCNFSM6AAAAABM55IALKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBUGUZTCNRQGE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
It's NIRCAM data. |
Can you show the contents of the |
Sure!
|
And here is the hdu[1].data:
There's some |
I have fixed the |
In the grizli/grizli/pipeline/photoz.py, I try to see the source code of photoz.eazy_photoz.
So in the translate step, there's nothing comes out.
|
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? |
Hello! I am weiwwqeo's partner. We add the filters of the direct images such as
|
Great! Perhaps you can submit a PR with these fixes? @gbrammer are there missing filters that could cause this? |
--> 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.
The text was updated successfully, but these errors were encountered: