Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
csst-sims
csst_msc_sim
Commits
e1a6d241
Commit
e1a6d241
authored
Jun 13, 2024
by
Zhang Xin
Browse files
modify getWCS in Tools
parent
7bb99732
Pipeline
#5492
passed with stage
in 0 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
tools/get_pointing.py
View file @
e1a6d241
...
...
@@ -63,10 +63,15 @@ class Chip(object):
ycen
=
self
.
cen_pix_y
if
pix_scale
==
None
:
pix_scale
=
self
.
pix_scale
# dudx = -np.cos(img_rot.rad) * pix_scale
# dudy = -np.sin(img_rot.rad) * pix_scale
# dvdx = -np.sin(img_rot.rad) * pix_scale
# dvdy = +np.cos(img_rot.rad) * pix_scale
dudx
=
-
np
.
cos
(
img_rot
.
rad
)
*
pix_scale
dudy
=
-
np
.
sin
(
img_rot
.
rad
)
*
pix_scale
dudy
=
+
np
.
sin
(
img_rot
.
rad
)
*
pix_scale
dvdx
=
-
np
.
sin
(
img_rot
.
rad
)
*
pix_scale
dvdy
=
+
np
.
cos
(
img_rot
.
rad
)
*
pix_scale
dvdy
=
-
np
.
cos
(
img_rot
.
rad
)
*
pix_scale
# dudx = +np.sin(img_rot.rad) * pix_scale
# dudy = +np.cos(img_rot.rad) * pix_scale
...
...
@@ -139,12 +144,11 @@ def getobsPA(ra, dec):
angle
=
math
.
acos
(
np
.
dot
(
l1l2cross
,
pdl2cross
)
/
(
np
.
linalg
.
norm
(
l1l2cross
)
*
np
.
linalg
.
norm
(
pdl2cross
)))
angle
=
(
angle
)
/
math
.
pi
*
180
#
if (ra
>
90
and
ra
<
270):
#
angle=-angle
angle
=
angle
+
90
if
(
ra
<
90
or
ra
>
270
):
angle
=-
angle
return
angle
# @jit()
def
getSelectPointingList
(
center
=
[
60
,
-
40
],
radius
=
2
):
points
=
np
.
loadtxt
(
'sky.dat'
)
...
...
@@ -261,7 +265,7 @@ def findPointingbyChipID(chipID = 8, ra = 60., dec = -40.):
if
__name__
==
"__main__"
:
tchip
,
tra
,
tdec
=
8
,
60.
,
-
40.
tchip
,
tra
,
tdec
=
13
,
60.
,
-
40.
pointing
=
findPointingbyChipID
(
chipID
=
tchip
,
ra
=
tra
,
dec
=
tdec
)
print
(
"[ra_center, dec_center, image_rot]: "
,
pointing
)
tools/target_location_check.py
View file @
e1a6d241
...
...
@@ -119,10 +119,15 @@ def getTanWCS(ra, dec, img_rot, pix_scale=0.074):
"""
xcen
,
ycen
=
0
,
0
img_rot
=
img_rot
*
galsim
.
degrees
# dudx = -np.cos(img_rot.rad) * pix_scale
# dudy = -np.sin(img_rot.rad) * pix_scale
# dvdx = -np.sin(img_rot.rad) * pix_scale
# dvdy = +np.cos(img_rot.rad) * pix_scale
dudx
=
-
np
.
cos
(
img_rot
.
rad
)
*
pix_scale
dudy
=
-
np
.
sin
(
img_rot
.
rad
)
*
pix_scale
dudy
=
+
np
.
sin
(
img_rot
.
rad
)
*
pix_scale
dvdx
=
-
np
.
sin
(
img_rot
.
rad
)
*
pix_scale
dvdy
=
+
np
.
cos
(
img_rot
.
rad
)
*
pix_scale
dvdy
=
-
np
.
cos
(
img_rot
.
rad
)
*
pix_scale
moscen
=
galsim
.
PositionD
(
x
=
xcen
,
y
=
ycen
)
sky_center
=
galsim
.
CelestialCoord
(
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment