Skip to content
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

651 conda activate fix mk #682

Closed
wants to merge 178 commits into from
Closed
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
178 commits
Select commit Hold shift + click to select a range
6934d27
added Dockerfile and GH action
sfarrens Nov 16, 2022
82bc72a
added make dependency
sfarrens Nov 16, 2022
5b44743
notebook
martinkilbinger May 15, 2023
29c609e
docker testing
martinkilbinger Nov 1, 2023
da18970
Merge remote-tracking branch 'upstream/develop' into docker_image
martinkilbinger Nov 3, 2023
5770367
Dockerfile tests
martinkilbinger Nov 8, 2023
3166e3c
Added cent-os to CI tests
martinkilbinger Nov 8, 2023
04a5315
fixed bug in install_shapepipe
sfarrens Sep 7, 2023
757ef7f
Added development environment.
sfarrens Nov 8, 2023
373722e
Added pyproject
martinkilbinger Nov 9, 2023
b025b6a
canfar pyproject update
martinkilbinger Nov 10, 2023
ba135f2
cfis vos configs: missing keywords, DR5 added
martinkilbinger Nov 10, 2023
07cafb4
Testing dockerfile with only conda env installed
martinkilbinger Nov 15, 2023
92a999c
Fixing numpy and astropy versions
martinkilbinger Nov 15, 2023
2b6600d
installation on canfar working: removed most versions from yml file; …
martinkilbinger Nov 17, 2023
b6e5c97
Dockerfile for image 0:7, 0:8
martinkilbinger Nov 17, 2023
bc66565
Installation of sextractor and psfex with conda
martinkilbinger Nov 19, 2023
0b3aac6
script to call curl with canfar contained updated, adding NCORE as ar…
martinkilbinger Nov 19, 2023
69317cb
added init scripts for canfar; job_sp added n_smp for further jobs
martinkilbinger Nov 19, 2023
d35bd69
script to call curl for canfar container: added resources
martinkilbinger Nov 19, 2023
d93a60e
testing input numbers
martinkilbinger Nov 19, 2023
fb83a27
removed debug msg
martinkilbinger Nov 20, 2023
e33972b
numpy error fixed with version upgrade
martinkilbinger Nov 20, 2023
edbec76
Merge branch 'science_portal_run' of github.com:martinkilbinger/shape…
martinkilbinger Nov 20, 2023
9aa16be
Getting ready for exclusive-one-tile processing
martinkilbinger Nov 22, 2023
e5d0335
Added command line option to specify exclusive ID for processing
martinkilbinger Nov 22, 2023
49d8880
Merge remote-tracking branch 'origin/exclusive' into science_portal_run
martinkilbinger Nov 22, 2023
d02347e
curl script exclusive ID
martinkilbinger Nov 24, 2023
12e6b63
Dockerfile conda -> source activate
martinkilbinger Nov 24, 2023
7d20699
Merge remote-tracking branch 'origin/docker_image' into docker_image
martinkilbinger Nov 24, 2023
1d3df1a
Merge branch 'docker_image' of github.com:martinkilbinger/shapepipe-1…
martinkilbinger Nov 24, 2023
b05f2a5
comment added
martinkilbinger Nov 24, 2023
45942d5
Updated Dockerfile
martinkilbinger Nov 24, 2023
7d1891e
running with exclusive ID
martinkilbinger Nov 24, 2023
02affa8
exp runs
martinkilbinger Nov 25, 2023
d8ad328
local curl script NCORES -> 1
martinkilbinger Nov 25, 2023
60c3cd1
Renamed science-portal scripts (local/remote)
martinkilbinger Nov 28, 2023
d331171
added BigMac depdendency for macOS
sfarrens Nov 30, 2023
e335922
activate dev environment
sfarrens Dec 1, 2023
0737c0f
trying to run Pi
martinkilbinger Dec 1, 2023
7dba136
Merge remote-tracking branch 'origin/science_portal_run' into exclusive
martinkilbinger Dec 1, 2023
c65d75a
numpy -> 1.22 to avoid asscalar bug
martinkilbinger Dec 1, 2023
2a7fab4
added cs_util to dev env
sfarrens Dec 1, 2023
1e7b633
aux script to create links for exposure output runs for tile
martinkilbinger Dec 3, 2023
b006368
Merge remote-tracking branch 'origin/science_portal_run' into exclusive
martinkilbinger Dec 3, 2023
85f0c99
Added aux script to update runs log file
martinkilbinger Dec 3, 2023
d0c3d9f
update runs log file script: deal with multiple runs of same module
martinkilbinger Dec 3, 2023
323d44a
run_log: added function get_all_dirs
martinkilbinger Dec 4, 2023
dedbc3f
Fixed new function get_all_dirs
martinkilbinger Dec 4, 2023
e67f549
Fixed (as for MCCD) FITS key bug
martinkilbinger Dec 4, 2023
55677e7
Merge branch 'exclusive' of github.com:martinkilbinger/shapepipe-1 in…
martinkilbinger Dec 4, 2023
b6cb27d
vignet makers: can use last and all in additional input inage directo…
martinkilbinger Dec 4, 2023
096af60
Dockerfile + jupyter, activate
martinkilbinger Dec 8, 2023
3c37250
file handler raises error if no process
martinkilbinger Dec 8, 2023
667eb7b
combine mask outputs
martinkilbinger Dec 8, 2023
bc20ab2
canfar curl command: added kind (tile, exp) as option
martinkilbinger Dec 13, 2023
1b4b3bf
curl remote job script init_run_exclusive_canfar: command line option…
martinkilbinger Dec 13, 2023
bd82f95
curl local command: added -k kind
martinkilbinger Dec 14, 2023
33ea4a1
summary missing ID 32 fixed (?)
martinkilbinger Dec 15, 2023
50df9a7
canfar scripts command line options
martinkilbinger Dec 15, 2023
ba17ebc
curl canfar local script added job, kind
martinkilbinger Dec 15, 2023
394e464
Merge branch 'exclusive' of github.com:martinkilbinger/shapepipe-1 in…
martinkilbinger Dec 15, 2023
94428b4
Merge pull request #4 from martinkilbinger/science_portal_run
martinkilbinger Dec 15, 2023
9ac9dc1
SP ngmxix (job 128) running on canfar
martinkilbinger Dec 17, 2023
1d25a8b
curl canfar local script updated
martinkilbinger Dec 17, 2023
3d2b127
Merge branch 'exclusive' of github.com:martinkilbinger/shapepipe-1 in…
martinkilbinger Dec 17, 2023
ca6b602
curl scripts updated
martinkilbinger Dec 19, 2023
cf69907
Merge branch 'exclusive' of github.com:martinkilbinger/shapepipe-1 in…
martinkilbinger Dec 19, 2023
c643d0c
run summary more OO
martinkilbinger Dec 19, 2023
523b10f
Merge branch 'exclusive' of github.com:martinkilbinger/shapepipe-1 in…
martinkilbinger Dec 19, 2023
53d9d35
update_runs_log_file script: fixed bug when run dir is empty
martinkilbinger Dec 21, 2023
ce1179e
improved canfar job scripts; fixed some make cat bugs
martinkilbinger Dec 21, 2023
a005119
added curl to Dockerimage
martinkilbinger Dec 21, 2023
64f04cf
Merge remote-tracking branch 'origin/exclusive' into exclusive
martinkilbinger Dec 21, 2023
22ee0f3
Remove temp hack from mask
martinkilbinger Dec 21, 2023
c62861d
Merge branch 'exclusive' of github.com:martinkilbinger/shapepipe-1 in…
martinkilbinger Dec 21, 2023
b682e7c
removed unused code from mask
martinkilbinger Dec 21, 2023
9b9dbf1
Merge pull request #3 from martinkilbinger/exclusive
martinkilbinger Dec 21, 2023
dd57fd8
Merge remote-tracking branch 'origin/develop' into develop
martinkilbinger Dec 21, 2023
7fc3645
curl scripts updated
martinkilbinger Dec 23, 2023
15a4b7b
combine psf validation files: preles now with prepare_tiles_for_final…
martinkilbinger Dec 25, 2023
0d56e23
Update post_processing.md
martinkilbinger Dec 25, 2023
fde5982
prepare tiles script loop tests
martinkilbinger Dec 25, 2023
9c5cad4
Merge branch 'p3' of github.com:martinkilbinger/shapepipe-1 into p3
martinkilbinger Dec 25, 2023
ac0a339
curl canfar local script minor change
martinkilbinger Dec 25, 2023
4048bf1
added vos doc md file
martinkilbinger Dec 25, 2023
0a3f80e
Update post_processing.md
martinkilbinger Dec 25, 2023
d81bdf2
Update vos_retrieve.md
martinkilbinger Dec 25, 2023
672001d
Update vos_retrieve.md
martinkilbinger Dec 25, 2023
cc96a0c
Update vos_retrieve.md
martinkilbinger Dec 25, 2023
87bb2b7
Update vos_retrieve.md
martinkilbinger Dec 25, 2023
76c08a6
Update vos_retrieve.md
martinkilbinger Dec 25, 2023
faa0836
Update vos_retrieve.md
martinkilbinger Dec 25, 2023
85f6d91
Update vos_retrieve.md
martinkilbinger Dec 25, 2023
4f81635
combine runs script renamed
martinkilbinger Dec 25, 2023
5574393
Merge branch 'p3' of github.com:martinkilbinger/shapepipe-1 into p3
martinkilbinger Dec 25, 2023
d4cb47c
Update post_processing.md
martinkilbinger Dec 25, 2023
2ffba3b
P3 proceesing to final cat
martinkilbinger Dec 26, 2023
67c966c
Merge branch 'p3' of github.com:martinkilbinger/shapepipe-1 into p3
martinkilbinger Dec 26, 2023
efb2799
Merge branch 'develop' into p3
martinkilbinger Dec 26, 2023
1f36bf5
Merge pull request #5 from martinkilbinger/p3
martinkilbinger Dec 26, 2023
9f81502
config files updated
martinkilbinger Jan 6, 2024
6eb11cf
PSFEx interp runner: allowing all: for ME_DOT_PSF_PDIRS
martinkilbinger Jan 15, 2024
485da58
init run exc script: added -d option; updates
martinkilbinger Jan 15, 2024
ef3a2c9
job sp canfar script: remove old vos upload code
martinkilbinger Jan 15, 2024
a20cb4f
summary create library and param files
martinkilbinger Jan 15, 2024
29b463b
minor changes
martinkilbinger Jan 15, 2024
cb67e8f
curl local script: now working with -e ID and -f file_IDs, in dry and…
martinkilbinger Jan 15, 2024
f0acd65
summary: fixed main path, verbose
martinkilbinger Jan 16, 2024
1bc602b
Started canfar howto
martinkilbinger Jan 16, 2024
d6ff437
Added summary run notebook
martinkilbinger Jan 16, 2024
1a81ae3
psfex_interp: continue instead of error if one of the .psf files not …
martinkilbinger Jan 17, 2024
93d6c6e
fixed symlink config files
martinkilbinger Jan 17, 2024
9c0b9a5
Updated summary run
martinkilbinger Jan 17, 2024
b19ad03
revert to main psfex in link exp for tiles script
martinkilbinger Jan 17, 2024
af38556
curl job script: remoging session logs
martinkilbinger Jan 17, 2024
8c9921f
comments
martinkilbinger Jan 17, 2024
18d104c
Merge pull request #6 from martinkilbinger/P7
martinkilbinger Jan 17, 2024
4276fea
Update canfar.md
martinkilbinger Jan 19, 2024
3f15533
Update canfar.md
martinkilbinger Jan 19, 2024
cfefcfb
Update canfar.md
martinkilbinger Jan 19, 2024
24480e2
Update canfar.md
martinkilbinger Jan 19, 2024
48e6114
Merge pull request #8 from martinkilbinger/martinkilbinger-patch-1
martinkilbinger Jan 19, 2024
cd7c61b
Merge pull request #7 from martinkilbinger/martinkilbinger-canfar-doc
martinkilbinger Jan 19, 2024
9a964c5
updated canfar doc
martinkilbinger Jan 26, 2024
e0100ca
script with akaha lib to count headlerss jobs
martinkilbinger Jan 26, 2024
984ec90
cleaned up curl submit script
martinkilbinger Jan 26, 2024
842e382
minor modifs to summary
martinkilbinger Jan 26, 2024
d9846e9
Removed VM_HOME; jon sp canfar cleaned up
martinkilbinger Jan 26, 2024
c5deb34
Dockerfile cleand up
martinkilbinger Jan 30, 2024
d507780
summary params minor bug fixed
martinkilbinger Feb 1, 2024
b4e0aa0
major bugx fixed: N_SMP was n_SMP, not propagated
martinkilbinger Feb 1, 2024
f8a07d7
major bugx fixed: N_SMP was n_SMP, not propagated
martinkilbinger Feb 1, 2024
30116b8
summary nb
martinkilbinger Feb 1, 2024
9e44fa6
sumamry updated
martinkilbinger Feb 11, 2024
3ab923f
terminal title from within curl script
martinkilbinger Feb 11, 2024
ee5b3ad
Update tiles_P7.txt
martinkilbinger Feb 11, 2024
79cb00a
Merge pull request #9 from martinkilbinger/P7
martinkilbinger Feb 11, 2024
92e4308
merged Dockerfile from docker_image
martinkilbinger Feb 11, 2024
a86b6fd
Merge remote-tracking branch 'origin/develop' into develop
martinkilbinger Feb 23, 2024
1d928d4
monitoring and job handling scripts; small modifs, output; canfar pip…
martinkilbinger Feb 23, 2024
403e8c5
Merge pull request #10 from martinkilbinger/curl
martinkilbinger Feb 23, 2024
a6d8b52
combine run script: flag_tile and flag_exp as diff options
martinkilbinger Mar 5, 2024
1a2d47d
mask runer excluding processed files working
martinkilbinger Mar 6, 2024
de82961
combine runs for masks: changed output target dir name
martinkilbinger Mar 6, 2024
8928c86
summary bug fixed
martinkilbinger Mar 6, 2024
fc5a7df
comment removed
martinkilbinger Mar 6, 2024
e882df3
style
martinkilbinger Mar 6, 2024
7cdcd73
Merge pull request #11 from martinkilbinger/mask
martinkilbinger Mar 6, 2024
802a8cf
t branMerge remote-tracking branch 'origin/develop' into develop
martinkilbinger Mar 6, 2024
2fb58eb
Merge remote-tracking branch 'upstream/develop' into develop
martinkilbinger Mar 6, 2024
160c1b4
Merge remote-tracking branch 'origin/develop' into docker_image
martinkilbinger Mar 6, 2024
93e86e9
Delete scripts/sh/init_canfar.sh
martinkilbinger Mar 6, 2024
8b92dbf
Merge pull request #13 from martinkilbinger/docker_image
martinkilbinger Mar 6, 2024
fe1eb3a
Merge remote-tracking branch 'origin/develop' into develop
martinkilbinger Mar 6, 2024
720afe9
Merge remote-tracking branch 'origin/develop' into plot_spectro
martinkilbinger Mar 6, 2024
07a5924
Merge pull request #14 from martinkilbinger/plot_spectro
martinkilbinger Mar 6, 2024
4ce26ba
Merge remote-tracking branch 'origin/develop' into develop
martinkilbinger Mar 6, 2024
a6bf8a5
remove centos ci
martinkilbinger Mar 6, 2024
339f13f
Merge branch 'develop' of github.com:martinkilbinger/shapepipe-1 into…
martinkilbinger Mar 6, 2024
bddc491
repaired plot spectro notebook
martinkilbinger Mar 6, 2024
4dffd47
added doc string
martinkilbinger Mar 6, 2024
41cfd97
Merge branch 'develop' of github.com:martinkilbinger/shapepipe-1 into…
martinkilbinger Mar 6, 2024
5675c06
python example runner: added back mccd and pysap
martinkilbinger Mar 6, 2024
14569b2
corrected typo in doc string
martinkilbinger Mar 6, 2024
b406438
updated canfar pipeline doc
martinkilbinger Mar 13, 2024
fe66831
fixed combined mask input dir
martinkilbinger Mar 13, 2024
282d76b
added parameters to final cat
martinkilbinger Mar 13, 2024
9ac6bb4
summary
martinkilbinger Mar 13, 2024
25ef4e2
Removed rarely used ngmix njob/ngal options; splits computed automati…
martinkilbinger Mar 13, 2024
75fb975
canfar init + run job: removed prev Ms and Mc dirs for job 256
martinkilbinger Mar 13, 2024
376bbf1
merge sep cats: error if ngmix #HDUs < 6
martinkilbinger Mar 13, 2024
06564a1
Merge pull request #15 from martinkilbinger/cleanup_canfar
martinkilbinger Mar 13, 2024
21deebc
env-dev updated to min versions on canfar (docker image SP 1.1)
martinkilbinger Apr 3, 2024
bb15d08
Merge remote-tracking branch 'upstream' into 651-conda-activate-fix-MK
martinkilbinger Apr 4, 2024
1ea5d4a
Merge remote-tracking branch 'origin/develop' into 651-conda-activate…
martinkilbinger Apr 4, 2024
f2a5a06
minor changes
Apr 10, 2024
925ae5b
Merge remote-tracking branch 'upstream/develop' into 651-conda-activa…
martinkilbinger Oct 21, 2024
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
1 change: 1 addition & 0 deletions auxdir/CFIS/tiles_202106/tiles_P7.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
000.000
052.332
053.331
053.332
Expand Down
95 changes: 95 additions & 0 deletions docs/source/pipeline_canfar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
patch="P7"
psf="psfex"
N_SMP=16

# Terminal title
echo -ne "\033]0;$patch\007"

# Run directory
dir=~/cosmostat/v2/pre_v2/$psf/$patch
cd $dir

# Get tile number list
ln -s ~/shapepipe/auxdir/CFIS/tiles_202106/tiles_$patch.txt tile_numbers.txt


# Get images

## Download and link separately

### Download
### Create and link to central image storage directory
mkdir -p ~/cosmostat/v2/data_tiles/$patch
ln -s ~/cosmostat/v2/data_tiles/$patch data_tiles

### Download and move tiles
ln -s ~/shapepipe/example/cfis
mkdir -p output
export SP_RUN=`pwd`

shapepipe_run -c cfis/config_Git_vos.ini
mv -i output/run_sp_Git_*/get_images_runner/output/CFIS.???.???.*fits* data_tiles
rm -rf output/run_sp_tiles_Git_*
update_run_log_file.py
# repeat the above block

### Find exposures; this run can be stopped after Fe
shapepipe_run -c cfis/config_GitFe_symlink.ini

### Download and move exposures

shapepipe_run -c cfis/config_Gie_vos.ini
mv -i output/run_sp_Gie_*/get_images_runner/output/*.fits*fz data_exp
rm -rf output/run_sp_Gie_*
update_run_log_file.py
# repeat the above

### Create links (and re-run Fe, not necessary)
job_sp_canfar.bash -p $psf `cat tile_numbers.txt` -j 1 -r symlink

# Uncompress weights, split exposures into single HDUs
job_sp_canfar.bash -p $psf -n $N_SMP -j 2

# Mask tiles
job_sp_canfar.bash -p $psf -n $N_SMP -j 4

# If not finshed:
combine_runs.bash -p psfex -c flag
mv output/run_sp_combined_flag output/run_sp_exp_Ma

# Mask exposures
job_sp_canfar.bash -p $psf -n $N_SMP -j 8


# Tile detection
curl_canfar_local.sh -j 16 -f tile_numbers.txt -k tile -p $psf -N $N_SMP


# Exposure detection
## Get single-HDU single-exposure IDs
~/shapepipe/scripts/python/summary_run.py

cp summary/missing_job_32_sextractor.txt all.txt
curl_canfar_local.sh -j 32 -f all.txt -k exp -p $psf -N $N_SMP

# Tile preparation
curl_canfar_local.sh -j 64 -f tile_numbers.txt -k tile -p $psf -N $N_SMP

# Tile shape measurement
curl_canfar_local.sh -j 128 -f tile_numbers.txt -k tile -p $psf -N 8

# Merge subcatalogues, and create final cat
job_sp_canfar.bash -p $psf -n 1 -j 256

# Combine all final cats in common output dir as links
combine_runs.bash -c final -p psfex

# Merge all final cats
# (use 192GB RAM)
merge_final_cat -i output/run_sp_combined_final/make_catalog_runner/output -p cfis/final_cat.param -v


# Delete jobs
SSL=~/.ssl/cadcproxy.pem
SESSION=https://ws-uv.canfar.net/skaha/v0/session
for ID in `cat session_IDs.txt`; do echo $ID; curl -X DELETE -E $SSL $SESSION/$ID; done
3 changes: 0 additions & 3 deletions example/cfis/config_merge_sep_cats_template.ini
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ RUN_LOG_NAME = log_run_sp

# Input directory, containing input files, single string or list of names with length matching FILE_PATTERN
INPUT_DIR = ./output/run_sp_tile_ngmix_Ng1u/ngmix_runner/output
#, ./output/run_sp_tile_ngmix_Ng1u/galsim_shapes_v2_runner/output

# Output directory
OUTPUT_DIR = ./output
Expand All @@ -58,11 +57,9 @@ TIMEOUT = 96:00:00
# Input file pattern(s), list of strings with length matching number of expected input file types
# Cannot contain wild cards
FILE_PATTERN = ngmix
#, galsim

# FILE_EXT (optional) list of string extensions to identify input files
FILE_EXT = .fits
#, .fits

# Numbering convention, string that exemplifies a numbering pattern.
NUMBERING_SCHEME = -000-000
Expand Down
2 changes: 1 addition & 1 deletion example/cfis/config_tile_Sx.ini
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ TIMEOUT = 96:00:00

[SEXTRACTOR_RUNNER]

INPUT_DIR = last:get_images_runner_run_1, last:uncompress_fits_runner, run_sp_tile_Ma:mask_runner
INPUT_DIR = last:get_images_runner_run_1, last:uncompress_fits_runner, run_sp_Ma_tile:mask_runner

FILE_PATTERN = CFIS_image, CFIS_weight, pipeline_flag

Expand Down
4 changes: 2 additions & 2 deletions scripts/jupyter/summary_run.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@
"output_type": "stream",
"text": [
" (Job 1)\n",
"get_images_runner_run_1 464 462 0 2 1.0 99.6%\n",
"find_exposures_runner 232 231 0 1 1.0 99.6%\n",
"get_images_runner_run_1 462 462 0 0 0.0 100.0%\n",
"find_exposures_runner 231 231 0 0 0.0 100.0%\n",
"get_images_runner_run_2 537 0 0 537 179.0 0.0%\n"
]
}
Expand Down
9 changes: 9 additions & 0 deletions scripts/python/stats_headless_canfar.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,20 @@

# Name: stats_headless_canfar.py

# Caution: Does not show all running or pending
# headless jobs, for some reason.

import sys
from skaha.session import Session


def main(argv=None):

print(
"# Depreciated, does not show pending jobs; use stats_jobs_canfar.sh",
file=sys.stderr,
)

session = Session()

n_headless = session.stats()["instances"]["headless"]
Expand Down
12 changes: 11 additions & 1 deletion scripts/python/summary_params_pre_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def set_jobs_v2_pre_v2(patch, verbose):
# - remove previous output dirs since only last is searched
jobs["1"] = job_data(
1,
"run_sp_Git",
"run_sp_GitFeGie",
[
"get_images_runner_run_1",
"find_exposures_runner",
Expand Down Expand Up @@ -220,6 +220,16 @@ def set_jobs_v2_pre_v2(patch, verbose):
)

# Post-processing
jobs["512"] = job_data(
"512",
["run_sp_combined_final"],
["make_cat_runner"],
"tile_IDs",
path_main=path_main,
path_left="output",
verbose=verbose,
)

jobs["1024"] = job_data(
"1024",
"run_sp_combined_psf",
Expand Down
46 changes: 33 additions & 13 deletions scripts/sh/combine_runs.bash
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ usage="Usage: $(basename "$0") [OPTIONS]
\n\nOptions:\n
-h\tthis message\n
-p, --psf MODEL\n
\tPSF model, one in ['psfex'|'mccd'|'setools'], default='$psf'\n
\tPSF model, allowed are 'psfex', 'mccd', 'setools', default='$psf'\n
-c, --cat TYPE\n
\tCatalogue type, one in ['final'|'flag'|'psf'|'image'], default='$cat'\n
\tCatalogue type, allowed are 'final', 'flag_tile', 'flag_exp', \n
\t'psf', 'image', default='$cat'\n
"

## Parse command line
Expand Down Expand Up @@ -48,10 +49,11 @@ done

## Check options
if [ "$cat" != "final" ] \
&& [ "$cat" != "flag" ] \
&& [ "$cat" != "flag_tile" ] \
&& [ "$cat" != "flag_exp" ] \
&& [ "$cat" != "psf" ] \
&& [ "$cat" != "image" ]; then
echo "cat (option -c) needs to be 'final', 'flag', 'psf', or 'image'"
echo "cat (option -c) needs to be 'final', 'flag_tile', 'flag_exp', 'psf', or 'image'"
exit 2
fi

Expand Down Expand Up @@ -106,11 +108,27 @@ if [ "$cat" == "final" ]; then
module="make_catalog_runner"
pattern="final_cat-*"

elif [ "$cat" == "flag" ]; then
elif [ "$cat" == "flag_tile" ]; then

run_in="$pwd/$out_base/run_sp_MaMa_*/mask_runner_run_1"
module="mask_runner_run_1"
pattenr="pipeline_flag-*"
# v1
#run_in="$pwd/$out_base/run_sp_MaMa_*/mask_runner_run_1"
# v2
run_in="$pwd/$out_base/run_sp_tile_Ma_*"
run_out="run_sp_Ma_tile"

module="mask_runner"
pattern="pipeline_flag-*"

elif [ "$cat" == "flag_exp" ]; then

# v1
#run_in="$pwd/$out_base/run_sp_MaMa_*/mask_runner_run_2"
# v2
run_in="$pwd/$out_base/run_sp_exp_Ma_*"
run_out="run_sp_Ma_exp"

module="mask_runner"
pattern="pipeline_flag-*"

elif [ "$cat" == "image" ]; then

Expand Down Expand Up @@ -162,20 +180,22 @@ i=0
for dir in $run_in; do
FILES=(`find $dir -type f -name "$pattern" -print0 | xargs -0 echo`)

echo "$dir $pattern"

## Look over source files
for file in ${FILES[@]}; do

target=$file
link_name=$outdir/`basename $file`
link_s $target $link_name
((i=i+1))
target=$file
link_name=$outdir/`basename $file`
link_s $target $link_name
((i=i+1))

done

done

#echo " $n_files target files, $i links created/skipped"
echo " $i total, "n_skipped skipped, "n_created links created"
echo " $i total, "$n_skipped skipped, "$n_created links created"

# Update log file
update_runs_log_file.py
15 changes: 9 additions & 6 deletions scripts/sh/curl_canfar_local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ID=-1
file_IDs=-1
N_SMP=1
kind=-1
version=1.0
version="1.1"
cmd_remote="shapepipe/scripts/sh/init_run_exclusive_canfar.sh"
batch_max=200
dry_run=0
Expand Down Expand Up @@ -92,7 +92,7 @@ while [ $# -gt 0 ]; do
shift
done

# Check options
## Check options
if [ "$job" == "-1" ]; then
echo "No job indicated, use option -j"
exit 2
Expand Down Expand Up @@ -136,11 +136,13 @@ function set_arg() {
}


# MKDEBUG TODO
function call_curl() {
my_arg=$1

}

# Add session and image IDs to log files
function update_session_logs() {
echo $my_session >> session_IDs.txt
echo "$my_session $ID" >> session_image_IDs.txt
Expand All @@ -152,7 +154,7 @@ function submit_batch() {

for ID in `cat $path`; do
my_arg=$(set_arg)
my_session=`curl -E $SSL $SESSION?$RESOURCES -d "image=$IMAGE:$version" -d "name=${NAME}" -d "cmd=$cmd_remote" --data-urlencode "args=$my_arg"`
my_session=`curl -E $SSL $SESSION?$RESOURCES -d "image=$IMAGE:$version" -d "name=${NAME}" -d "cmd=$cmd_remote" --data-urlencode "args=$my_arg" &> /dev/null`
update_session_logs
done

Expand Down Expand Up @@ -203,19 +205,20 @@ else
echo "Split '$file_IDs' into $n_split batches of size $batch"

count=1
n_running=`stats_jobs_canfar.sh`
for batch in $prefix*; do
echo "Number of running jobs = $n_running"
echo "Submitting batch $batch ($count/$n_split)"
echo -ne "\033]0;curl patch=$patch job=$job $count/$n_split\007"
submit_batch $batch
((count=count+1))

n_running=`stats_headless_canfar.py`
n_running=`stats_jobs_canfar.sh`

while [ "$n_running" -gt "$n_thresh" ]; do
echo "Wait for #jobs = $n_running jobs to go < $n_thresh ..."
sleep $sleep
n_running=`stats_headless_canfar.py`
n_running=`stats_jobs_canfar.sh`
done

done
Expand All @@ -232,7 +235,7 @@ else

# Submit image
arg=$(set_arg)
session=`curl -E $SSL $SESSION?$RESOURCES -d "image=$IMAGE:$version" -d "name=${NAME}" -d "cmd=$cmd_remote" --data-urlencode "args=$arg"`
session=`curl -E $SSL $SESSION?$RESOURCES -d "image=$IMAGE:$version" -d "name=${NAME}" -d "cmd=$cmd_remote" --data-urlencode "args=$arg" &> /dev/null`
update_session_logs

fi
Expand Down
27 changes: 27 additions & 0 deletions scripts/sh/missing_unique.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash

FILES=("summary/missing_job_128_ngmix_runner_*.txt")
temp="temp_temp.tmp"
temp2="temp_temp2.tmp"
out="missing_job_128_ngmix_runner_cut.txt"

i=0
for file in ${FILES[@]}; do

echo $file $i

if [ "$i" == "0" ]; then
cp $file $temp
else
comm -12 <(sort $file) <(sort $temp) > $temp2
cp $temp2 $temp
fi

wc $file $temp

((i=i+1))

done

mv $temp $out
rm $temp2
Loading