LSST Applications  21.0.0-147-g0e635eb1+1acddb5be5,22.0.0+052faf71bd,22.0.0+1ea9a8b2b2,22.0.0+6312710a6c,22.0.0+729191ecac,22.0.0+7589c3a021,22.0.0+9f079a9461,22.0.1-1-g7d6de66+b8044ec9de,22.0.1-1-g87000a6+536b1ee016,22.0.1-1-g8e32f31+6312710a6c,22.0.1-10-gd060f87+016f7cdc03,22.0.1-12-g9c3108e+df145f6f68,22.0.1-16-g314fa6d+c825727ab8,22.0.1-19-g93a5c75+d23f2fb6d8,22.0.1-19-gb93eaa13+aab3ef7709,22.0.1-2-g8ef0a89+b8044ec9de,22.0.1-2-g92698f7+9f079a9461,22.0.1-2-ga9b0f51+052faf71bd,22.0.1-2-gac51dbf+052faf71bd,22.0.1-2-gb66926d+6312710a6c,22.0.1-2-gcb770ba+09e3807989,22.0.1-20-g32debb5+b8044ec9de,22.0.1-23-gc2439a9a+fb0756638e,22.0.1-3-g496fd5d+09117f784f,22.0.1-3-g59f966b+1e6ba2c031,22.0.1-3-g849a1b8+f8b568069f,22.0.1-3-gaaec9c0+c5c846a8b1,22.0.1-32-g5ddfab5d3+60ce4897b0,22.0.1-4-g037fbe1+64e601228d,22.0.1-4-g8623105+b8044ec9de,22.0.1-5-g096abc9+d18c45d440,22.0.1-5-g15c806e+57f5c03693,22.0.1-7-gba73697+57f5c03693,master-g6e05de7fdc+c1283a92b8,master-g72cdda8301+729191ecac,w.2021.39
LSST Data Management Base Package
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 534 of file utils.py.

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

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

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

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

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

◆ 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.

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

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

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

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

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

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

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

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

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

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

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

Variable Documentation

◆ MatchDict

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

Definition at line 46 of file utils.py.