Skip to content

Commit

Permalink
Repair the thin-disk problem after new adaptive-res stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Prather committed May 12, 2020
1 parent 2e05641 commit 03a6518
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
18 changes: 8 additions & 10 deletions src/ipolarray.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,21 @@ void integrate_emission(struct of_traj *traj, int nstep, int only_unpolarized,
Kconf[mu] = traj[nstep - 1].Kcon[mu];
}

#if THIN_DISK
if (thindisk_region(Xi, Xf)) {
get_model_i(Xf, Kconf, Intensity);
} else {
*Intensity = 0.;
}
#else
// solve total intensity equation alone
double jf, kf;
get_jkinv(Xf, Kconf, &jf, &kf);
*Intensity = approximate_solve(*Intensity, ji, ki, jf, kf, traj[nstep].dl, Tau);
// swap start and finish
ji = jf;
ki = kf;
#endif

// solve polarized transport
if (!only_unpolarized) {
Expand Down Expand Up @@ -384,15 +392,6 @@ void project_N(double X[NDIM], double Kcon[NDIM],
double approximate_solve(double Ii, double ji, double ki, double jf,
double kf, double dl, double *tau)
{
#if THIN_DISK
if (thindisk_region(Xi, Xf)) {
double Intensity;
get_model_i(Xf, Kconf, &Intensity);
return Intensity;
} else {
return 0.
}
#else
double efac, If, javg, kavg, dtau;

javg = (ji + jf) / 2.;
Expand All @@ -411,7 +410,6 @@ double approximate_solve(double Ii, double ji, double ki, double jf,
}

return If;
#endif
}

/*************************SUPPORTING FUNCTIONS******************************/
Expand Down
3 changes: 1 addition & 2 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -505,8 +505,7 @@ int main(int argc, char *argv[])
}
}
avg_val /= nx*ny;
fprintf(stderr, "\nMade initial image.\n");
fprintf(stderr, "Image average flux in Jy/muas^2: %f\n", avg_val * pow(freqcgs, 3) / (JY * MUAS_PER_RAD * MUAS_PER_RAD));
//fprintf(stderr, "\nBase image average flux in Jy/muas^2: %g\n", avg_val * pow(freqcgs, 3) / (JY * MUAS_PER_RAD * MUAS_PER_RAD));

// REFINE based on previous image
double *parent_image = image_min;
Expand Down

0 comments on commit 03a6518

Please sign in to comment.