4. Create reports#

This section introduces different ways to save query results:

Load libraries & create a query

To explore these options, we will first query the archive using one of the methods presented in the previous section and use the results in the remainder of this tutorial.

[1]:
import alminer

observations = alminer.keysearch({'science_keyword':['"Galaxy chemistry"']},
                                 print_targets=False)
================================
alminer.keysearch results
================================
--------------------------------
Number of projects = 48
Number of observations = 341
Number of unique subbands = 1166
Total number of subbands = 1368
Total number of targets with ALMA data = 64
--------------------------------

4.1 Export results as a table#

The alminer.save_table function writes the provided DataFrame to a table in CSV format in the ‘tables’ folder within the current working directory. If the ‘tables’ folder does not exist, it will be created.

Example 4.1.1: save query results as a table#

[2]:
alminer.save_table(observations, filename="galaxy_chemistry")

4.2 Save overview plots#

The alminer.save_source_reports function creates overview plots of observed frequencies, angular resolution, LAS, frequency and velocity resolutions for each source in the provided DataFrame and saves them in PDF format in the ‘reports’ folder in the current working directory. If the ‘reports’ folder does not exist, it will be created. The reports are named after the target names.

Note: Currently, the grouping is done based on ALMA target names, so the same source with a slighly different naming schemes will be treated as separate targets.

Example 4.2.1: save overview plots of each target with CO lines marked#

Let’s first narrow down our large query to a smaller subset to only a range of frequencies (Band 3) and angular resolutions < 0.5”:

[3]:
selected = observations[(observations["min_freq_GHz"] > 80.0) &
                        (observations["max_freq_GHz"] < 115.0) &
                        (observations["ang_res_arcsec"] < 0.5)]
alminer.summary(selected)
--------------------------------
Number of projects = 7
Number of observations = 16
Number of unique subbands = 61
Total number of subbands = 61
7 target(s) with ALMA data = ['NGC1266', 'Arp220', 'ngc6240', 'n613', 'NGC4418', 'NGC7469', 'Cloverleaf']
--------------------------------

Now we can create and save plots for each source, with CO and its isotopologues marked:

[4]:
alminer.save_source_reports(selected, mark_CO=True)