LSSTApplications  16.0-10-g0ee56ad+5,16.0-11-ga33d1f2+5,16.0-12-g3ef5c14+3,16.0-12-g71e5ef5+18,16.0-12-gbdf3636+3,16.0-13-g118c103+3,16.0-13-g8f68b0a+3,16.0-15-gbf5c1cb+4,16.0-16-gfd17674+3,16.0-17-g7c01f5c+3,16.0-18-g0a50484+1,16.0-20-ga20f992+8,16.0-21-g0e05fd4+6,16.0-21-g15e2d33+4,16.0-22-g62d8060+4,16.0-22-g847a80f+4,16.0-25-gf00d9b8+1,16.0-28-g3990c221+4,16.0-3-gf928089+3,16.0-32-g88a4f23+5,16.0-34-gd7987ad+3,16.0-37-gc7333cb+2,16.0-4-g10fc685+2,16.0-4-g18f3627+26,16.0-4-g5f3a788+26,16.0-5-gaf5c3d7+4,16.0-5-gcc1f4bb+1,16.0-6-g3b92700+4,16.0-6-g4412fcd+3,16.0-6-g7235603+4,16.0-69-g2562ce1b+2,16.0-8-g14ebd58+4,16.0-8-g2df868b+1,16.0-8-g4cec79c+6,16.0-8-gadf6c7a+1,16.0-8-gfc7ad86,16.0-82-g59ec2a54a+1,16.0-9-g5400cdc+2,16.0-9-ge6233d7+5,master-g2880f2d8cf+3,v17.0.rc1
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 532 of file utils.py.

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

◆ 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 497 of file utils.py.

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

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

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

◆ 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 716 of file utils.py.

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

◆ 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 679 of file utils.py.

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

◆ 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 619 of file utils.py.

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

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

◆ 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 541 of file utils.py.

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

Variable Documentation

◆ MatchDict

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

Definition at line 46 of file utils.py.