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

assign colors to filters #3

Open
yuval-harpaz opened this issue Mar 11, 2023 · 0 comments
Open

assign colors to filters #3

yuval-harpaz opened this issue Mar 11, 2023 · 0 comments

Comments

@yuval-harpaz
Copy link

We want to assign colors to layers. I had a few experiments. trying to get a range of colors from red to yellow-white yielded images too monotonous so I couldn't see difference between "red" galaxies and not so red galaxies. Also, I thought to assign fixed colors. but if we only have NIRCam images, the colors' maximum redness is 440/2100 from maximum. So I tried dividing the colormap col by the maximum filter.
I create the colormap like this:
col = matplotlib.cm.jet(filter/np.max(filter))[:, :3] # colormap based on the filters
Then create RGB like this:

mean = np.zeros((layers.shape[0], layers.shape[1], 3))
for lay in range(layers.shape[2]):
    for ic in range(3):
        mean[:, :, ic] = np.nansum(np.array([mean[:, :, ic], layers[:, :, lay]*(1/layers.shape[2])*col[lay, ic]]), 0)

Here are two results, one for NIRCam only, nicely detailed but with little blue, and another using NIRCam + MIRI, more blue but some of the fine details are smoothed out.

image
For this example layers has the shape of (4633, 4127, 13)

path = ['jw01355-o009_t009_nircam_clear-f115w/jw01355-o009_t009_nircam_clear-f115w_i2d.fits',
 'jw01355-o009_t009_nircam_clear-f150w/jw01355-o009_t009_nircam_clear-f150w_i2d.fits',
 'jw01355-o009_t009_nircam_clear-f200w/jw01355-o009_t009_nircam_clear-f200w_i2d.fits',
 'jw01355-o009_t009_nircam_clear-f277w/jw01355-o009_t009_nircam_clear-f277w_i2d.fits',
 'jw01355-o009_t009_nircam_clear-f356w/jw01355-o009_t009_nircam_clear-f356w_i2d.fits',
 'jw01355-o009_t009_nircam_clear-f444w/jw01355-o009_t009_nircam_clear-f444w_i2d.fits',
 'jw01355-o010_t009_miri_f1000w/jw01355-o010_t009_miri_f1000w_i2d.fits',
 'jw01355-o010_t009_miri_f1280w/jw01355-o010_t009_miri_f1280w_i2d.fits',
 'jw01355-o010_t009_miri_f1500w/jw01355-o010_t009_miri_f1500w_i2d.fits',
 'jw01355-o010_t009_miri_f1800w/jw01355-o010_t009_miri_f1800w_i2d.fits',
 'jw01355-o010_t009_miri_f2100w/jw01355-o010_t009_miri_f2100w_i2d.fits',
 'jw01355-o010_t009_miri_f560w/jw01355-o010_t009_miri_f560w_i2d.fits',
 'jw01355-o010_t009_miri_f770w/jw01355-o010_t009_miri_f770w_i2d.fits']
filter = [ 115.,  150.,  200.,  277.,  356.,  444.,  560.,  770., 1000., 1280., 1500., 1800., 2100.]
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

1 participant