Skip to content

FedeMPouzols/apsymsim

Repository files navigation

APSYNSIM, A REAL-TIME APERTURE SYNTHESIS SIMULATOR
IVAN MARTI-VIDAL (ONSALA SPACE OBSERVATORY, NORDIC ARC NODE)


A warm acknowledgement to J. Girard, for very useful feedback!


#####################
# RUNNING APSYNSIM: #
#####################

If you work on Windows, run the binary file called APSYNSIM.exe, 
which is located in the APSYNSIM directory.

If you work on Mac, try to run the script (located in either the SCRIPT
or the SOURCE_CODE directory) with the command:

pythonw APSYNSIM.py

(notice the "w" at the end of the "python").

If the GUI does not respond well, then run the binary "APSYNSIM.app" 
(located in the APSYNSIM directory) *from*the*command*line*.

If you work on Linux, open a terminal, go to the the directory 
called SCRIPT (or SOURCE_CODE), and run the command "python APSYNSIM.py".



##########
# USAGE: #
##########

You will find some examples of interferometer arrays and source models 
in the ARRAYS and SOURCE_MODELS directories, respectively, together with 
instructions on how you can build your own interferometers and source 
models (read, for instance, the content of the "default.array" and 
"default.model" files).

You can click and drag the antennas in the plot called "ARRAY CONFIGURATION".
When you drag an antenna, all other plots (UV PLANE, DIRTY BEAM, and DIRTY 
IMAGE) will be updated automatically (may need some time to refresh, 
especially if working on Windows and/or with many antennas).

You can also click on any point of the DIRTY BEAM, MODEL IMAGE, or DIRTY 
IMAGE plots, and the program will tell you the intensity value and the pixel 
coordinates.

If you click on the UV PLANE image, the program will print the value of the 
source Fourier transform at that point. If you click close to a point observed
with the interferometer, the program will tell you the baseline and hour
angle of observation.

You can also change the observing latitude, hour-angle coverage, source 
declination, and observing wavelength by clicking on the blue sliders at 
the bottom-right corner of the figure. The plots will be updated 
automatically (may also need some time to refresh all plots).

The dirty beam is computed using Briggs weighting. The robustness parameter
can be changed by shifting the corresponding blue slider (robustness of -2 
tends to uniform weighting, whereas +2 tends to natural weighting).

You can add and/or subtract antennas by pressing the "+ Antenna" and 
"- Antenna" buttons. New antennas are inserted at the array origin (0,0). 
If you add, drag, and subtract an antenna, the program will remember the 
last antenna positions if you add them again.

You can save the current array, load a new array (for instance, from the 
EXAMPLES folder), and/or load a new source model (for instance, from 
the EXAMPLES folder) by pressing the corresponding buttons "Save array", 
"Load array" and "Load model".

You can zoom in/out by pressing "Z" or "z" (respectively). The program will
then zoom using the current cursor position as zooming center.
 
The new "Reduce data" button opens a CLEAN GUI, where you can also corrupt
your visibilities, to see the effect on the DIRTY and CLEAN images.



------------------
NEW GUI FOR CLEAN
------------------

Here you can experiment with CLEAN deconvolution on (noise-free) 
visibilities. You can also corrupt the visibilities by adding a complex
gain to one of your antennas (or baselines). 

Clicking and dragging, with the LEFT mouse button, on the RESIDUALS image 
creates new CLEAN mask regions. Clicking and dragging with the RIGHT mouse
button removes CLEAN mask regions. You can add as many CLEAN mask regions
as you want.

The CLEAN gain and number of iterations can be changed in the text boxes.
Pressing CLEAN executes the iterations, refreshing all images in real time.
You can further click on CLEAN, to continue deconvolving.

Pressing RESET will undo all CLEANING. 

You also need to press RESET to refresh the images for CLEANing, if you 
change anything in the main program window (e.g., observing wavelength, 
antenna positions, etc.).

Pressing "+/- Resid" will add (or remove) the residuals from the CLEANed 
image.  By default, the residuals are NOT added (i.e., only the restored
CLEAN components are shown in the CLEAN image).

You can also add random noise to your visibilities. See the help, from the program window, for more information.


-----------------------------
HOW TO ADD A CORRUPTING GAIN
-----------------------------

Just select an antenna from the "Ant. 1" list to corrupt it. If you select
a different antenna from the "Ant. 2" list, only the baseline between 
the two antennas will be corrupted. But if the two antennas are the same,
then ALL the baselines to that antenna will be corrupted.

The two first sliders ("From integration" and "to integration") mark the 
first and last observing scans where the corruption term will be applied.
By default, the whole duration of the experiment is selected.

The last two sliders ("Amplitude gain" and "phase gain") define the gain 
that will be applied to the corrupted antenna. 

The button "APPLY GAIN" actually applies the gain and reloads the new
images. 

The button "RESET GAIN", undoes the gain correction (so the data become
perfectly calibrated again).

NOTICE THAT if a new antenna is added, or subtracted, the gains are 
reset automatically to 1.0 (but you will need to refresh the images in 
this window, by pressing the "RESET" button, just below the "CLEAN" 
button, to load the correct images). 




Enjoy!




P.S: Any bug report, comment or suggestion should be addressed to:

contact@nordic-alma.se

About

Aperture Synthesis Simulator

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages