Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit31c58a3

Browse files
committed
PM nulling bugfix after@vitcpp's PR review.
(and a few minor editorial changes)
1 parenta0e65de commit31c58a3

File tree

3 files changed

+5
-21
lines changed

3 files changed

+5
-21
lines changed

‎expected/epochprop.out‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ FROM (
8181
120) AS tp) AS q;
8282
to_char | to_char | to_char | to_char | to_char | to_char
8383
-----------------+-----------------+----------+---------+---------+----------
84-
269.4520769500 |5.0388680565 | 23.007 | | | -97.120
84+
269.4520769500 |4.6933649660 | 23.007 | | |-110.000
8585
(1 row)
8686

8787
SELECT epoch_prop(NULL,

‎src/epochprop.c‎

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -144,28 +144,21 @@ epoch_prop(PG_FUNCTION_ARGS) {
144144
input.parallax=0;
145145
output_null[2]=1;
146146
/* The way we do our computation, with a bad parallax the RV
147-
will be horribly off, too, so null this out, too */
147+
will be horribly off, too, so null this out, too; if avaialble,
148+
we will fiddle in the original RV below again. */
148149
output_null[5]=1;
149150
}else {
150151
input.parallax=PG_GETARG_FLOAT8(1);
151152
}
152153
input.parallax_valid=fabs(input.parallax)>PX_MIN;
153154

154-
if (PG_ARGISNULL(2)) {
155+
if (PG_ARGISNULL(2)||PG_ARGISNULL(3)) {
155156
input.pm[0]=0;
156157
input.pm[1]=0;
157158
output_null[3]=1;
158159
output_null[4]=1;
159160
}else {
160161
input.pm[0]=PG_GETARG_FLOAT8(2);
161-
}
162-
163-
if (PG_ARGISNULL(3)) {
164-
input.pm[0]=0;
165-
input.pm[1]=0;
166-
output_null[3]=1;
167-
output_null[4]=1;
168-
}else {
169162
input.pm[1]=PG_GETARG_FLOAT8(3);
170163
}
171164

‎src/epochprop.h‎

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,12 @@
66
externDatumepoch_prop(PG_FUNCTION_ARGS);
77

88

9-
/* a cartesian point; this is like geo_decl's point, but you can't
10-
have both geo_decls and pg_sphere right now (both define a type Point,
11-
not to mention they have different ideas on EPSILON */
12-
typedefstructs_cpoint
13-
{
14-
doublex,
15-
y;
16-
}CPoint;
17-
189
typedefstructs_phasevec
1910
{
2011
SPointpos;/* Position as an SPoint */
2112
doublepm[2];/* Proper motion long/lat in rad/year, PM in
2213
* longitude has cos(lat) applied */
2314
doubleparallax;/* in rad */
2415
doublerv;/* radial velocity in km/s */
25-
intparallax_valid;/* 1 if the parallaxreally is a NULL */
16+
intparallax_valid;/* 1 ifwe acceptthe parallaxas physical */
2617
}phasevec;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp