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.

import alminer

observations = alminer.keysearch({'science_keyword':['Galaxy chemistry']},
alminer.keysearch results
Number of projects = 47
Number of observations = 339
Number of unique subbands = 1162
Total number of subbands = 1361
Total number of targets with ALMA data = 63

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

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”:

selected = observations[(observations["min_freq_GHz"] > 80.0) &
                        (observations["max_freq_GHz"] < 115.0) &
                        (observations["ang_res_arcsec"] < 0.5)]
Number of projects = 8
Number of observations = 21
Number of unique subbands = 81
Total number of subbands = 81
8 target(s) with ALMA data = ['NGC7469', 'NGC1266', 'Arp220', 'ngc6240', 'IRAS_F16399-0937', 'n613', 'NGC4418', 'Cloverleaf']

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

alminer.save_source_reports(selected, mark_CO=True)