Skip to content

Commit

Permalink
MR: Correction of the HiRISE type data loops when using cuts
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthieuR18 committed Aug 8, 2024
1 parent 345837c commit 928d437
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ForMoSA/adapt/adapt_obs_mod.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ def launch_adapt(global_params, justobs='no'):
if len(transm_obs_extract) != 0:
transm_obs_extract = np.concatenate((transm_obs_extract, obs_opt[c][1]))
if len(star_flx_obs_extract) != 0:
star_flx_obs_extract = np.concatenate((star_flx_obs_extract, obs_opt[c][2]))
star_flx_obs_extract = np.concatenate((star_flx_obs_extract, obs_opt[c][2]), axis=1)
if len(system_obs_extract) != 0:
system_obs_extract = np.concatenate((system_obs_extract, obs_opt[c][3]), axis=0)
system_obs_extract = np.concatenate((system_obs_extract, obs_opt[c][3]), axis=1)
# Save the interpolated resolution of the grid
res_mod_obs_merge.append(res_mod_cut)

Expand Down
4 changes: 2 additions & 2 deletions ForMoSA/nested_sampling/nested_sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,9 @@ def loglike(theta, theta_index, global_params, main_file, for_plot='no'):
if len(transm_obs_ns_u) != 0: # Merge the transmissions (if necessary)
transm_obs_ns_u = np.concatenate((transm_obs_ns_u, transm_obs[ind_spectro]))
if len(star_flx_obs_ns_u) != 0: # Merge star fluxes (if necessary)
star_flx_obs_ns_u = np.concatenate((star_flx_obs_ns_u, star_flx_obs[0,ind_grid_spectro_sel]),axis=0)
star_flx_obs_ns_u = np.concatenate((star_flx_obs_ns_u, star_flx_obs[0,ind_grid_spectro_sel]),axis=1)
if len(system_obs) != 0: # Merge systematics model (if necessary)
system_obs_ns_u = np.concatenate((system_obs_ns_u, system_obs[0,ind_grid_spectro_sel]), axis=0)
system_obs_ns_u = np.concatenate((system_obs_ns_u, system_obs[0,ind_grid_spectro_sel]), axis=1)
wav_obs_photo_ns_u = np.concatenate((wav_obs_photo_ns_u, wav_obs_photo[ind_photo]))
flx_obs_photo_ns_u = np.concatenate((flx_obs_photo_ns_u, flx_obs_photo[ind_photo]))
err_obs_photo_ns_u = np.concatenate((err_obs_photo_ns_u, err_obs_photo[ind_photo]))
Expand Down
15 changes: 15 additions & 0 deletions RELEASE_NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -361,3 +361,18 @@ Comments:
Tests:
Webpage API is generating without issues locally (make html)



- - -

08/08/2024

Matthieu Ravet

Comments:
- Correcting for the HiRISE type data merging when using cuts (i.e. remplacing axis=0 by axis=1). In the future, it would be
nice to create a more simple version of the star and systematic matrix (for now its (1, lambda, sys/star) it would be best to
have (lambda, sys/star) to avoid keeping large matrices accross the inversion)

Tests:
- Test with CRIRES+ datasets with cuts in the adapt and in the fit

0 comments on commit 928d437

Please sign in to comment.