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

Getting variable size error while running Coronagraph_Basic.ipynb notebook. #61

Open
asahooexo opened this issue Sep 12, 2024 · 0 comments

Comments

@asahooexo
Copy link

  • pyNRC version: 1.2.1 , build: <dev_0>, channel:
  • Python version: 3.11.9
  • Operating System: macOS

Description

I am getting some error while running the Coronagraph_Basic.ipynb notebook. Specifically at cell 14 of the notebook, where obs.gen_roll_image() is called. It seems like there is an array size mismatch while adding some images.

What I Did

the parameter, fov_pix, is set to 321 in the notebook, I changed it to 320 to be consistent with wind_modevalue. I don’t get any error and I am able to generate some contrast plots that looks nearly same as shown in the remote notebooks.

Paste the command(s) you ran and the output.
If there was a crash, please include the traceback here.
0%|                                                     | 0/3 [00:11<?, ?it/s]
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In[14], line 12
      9 for wfe_drift in tqdm(wfe_list):
     10     # Assume drift between Roll1 and Roll2 is 2 nm WFE
     11     wfe_roll_drift = 0 if wfe_drift<2 else 2
---> 12     hdulist = obs.gen_roll_image(PA1=PA1, PA2=PA2,
     13                                  wfe_ref_drift=wfe_drift, wfe_roll_drift=wfe_roll_drift)
     14     hdul_dict[wfe_drift] = hdulist

File ~/repos/pynrc/pynrc/obs_nircam.py:1942, in obs_hci.gen_roll_image(self, PA1, PA2, return_oversample, no_ref, opt_diff, fix_sat, ref_scale_all, wfe_drift0, wfe_ref_drift, wfe_roll_drift, xyoff_roll1, xyoff_roll2, xyoff_ref, interp, **kwargs)
   1940 if interp is None:
   1941     interp = 'linear' if ('FULL' in self.det_info['wind_mode']) else 'cubic'
-> 1942 im_roll1 = self.gen_slope_image(PA=PA1, xyoff_asec=xyoff_asec1, im_star=im_star, 
   1943                                 return_oversample=True, interp=interp, **kwargs)
   1945 if no_ref and (roll_angle==0):
   1946     _log.warning('If no_ref=True, then PA1 must not equal PA2. Setting no_ref=False')

File ~/repos/pynrc/pynrc/obs_nircam.py:1615, in obs_hci.gen_slope_image(self, PA, xyoff_asec, return_oversample, exclude_disk, exclude_planets, exclude_noise, zfact, do_ref, do_roll2, im_star, sat_val, wfe_drift0, wfe_ref_drift, wfe_roll_drift, shift_method, interp, apply_distortions, diffusion_sigma, kipc, kppc, psf_corr_over, **kwargs)
   1612     fzodi = frebin(fzodi, scale=oversample)
   1614 # Combine components
-> 1615 im_final_over = im_star + im_disk + im_pl + fzodi
   1617 # Noise per detector pixel
   1618 if not exclude_noise:

ValueError: operands could not be broadcast together with shapes (642,642) (640,640) 

@asahooexo asahooexo changed the title Getting some variable size error while running Coronagraph_Basic.ipynb notebook. Getting variable size error while running Coronagraph_Basic.ipynb notebook. Sep 12, 2024
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