Skip to content

Commit

Permalink
Ephemeris generation was mangled if display of radial velocity and/or…
Browse files Browse the repository at this point in the history
… delta uncertainties were turned on, but the current orbit lacked uncertainty data. The revised version is more readable anyway...
  • Loading branch information
Bill-Gray committed Aug 9, 2023
1 parent 4834581 commit 196a044
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 17 deletions.
4 changes: 3 additions & 1 deletion ObsCodes.htm
Original file line number Diff line number Diff line change
Expand Up @@ -2188,6 +2188,7 @@
V21 251.102310.849511+0.526188Cewanee Observatory at DSNM
V22 251.815500.827009+0.560941Insight Remote Observatory, Pie Town
V23 252.764060.828722+0.558332FOAH Observatory, Magdalena
V25 253.301940.846331+0.531305Tortugas Mountain Observatory, Las Cruces
V26 253.390200.911283+0.410639UAS-ISON Observatory, Cosala
V27 253.718190.811354+0.583180North Mesa Observatory, Los Alamos
V28 254.346470.817018+0.575271Deep Sky West Observatory, Rowe
Expand Down Expand Up @@ -2306,6 +2307,7 @@
X06 289.146490.862374-0.505110Skygems Chile, Rio Hurtado
X07 289.146390.862374-0.505109iTelescope Deep Sky Chile, Rio Hurtado
X08 289.235000.862852-0.504255ShAO Chile station, El Sauce
X09 289.146700.862375-0.505108Deep Random Survey, Rio Hurtado
X10 291.820400.921644-0.387717OVTLN, San Pedro de Atacama
X11 289.596040.909953-0.414324VLT Survey Telescope, Paranal
X12 295.712000.803430-0.593455Observatorio Los Cabezones
Expand All @@ -2330,7 +2332,7 @@
X93 313.6047 0.92363 -0.38244 Munhoz Observatory
Y00 315.215040.935906-0.351562SONEAR Observatory, Oliveira
Y01 316.015800.940890-0.337985SONEAR 2 Observatory, Belo Horizonte
Y05 316.310000.941254-0.337051SONEAR Wykrota-CEAMIG, Serra da Piedade
Y05 316.310000.941320-0.337075SONEAR Wykrota-CEAMIG, Serra da Piedade
Y16 318.687940.929268-0.368170ROCG, Campos dos Goytacazes
Y28 321.3126 0.98840 -0.15179 OASI, Nova Itacuruba
Y40 324.038890.989706-0.143217Discovery Observatory, Caruaru
Expand Down
28 changes: 14 additions & 14 deletions ephem0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2126,6 +2126,12 @@ static int _ephemeris_in_a_file( const char *filename, const double *orbit,
int n_mag_places = atoi( get_environment_ptr( "MAG_DIGITS"));
char motion_unit_text[7];
double motion_units = 1.;
const bool showing_rvel_sigmas = (options & OPTION_RADIAL_VEL_OUTPUT)
&& (options & OPTION_RV_AND_DELTA_SIGMAS)
&& n_objects > 1;
const bool showing_delta_sigmas = !(options & OPTION_SUPPRESS_DELTA)
&& (options & OPTION_RV_AND_DELTA_SIGMAS)
&& n_objects > 1;

strlcpy_error( motion_unit_text, get_environment_ptr( "MOTION_UNITS"));
if( !*motion_unit_text)
Expand Down Expand Up @@ -2286,11 +2292,9 @@ static int _ephemeris_in_a_file( const char *filename, const double *orbit,
snprintf_append( buff, sizeof( buff), "-RA%s -Dec%s ",
added_prec_text_ra + 3, added_prec_text_dec + 4);
if( !(options & OPTION_SUPPRESS_DELTA))
{
snprintf_append( buff, sizeof( buff), "-delta ");
if( options & OPTION_RV_AND_DELTA_SIGMAS)
snprintf_append( buff, sizeof( buff), "-sgDel ");
}
if( showing_delta_sigmas)
snprintf_append( buff, sizeof( buff), "-sgDel ");
if( !(options & OPTION_SUPPRESS_SOLAR_R))
snprintf_append( buff, sizeof( buff), "-r---- ");
if( !(options & OPTION_SUPPRESS_ELONG))
Expand Down Expand Up @@ -2346,11 +2350,9 @@ static int _ephemeris_in_a_file( const char *filename, const double *orbit,
if( options & OPTION_MOON_AZ)
snprintf_append( buff, sizeof( buff), " Maz");
if( options & OPTION_RADIAL_VEL_OUTPUT)
{
snprintf_append( buff, sizeof( buff), " rvel-");
if( options & OPTION_RV_AND_DELTA_SIGMAS)
snprintf_append( buff, sizeof( buff), " sigRV");
}
if( showing_rvel_sigmas)
snprintf_append( buff, sizeof( buff), " sigRV");
if( options & OPTION_SPACE_VEL_OUTPUT)
snprintf_append( buff, sizeof( buff), " svel-");
if( show_radar_data)
Expand Down Expand Up @@ -2720,8 +2722,7 @@ static int _ephemeris_in_a_file( const char *filename, const double *orbit,
strlcat_error( buff, tbuff);
snprintf_append( alt_buff, sizeof( alt_buff), " %8.3f %3d",
dist * 3600. * 180. / PI, int_pa);
if( !(options & OPTION_SUPPRESS_DELTA) &&
(options & OPTION_RV_AND_DELTA_SIGMAS))
if( showing_delta_sigmas)
{
double sigma_r;
char sigma_buff[20];
Expand All @@ -2743,8 +2744,7 @@ static int _ephemeris_in_a_file( const char *filename, const double *orbit,
text_search_and_replace( buff, sigma_delta_placeholder,
sigma_buff);
}
if( (options & OPTION_RADIAL_VEL_OUTPUT) &&
(options & OPTION_RV_AND_DELTA_SIGMAS))
if( showing_rvel_sigmas)
{
double sigma_rv;
char sigma_buff[20];
Expand Down Expand Up @@ -3030,7 +3030,7 @@ static int _ephemeris_in_a_file( const char *filename, const double *orbit,
format_dist_in_buff( buff + strlen( buff), r);
use_au_only = false;
}
if( options & OPTION_RV_AND_DELTA_SIGMAS)
if( showing_delta_sigmas)
{
strlcat_error( buff, sigma_delta_placeholder);
strlcat_error( alt_buff, sigma_delta_placeholder);
Expand Down Expand Up @@ -3415,7 +3415,7 @@ static int _ephemeris_in_a_file( const char *filename, const double *orbit,
snprintf_append( alt_buff, sizeof( alt_buff),
" %11.6f", rvel_in_km_per_sec);
format_velocity_in_buff( end_ptr, rvel_in_km_per_sec);
if( options & OPTION_RV_AND_DELTA_SIGMAS)
if( showing_rvel_sigmas)
{
strlcat_error( buff, sigma_rvel_placeholder);
strlcat_error( alt_buff, sigma_rvel_placeholder);
Expand Down
4 changes: 2 additions & 2 deletions miscell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,6 @@ int pattern_match(const char* pattern, const char* string)
const char *find_orb_version_jd( double *jd)
{
if( jd)
*jd = 2460154.5;
return( "2023 Jul 29");
*jd = 2460165.5;
return( "2023 Aug 09");
}

0 comments on commit 196a044

Please sign in to comment.