Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
aaoMathUtils
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
rds
aaoMathUtils
Commits
6f2d0e93
Commit
6f2d0e93
authored
7 years ago
by
mnb
Committed by
afarrell
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Updates to PositionalAstronomy.f90
Updates to PositionalAstronomy.f90
parent
5a03d500
No related branches found
Branches containing commit
Tags
1.90
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
PositionalAstronomy.f90
+100
-0
100 additions, 0 deletions
PositionalAstronomy.f90
with
100 additions
and
0 deletions
PositionalAstronomy.f90
+
100
−
0
View file @
6f2d0e93
...
...
@@ -374,4 +374,104 @@ SUBROUTINE HELIOBARY_CENTRIC_CORRECTION(MN_RA,MN_DEC,EQX,TMJD,CORHV,CORHZ,&
END
SUBROUTINE
HELIOBARY_CENTRIC_CORRECTION
! -------------------------------------------------------------
! -------------------------------------------------------------
SUBROUTINE
HELIOBARY_CENTRIC_VELOCITY
(
MN_RA
,
MN_DEC
,
EQX
,
TMJD
,
DIRHV
,
DIRBV
,
HAFLG
)
! --------
! Purpose:
! --------
! Given the mean RA and DEC of a target and a date of observation
! in MJD per specified Equinox, determine the velocity in that direction
! (in km/s) due to the Earths motion around the sun. Note the Earths
! velocity around the Sun is roughly 30km/s
! -----------
! Description:
! -----------
! Derivation of the correction velocity is textbook as taken from the
! slalib guide and uses the following
! salib routines:
! SLAEVP ~ Calculate the Earths position velocity and velocity vector
! relative to the sun (DPH and DPV) and the Earth Sun
! barycentre (DPB and DVB) from given date/time. Note units
! are in AU and AU/s
!
! SLAEVP ~ Same as SLAEVP but listed as deriving higher accuracy.Note
! units are in AU and AU/d so return velocity values need
! to be divided by 86400
!
! SLADCS2C ~ Calculate the direction cosines (unit direction vector)
! of a target specified in RA and Dec.
!
! SLADVDV ~ Perform a double precision scalar product of two vectors
!
! Correction z value is simply (correction velocity)/(speed of light)
!
! ----------
! Arguments:
! ----------
DOUBLE PRECISION
,
INTENT
(
IN
)
::
MN_RA
! Mean Right Ascension (deg)
DOUBLE PRECISION
,
INTENT
(
IN
)
::
MN_DEC
! Mean Declination (deg)
DOUBLE PRECISION
,
INTENT
(
IN
)
::
EQX
! Chosen Refernce Equinox
DOUBLE PRECISION
,
INTENT
(
IN
)
::
TMJD
! Time in MJD
DOUBLE PRECISION
,
INTENT
(
OUT
)
::
DIRHV
! Return helio-centric velocity
DOUBLE PRECISION
,
INTENT
(
OUT
)
::
DIRBV
! Return bary- centric velocity
LOGICAL
,
INTENT
(
IN
)
::
HAFLG
! Flag to use high accuracy
! slalib routines
! ----------------
! Local Variables:
! ----------------
DOUBLE PRECISION
::
DVB
(
3
),
DPB
(
3
),
DVH
(
3
),
DPH
(
3
),
UNIT_V
(
3
)
DOUBLE PRECISION
::
VEL_INAU
DOUBLE PRECISION
::
VEL_INKM
! ----------
! Constants:
! ----------
DOUBLE PRECISION
,
PARAMETER
::
AU_dp
=
149.597870E6
! Km
DOUBLE PRECISION
,
PARAMETER
::
c_dp
=
3.0E5
! Km/s (= 3.0E8 m/s)
! Get the position vector and the velocity vector of the Earth relative
! to the sun (DPH and DVH) at the specified date time (TMJD wrt EQX)
! Note return vectors are in units of AU and AU/s
IF
(
.NOT.
HAFLG
)
THEN
! Use the standard SLAEVP slalib routine
CALL
SLAEVP
(
TMJD
,
EQX
,
DVB
,
DPB
,
DVH
,
DPH
)
ELSE
! Use the "high accuracy" SLAEPV slalib routine that returns velocites
! in AU/day
CALL
SLAEPV
(
TMJD
,
DPH
,
DVH
,
DPB
,
DVB
)
DVH
=
DVH
/
86400
;
DVB
=
DVB
/
86400
;
ENDIF
! Get the unit direction vector from the Earth to the specified target at
! spherical coordinates in radians (RA, DEC)
! Note: due to the lack of parallax, this direction vector is constant
! from the Earth at any point along it's path of orbit around the Sun.
CALL
SLADCS2C
(
MN_RA
/
DR2D
,
MN_DEC
/
DR2D
,
UNIT_V
)
! Velocity of Earth towards target is simply the scalar product of the
! velocity vector with the unit direction vector. Note this velocity is in
! AU/s
VEL_INAU
=
SLADVDV
(
UNIT_V
,
DVH
)
! Convert to velocity in km/s
VEL_INKM
=
VEL_INAU
*
AU_dp
! Thus required velocity (in km/s) value to return
DIRHV
=
VEL_INKM
! And the same calculations for the bary-centric corrections
VEL_INAU
=
SLADVDV
(
UNIT_V
,
DVB
)
VEL_INKM
=
VEL_INAU
*
AU_dp
DIRBV
=
VEL_INKM
END
SUBROUTINE
HELIOBARY_CENTRIC_VELOCITY
END
MODULE
POSITIONAL_ASTRONOMY
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment