ASIIP: a stellar intensity interferometry target planner

Abstract. Over recent years, several independent groups have pursued the realization of a modern stellar intensity interferometry (SII) system to perform high angular resolution observations at optical wavelengths. Here, we present a general purpose SII observation planner (ASIIP) that can be used to aid in SII observational efforts. ASIIP can be used to coordinate and prioritize SII observations based on observational and instrumental parameters. ASIIP constructs a master catalog by gathering information from several stellar catalogs, and targets within the master catalog are ranked based on the ability to make stellar diameter estimates using a Monte Carlo analysis. The Monte Carlo analysis takes into account the estimated angular diameter, apparent brightness, a target’s uv-plane baseline coverage for a given observation, and instrumental sensitivity.


Introduction
Stellar intensity interferometry (SII) is used to measure the squared visibility, which corresponds to the Fourier transform of the distribution of brightness from a given source for the projected position angle of a pair of telescopes. SII measures the squared visibility through correlations of starlight intensity fluctuations between separated telescope pairs. SII has a significant advantage of being relatively insensitive to atmospheric effects and the minor imperfections of an optical system, allowing for observations over large baselines and low elevation angles, leading to the extension of uv-plane coverage. 1 Such uv-plane extension subsequently allows high angular resolution measurements of stellar targets with submilliarcsecond (mas) resolution capabilities. Coincidentally, many telescope arrays constructed to perform gamma-ray observations also meet the requirements of SII. For example, the Very Energetic Radiation Imaging Telescope Array System (VERITAS) 2 is an Imaging Air Cherenkov Telescope (IACT) array that is a prime candidate for SII observations. 3 Recently, there has been great experimental progress using IACT arrays for SII, as evidenced by successful on-sky observations from VERITAS 4,5 and MAGIC. 6 Future arrays, such as the Cherenkov Telescope Array (CTA), 7 would offer even greater SII capabilities than current observatories due to the increased number of telescopes and larger baselines. 8 SII observations are constrained by various source, observatory, and instrumental parameters. These factors need to be carefully included when planning SII observations. Observation planning tools like ASPRO 9,10 are used to prepare efficient observations for optical amplitude interferometry (OAI) observatories. Many similar constraints exist between OAI and SII in d etermining optimal observation targets. While the goals of SII and OAI overlap significantly, as both techniques employ measurements of the interferometric visibility to perform highresolution optical measurements, they differ in several important aspects. A key difference is that the expected signal-to-noise ratio of an SII instrument is dependent on the quantum efficiency, electronic bandwidth of the system, the effective throughput of the optical filter, and the collecting area of the telescope. 11 It is possible to equip many telescopes within observatory arrays to perform SII, e.g., CTA 8 and VERITAS. 2 In general, these observatories differ in many factors, which affect uv-plane coverage. It is also possible for any SII equipped array that only a subset of telescopes for a given array are available for use, thus affecting the uv-plane coverage depending on telescope availability and the sky position of the proposed observation. Because of this possible variability, certain targets may be better or worse to observe on a given night depending on the specific array configuration. For a given array configuration, there are usually far too many potential targets to be observed each night. Consequently, nightly observation planning requires the development of a rank-ordered list of possible targets, which meet a required level of precision for the specified stellar classes and brightness. To assist with the unique challenges presented by SII observation planning, a Python software package called a stellar intensity interferometry planner (ASIIP) has been created to perform SII target sensitivity estimations that can be adapted for use with arbitrary array configurations and instrumental sensitivity. The software was developed to be expandable as well as easy to use and can be downloaded from https://github.com/astronomaestro/ASIIP.git. A README is also included to assist with the installation and use of the ASIIP software.
The ASIIP script is designed to construct a master catalog by • Reading a configuration file, which specifies the various parameters needed to constrain which stars are useful to analyze.
• Using target and observatory parameters (i.e., the right ascension, declination, angular diameter, etc.), a master SII catalog is constructed from seven different star catalogs.
• Performing Monte Carlo simulations to quantitatively estimate the ability of the specified SII telescope array to measure the diameter of each star in the master SII catalog. The resulting targets are then ranked based on the stability and quality of the simulated observations.

Construction of a Master SII Target Catalog
The catalog construction begins with the assembly of a master SII target catalog of all feasible observation targets on a specified night. In order to construct a master SII catalog that is as complete as possible, several online star catalogs are queried using VizieR 12 with the astropy affiliated Python package astroquery. 13 Several online star catalogs have sufficient information to estimate the stellar angular diameter, which include the GAIA DR2, 14 JMMC, 15 the TESS input catalog, 16 CHARM2, 17 and CADARS. 18 Catalog prioritization is based on catalog age and affects the RA and DEC, initial angular diameter estimate, and the initial magnitude used in ASIIP simulations. As proper motion is not included in every catalog, it is not corrected for. ASIIP uses astropy to handle coordinate transformations as well as to determine valid dark sky hours for a given latitude, longitude, elevation, and date. Each online catalog is queried using the constraints defined within the input parameter file. Stars that are not observable at any time during the selected night are removed. To keep duplicate entries from being included in the master SII catalog, each online catalog entry is comprehensively cross-matched to all other catalog entries using the RAJ2000 and DEJ2000 of potential sources from each individual entry, with cross-matched targets only being included once. After ASIIP has constructed the master catalog, additional information, such as B magnitudes, are obtained with SIMBAD 19 and the Bright Star Catalog, 20 along with the star's spectral type, radial velocity, name, and proper motion. If SIMBAD B magnitudes are successfully obtained, these take priority over Bright Star Catalog B magnitudes. A user can specify whether to use the original queried magnitude or the B magnitude obtained from SIMBAD or the Bright Star Catalog in ASIIP simulations.

ASIIP Target Planner Parameters
An ASIIP target parameter file specifies the required constraints for a desired observation, with ASIIP using a json parameter input file to simplify defining these constraints. As time progresses and observing needs evolve, the parameter input file can be expanded to include additional functionality. The currently available parameters are described in Appendix B.
ASIIP will also include several different pieces of information about a given target, including the position, an initial angular diameter estimate, spectral type, target magnitude, rotational velocities, the total available observing time, and the estimated errors associated with observing a given target. Individual columns of the master SII catalog are discussed in Appendix C.

Determining the Viability of Potential Target Observations
A Monte Carlo analysis is powerful enough to assess the quality of both simple and more complex fits to the simulated squared visibility curves.
ASIIP simulations rely on the user knowing an initial estimate of the noise inherent with the SII system being used, defined in software as the uncertainty of a SII measurement and defined in Appendix B as sigmaTel. Here, we define the uncertainty as E Q -T A R G E T ; t e m p : i n t r a l i n k -; e 0 0 1 ; 1 1 6 ; 6 0 9 (1) obtained from Rou et al. 21 Here, A is the total area of the telescope, α is the quantum efficiency of your detector, n 0 is the spectral density ( photons m 2 s Hz ) of a zero magnitude star, m is the magnitude of the target, Δf is the electronic bandwidth of the detector, T is the integration time, and C is a calibration noise factor constant. The uncertainty used in the simulated demonstration shown in Fig. 1 6 Hz, T ¼ 1800 s, and C ¼ 2.0. A script is included with ASIIP to assist in estimating σ tel in the case the uncertainty is not directly known. If data have been taken, a user can scale C until simulated error matches the RMS of the empirical measurements. Once a calibration constant and an initial σ tel are determined, ASIIP can dynamically predict the detector error of various bright targets using the scaling relation described by Eq. (7). Using the calibration constant, the included instrument error script can also provide error estimates of differing array configurations. If dimmer targets are to be observed, where background light cannot be considered negligible, the scaling relationship ASIIP uses between differing targets can become inaccurate.

is as follows:
To give a quick overview of the Monte Carlo method used, simulated data, as defined by a multibaseline, 1D averaged Airy functions V av , are fit using curve_fit from scipy 22 repeatedly: E Q -T A R G E T ; t e m p : i n t r a l i n k -; e 0 0 2 ; 1 1 6 ; 3 6 0 V mc ¼ ½V av0 þ σ obs0 ; V av1 þ σ obs1 ; : : : ; V avn þ σ obsn : (2) Here, V mc is the approximately time-integrated, multibaseline, 1D Airy disk simulation, V av is the squared visibility at the average baseline over the given integration time, and σ obs is random Gaussian error, whose amplitude is defined by the σ tel parameter. See Appendix A for a full mathematical definition with Fig. 1, panel (b) showing a graphical representation.
Because scipy's curve_fit can underestimate the error and simply converge to an initial guess parameter leading to an underestimation of a target's measurement error, a varying guess parameter r guess is randomly chosen from a uniform distribution in the range of r zero AE σ r , where r zero is the true radial value.
Many sets of V mc are then independently fit in sequence using a varying initial guess parameter of r guess with SciPy's curve_fit. 22 The final simulation error σ rfit is then calculated by taking a standard deviation of the ensemble of the simulated V mc fits. Targets are then ranked by the estimated uncertainty in the angular stellar diameter σ rfit . The ASIIP fmaster catalog shows σ rfit as a percent error, defined in ASIIP to be PerFitError.
Targets that produce values of PerFitErr above 20% of r zero should be considered with caution if they are to be observed, as errors above this threshold provide an indication that scipy's curve_fit is simply converging to a value close to r guess , and not the true value r zero .
Along with the uncertainty produced by the Monte Carlo analysis, the fit of the squared visibility curve to the simulated observations can be visualized through a χ 2 analysis plot for a given source.
Throughout ASIIP, the Python package numpy 23,24 is used to assist in various numerical calculations with matplotlib 25 used to display results graphically.

Results of ASIIP's Master Catalog Analysis
The resulting ASIIP Master catalog consists of a list of potential targets for a given observation date and observatory configuration. The master target list is sorted into rows according to the quality of the potential observations, with the first row providing the highest quality constraint on the stellar angular diameter and the last row containing the lowest quality resolution. For a complete description of the columns, see Appendix C. Fig. 2 An example of a fully ranked and analyzed ASIIP master catalog. This master catalog was constructed for the night of December 10, 2019, using input parameters, as mentioned in Sec. 3, excluding stars dimmer then magnitude 2, with 50 simulated analysis runs per target. In this particular master catalog, a clear delineation between targets which converge and those that do not is seen between target 8 β Aurigae and target 9 β Orionis, as shown in the PerFitErr column. This visual example of an ASIIP catalog is truncated to allow for readability.  Figure 2 shows an example of fully ranked, ASIIP master catalog. Figure 3 demonstrates that only targets which meet certain physical and brightness constraints are useful to observe; this is expected due to the geometrical constraints and measurement error for the simulated array. It was also found that using more than 50 for bootStrapRuns (the number of Monte Carlo simulations performed) did not significantly improve results for the majority of simulated targets. For targets less well constrained, this may not always be true.

Important Caveats for Use of the ASIIP Software
There are precautions that one must consider when using the software to plan SII observations. The five different catalogs, which are comprehensively cross-matched also have positions for stars, which are often slightly different. This issue is handled by comparing the position of each star in the different catalogs and calculating if the projected sky distance between the two star positions was smaller than 1 arc sec. For stellar separations below this value, the matching star is flagged as a duplicate. This procedure can fail when a catalog lists a binary pair as two separate targets, while another lists them as a single target, or if two bright targets happen to be extremely close. To account for these issues, the mean angular diameter along with the standard deviation from the mean is included in the master catalog. If the standard deviation of the mean angular diameter is large, it is possible the entry was incorrectly cross-matched, and further investigation is necessary to determine whether the star is a suitable target object. The target RA and DEC used in ASIIP simulations are directly taken from the original five catalogs and are prioritized by catalog age. This ensures that even if cross-matching fails, the target RA and DEC used in ASIIP simulations will always represent a valid target found in one of the original five catalogs. Fig. 3 A visualization of ASIIP's custom Monte Carlo analysis, the Bright Star magnitude plotted against angular diameter, colored by the stability of the fit, excluding targets with a high BSSkyD value. The most stable targets are shown in blue dots, being very well delineated from unstable fits, shown in red x's, with some mixing of semi stable fits shown with yellow triangles. Highly ranked targets shown with blue dots generally fall within a given range of magnitudes and angular diameter, this being expected as targets with too large an angular diameter produce a squared visibility pattern to small to be useful with a VERITAS-like array. It was found that using more than 50 Monte Carlo simulations did not significantly change the determination of valid targets. This analysis was done with input parameters mentioned in Sec. 3, with targets dimmer then magnitude 5 excluded, for the night of January 10, 2020.
Proper motion is currently not corrected for. This generally does not affect simulations of targets by any significant amount but could possibly lead to duplicate entries or incorrectly crossmatched targets. The BSSkyD, SIMSkyD, SIM_pmra, SIM_pmdec, BS_pmra, and BS_pmdec columns can assist in determining if this might be an issue.
As filter definitions are not necessarily consistent or the same across catalogs, once ASIIP has constructed a master catalog, SIMBAD and The Bright Star Catalog are then cross-matched to include additional information about each corresponding target, such as consistent B magnitudes. The Bright Star Catalog is used as a backup cross-reference catalog. As cross-matching is done on SIMBAD servers, it is possible for SIMBAD to timeout on larger queries. Because cross-matching is done on the Bright Star Catalog using information from VizieR, even if SIMBAD times-out, there should always be some cross-reference information available for bright targets. The BSSkyD and SIMSkyD give information about the sky distance between the ASIIP master stellar catalog targets and the cross-matched Bright Star and SIMBAD targets included in the master catalog. If BSSkyD or SIMSkyD is high, it likely means the SIMBAD/ Bright Star Catalog cross-matching failed for that particular target and the additional information given by SIMBAD and the Bright Star Catalog is incorrect. Because magnitude types and definitions vary, a user can specify to use SIMBAD or Bright Star Catalog B magnitudes or the original queried magnitude in ASIIP simulations. Only if SIMBAD is unavailable, ASIIP will use the B magnitude from the Bright Star Catalog. If B magnitudes are used in simulations, because SIMBAD and the Bright Star Catalog could be incorrectly cross-matched to the ASIIP master catalog, a user must take care if a target B magnitude is not what is expected.
Simulated observations, which constrain the squared visibility near the edge of the Airy Disk, require additional consideration. In certain scenarios, e.g., when the true stellar diameter differs significantly from the simulated fit, the actual observation may yield a poorly constrained stellar diameter despite being ranked as a quality target by the ASIIP software. There are also edge cases with large, bright stars like Sirius, where the first order of the Airy Disk can be fit, leading to a higher ranking in an ASIIP master catalog, even though the stellar brightness will fully saturate certain detector and telescope configurations before a usable signal could be obtained. The ASIIP visualization tools can assist in the closer inspection of the quality of the squared visibility curve fit for the Monte Carlo simulations (Fig. 1).
The performance of ASIIP will depend on the quality of the internet connection, as external servers are queried to retrieve stellar catalog information (i.e., SIMBAD and VizieR), and of course, computing power. Poor internet connectivity can introduce response timeouts and parsing errors. The bandwidth requirements for the online catalog searches can compete for bandwidth with other critical software applications (such as telescope control, data archiving, etc). The user can adopt several strategies to mitigate these issues. For large queries involving lower magnitude targets, one should narrow the RA and DEC search range when assembling the master catalog, as well as reduce the range of target magnitudes as narrowly as possible. When run, ASIIP will check to see if a master SII catalog has already been created for the specified date and magnitude range. If ASIIP finds that such a master catalog already exists, it allows the user to choose whether to load it (or not). If the ASIIP software cannot find a previously created master catalog, or the user wishes not to load an existing one, it will begin the creation of a new catalog. If one plans on being somewhere without internet access, one can create the master catalog beforehand, while one has internet access, as ASIIP saves any successfully constructed master catalogs before doing a full analysis. This procedure allows previously created master catalogs to be used to perform the analysis offline.
If a user desires to manually correct entries, or create custom targets, the catalogs are saved in a CSV format to allow for easier editing. Edited and custom catalogs are loaded from the same directory as regular ASIIP master catalogs. However, because all catalogs are loaded through the same method, if the user decides to manually edit or add entries to the ASIIP master catalog, one must take care to keep data types, indexing, and columns consistent.
Installation of the ASIIP software was made with simplicity and cross platform compatibility in mind and a README is included in the GitHub to assist in successfully installing, running, and using ASIIP. Current reasonable catalog sizes for a VERITAS-like array can typically include thousands of targets. However, since the computational complexity of any ASIIP simulation can change due to numerous input parameters, a user will have to determine for themselves reasonable catalog sizes and constrain catalog size accordingly.
Finally, the software currently ranks target resolution quality based on the assumption of a uniform, circular stellar disk. If the stellar target happens to be, for example, a binary star system, a fast rotator, or anything not well approximated by a uniform, circular stellar disk, the target ranking may be unreliable. To help the user identify occurrences when the Airy disk approximation may be invalid, the master catalog includes the spectral type and rotational velocity from the Bright Star Catalog and/or SIMBAD. Both the spectral type and radial velocity can assist in the identification of targets, which may contain binary systems or fast rotators.

Future Work and Conclusions
The current core functionality of ASIIP is complete, and this software can serve as an effective tool for planning a set of science observations at any SII observatory. ASIIP is a dynamic tool, with the ability for users to add additional improvements to create a more sophisticated and accurate science planning toolkit. The software was written using object-oriented programming for easy expansion, with the code being open source. ASIIP's design allows additional, future catalogs to be added to the master catalog construction, as well as possibly adding additional information from those catalogs using VizieR. The code structure allows additional analytical models to be integrated with the custom Monte Carlo method. Different visualization techniques can also be added to aid with science observation planning. Simulations have been found to accurately predict noise for a variety of brighter targets. However, the error approximation ASIIP uses is only accurate if background contamination light is negligible. Dimmer targets, which are comparable to background contamination, could be improperly modeled by the ASIIP software. Improving dynamic error calculations, the cross-matching, and identification of targets, correcting for proper motion to improve cross-matching, and improving the computational speed of calculations are also ongoing.
In closing, ASIIP provides an effective tool for planning SII target selection for observations at distributed arrays of optical telescopes, such as VERITAS 2 or the planned CTA. 7 The software automates the task of having to search through large star catalogs, thereby providing a more complete list of possible targets for observation than can be achieved by manual methods. The software is well suited to support individual science observation plans, such as the development of a population study of stellar radii within a selected stellar class.

Appendix A: The Methodology of Determining Optimal SII Targets
Appendix A provides details about the fundamental mathematics ASIIP uses in the customized Monte Carlo analysis. Before any visibility model can be properly analyzed, one must determine the projected, uv-plane baseline coverage for a given target observation. ASIIP uses the methodology outlined in Segransan 26 to define coverage for a single projected baseline, to determine the number of baselines for a given observation, and finally construct a time series of the uv-plane coverage. A visual example of the 2D projected baseline coverage of κ Orionis is shown by the blue lines in Fig. 1(a).
Once the projected baseline coverage is determined, one can use a visibility model to determine the squared visibility of a target source. There are many visibility models, which can be used to help in determining optimal targets outlined in Berger and Segransan. 27 Currently, ASIIP uses a circular uniform disk approximation for the stellar image, given by an Airy Disk profile in the Fourier Image plane.
The uniform-disk model is generated with an initial angular diameter estimate θ obtained from the ASIIP master catalog and filter wavelength λ. We define a characteristic baseline r zero : E Q -T A R G E T ; t e m p : i n t r a l i n k -; e 0 0 3 ; 1 1 6 ; 1 1 0 Since the expected visibilities produced in the uv-plane from a uniform-disk model are circularly symmetric, the squared visibility can be written in terms of a single radial baseline given by E Q -T A R G E T ; t e m p : i n t r a l i n k -; e 0 0 4 ; 1 1 6 ; 6 9 9 Here, u and v are the uv-plane baseline coverage coordinates determined from the projected 2D baselines and r is the distance from the center of the Airy Disk.
We then obtain ideal, squared visibilities over the set of 1D radial coordinates determined by Eq. (4): E Q -T A R G E T ; t e m p : i n t r a l i n k -; e 0 0 5 ; 1 1 6 ; 6 1 6 Vðr; r zero Þ ¼ 2 where J 1 is the first Bessel Function As the Airy Disk model given in Eq. (5) is a time series, it is integrated over adjacent radial baseline intervals and averaged to simulate actual observations: E Q -T A R G E T ; t e m p : i n t r a l i n k -; e 0 0 6 ; 1 1 6 ; 5 3 5 Vðr; r zero Þdr: Here r i and r iþ1 is the radial position of two adjacent, radial, baseline points, and r zero being the first zero of the Airy Disk.
Once a simulated observation has been created with Eq. (6), in order to represent real observations, simulated uncertainty σ sim is added to each simulated point: E Q -T A R G E T ; t e m p : i n t r a l i n k -; e 0 0 7 ; 1 1 6 ; 4 4 2 Here, σ tel is defined by Eq. (1) and is empirically calibrated for a given telescope array or estimated, as described in Sec. 2, m 0 is the magnitude of the target used in the initial calculation of σ tel and T 0 the exposure time used in the initial calculation of σ tel . m is the magnitude of the target source and T is the integration time being used in the measurement of the target source. This scaling relation will not be accurate for dimmer targets due to the effects of background light and potential systematic issues. Since a single model consists of many different baseline measurements, a multibaseline simulation of n total Airy Disk average measurements, n being the total number of simulated baselines, is constructed from Eqs. (6) and (7) to simulate the full set of data, which would be obtained from a target: E Q -T A R G E T ; t e m p : i n t r a l i n k -; e 0 0 8 ; 1 1 6 ; 2 8 7 V mc ¼ ½V av0 þ σ obs0 ; V av1 þ σ obs1 ; : : : ; V avn þ σ obsn : Here, σ obs is random Gaussian error generated from a normal Gaussian distribution of width σ sim centered on 0. This final equation is what ASIIP uses in its custom Monte Carlo analysis in determining σ rfit [see Fig. 1(b)].

Appendix B: Input Parameters
These are the parameters that are included in the parameter input file with ASIIP, with units and a brief description of what the parameter does. Units used were chosen due to how ASIIP communicates with the various Python packages being used.
FILT column along with the CAT column identifying the queried filter and catalog, respectively.
• wavelength (m): Specifies the wavelength of the filter being used. • telLocs (m): Relative telescope locations of the telescopes you will be using to perform your observation from some initial location, which will also be used to dynamically calculate the baseline coverage.
• integrationTime (h): The length, in hours, of a single observation interval.
• telLat (deg): The central latitude of the telescope array.
• telLon (deg): The central longitude of the telescope array.
• telElv (m): The central elevation of the telescope array.
• altitudeCutoff (deg): The lowest possible latitude which can be observed by the given observatory. Targets which never rise above this will be excluded.
• maxSunAltitude (deg): The altitude the sun must be below before ASIIP will consider a target observable. • sigmaTel: The error associated with SII measurements for a given telescope array. This is determined empirically before hand. There is a script included in the ASIIP package, which can assist with this calculation.
• sigmaMag: The magnitude of the star used when empirically determining sigmaTel.
• sigmaTime (s): The integration time used when empirically determining sigmaTel.
• bootStrapRuns: The amount of Monte Carlo simulations you desire to run in order to determine the degeneracy of a potential target. The more bootstrap runs are done, the more accurately the software can rank targets at the cost of computational speed. The default is 50 and it was not found to significantly impact results using additional runs.
• useQueriedMag: If this is true, this will tell ASIIP to use the queried MAG in simulations, which comes from the original five catalogs that are prioritized by age. If this is false, ASIIP will use the SIMBAD B magnitude. If SIMBAD is not available, ASIIP will use the Bright Star Catalog B magnitude.
• savePlots: If this is true, ASIIP will save produced plots in a directory. If this is false, ASIIP will simply display them on screen.

Appendix C: Catalog Results
These are the column results of the ASIIP software after it has completed a full Monte Carlo analysis for each target.
• Index: This column specifies a unique index number for each row in the catalog. Use the index number to choose which star you want to visualize using the graphing software.
• NAME: The ID given by SIMBAD to the star located at the associated RA and DEC. If SIMBAD failed, it will use the ID given by the Bright Star Catalog.
• RA(arc hour): The target J2000 Right Ascension used in ASIIP simulations and calculations. Its value is determined by the catalog prioritization described in Sec. 1.
• DEC (deg): The target J2000 Declination used in ASIIP simulations and calculations. Its value is determined by the catalog prioritization described in Sec. 1.
• ANGD (mas): The prioritized angular diameter from the corresponding catalog CAT used in ASIIP simulations and calculations. Its value is determined by the catalog prioritization described in Sec. 1.