LSSTApplications  16.0-11-g09ed895+2,16.0-11-g12e47bd,16.0-11-g9bb73b2+6,16.0-12-g5c924a4+6,16.0-14-g9a974b3+1,16.0-15-g1417920+1,16.0-15-gdd5ca33+1,16.0-16-gf0259e2,16.0-17-g31abd91+7,16.0-17-g7d7456e+7,16.0-17-ga3d2e9f+13,16.0-18-ga4d4bcb+1,16.0-18-gd06566c+1,16.0-2-g0febb12+21,16.0-2-g9d5294e+69,16.0-2-ga8830df+6,16.0-20-g21842373+7,16.0-24-g3eae5ec,16.0-28-gfc9ea6c+4,16.0-29-ge8801f9,16.0-3-ge00e371+34,16.0-4-g18f3627+13,16.0-4-g5f3a788+20,16.0-4-ga3eb747+10,16.0-4-gabf74b7+29,16.0-4-gb13d127+6,16.0-49-g42e581f7+6,16.0-5-g27fb78a+7,16.0-5-g6a53317+34,16.0-5-gb3f8a4b+87,16.0-6-g9321be7+4,16.0-6-gcbc7b31+42,16.0-6-gf49912c+29,16.0-7-gd2eeba5+51,16.0-71-ge89f8615e,16.0-8-g21fd5fe+29,16.0-8-g3a9f023+20,16.0-8-g4734f7a+1,16.0-8-g5858431+3,16.0-9-gf5c1f43+8,master-gd73dc1d098+1,w.2019.01
LSSTDataManagementBasePackage
Classes | Functions | Variables
lsst.jointcal.utils Namespace Reference

Classes

class  JointcalStatistics
 

Functions

def plot_flux_distributions (plt, old_mag, new_mag, old_weighted_rms, new_weighted_rms, faint, bright, old_PA1, new_PA1, name='', outdir='.plots')
 
def plot_all_wcs_deltas (plt, data_refs, visits, old_wcs_list, per_ccd_plot=False, name='', outdir='.plots')
 
def make_xy_wcs_grid (x_dim, y_dim, wcs1, wcs2, num=50)
 
def wcs_convert (xv, yv, wcs)
 
def plot_all_wcs_quivers (plt, data_refs, visits, old_wcs_list, name, outdir='.plots')
 
def plot_wcs_quivers (ax, wcs1, wcs2, x_dim, y_dim)
 
def plot_wcs_magnitude (plt, data_refs, visits, old_wcs_list, name, outdir='.plots')
 
def plot_wcs (plt, wcs1, wcs2, x_dim, y_dim, center=(0, 0), name="", outdir='.plots')
 
def plot_rms_histogram (plt, old_rms_relative, old_rms_absolute, new_rms_relative, new_rms_absolute, old_rel_total, old_abs_total, new_rel_total, new_abs_total, name="", outdir='.plots')
 

Variables

 MatchDict = collections.namedtuple('MatchDict', ['relative', 'absolute'])
 

Function Documentation

◆ make_xy_wcs_grid()

def lsst.jointcal.utils.make_xy_wcs_grid (   x_dim,
  y_dim,
  wcs1,
  wcs2,
  num = 50 
)
Return num x/y grid coordinates for wcs1 and wcs2.

Definition at line 530 of file utils.py.

530 def make_xy_wcs_grid(x_dim, y_dim, wcs1, wcs2, num=50):
531  """Return num x/y grid coordinates for wcs1 and wcs2."""
532  x = np.linspace(0, x_dim, num)
533  y = np.linspace(0, y_dim, num)
534  x1, y1 = wcs_convert(x, y, wcs1)
535  x2, y2 = wcs_convert(x, y, wcs2)
536  return x1, y1, x2, y2
537 
538 
def wcs_convert(xv, yv, wcs)
Definition: utils.py:539
def make_xy_wcs_grid(x_dim, y_dim, wcs1, wcs2, num=50)
Definition: utils.py:530

◆ plot_all_wcs_deltas()

def lsst.jointcal.utils.plot_all_wcs_deltas (   plt,
  data_refs,
  visits,
  old_wcs_list,
  per_ccd_plot = False,
  name = '',
  outdir = '.plots' 
)
Various plots of the difference between old and new Wcs.

Parameters
----------
plt : matplotlib.pyplot instance
    pyplot instance to plot with.
data_refs : list of lsst.daf.persistence.butlerSubset.ButlerDataRef
    A list of data refs to plot.
visits : list of visit id (usually int)
    list of visit identifiers, one-to-one correspondent with catalogs.
old_wcs_list : list of lsst.afw.image.wcs.Wcs
    A list of the old (pre-jointcal) WCSs, one-to-one corresponding to data_refs.
per_ccd_plot : bool, optional
    Make per-ccd plots of the "wcs different" (warning: slow!)
name : str
    Name to include in plot titles and save files.
outdir : str, optional
    Directory to write the saved plots to.

Definition at line 495 of file utils.py.

495  name='', outdir='.plots'):
496  """
497  Various plots of the difference between old and new Wcs.
498 
499  Parameters
500  ----------
501  plt : matplotlib.pyplot instance
502  pyplot instance to plot with.
503  data_refs : list of lsst.daf.persistence.butlerSubset.ButlerDataRef
504  A list of data refs to plot.
505  visits : list of visit id (usually int)
506  list of visit identifiers, one-to-one correspondent with catalogs.
507  old_wcs_list : list of lsst.afw.image.wcs.Wcs
508  A list of the old (pre-jointcal) WCSs, one-to-one corresponding to data_refs.
509  per_ccd_plot : bool, optional
510  Make per-ccd plots of the "wcs different" (warning: slow!)
511  name : str
512  Name to include in plot titles and save files.
513  outdir : str, optional
514  Directory to write the saved plots to.
515  """
516 
517  plot_wcs_magnitude(plt, data_refs, visits, old_wcs_list, name, outdir=outdir)
518  plot_all_wcs_quivers(plt, data_refs, visits, old_wcs_list, name, outdir=outdir)
519 
520  if per_ccd_plot:
521  for i, ref in enumerate(data_refs):
522  md = ref.get('calexp_md')
523  dims = lsst.afw.image.bboxFromMetadata(md).getDimensions()
524  plot_wcs(plt, old_wcs_list[i], ref.get('jointcal_wcs'),
525  dims.getX(), dims.getY(),
526  center=(md.getScalar('CRVAL1'), md.getScalar('CRVAL2')), name='dataRef %d'%i,
527  outdir=outdir)
528 
529 
def plot_wcs(plt, wcs1, wcs2, x_dim, y_dim, center=(0, 0), name="", outdir='.plots')
Definition: utils.py:677
def plot_wcs_magnitude(plt, data_refs, visits, old_wcs_list, name, outdir='.plots')
Definition: utils.py:617
def plot_all_wcs_quivers(plt, data_refs, visits, old_wcs_list, name, outdir='.plots')
Definition: utils.py:551
lsst::geom::Box2I bboxFromMetadata(daf::base::PropertySet &metadata)
Determine the image bounding box from its metadata (FITS header)
Definition: Image.cc:703

◆ plot_all_wcs_quivers()

def lsst.jointcal.utils.plot_all_wcs_quivers (   plt,
  data_refs,
  visits,
  old_wcs_list,
  name,
  outdir = '.plots' 
)
Make quiver plots of the WCS deltas for each CCD in each visit.

Parameters
----------
plt : matplotlib.pyplot instance
    pyplot instance to plot with.
data_refs : list of lsst.daf.persistence.butlerSubset.ButlerDataRef
    A list of data refs to plot.
visits : list of visit id (usually int)
    list of visit identifiers, one-to-one correspondent with catalogs.
old_wcs_list : list of lsst.afw.image.wcs.Wcs
    A list of the old (pre-jointcal) WCSs, one-to-one corresponding to data_refs.
name : str
    Name to include in plot titles and save files.
outdir : str, optional
    Directory to write the saved plots to.

Definition at line 551 of file utils.py.

551 def plot_all_wcs_quivers(plt, data_refs, visits, old_wcs_list, name, outdir='.plots'):
552  """
553  Make quiver plots of the WCS deltas for each CCD in each visit.
554 
555  Parameters
556  ----------
557  plt : matplotlib.pyplot instance
558  pyplot instance to plot with.
559  data_refs : list of lsst.daf.persistence.butlerSubset.ButlerDataRef
560  A list of data refs to plot.
561  visits : list of visit id (usually int)
562  list of visit identifiers, one-to-one correspondent with catalogs.
563  old_wcs_list : list of lsst.afw.image.wcs.Wcs
564  A list of the old (pre-jointcal) WCSs, one-to-one corresponding to data_refs.
565  name : str
566  Name to include in plot titles and save files.
567  outdir : str, optional
568  Directory to write the saved plots to.
569  """
570 
571  for visit in visits:
572  fig = plt.figure()
573  # fig.set_tight_layout(True)
574  ax = fig.add_subplot(111)
575  for old_wcs, ref in zip(old_wcs_list, data_refs):
576  if ref.dataId['visit'] != visit:
577  continue
578  md = ref.get('calexp_md')
579  dims = lsst.afw.image.bboxFromMetadata(md).getDimensions()
580  Q = plot_wcs_quivers(ax, old_wcs, ref.get('jointcal_wcs'),
581  dims.getX(), dims.getY())
582  # TODO: add CCD bounding boxes to plot once DM-5503 is finished.
583  # TODO: add a circle for the full focal plane.
584  length = (0.1*u.arcsecond).to(u.radian).value
585  ax.quiverkey(Q, 0.9, 0.95, length, '0.1 arcsec', coordinates='figure', labelpos='W')
586  plt.xlabel('RA')
587  plt.ylabel('Dec')
588  plt.title('visit: {}'.format(visit))
589  filename = os.path.join(outdir, '{}-{}-quivers.pdf')
590  plt.savefig(filename.format(name, visit))
591 
592 
table::Key< int > to
def plot_wcs_quivers(ax, wcs1, wcs2, x_dim, y_dim)
Definition: utils.py:593
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
Definition: history.py:129
def plot_all_wcs_quivers(plt, data_refs, visits, old_wcs_list, name, outdir='.plots')
Definition: utils.py:551
lsst::geom::Box2I bboxFromMetadata(daf::base::PropertySet &metadata)
Determine the image bounding box from its metadata (FITS header)
Definition: Image.cc:703

◆ plot_flux_distributions()

def lsst.jointcal.utils.plot_flux_distributions (   plt,
  old_mag,
  new_mag,
  old_weighted_rms,
  new_weighted_rms,
  faint,
  bright,
  old_PA1,
  new_PA1,
  name = '',
  outdir = '.plots' 
)
Plot various distributions of fluxes and magnitudes.

Parameters
----------
plt : matplotlib.pyplot instance
    pyplot instance to plot with
old_mag : np.array
    old magnitudes
new_mag : np.array
    new magnitudes
old_weighted_rms : np.array
    old rms weighted by the mean (rms(data)/mean(data))
new_weighted_rms : np.array
    old rms weighted by the mean (rms(data)/mean(data))
faint : float
    Faint end of range that PA1 was computed from.
bright : float
    Bright end of range that PA1 was computed from.
old_PA1 : float
    Old value of PA1, to plot as horizontal line.
new_PA1 : float
    New value of PA1, to plot as horizontal line.
name : str
    Name to include in plot titles and save files.
outdir : str, optional
    Directory to write the saved plots to.

Definition at line 434 of file utils.py.

434  name='', outdir='.plots'):
435  """Plot various distributions of fluxes and magnitudes.
436 
437  Parameters
438  ----------
439  plt : matplotlib.pyplot instance
440  pyplot instance to plot with
441  old_mag : np.array
442  old magnitudes
443  new_mag : np.array
444  new magnitudes
445  old_weighted_rms : np.array
446  old rms weighted by the mean (rms(data)/mean(data))
447  new_weighted_rms : np.array
448  old rms weighted by the mean (rms(data)/mean(data))
449  faint : float
450  Faint end of range that PA1 was computed from.
451  bright : float
452  Bright end of range that PA1 was computed from.
453  old_PA1 : float
454  Old value of PA1, to plot as horizontal line.
455  new_PA1 : float
456  New value of PA1, to plot as horizontal line.
457  name : str
458  Name to include in plot titles and save files.
459  outdir : str, optional
460  Directory to write the saved plots to.
461  """
462 
463  import seaborn
464  seaborn.set_style('whitegrid')
465  import scipy.stats
466 
467  old_color = 'blue'
468  new_color = 'red'
469  plt.figure()
470  plt.plot(old_mag, old_weighted_rms, '.', color=old_color, label='old')
471  plt.plot(new_mag, new_weighted_rms, '.', color=new_color, label='new')
472  plt.axvline(faint, ls=':', color=old_color)
473  plt.axvline(bright, ls=':', color=old_color)
474  plt.axhline(old_PA1, ls='--', color=old_color)
475  plt.axhline(new_PA1, ls='--', color=new_color)
476  plt.legend(loc='upper left')
477  plt.title('Where is the systematic flux rms limit?')
478  plt.xlabel('magnitude')
479  plt.ylabel('rms/mean per source')
480  filename = os.path.join(outdir, '{}-photometry-PA1.pdf')
481  plt.savefig(filename.format(name))
482 
483  plt.figure()
484  seaborn.distplot(old_weighted_rms, fit=scipy.stats.lognorm, kde=False, label="old", color=old_color)
485  seaborn.distplot(new_weighted_rms, fit=scipy.stats.lognorm, kde=False, label="new", color=new_color)
486  plt.title('Source RMS pre/post-jointcal')
487  plt.xlabel('rms(flux)/mean(flux)')
488  plt.ylabel('number')
489  plt.legend(loc='upper right')
490  filename = os.path.join(outdir, '{}-photometry-rms.pdf')
491  plt.savefig(filename.format(name))
492 
493 

◆ plot_rms_histogram()

def lsst.jointcal.utils.plot_rms_histogram (   plt,
  old_rms_relative,
  old_rms_absolute,
  new_rms_relative,
  new_rms_absolute,
  old_rel_total,
  old_abs_total,
  new_rel_total,
  new_abs_total,
  name = "",
  outdir = '.plots' 
)
Plot histograms of the source separations and their RMS values.

Parameters
----------
plt : matplotlib.pyplot instance
    pyplot instance to plot with.
old_rms_relative : np.array
    old relative rms/star
old_rms_absolute : np.array
    old absolute rms/star
new_rms_relative : np.array
    new relative rms/star
new_rms_absolute : np.array
    new absolute rms/star
old_rel_total : float
    old relative rms over all stars
old_abs_total : float
    old absolute rms over all stars
new_rel_total : float
    new relative rms over all stars
new_abs_total : float
    new absolute rms over all stars
name : str
    Name to include in plot titles and save files.
outdir : str, optional
    Directory to write the saved plots to.

Definition at line 714 of file utils.py.

714  name="", outdir='.plots'):
715  """Plot histograms of the source separations and their RMS values.
716 
717  Parameters
718  ----------
719  plt : matplotlib.pyplot instance
720  pyplot instance to plot with.
721  old_rms_relative : np.array
722  old relative rms/star
723  old_rms_absolute : np.array
724  old absolute rms/star
725  new_rms_relative : np.array
726  new relative rms/star
727  new_rms_absolute : np.array
728  new absolute rms/star
729  old_rel_total : float
730  old relative rms over all stars
731  old_abs_total : float
732  old absolute rms over all stars
733  new_rel_total : float
734  new relative rms over all stars
735  new_abs_total : float
736  new absolute rms over all stars
737  name : str
738  Name to include in plot titles and save files.
739  outdir : str, optional
740  Directory to write the saved plots to.
741  """
742  plt.figure()
743 
744  color_rel = 'black'
745  ls_old = 'dotted'
746  color_abs = 'green'
747  ls_new = 'dashed'
748  plotOptions = {'lw': 2, 'range': (0, 0.1)*u.arcsecond, 'normed': True,
749  'bins': 30, 'histtype': 'step'}
750 
751  plt.title('relative vs. absolute: %d vs. %d'%(len(old_rms_relative), len(old_rms_absolute)))
752 
753  plt.hist(old_rms_absolute, color=color_abs, ls=ls_old, label='old abs', **plotOptions)
754  plt.hist(new_rms_absolute, color=color_abs, ls=ls_new, label='new abs', **plotOptions)
755 
756  plt.hist(old_rms_relative, color=color_rel, ls=ls_old, label='old rel', **plotOptions)
757  plt.hist(new_rms_relative, color=color_rel, ls=ls_new, label='new rel', **plotOptions)
758 
759  plt.axvline(x=old_abs_total.value, linewidth=1.5, color=color_abs, ls=ls_old)
760  plt.axvline(x=new_abs_total.value, linewidth=1.5, color=color_abs, ls=ls_new)
761  plt.axvline(x=old_rel_total.value, linewidth=1.5, color=color_rel, ls=ls_old)
762  plt.axvline(x=new_rel_total.value, linewidth=1.5, color=color_rel, ls=ls_new)
763 
764  plt.xlim(plotOptions['range'])
765  plt.xlabel('arcseconds')
766  plt.legend(loc='best')
767  filename = os.path.join(outdir, '{}-histogram.pdf')
768  plt.savefig(filename.format(name))
769 

◆ plot_wcs()

def lsst.jointcal.utils.plot_wcs (   plt,
  wcs1,
  wcs2,
  x_dim,
  y_dim,
  center = (0, 0),
  name = "",
  outdir = '.plots' 
)
Plot the "distortion map": wcs1-wcs2 delta of points in the CCD grid.

Parameters
----------
plt : matplotlib.pyplot instance
    pyplot instance to plot with.
wcs1 : lsst.afw.image.wcs.Wcs
    First WCS to compare.
wcs2 : lsst.afw.image.wcs.Wcs
    Second WCS to compare.
x_dim : int
    Size of array in X-coordinate to make the grid over.
y_dim : int
    Size of array in Y-coordinate to make the grid over.
center : tuple, optional
    Center of the data, in on-chip coordinates.
name : str
    Name to include in plot titles and save files.
outdir : str, optional
    Directory to write the saved plots to.

Definition at line 677 of file utils.py.

677 def plot_wcs(plt, wcs1, wcs2, x_dim, y_dim, center=(0, 0), name="", outdir='.plots'):
678  """Plot the "distortion map": wcs1-wcs2 delta of points in the CCD grid.
679 
680  Parameters
681  ----------
682  plt : matplotlib.pyplot instance
683  pyplot instance to plot with.
684  wcs1 : lsst.afw.image.wcs.Wcs
685  First WCS to compare.
686  wcs2 : lsst.afw.image.wcs.Wcs
687  Second WCS to compare.
688  x_dim : int
689  Size of array in X-coordinate to make the grid over.
690  y_dim : int
691  Size of array in Y-coordinate to make the grid over.
692  center : tuple, optional
693  Center of the data, in on-chip coordinates.
694  name : str
695  Name to include in plot titles and save files.
696  outdir : str, optional
697  Directory to write the saved plots to.
698  """
699 
700  plt.figure()
701 
702  x1, y1, x2, y2 = make_xy_wcs_grid(x_dim, y_dim, wcs1, wcs2, num=50)
703  plt.plot((x1 - x2) + center[0], (y1 - y2) + center[1], '-')
704  plt.xlabel('delta RA (arcsec)')
705  plt.ylabel('delta Dec (arcsec)')
706  plt.title(name)
707  filename = os.path.join(outdir, '{}-wcs.pdf')
708  plt.savefig(filename.format(name))
709 
710 
def plot_wcs(plt, wcs1, wcs2, x_dim, y_dim, center=(0, 0), name="", outdir='.plots')
Definition: utils.py:677
def make_xy_wcs_grid(x_dim, y_dim, wcs1, wcs2, num=50)
Definition: utils.py:530

◆ plot_wcs_magnitude()

def lsst.jointcal.utils.plot_wcs_magnitude (   plt,
  data_refs,
  visits,
  old_wcs_list,
  name,
  outdir = '.plots' 
)
Plot the magnitude of the WCS change between old and new visits as a heat map.

Parameters
----------
plt : matplotlib.pyplot instance
    pyplot instance to plot with.
data_refs : list of lsst.daf.persistence.butlerSubset.ButlerDataRef
    A list of data refs to plot.
visits : list of visit id (usually int)
    list of visit identifiers, one-to-one correspondent with catalogs.
old_wcs_list : list of lsst.afw.image.wcs.Wcs
    A list of the old (pre-jointcal) WCSs, one-to-one corresponding to data_refs.
name : str
    Name to include in plot titles and save files.
outdir : str, optional
    Directory to write the saved plots to.

Definition at line 617 of file utils.py.

617 def plot_wcs_magnitude(plt, data_refs, visits, old_wcs_list, name, outdir='.plots'):
618  """Plot the magnitude of the WCS change between old and new visits as a heat map.
619 
620  Parameters
621  ----------
622  plt : matplotlib.pyplot instance
623  pyplot instance to plot with.
624  data_refs : list of lsst.daf.persistence.butlerSubset.ButlerDataRef
625  A list of data refs to plot.
626  visits : list of visit id (usually int)
627  list of visit identifiers, one-to-one correspondent with catalogs.
628  old_wcs_list : list of lsst.afw.image.wcs.Wcs
629  A list of the old (pre-jointcal) WCSs, one-to-one corresponding to data_refs.
630  name : str
631  Name to include in plot titles and save files.
632  outdir : str, optional
633  Directory to write the saved plots to.
634  """
635  for visit in visits:
636  fig = plt.figure()
637  fig.set_tight_layout(True)
638  ax = fig.add_subplot(111)
639  # Start min/max at the "opposite" ends so they always get the first valid value.
640  xmin = np.inf
641  ymin = np.inf
642  xmax = -np.inf
643  ymax = -np.inf
644  for old_wcs, ref in zip(old_wcs_list, data_refs):
645  if ref.dataId['visit'] != visit:
646  continue
647  md = ref.get('calexp_md')
648  dims = lsst.afw.image.bboxFromMetadata(md).getDimensions()
649  x1, y1, x2, y2 = make_xy_wcs_grid(dims.getX(), dims.getY(),
650  old_wcs, ref.get('jointcal_wcs'))
651  uu = x2 - x1
652  vv = y2 - y1
653  extent = (x1[0, 0], x1[-1, -1], y1[0, 0], y1[-1, -1])
654  xmin = min(x1.min(), xmin)
655  ymin = min(y1.min(), ymin)
656  xmax = max(x1.max(), xmax)
657  ymax = max(y1.max(), ymax)
658  magnitude = (np.linalg.norm((uu, vv), axis=0)*u.radian).to(u.arcsecond).value
659  img = ax.imshow(magnitude, vmin=0, vmax=0.3,
660  aspect='auto', extent=extent, cmap=plt.get_cmap('magma'))
661  # TODO: add CCD bounding boxes to the plot once DM-5503 is finished.
662  # TODO: add a circle for the full focal plane.
663 
664  # We're reusing only one of the returned images here for colorbar scaling,
665  # but it doesn't matter because we set vmin/vmax so they are all scaled the same.
666  cbar = plt.colorbar(img)
667  cbar.ax.set_ylabel('distortion (arcseconds)')
668  plt.xlim(xmin, xmax)
669  plt.ylim(ymin, ymax)
670  plt.xlabel('RA')
671  plt.ylabel('Dec')
672  plt.title('visit: {}'.format(visit))
673  filename = os.path.join(outdir, '{}-{}-heatmap.pdf')
674  plt.savefig(filename.format(name, visit))
675 
676 
int min
table::Key< int > to
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
Definition: history.py:129
int max
def make_xy_wcs_grid(x_dim, y_dim, wcs1, wcs2, num=50)
Definition: utils.py:530
def plot_wcs_magnitude(plt, data_refs, visits, old_wcs_list, name, outdir='.plots')
Definition: utils.py:617
lsst::geom::Box2I bboxFromMetadata(daf::base::PropertySet &metadata)
Determine the image bounding box from its metadata (FITS header)
Definition: Image.cc:703

◆ plot_wcs_quivers()

def lsst.jointcal.utils.plot_wcs_quivers (   ax,
  wcs1,
  wcs2,
  x_dim,
  y_dim 
)
Plot the delta between wcs1 and wcs2 as vector arrows.

Parameters
----------
ax : matplotlib.axis
    Matplotlib axis instance to plot to.
wcs1 : lsst.afw.image.wcs.Wcs
    First WCS to compare.
wcs2 : lsst.afw.image.wcs.Wcs
    Second WCS to compare.
x_dim : int
    Size of array in X-coordinate to make the grid over.
y_dim : int
    Size of array in Y-coordinate to make the grid over.

Definition at line 593 of file utils.py.

593 def plot_wcs_quivers(ax, wcs1, wcs2, x_dim, y_dim):
594  """
595  Plot the delta between wcs1 and wcs2 as vector arrows.
596 
597  Parameters
598  ----------
599  ax : matplotlib.axis
600  Matplotlib axis instance to plot to.
601  wcs1 : lsst.afw.image.wcs.Wcs
602  First WCS to compare.
603  wcs2 : lsst.afw.image.wcs.Wcs
604  Second WCS to compare.
605  x_dim : int
606  Size of array in X-coordinate to make the grid over.
607  y_dim : int
608  Size of array in Y-coordinate to make the grid over.
609  """
610 
611  x1, y1, x2, y2 = make_xy_wcs_grid(x_dim, y_dim, wcs1, wcs2)
612  uu = x2 - x1
613  vv = y2 - y1
614  return ax.quiver(x1, y1, uu, vv, units='x', pivot='tail', scale=1e-3, width=1e-5)
615 
616 
def plot_wcs_quivers(ax, wcs1, wcs2, x_dim, y_dim)
Definition: utils.py:593
def make_xy_wcs_grid(x_dim, y_dim, wcs1, wcs2, num=50)
Definition: utils.py:530

◆ wcs_convert()

def lsst.jointcal.utils.wcs_convert (   xv,
  yv,
  wcs 
)
Convert two arrays of x/y points into an on-sky grid.

Definition at line 539 of file utils.py.

539 def wcs_convert(xv, yv, wcs):
540  """Convert two arrays of x/y points into an on-sky grid."""
541  xout = np.zeros((xv.shape[0], yv.shape[0]))
542  yout = np.zeros((xv.shape[0], yv.shape[0]))
543  for i, x in enumerate(xv):
544  for j, y in enumerate(yv):
545  sky = wcs.pixelToSky(x, y)
546  xout[i, j] = sky.getRa()
547  yout[i, j] = sky.getDec()
548  return xout, yout
549 
550 
def wcs_convert(xv, yv, wcs)
Definition: utils.py:539

Variable Documentation

◆ MatchDict

lsst.jointcal.utils.MatchDict = collections.namedtuple('MatchDict', ['relative', 'absolute'])

Definition at line 46 of file utils.py.