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

Commita063d3e

Browse files
committed
Now shunting through the input rv if it's valid but there is no parallax.
1 parent8820ca0 commita063d3e

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

‎expected/epochprop.out‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
SET extra_float_digits=2;
1+
SET extra_float_digits = 1;
22
SELECT
33
to_char(DEGREES(tp[1]), '999D9999999999'),
44
to_char(DEGREES(tp[2]), '999D9999999999'),
@@ -45,9 +45,9 @@ FROM (
4545
NULL,
4646
RADIANS(-801.551/3.6e6), RADIANS(10362/3.6e6), -110,
4747
-100) AS tp) AS q;
48-
to_char | to_char | to_char | to_char | to_char | to_char
49-
-----------------+-----------------+---------+----------+------------+---------
50-
269.4744079540 | 4.4055337210 | | -801.210 | 10361.762 |
48+
to_char | to_char | to_char | to_char | to_char | to_char
49+
-----------------+-----------------+---------+----------+------------+----------
50+
269.4744079540 | 4.4055337210 | | -801.210 | 10361.762 |-110.000
5151
(1 row)
5252

5353
SELECT

‎sql/epochprop.sql‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
SET extra_float_digits=2;
1+
SET extra_float_digits=1;
22

33
SELECT
44
to_char(DEGREES(tp[1]),'999D9999999999'),

‎src/epochprop.c‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,14 +184,23 @@ epoch_prop(PG_FUNCTION_ARGS) {
184184

185185
propagate_phasevec(&input,delta_t,&output);
186186

187+
/* If we have a null parallax but a good RV, preserve the original,
188+
untransformed RV on output. See
189+
https://github.com/ivoa-std/udf-catalogue/pull/20#issuecomment-2115053757
190+
for the rationale. */
191+
if (!PG_ARGISNULL(4)&&PG_ARGISNULL(1)) {
192+
output_null[5]=0;
193+
output.rv=input.rv;
194+
}
195+
187196
/* change to internal units: rad, rad/yr, mas, and km/s */
188197
retvals[0]=Float8GetDatum(output.pos.lng);
189198
retvals[1]=Float8GetDatum(output.pos.lat);
190199
retvals[2]=Float8GetDatum(output.parallax);
191200
retvals[3]=Float8GetDatum(output.pm[0]);
192201
retvals[4]=Float8GetDatum(output.pm[1]);
193202
retvals[5]=Float8GetDatum(output.rv);
194-
203+
195204
{
196205
intlower_bounds[1]= {1};
197206
intdims[1]= {6};

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp