Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development #12

Merged
merged 5 commits into from
Nov 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ dependencies:
- casacore
- cfitsio
- openmpi
- mpi4py
- python=3.8
- numpy=1.23
- pip
Expand Down
1 change: 1 addition & 0 deletions environment_cudatoolkit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ dependencies:
- cuda-toolkit
- cuda-samples
- openmpi
- mpi4py
- python=3.8
- numpy=1.23
- pip
Expand Down
5 changes: 3 additions & 2 deletions src/MSFITSIO.cu
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,9 @@ __host__ void readMS(const char* MS_name,
data->telescope_name = obs_col(0);

std::string field_query =
"select REFERENCE_DIR,PHASE_DIR,ROWID() AS ID FROM " + dir +
"/FIELD where !FLAG_ROW";
"select meas.j2000(REFERENCE_DIR) as REFERENCE_DIR,meas.j2000(PHASE_DIR) "
"as PHASE_DIR,ROWID() AS ID FROM " +
dir + "/FIELD where !FLAG_ROW";
casacore::Table field_tab(casacore::tableCommand(field_query.c_str()));

std::string aux_query = "select DATA_DESC_ID FROM " + dir +
Expand Down
10 changes: 7 additions & 3 deletions src/mfs.cu
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ void MFS::configure(int argc, char** argv) {

std::vector<float> ms_ref_freqs;
std::vector<float> ms_max_freqs;
std::vector<float> ms_min_freqs;
std::vector<float> ms_max_blength;
std::vector<float> ms_min_blength;
std::vector<float> ms_uvmax_wavelength;
Expand All @@ -269,6 +270,7 @@ void MFS::configure(int argc, char** argv) {
datasets[d].fields, &datasets[d].data);
ms_ref_freqs.push_back(datasets[d].data.ref_freq);
ms_max_freqs.push_back(datasets[d].data.max_freq);
ms_min_freqs.push_back(datasets[d].data.min_freq);
ms_max_blength.push_back(datasets[d].data.max_blength);
ms_min_blength.push_back(datasets[d].data.min_blength);
ms_uvmax_wavelength.push_back(datasets[d].data.uvmax_wavelength);
Expand All @@ -280,6 +282,7 @@ void MFS::configure(int argc, char** argv) {
Calculating theoretical resolution
*/
float max_freq = *max_element(ms_max_freqs.begin(), ms_max_freqs.end());
float min_freq = *min_element(ms_min_freqs.begin(), ms_min_freqs.end());
float max_blength =
*max_element(ms_max_blength.begin(), ms_max_blength.end());
float min_wlength = freq_to_wavelength(max_freq);
Expand All @@ -299,9 +302,10 @@ void MFS::configure(int argc, char** argv) {

if (nu_0 < 0.0) {
printf(
"Reference frequency not provided. It will be calculated as the median "
"of all the arrays of frequencies.\n");
nu_0 = median(ms_ref_freqs);
"WARNING: Reference frequency not provided. It will be calculated as "
"the middle"
"of the frequency range.\n");
nu_0 = 0.5f * (max_freq + min_freq);
}
printf("Reference frequency: %e Hz\n", nu_0);
double deltau_theo = 2.0 * max_uvmax_wavelength / (M - 1);
Expand Down
12 changes: 6 additions & 6 deletions tests/FREQ78/test.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
function valid () {
if [ $? -eq 0 ]; then
echo OK
else
echo ERROR
exit 1
fi
if [ $? -eq 0 ]; then
echo OK
else
echo ERROR
exit 1
fi
}

test=$($1 -i $2/FREQ78.ms -o $2/residuals.ms -O $2/mod_out.fits -m $2/mod_in_0.fits -p $2/mem/ -X 16 -Y 16 -V 256 -z 0.001 -Z 0.005,0.0 -t 500000000 -g 2 --verbose --print-images)
Expand Down
12 changes: 6 additions & 6 deletions tests/M87/test.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
function valid () {
if [ $? -eq 0 ]; then
echo OK
else
echo ERROR
exit 1
fi
if [ $? -eq 0 ]; then
echo OK
else
echo ERROR
exit 1
fi
}

test=$($1 -i $2/SR1_M87_2017_101_hi_hops_netcal_StokesI.selfcal.LLRR.ms -o $2/residuals.ms -O $2/mod_out.fits -m $2/mod_in_0.fits -p $2/mem/ -X 16 -Y 16 -V 256 --verbose --print-images -z 0.0,0.0 -Z 0.0,0.001,0.005 -R -2.0 -t 500000000 --use-radius-mask)
Expand Down
12 changes: 6 additions & 6 deletions tests/antennae/test.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
function valid () {
if [ $? -eq 0 ]; then
echo OK
else
echo ERROR
exit 1
fi
if [ $? -eq 0 ]; then
echo OK
else
echo ERROR
exit 1
fi
}

test=$($1 -i $2/all_fields.ms -o $2/residuals.ms -O $2/mod_out.fits -m $2/mod_in_0.fits -p $2/mem/ -X 16 -Y 16 -V 256 -z 0.001 -Z 0.01,0.0 -g 1 -R 2.0 -t 500000000 --print-images --verbose)
Expand Down
12 changes: 6 additions & 6 deletions tests/co65/test.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
function valid () {
if [ $? -eq 0 ]; then
echo OK
else
echo ERROR
exit 1
fi
if [ $? -eq 0 ]; then
echo OK
else
echo ERROR
exit 1
fi
}

test=$($1 -X 16 -Y 16 -V 256 -i $2/co65.ms -o $2/residuals.ms -O $2/mod_out.fits -m $2/mod_in_0.fits -p $2/mem/ -z 0.001 -Z 0.01,0.05 -g 1 -t 500000000 --verbose)
Expand Down
12 changes: 6 additions & 6 deletions tests/selfcalband9/test.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
function valid () {
if [ $? -eq 0 ]; then
echo OK
else
echo ERROR
exit 1
fi
if [ $? -eq 0 ]; then
echo OK
else
echo ERROR
exit 1
fi
}

test=$($1 -i $2/hd142_b9cont_self_tav.ms -o $2/residuals.ms -O $2/mod_out.fits -m $2/mod_in_0.fits -p $2/mem/ -X 16 -Y 16 -V 256 --verbose -z 0.001,3.5 -Z 0.05,0.0 -t 500000000 -g 1 --print-images --print-errors)
Expand Down