Skip to content

Commit

Permalink
Fixes issues #6 and #7
Browse files Browse the repository at this point in the history
  • Loading branch information
fpavogt committed Jul 27, 2018
1 parent 9a8dc29 commit e361b95
Show file tree
Hide file tree
Showing 16 changed files with 74 additions and 38 deletions.
10 changes: 9 additions & 1 deletion docs/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,24 @@ Changelog |last-commit| |issues|
================================

.. todo::
- (!) deal with multiple spaces in the local files, e.g. [O S O]
- (!) figure out a way to add test OBs on Demo-p2 ?
- (!) formally validate the parallactic function
- (?) include an instrument-free mode
- (?) add metadata to .jpg
- (!) formally validate the parallactic function
- (?) add support for jitter in HAWKI (showing the max jitter area with a circle)
- (?) find a better way to display the allowed TT area for MUSE, e.g. shaded area with
``shapley``
- (?) make the obsdate an ``fc_params`` entry rather than a global variable
- (?) for time critical OBs, get the time from the OB


v0.3.8 July 2018, F.P.A. Vogt
- fixed issue `#6 <https://github.com/fpavogt/fcmaker/issues/6>`_
- fixed issue `#7 <https://github.com/fpavogt/fcmaker/issues/7>`_
- added a N-E arrow to the left plot (useful for custom FITS files not aligned NORTH)
- added a scale to the right plot

v0.3.7 July 2018, F.P.A. Vogt
- fixed issue `#4 <https://github.com/fpavogt/fcmaker/issues/4>`_
- By default, if there are no finding charts associated with an OB, just use the first slot to store the fcmaker one.
Expand Down
7 changes: 5 additions & 2 deletions docs/source/examples/gallery.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ All the fcmaker finding charts share common elements. They are:
- **a left panel aimed at the night astronomer:** the background image is instrument
dependant, and can be chosen/provided by the user.

+ The acquisition field is shown in bold purple.
+ The acquisition field is shown in bold purple. Its center is traced using a crosshair.
+ In case of moving targets (with an ephemeris file), the target position within
:math:`\pm` 2 hours (default, set in ``fcm_m.ephem_range``) from the ``obsdate`` parameter are
shown with red stars. Each time entry within the ephemeris file is shown individually.
Expand All @@ -50,7 +50,10 @@ MUSE WFM-NOAO

The MUSE finding charts in NOAO mode show the location of the *target* defined in the OB,
the acquisition field, and the subsequent O and S fields. The minimum valid radius for
telescope Guide Stars is 120 arcsec from any offset position.
telescope Guide Stars is 120 arcsec from any offset position. The crosshair marking the
center of the acquisition field is only drawn for OBs using the
``MUSE_wfm-noao_acq_movetopixel`` acquisition template, to highlight the need for a
fine-centering on the central object (be it the target, or a blind offset star).

.. figure:: ./fcm_plots/MUSE_WFM_NOAO_DSS2-Red.png
:width: 750px
Expand Down
6 changes: 3 additions & 3 deletions docs/source/examples/local_2_fcm.hawki.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ starty: 1000 # First row for fats phot window
##### Observation #####
noff: 3 #
filter: J #
obstype: [O S O] #
obstype: [O S O] # Offsets must be separated by a single space!
coordtype: SKY #
off1: [0 480 -485] #
off2: [0 -200 205] #
off1: [0 480 -485] # Offsets must be separated by a single space!
off2: [0 -200 205] # Offsets must be separated by a single space!
return: True #

##### Other params #####
Expand Down
4 changes: 2 additions & 2 deletions docs/source/examples/local_2_fcm.hawki_fph.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ noff: 1 #
filter: J #
obstype: [O] #
coordtype: SKY #
off1: [0] #
off2: [0] #
off1: [0] # Offsets must be separated by a single space!
off2: [0] # Offsets must be separated by a single space!
return: True #

##### Other params #####
Expand Down
6 changes: 3 additions & 3 deletions docs/source/examples/local_2_fcm.hawki_noao.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ starty: 1 # First row for fats phot window
##### Observation #####
noff: 3 #
filter: J #
obstype: [O S O] #
obstype: [O S O] # Offsets must be separated by a single space!
coordtype: SKY #
off1: [0 480 -485] #
off2: [0 -200 205] #
off1: [0 480 -485] # Offsets must be separated by a single space!
off2: [0 -200 205] # Offsets must be separated by a single space!
return: True #

##### Other params #####
Expand Down
6 changes: 3 additions & 3 deletions docs/source/examples/local_2_fcm.muse_nfm-DSS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ oatt_dec: -72d02m20.4919s #

##### Observation #####
noff: 3 #
obstype: [O O O] #
obstype: [O O O] # Offsets must be separated by a single space!
coordtype: SKY #
posang: [0 0 0] #
off1: [0 0.2 -0.4] #
off2: [0 0.2 -0.4] #
off1: [0 0.2 -0.4] # Offsets must be separated by a single space!
off2: [0 0.2 -0.4] # Offsets must be separated by a single space!
return: True #

##### Other params #####
Expand Down
10 changes: 5 additions & 5 deletions docs/source/examples/local_2_fcm.xshooter_ephem.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ephemeris: ./ephem.txt # relative path+filename of an ephemeris file, optiona
##### Acquisition #####
bos_ra: 0 # Blind-offset (RA), XSHOOTER convention!
bos_dec: 0 # Blind offset (Dec), XSHOOTER convention!
acq_pa: -25 # Acquisiton Position Angle (degrees), XSHOOTER convention!
acq_pa: -25 # Acquisition Position Angle (degrees), XSHOOTER convention!
is_gs: False # User-defined Guide Star ?
gs_ra: 21h49m22.147s #
gs_dec: +00d27m53.336s #
Expand All @@ -32,10 +32,10 @@ vis_slt: 1.0 #
nir_slt: 1.0 #
slt_throw: 0.0 # The Nodding Throw along the slit
noff: 2 #
obstype: [O S] #
coordtype: SKY # DETECTOR = SLIT, or SKY
off1: [0 -75] #
off2: [0 -70] #
obstype: [O S] # Offsets must be separated by a single space!
coordtype: DETECTOR # DETECTOR = SLIT, or SKY
off1: [0 12] # Offsets must be separated by a single space!
off2: [0 0] # Offsets must be separated by a single space!
return: True

##### Other params #####
Expand Down
8 changes: 4 additions & 4 deletions docs/source/examples/local_2_fcm.xshooter_pm.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ephemeris: # relative path+filename of an ephemeris file, optiona
##### Acquisition #####
bos_ra: 0 # Blind-offset (RA), XSHOOTER convention!
bos_dec: 0 # Blind offset (Dec), XSHOOTER convention!
acq_pa: 9999 # Acquisiton Position Angle (degrees), XSHOOTER convention!
acq_pa: 9999 # Acquisition Position Angle (degrees), XSHOOTER convention!
is_gs: False # User-defined Guide Star ?
gs_ra: 21h49m22.147s #
gs_dec: +00d27m53.336s #
Expand All @@ -32,10 +32,10 @@ vis_slt: 1.0 #
nir_slt: 1.0 #
slt_throw: 0.0 # The Nodding Throw along the slit
noff: 2 #
obstype: [O S] #
obstype: [O S] #
coordtype: SKY # DETECTOR = SLIT, or SKY
off1: [0 -75] #
off2: [0 -70] #
off1: [0 20] # Offsets must be separated by a single space!
off2: [0] # Offsets must be separated by a single space!
return: True

##### Other params #####
Expand Down
2 changes: 1 addition & 1 deletion docs/source/modules/modules.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
The functions of fcmaker
=========================
========================

.. toctree::
:maxdepth: 4
Expand Down
2 changes: 1 addition & 1 deletion fcmaker/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
help='feed a manual, local OB description')

parser.add_argument('--montage', action='store_true',
help='disable the use of Montage to rotate the charts')
help='enable the use of Montage to rotate the charts')

parser.add_argument('--systemtex', action='store_true',
help='disable the use of the system-wide LaTeX')
Expand Down
9 changes: 8 additions & 1 deletion fcmaker/fcmaker_instrument_dispatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,14 @@ def get_p2fcdata(obID, api):

# Need to deal with the target coordinates. Ephemeris file, or not ?
if ephem_fn is None:


# Issue #6: https://github.com/fpavogt/fcmaker/issues/6
# Make sure the equinox comes with a "J"
if not(ob['target']['equinox'][0] == 'J'):
warnings.warn('Equinox %s invalid: it should start with a "J". Using %s instead.'
% (ob['target']['equinox'], 'J'+ob['target']['equinox']) )
ob['target']['equinox'] = 'J'+ob['target']['equinox']

# Ok, just a normal target ... extract the required info
tc = SkyCoord(ra = ob['target']['ra'],
dec = ob['target']['dec'],
Expand Down
2 changes: 1 addition & 1 deletion fcmaker/fcmaker_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
'''

# Define the version of fcmaker
__version__ = '0.3.7'
__version__ = '0.3.8'

# Where are we located ?
fcm_dir = os.path.dirname(__file__)
Expand Down
31 changes: 24 additions & 7 deletions fcmaker/fcmaker_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ def add_orient(ax, field_center,
ax.show_arrows([a_west[0], a_south[0]], [a_west[1],a_south[1]],
[arrow_width.to(u.deg).value/np.cos(np.radians(aloc[1])),0],
[0,arrow_width.to(u.deg).value],
head_length=20,head_width=15, color='k')
#head_length = 562 * arrow_width.to(u.deg).value,
#head_width = 422 * arrow_width.to(u.deg).value,
color='k')

#print(arrow_width.to(u.deg).value)

if usetex:
lab1 = r'\smaller\textbf{N}'
Expand Down Expand Up @@ -522,16 +526,29 @@ def draw_fc(fc_params, bk_image = None, bk_lam = None, do_pdf = False, do_png =
warnings.warn('Watch out ... no suitable Guide Star found in UCAC2 !')

# Add orientation arrows to the large view plot
add_orient(ax2, right_center, radius = (right_radius*0.8)*u.arcsec, usetex = fcm_m.fcm_usetex)
add_orient(ax2, right_center, radius = (right_radius*0.82)*u.arcsec,
arrow_width = (right_radius*0.82)/4.5 * u.arcsec, usetex = fcm_m.fcm_usetex)
add_orient(ax1, left_center, radius = (left_radius*0.82)*u.arcsec,
arrow_width = (left_radius*0.82)/4.5 * u.arcsec, usetex = fcm_m.fcm_usetex)


# Add a scale bar
(scl,scll) = fcm_id.get_scalebar(fc_params['inst'], ins_mode = fc_params['ins_mode'])

ax1.add_scalebar(scl) # Length in degrees
ax1.scalebar.show(scl, label=scll, corner = 'bottom right',
ax1.scalebar.show(scl, label=scll, corner = 'bottom left',
color = 'k', frame=1, fontsize=12)
ax1.scalebar.set_linewidth(2)


scl2 = np.floor(right_radius/60/6)/60.
scll2 = r'%.0f$^{\prime}$' % (scl2*60)
ax2.add_scalebar(scl2)
ax2.scalebar.show(scl2, label=scll2, corner = 'bottom left',
color = 'k', frame=1, fontsize=12)


for ax in [ax1,ax2]:
ax.scalebar.set_linewidth(2)

# Fine tune things a bit further, just because I can ...
for ax in [ax1,ax2]:
ax.tick_labels.set_xformat('hh:mm:ss')
Expand Down Expand Up @@ -571,8 +588,8 @@ def draw_fc(fc_params, bk_image = None, bk_lam = None, do_pdf = False, do_png =

# Add a legend (if warranted) for the left plot
if len(ax1_legend_items) >0:
ax1._ax1.legend(handles=ax1_legend_items, loc='lower left',
bbox_to_anchor=(0.0255, 0.025, 0.4, .1),
ax1._ax1.legend(handles=ax1_legend_items,
bbox_to_anchor=(-0.03, 0.82, 0.4, .1), #loc='lower right',
ncol=1, #mode="expand",
borderaxespad=0., fontsize=10, borderpad=0.3,
handletextpad=0., handlelength=2.0)
Expand Down
5 changes: 3 additions & 2 deletions fcmaker/fcmaker_xshooter.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,9 @@ def detector_to_sky(dx,dy,pa):
'''

# Rotate the offsets in the Ra-Dec frame
ddec = np.sin(np.radians(pa)) * dx + np.cos(np.radians(pa)) * dy
dra = np.cos(np.radians(pa)) * dx - np.sin(np.radians(pa)) * dy
# Issue #7: https://github.com/fpavogt/fcmaker/issues/6
ddec = - np.cos(np.radians(pa)) * dx + np.sin(np.radians(pa)) * dy
dra = np.sin(np.radians(pa)) * dx + np.cos(np.radians(pa)) * dy

# Flip the RA axis to increase along East
dra *= -1.
Expand Down
2 changes: 1 addition & 1 deletion fcmaker/mpl_styles/fcmaker_plots.mplstyle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

font.family: sans-serif
font.serif: Computer Modern Serif
font.sans-serif: Computer Modern Sans serif
font.sans-serif: Arial
font.size: 16
font.weight: 500
font.variant: normal
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='fcmaker',
version='0.3.7',
version='0.3.8',
author='F.P.A. Vogt',
author_email='[email protected]',
packages=['fcmaker',],
Expand Down

0 comments on commit e361b95

Please sign in to comment.