Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
Now you should be able to run everything also without an input map.
  • Loading branch information
Joshiwavm committed Aug 25, 2023
1 parent 703ffa9 commit 164a6e4
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 16 deletions.
27 changes: 14 additions & 13 deletions docs/source/tutorials/mock-observations.ipynb

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions maria/mappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,14 @@ def save_maps(self, filepath):
self.header['CDELT2'] = np.rad2deg(self.map_res)
self.header['CRPIX1'] = self.maps[list(self.maps.keys())[0]].shape[0]/2
self.header['CRPIX2'] = self.maps[list(self.maps.keys())[0]].shape[1]/2

self.header['CRVAL1'] = np.rad2deg(self.tods[0].cntr[0])
self.header['CRVAL2'] = np.rad2deg(self.tods[0].cntr[1])

self.header['CTYPE1'] = 'RA---SIN'
self.header['CUNIT1'] = 'deg '
self.header['CTYPE2'] = 'DEC--SIN'
self.header['CUNIT2'] = 'deg '
self.header['comment'] = 'Overwrote pointing location of the output map'

self.header['comment'] = 'Overwrote spectral position of the output map'
Expand Down
5 changes: 5 additions & 0 deletions maria/sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,15 @@ def run(self):
tod.el = self.pointing.el
tod.ra = self.pointing.ra
tod.dec = self.pointing.dec
tod.cntr = self.pointing.scan_center

if self.map_sim is not None:
tod.unit = self.map_sim.input_map.units
tod.header = self.map_sim.input_map.header
else:
tod.unit = 'K'
tod.header = fits.header.Header()


# number of bands are lost here
tod.data = np.zeros((self.array.n_dets, self.pointing.n_time))
Expand Down
4 changes: 1 addition & 3 deletions maria/sky.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,10 @@ def __init__(self,
self.input_map.header['comment'] = 'Changed input CDELT1 and CDELT2'
self.input_map.header['comment'] = 'Changed surface brightness units to ' + self.input_map.units
self.input_map.header['comment'] = 'Repositioned the map on the sky'
self.input_map.header['CRVAL1'] = np.rad2deg(self.input_map.center[0])
self.input_map.header['CRVAL2'] = np.rad2deg(self.input_map.center[1])

if self.input_map.inbright is not None:
self.input_map.data *= self.input_map.inbright / np.nanmax(self.input_map.data)
self.input_map.header[""] = "Amplitude is rescaled."
self.input_map.header['comment'] = "Amplitude is rescaled."

if self.input_map.units == 'Jy/pixel':
for i, nu in enumerate(self.input_map.freqs):
Expand Down

0 comments on commit 164a6e4

Please sign in to comment.