Closed ckar30 closed 2 years ago
Sorry for taking so long to reply to this! The code inside source_surface_br
should help:
# Get radial component at the top
br = self.bc[0][:, :, -1].to_value(self.bunit)
# Remove extra ghost cells off the edge of the grid
m = sunpy.map.Map((br.T, self._wcs_header()))
if 'bunit' in self.input_map.meta:
m.meta['bunit'] = self.input_map.meta['bunit']
vlim = np.max(np.abs(br))
m.plot_settings['cmap'] = _MAG_CMAP
m.plot_settings['vmin'] = -vlim
m.plot_settings['vmax'] = vlim
return m
If you replace self.bc[0]
with 1
or 2
these will be the theta and phi components respectively. I'd be open to adding helper methods similar to source_surface_br()
(source_surface_btheta()
and source_surface_bphi()
) if that would be helpful for you?
Thank you very much. That is what I did back then and it worked well. Again thanks for your help.
How can I get the θ/φ coordinates of the magnetic field and plot a sunpy map object?