Skip to content
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
3 changes: 3 additions & 0 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ jobs:
run: |
ls
if [ -f "${SINGULARITY_RECIPE}" ]; then
echo "Working directory: $PWD"
echo "Recipe: ${SINGULARITY_RECIPE}"
echo "Output: ${OUTPUT_CONTAINER}"
singularity build ${OUTPUT_CONTAINER} ${SINGULARITY_RECIPE}
else
echo "${SINGULARITY_RECIPE} is not found."
Expand Down
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ find_package(SuiteSparse REQUIRED)

find_package(MPI REQUIRED)

find_package(PythonInterp REQUIRED)
find_package(Python REQUIRED COMPONENTS Interpreter Development)

find_package(MPI4PY REQUIRED)

Expand All @@ -67,3 +67,4 @@ enable_testing()

# The directory that gather the whole source code.
add_subdirectory(src)

9 changes: 9 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
-) Fork `cal` repository on your account

-) Clone the `cal` repository from your account

-) Open new brnach with a sensible name linked to the new features that you want to introduce

-) Commit on your account

-) Open and discuss a PULLREQUEST
142 changes: 142 additions & 0 deletions cookbook/Example_atm_spectrum.ipynb

Large diffs are not rendered by default.

108 changes: 52 additions & 56 deletions cookbook/Focal_Plane.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cookbook/Qubic_beam_filter.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.2"
"version": "3.9.7"
}
},
"nbformat": 4,
Expand Down
12 changes: 8 additions & 4 deletions cookbook/Simulation/strip_file_0.par
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ Test_scan
2022,1,1,1,0,0
-sample_rate
20
-el_mod_rate
0.01
-el_mod_amplitude
1.0
-ces_azmin
0
1
-ces_azmax
0
359
-ces_el
70
-scan
Expand All @@ -30,11 +34,11 @@ None
128
-debug
-outdir
out_directory_prova
feb_
-start_mc
0
-nsimu
50
10
-cache_name
atm_
-atm_cache
Expand Down
50 changes: 12 additions & 38 deletions cookbook/Simulation/strip_pipeline.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ def main():
parser.add_argument("-ces_start_time", default="2022,9,1,0,0,0", required=True)
parser.add_argument("-ces_stop_time", default="2022,9,1,1,0,0", required=True)
parser.add_argument("-sample_rate", required=True, type=int, help="Frequency sample rate [Hz]")
parser.add_argument("-el_mod_rate", required=False, default=0, type=np.float, help="If non-zero, observing elevation will be continuously modulated during the science scan. [Hz]")
parser.add_argument("-el_mod_amplitude", required=False, default=1, type=np.float, help="Range of elevation modulation when `el_mod_rate` is non-zero. [degrees]")

# Scan parameters
parser.add_argument("-ces_azmin", default=0, type=int)
Expand Down Expand Up @@ -150,37 +152,6 @@ def main():
parser.add_argument("-freq", default=43.0, type=float)


# Arguments of the simulation
# class args:
# sample_rate=20
# focalplane=None
# ces_name = "Test1"
# scan="spin"
# subscan="spin_1hour"
# ces_stop_time = datetime(2022, 9, 2, 0, 0, 0).timestamp()
# ces_start_time = datetime(2022, 9, 1, 0, 0, 0).timestamp()
# site_name= "Tenerife"
# site_lon = "-16:31:00"
# site_lat = "28:20:00"
# site_alt = 2390.0
# coord = "C"
# ces_azmin = 0
# ces_azmax = 0
# ces_el = 70
# scanrate = 1.0
# scan_accel = 1000
# CES_start = None
# NSIDE=128
# debug=True
# outdir="out_directory"

# start_mc = 0
# nsimu = 1
# cache_name = "atm_"
# atm_cache="atm_cache_"
# verbose = 0
# freq = 43 # GHz

# definition of the logger, the global timer and the environment
log = Logger.get()
gt = GlobalTimers.get()
Expand Down Expand Up @@ -234,7 +205,7 @@ def main():
comm.comm_group,
fp.detquats,
totsamples,
detranks=ndetrank,
# detranks=ndetrank,
firsttime=start_time,
rate=args.sample_rate,
site_lon=args.site_lon,
Expand All @@ -243,9 +214,12 @@ def main():
azmin=args.ces_azmin,
azmax=args.ces_azmax,
el=args.ces_el,
el_mod_rate=0.01,
el_mod_amplitude=1.0,
el_mod_sine=True,
scanrate=args.scanrate,
scan_accel=args.scan_accel,
sinc_modulation=None,
cosecant_modulation=True,
CES_start=None,
CES_stop=None,
sun_angle_min=None,
Expand Down Expand Up @@ -310,7 +284,7 @@ def main():
for i in obs['tod'].local_dets:
p = obs['tod'].cache.reference("pixels_{}".format(i))
poin[i]=p
np.save(args.outdir+'/pointings', poin)
np.savez_compressed(args.outdir+'/pointings', poin)


# Atmospheric MC simulation
Expand Down Expand Up @@ -363,10 +337,10 @@ def main():
atm.exec(data)

if comm.comm_world is not None:
comm.comm_world.barrier()
comm.comm_world.barrier()
tmr.stop()
if comm.world_rank == 0:
tmr.report("Atmosphere simulation")
tmr.report("Atmosphere simulation")


if comm.world_rank == 0:
Expand Down Expand Up @@ -484,8 +458,8 @@ def main():
tods = {}
for i in obs['tod'].local_dets:
t = obs['tod'].cache.reference("atm_{}".format(i))
tods[i]=t
np.save(outpath+'/tod_mc_'+str(mc), tods)
tods[i]=np.float32(t)
np.savez_compressed(outpath+'/tod_mc_'+str(mc), tods)

timer_MC_iter.stop()
timer_MC_iter.report("Monte Carlo iteration completed in ")
Expand Down
Loading