jacopo-chevallard / PyP-BEAGLE

4 stars 1 forks source link

for future implementation of plot_integrated_fluxes.py #31

Closed feltre closed 5 years ago

feltre commented 6 years ago

I have noticed that in the temporary post-processing routine plot_integrated_fluxes.py there is a problem with the following lines

       if IDs is None:
           IDs = IDs_
           indx = range(len(IDs))
       else:
           # find index in summary catalogue identical to IDs
               indx, _ = match_ID(IDs_, IDs) 

once the ID orders in the summary_catalogue differ from those of the input catalogue of observables. More precisely, this happens when the catalogue ID are in increasing order (but in String format), while they are in mixed order in the summary_catalogue.

For the moment, I have solved by substituting the above lines with the followings (even thought there might be a smarter way of solving the problem).

       if IDs is None:
           IDs = IDs_
           indx = range(len(IDs))
       else:
           # find index in summary catalogue identical to IDs
           for xxx in range (0,len(IDs)-1):
               in = np.where(IDs_ == IDs[xxx])
               indx[xxx]=np.asscalar(in[0])
               #indx, _ = match_ID(IDs_, IDs) 
               #print "here", IDs[xxx], in[0], IDs_[in[0]]
jacopo-chevallard commented 5 years ago

As of release 0.6.0 the spectral indices can be plotted using the "standard" pyp_beagle commands, and providing a JSON configuration file similar to emission_lines.json. Note that the key of each entry (e.g. each emission line) in the JSON structure must reflect the value in the label: token of the Beagle SPECTRAL INDICES CONFIGURATION file.

Below an example image obtained with the command

 pyp_beagle --plot-marginal --json-line-labels emission_lines.json --ID-key sbid --log-flux --fontsize 14 --show-line-values

82_beagle_spectral_indices