AstroChem / vis_sample

Other
13 stars 7 forks source link

using full frequency information to parse u,v positions #31

Open seanandrews opened 4 years ago

seanandrews commented 4 years ago

If I'm understanding it correctly, the 'file_handling.py' code seems to assign the same reference frequency to each u,v point when converting to kilo-lambda units. Is this some reflection of what CASA does, or is it just a simplification? I would have assumed that the same (u,v) positions in meters units would be converted to different values in kilo-lambda units, depending on the frequency of each input channel. (This is probably a small difference for narrowband cubes, but maybe not negligible if you're trying to fit models.)

ryanaloomis commented 4 years ago

This is a simplification (CASA computes everything fully), as vis_sample has generally been used for relatively small fractional bandwidths. @iancze and I had a discussion about this the other day w/ regard to RML imaging for MAPS.

Since this would manifest as bandwidth smearing, the same guidelines that apply to channel averaging would probably apply here. In that case, the approximation is valid for fitting narrowband cubes as you mention, but starts to slightly break down for long baseline TDM windows. (Note that currently vis_sample only can handle 1 spw at a time, so the max fractional bandwidth is 2GHz at Band 3 for ALMA data). The computational advantage of this approximation is quite large, especially for FDM windows with large numbers of channels, but you're right that this is an issue for fitting very long baseline continuum datasets.

Perhaps a compromise is to include some logic to check the fractional bandwidth, and then 'chunk' the uv calculations in pieces based on bandwidth smearing guidelines.

seanandrews commented 4 years ago

I think its actually a quite reasonable approximation for most use cases. I was mostly curious if it was an approximation for speed (which I get it: it is), and to help myself better parse how to use the code when supplying a list of u,v spacings rather than a UVFITS file (there's no example in the README).

Rather than change the code, it might be better to warn the user and force them to chunk it themselves (i.e., if you were combining broad-bw SPWs, you should compute N_spw visibility sets instead of just one, and assess your objective function internally [i.e., add your chi**2s] yourself).

ryanaloomis commented 4 years ago

Ah that may be useful to add to the examples.

One of my goals for the summer is to modify the code to handle multiple SPWs, so it may be easy enough to add the chunking at the same time. I could add the warning in the meantime.