Skip to content

modifications necessary to run usage.ipynb on non-steve machine with python3.8 and allow newer mapsims #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ numpy==1.21.5
matplotlib==3.5.2
texttable==1.6.4
scipy==1.7.3
mapsims==2.6.0
mapsims==2.6.1
5 changes: 3 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ license = MIT
license_file = LICENSE
platforms = any
classifiers =
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Expand All @@ -21,12 +22,12 @@ install_requires =
texttable>=1.6
scipy>=1.7
mapsims>=2.6.0
python_requires = >=3.9
python_requires = >=3.8
package_dir =
=src
zip_safe = no

[options.extras_require]
testing =
pytest>=6.0
tox>=3.24
tox>=3.24
10 changes: 5 additions & 5 deletions src/sensitivity_calculator/sensitivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def _calculate(diameter, t, wfe, eta, doe, t_int, pixelYield, szCamNumPoln, eorS
return {"netW8Avg": netW8Avg, "netW8RJ":
netW8RJ, "neiW8": neiW8, "eorNEFD": eorNEFD, "eorNEI": eorNEI, "powerPerPixel":
powerPerPixel, "eorPowerPerPixel": eorPowerPerPixel, "wavelength": wavelength, "beam": beam,
"eorPhotonNoiseNEP": eorPhotonNoiseNEP, "photonNoiseNEP": photonNoiseNEP, "EqTrans": eqtrans}
"eorPhotonNoiseNEP": eorPhotonNoiseNEP, "photonNoiseNEP": photonNoiseNEP}


def _pwvToTick(pwv):
Expand Down Expand Up @@ -487,7 +487,7 @@ def outputSpillEfficiencyFile(i, calculate, spillEfficiency):


# Load the beam file and pass the angle and value data to other functions
def getSpillEfficiency(i, oldFile=True):
def getSpillEfficiency(i, oldFile=False):
"""Returns spill efficiency, using data/tolTEC_staircase_singleHorn_280GHz.txt as a reference. Is meant to be updated when better/more curves are calculated."""
if oldFile:
data = np.genfromtxt(os.path.join(absolute_path,
Expand Down Expand Up @@ -821,7 +821,7 @@ def _apodize_map(map0, n_it=5):
return output


def ccat_mapsims(i, outputs, band, tube, pysm_components, seed, data_C, sim_cmb=False, sim_noise=False, instrument_parameters_path="/Users/stevekchoi/work/build/Sensitivity-Calculator/src/sensitivity_calculator/data/instrument_parameters/instrument_parameters.tbl", hitmap_path="/Users/stevekchoi/work/build/Sensitivity-Calculator/src/sensitivity_calculator/data/ccat_uniform_coverage_nside256_201021.fits", NSIDE=256, lmax=None):
def ccat_mapsims(i, outputs, band, tube, pysm_components, seed, data_C, sim_cmb=False, sim_noise=False, instrument_parameters_path="src/sensitivity_calculator/data/instrument_parameters/instrument_parameters.tbl", hitmap_path="src/sensitivity_calculator/data/ccat_uniform_coverage_nside256_201021.fits", NSIDE=256, lmax=None):
"""Graphs and returns the map corresponding to a given [band] and [tube] in CCAT, with
[pysm_components] and [seed] fed into mapsims to create the map. Sensitivities from the rest of
the calculator are passed in through the input parameters [i] and broadband outputs [outputs].
Expand Down Expand Up @@ -892,7 +892,7 @@ def ccat_mapsims(i, outputs, band, tube, pysm_components, seed, data_C, sim_cmb=
return final[0][tag]


def so_mapsims(band, tube, pysm_components, seed, sim_cmb=False, sim_noise=False, instrument_parameters_path="/Users/stevekchoi/work/build/Sensitivity-Calculator/src/sensitivity_calculator/data/instrument_parameters/instrument_parameters.tbl", hitmap="/Users/stevekchoi/work/build/Sensitivity-Calculator/src/sensitivity_calculator/data/ccat_uniform_coverage_nside256_201021.fits", NSIDE=256, lmax=None):
def so_mapsims(band, tube, pysm_components, seed, sim_cmb=False, sim_noise=False, instrument_parameters_path="src/sensitivity_calculator/data/instrument_parameters/instrument_parameters.tbl", hitmap="src/sensitivity_calculator/data/ccat_uniform_coverage_nside256_201021.fits", NSIDE=256, lmax=None):
"""Graphs and returns the map corresponding to a given [band] and [tube] in SO's telescopes, with
[pysm_components] and [seed] fed into mapsims to create the map. [sim_cmb] and [sim_noise] are toggles
for whether the CMB and noise will be simulated respectively."""
Expand Down Expand Up @@ -1018,7 +1018,7 @@ def _main():
noiseCurves = getNoiseCurves(i, outputs)
seed = 0
NSIDE = 256
hitmap_path = "/Users/stevekchoi/work/build/Sensitivity-Calculator/src/sensitivity_calculator/ccat_uniform_coverage_nside" + \
hitmap_path = "src/sensitivity_calculator/ccat_uniform_coverage_nside" + \
str(NSIDE) + "_201021.fits"
zeroHitmapFractio = zeroHitmapFraction(hitmap_path, NSIDE)
zf = zeroHitmapFractio
Expand Down
85 changes: 36 additions & 49 deletions usage.ipynb

Large diffs are not rendered by default.