Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
resolve
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ift
resolve
Commits
312b366b
Commit
312b366b
authored
3 years ago
by
Philipp Arras
Browse files
Options
Downloads
Patches
Plain Diff
field2fits: add headeroverride
parent
421155cf
No related branches found
Branches containing commit
No related tags found
1 merge request
!37
Draft: Observation: introduce __hash__
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
resolve/ubik_tools/fits.py
+6
-2
6 additions, 2 deletions
resolve/ubik_tools/fits.py
with
6 additions
and
2 deletions
resolve/ubik_tools/fits.py
+
6
−
2
View file @
312b366b
...
...
@@ -25,7 +25,7 @@ from ..util import assert_sky_domain
from
..data.observation
import
Observation
def
field2fits
(
field
,
file_name
,
observations
=
[]):
def
field2fits
(
field
,
file_name
,
observations
=
[]
,
header_override
=
{}
):
import
astropy.io.fits
as
pyfits
from
astropy.time
import
Time
...
...
@@ -55,7 +55,8 @@ def field2fits(field, file_name, observations=[]):
# h["DATE-OBS"] = '2019-05-08T20:32:19.1' # TEMPORARY
# #h["TELESCOPE"] = "MEERKAT" # TEMPORARY
# h["OBSERVER"] = "xxx" # TEMPORARY
# h["OBJECT"] = "xxx" # TEMPORARY
h
[
"
OBSRA
"
]
=
direction
.
phase_center
[
0
]
*
180
/
np
.
pi
if
direction
is
not
None
else
0.0
h
[
"
OBSDEC
"
]
=
direction
.
phase_center
[
1
]
*
180
/
np
.
pi
if
direction
is
not
None
else
0.0
# h["SPECSYS"] = "TOPOCENT"
h
[
"
CTYPE1
"
]
=
"
RA---SIN
"
h
[
"
CRVAL1
"
]
=
direction
.
phase_center
[
0
]
*
180
/
np
.
pi
if
direction
is
not
None
else
0.0
...
...
@@ -94,6 +95,9 @@ def field2fits(field, file_name, observations=[]):
h
[
"
DATE-MAP
"
]
=
Time
(
time
.
time
(),
format
=
"
unix
"
).
iso
.
split
()[
0
]
if
direction
is
not
None
:
h
[
"
EQUINOX
"
]
=
direction
.
equinox
h
=
{
**
h
,
**
header_override
}
for
t_ind
,
t_val
in
enumerate
(
tdom
.
coordinates
):
val
=
field
.
val
[:,
t_ind
]
# Select time
val
=
np
.
transpose
(
val
,
(
0
,
1
,
3
,
2
))
# Switch spatial axes
...
...
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