original_docstring: 
          Function to query splatalogue for a specific molecule. By default, the
          frequency range that will be requested corresponds to the spectral range
          available in the experiment.
          
          Parameters
          ----------
          species : str
              Identifier for a specific molecule, typically name
          
          Returns
          -------
          FigureWidget
              Plotly FigureWidget that shows the experimental spectrum along
              with the detected peaks, and the molecule spectrum.
          DataFrame
              Pandas DataFrame from the Splatalogue query.
          
          Raises
          ------
          Exception
              If no species are found in the query, raises Exception.
          
docstring: Function to query splatalogue for a specific molecule. By default, the
  frequency range that will be requested corresponds to the spectral range
  available in the experiment.
  
  Parameters
  
  species : str
  Identifier for a specific molecule, typically name
  
  Returns
  
  FigureWidget
  Plotly FigureWidget that shows the experimental spectrum along
  with the detected peaks, and the molecule spectrum.
  DataFrame
  Pandas DataFrame from the Splatalogue query.
  
  Raises
  
  Exception
  If no species are found in the query, raises Exception.
docstring_tokens: Function to query splatalogue for a specific molecule . By default the frequency range that will be requested corresponds to the spectral range available in the experiment . Parameters species : str Identifier for a specific molecule typically name Returns FigureWidget Plotly FigureWidget that shows the experimental spectrum along with the detected peaks and the molecule spectrum . DataFrame Pandas DataFrame from the Splatalogue query . Raises Exception If no species are found in the query raises Exception .
code: def overlay_molecule(self, species: str, freq_range=None, threshold=-7.0):
          """
          Function to query splatalogue for a specific molecule. By default, the
          frequency range that will be requested corresponds to the spectral range
          available in the experiment.
          
          Parameters
          ----------
          species : str
              Identifier for a specific molecule, typically name
          
          Returns
          -------
          FigureWidget
              Plotly FigureWidget that shows the experimental spectrum along
              with the detected peaks, and the molecule spectrum.
          DataFrame
              Pandas DataFrame from the Splatalogue query.
          
          Raises
          ------
          Exception
              If no species are found in the query, raises Exception.
          """
          if freq_range is None:
              freq_range = [
                  self.data[self.freq_col].min(),
                  self.data[self.freq_col].max(),
              ]
          molecule_df = analysis.search_molecule(species, freq_range)
          # Threshold intensity
          molecule_df = molecule_df.loc[molecule_df["CDMS/JPL Intensity"] >= threshold]
          # This prevents missing values from blowing up the normalization
          molecule_df.loc[molecule_df["CDMS/JPL Intensity"] > -1.0][
              "CDMS/JPL Intensity"
          ] = -1.0
          # Calculate the real intensity and normalize
          molecule_df["Intensity"] = 10 ** molecule_df["CDMS/JPL Intensity"]
          molecule_df["Normalized"] = (
              molecule_df["Intensity"] / molecule_df["Intensity"].max()
          )
          # Add annotations to the hovertext
          molecule_df["Annotation"] = (
              molecule_df["Resolved QNs"].astype(str)
              + "-"
              + molecule_df["E_U (K)"].astype(str)
          )
          if len(molecule_df) != 0:
              fig = self.plot_spectrum()
              fig.add_bar(
                  x=molecule_df["Frequency"],
                  y=molecule_df["Normalized"],
                  hoverinfo="text",
                  text=molecule_df["Annotation"],
                  name=species,
                  width=2.0,
              )
              molecule_df.to_csv(f"linelists/{species}-splatalogue.csv", index=False)
              return fig, molecule_df
          else:
              raise Exception(f"No molecules found in Splatalogue named {species}.")
code_tokens: def overlay_molecule ( self , species : str , freq_range = None , threshold = - 7.0 ) : if freq_range is None : freq_range = [ self . data [ self . freq_col ] . min ( ) , self . data [ self . freq_col ] . max ( ) , ] molecule_df = analysis . search_molecule ( species , freq_range ) molecule_df = molecule_df . loc [ molecule_df [ "CDMS/JPL Intensity" ] >= threshold ] molecule_df . loc [ molecule_df [ "CDMS/JPL Intensity" ] > - 1.0 ] [ "CDMS/JPL Intensity" ] = - 1.0 molecule_df [ "Intensity" ] = 10 ** molecule_df [ "CDMS/JPL Intensity" ] molecule_df [ "Normalized" ] = ( molecule_df [ "Intensity" ] / molecule_df [ "Intensity" ] . max ( ) ) molecule_df [ "Annotation" ] = ( molecule_df [ "Resolved QNs" ] . astype ( str ) + "-" + molecule_df [ "E_U (K)" ] . astype ( str ) ) if len ( molecule_df ) != 0 : fig = self . plot_spectrum ( ) fig . add_bar ( x = molecule_df [ "Frequency" ] , y = molecule_df [ "Normalized" ] , hoverinfo = "text" , text = molecule_df [ "Annotation" ] , name = species , width = 2.0 , ) molecule_df . to_csv ( f"linelists/{species}-splatalogue.csv" , index = False ) return fig , molecule_df else : raise Exception ( f"No molecules found in Splatalogue named {species}." )
short_docstring: Function to query splatalogue for a specific molecule.
short_docstring_tokens: Function to query splatalogue for a specific molecule .
comment: """
          Function to query splatalogue for a specific molecule. By default, the
          frequency range that will be requested corresponds to the spectral range
          available in the experiment.
          
          Parameters
          ----------
          species : str
              Identifier for a specific molecule, typically name
          
          Returns
          -------
          FigureWidget
              Plotly FigureWidget that shows the experimental spectrum along
              with the detected peaks, and the molecule spectrum.
          DataFrame
              Pandas DataFrame from the Splatalogue query.
          
          Raises
          ------
          Exception
              If no species are found in the query, raises Exception.
          """$SEP$# Threshold intensity$SEP$# This prevents missing values from blowing up the normalization$SEP$# Calculate the real intensity and normalize$SEP$# Add annotations to the hovertext