Skip to content

Commit

Permalink
set RAYFILE Source to RECORD tp make sure dither is written
Browse files Browse the repository at this point in the history
  • Loading branch information
hamogu committed Dec 28, 2023
1 parent b32df4a commit 68bd021
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
24 changes: 23 additions & 1 deletion marx/libsrc/dither.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,25 @@ static int get_internal_dither (double t, Marx_Dither_Type *d,
return 1;
}

/* Record the dither state but do not actually dither the rays, which are
* already assumed to be dithered a;ready in the input file.
*/
static int get_internal_dither_record_only(double t, Marx_Dither_Type *d,
double *rap, double *decp, double *rollp)
{
int status;

if (1 != (status = get_internal_dither(t, d, rap, decp, rollp)))
return status;

*rap = 0;
*decp = 0;
*rollp = 0;

return 1;
}


static int get_zeroamp_internal_dither (double t, Marx_Dither_Type *d,
double *rap, double *decp, double *rollp)
{
Expand Down Expand Up @@ -209,7 +228,10 @@ static int init_internal_dither (int dither_flag)
Ra_Amp = Ra_Amp * (PI/(180.0 * 3600));
Dec_Amp = Dec_Amp * (PI/(180.0 * 3600));
Roll_Amp = Roll_Amp * (PI/(180.0 * 3600));
Get_Dither_Function = get_internal_dither;
if (dither_flag & _MARX_DITHER_RECORD_ONLY)
Get_Dither_Function = get_internal_dither_record_only;
else
Get_Dither_Function = get_internal_dither;
marx_message ("[Using INTERNAL dither model]\n");
}
Get_Dither_Par_Means = get_dither_par_means_0;
Expand Down
2 changes: 1 addition & 1 deletion marx/libsrc/source.def
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ static Source_Object_Type Sources [] =
{"GAUSS", marx_select_gauss_source, 0, 0},
{"LINE", marx_select_line_source, 0, 0},
{"BETA", marx_select_beta_source, 0, 0},
{"RAYFILE", marx_select_rayfile_source, _MARX_DITHER_UNSUPPORTED, 0},
{"RAYFILE", marx_select_rayfile_source, _MARX_DITHER_RECORD_ONLY, 0},
{"DISK", marx_select_disk_source, 0, 0},
{"USER", marx_select_user_source, 0, 0},
{"SAOSAC", marx_select_saosac_source, _MARX_DITHER_ZERO_AMP|_MARX_DITHER_RECORD_ONLY, 0},
Expand Down

0 comments on commit 68bd021

Please sign in to comment.