"Miriad operations" panel

Allows the user to use some miriad tasks interactively. This guide assumes the user is already familiar with miriad and only describes their operation within FRELLED. Most operations produce text files containing the inputs needed for miriad, so it does not matter if miriad is actually installed or not (this includes mbspect).

The file selector allows the user to specify a miriad file, but unfortunately this is a bit awkward because miriad files are actually directories whereas Blender insists you select a file. The easiest option is to choose a FITS file instead (e.g. the one you're visualising/analysing). Any operations which actually invoke miriad will first attempt to convert the FITS file to miriad's own format, provided that no such file already exists - that is, having the same name but with a .mir extension. If the file does exist, it will simply use that file for the miriad operations.



"Mask" generates the miriad task "mask" for the selected regions, producing a single file "MiriadMask.txt" containing all the input parameters. The user can then copy and paste this into miriad to run it. This button does NOT run the operation itself, it just generates the input parameter file.

"Make FITS" is very similar to "Mask", but uses the "FITS" task instead, enabling conversion of individual regions to the miriad format. Note that miriad only allows the use of regions when converting from a miriad file into a FITS file, not the other way around. As above, this button does NOT run the operation itself, it just generates the input parameter file.


"Mbspect spectral analysis" runs the "mbspect" task, which analyses individual spectra. All parameters are as described in the miriad documentation. Using "Auto" will attempt to automatically choose sensible values or simply leave the parameters unset.
Note that the numerical sliders function as simple calculators. E.g. when the systemic velocity of a source is known, one can directly enter (say) "513+250" and "513-250" (to give 763 and 263 respectively) to easily ensure a symmetrical xrange for plotting.
FRELLED will determine if the user has miriad installed or not, including via WSL. If they do not, it will only produce text files of the miriad input parameters instead. If they do, it will run mbspect interactively provided only one region is selected, or produce text files if multiple regions are selected.

There are two buttons that run mbspect, described below. Both will ONLY produce a graphical XSERVE display if only one region is selected, to avoid overwheling the user (who might have idiotically selected 500 regions or something daft like that). However text files always use the user's choice of plotting device. 

"Miriad quick" runs mbspect interactively, i.e. displaying the miriad output directly in the terminal (and plotting the spectrum in an XSERVE window if selected). This means you can easily check which settings work and adjust them (and/or the region itself) if needed. This is especially useful for determining a sensible velocity range, allowing the user to simply scale the region rather than manually inputting values. The output values are shown in the terminal.
"Miriad full" is designed for when the user is satisfied that all the parameters are correct. It produces text files each containing the input parameters, the miriad measurements, and the spectrum itself.

Both operations of mbspect produce text files in the "Mbspect" directory. "Quick" ONLY produces the input parameter file, while "Full" produces both the input parameter file and the full measurements, including a combined file containing the input parameters, spectral parameters, and the raw spectrum. 


A note on masking : whether auto-masking is enabled or disabled, FRELLED will also mask the profile range plus a bit extra. To fully disable masking, disable the auto-profile option and set the profile range to something outside the spectrum.

Notes on the x-axis : if using "VELO", which should be the radio velocity convention, the mbspect spectrum may have the label "RELATIVISTIC". This appears to be a miriad bug.
Using "FREQ" is not well tested. It's probably a good idea to set the equivalent option in the "Spectral Coordinates" panel first (and then redraw the axes) so that the spectral range of the regions will be calculated correctly, but at present this option is not well tested.
