LSSTApplications  18.0.0+106,18.0.0+50,19.0.0,19.0.0+1,19.0.0+10,19.0.0+11,19.0.0+13,19.0.0+17,19.0.0+2,19.0.0-1-g20d9b18+6,19.0.0-1-g425ff20,19.0.0-1-g5549ca4,19.0.0-1-g580fafe+6,19.0.0-1-g6fe20d0+1,19.0.0-1-g7011481+9,19.0.0-1-g8c57eb9+6,19.0.0-1-gb5175dc+11,19.0.0-1-gdc0e4a7+9,19.0.0-1-ge272bc4+6,19.0.0-1-ge3aa853,19.0.0-10-g448f008b,19.0.0-12-g6990b2c,19.0.0-2-g0d9f9cd+11,19.0.0-2-g3d9e4fb2+11,19.0.0-2-g5037de4,19.0.0-2-gb96a1c4+3,19.0.0-2-gd955cfd+15,19.0.0-3-g2d13df8,19.0.0-3-g6f3c7dc,19.0.0-4-g725f80e+11,19.0.0-4-ga671dab3b+1,19.0.0-4-gad373c5+3,19.0.0-5-ga2acb9c+2,19.0.0-5-gfe96e6c+2,w.2020.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 527 of file utils.py.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Variable Documentation

◆ MatchDict

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

Definition at line 46 of file utils.py.