Skip to content
Snippets Groups Projects
Commit 7a672276 authored by Stefano Covino's avatar Stefano Covino
Browse files

190524 commit

parents
No related branches found
No related tags found
No related merge requests found
Showing
with 836 additions and 0 deletions
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
dist/*
Docs/*
Misc/*
Copyright (c) 2016 The Python Packaging Authority (PyPA)
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
# Include the README
include ./README.md
# Include the license file
include ./LICENSE.txt
# Include the data files
recursive-include SRPGW/Data/ *
#Esclude Misc
exclude ./Misc
# Include all python files
recursive-include . *.py
# Exclude MacOS files
recursive-exclude . .DS_Store
# Swift Reduction Package
The Swift Reduction Package (hereafter SRP) is a packet of command line tools to solve problems (e.g. basic reduction and analysis tasks of optical/NIR astronomical data, quick cosmological computations, units conversions, etc.) often met in astronomical research activities.
SRP was originally developed in the context of the Swift follow-up activities of the Milan GRB team at the INAF/Brera Astronomical Observatory. The package is designed to be an aid to any researcher to drive further observation of a followed-up GRB counterpart and “swift” can therefore be read simply as “rapid”, “agile”, etc.
This subpackage if the SRP suite is devoted to the identification of transient sources in wide-field surveyes.
Metadata-Version: 2.1
Name: SRPAstro.GW
Version: 1.9.0
Summary: Tools for handling GW EM transient search under SRP
Home-page: https://pypi.python.org/pypi/SRPAstro.GW
Author: Stefano Covino
Author-email: stefano.covino@inaf.it
Keywords: astronomy data analysis
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: Astronomy
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: Unix
Classifier: Operating System :: POSIX
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3
Description-Content-Type: text/markdown
License-File: LICENSE.txt
# Swift Reduction Package
Background
The Swift Reduction Package (hereafter SRP) is a packet of command line tools to solve problems (e.g. basic reduction and analysis tasks of optical/NIR astronomical data, quick cosmological computations, units conversions, etc.) often met in astronomical research activities.
SRP was originally developed in the context of the Swift follow-up activities of the Milan GRB team at the INAF/Brera Astronomical Observatory. The package is designed to be an aid to any researcher to drive further observation of a followed-up GRB counterpart and “swift” can therefore be read simply as “rapid”, “agile”, etc.
This subpackage if the SRP suite is devoted to the identification of transient sources in wide-field surveyes.
LICENSE.txt
MANIFEST.in
README.md
setup.cfg
setup.py
./LICENSE.txt
./README.md
./setup.py
./Misc/ApyPSFPhot.py
./Misc/ApyPhot.py
./Misc/DaoPhot.py
./Misc/GetFWHM.py
./Misc/GetPicsA.py
./SRPGW/ApyPSFPhot.py
./SRPGW/ApyPhot.py
./SRPGW/CheckMagDiff.py
./SRPGW/Chi2.py
./SRPGW/DaoPSFPhot.py
./SRPGW/DaoPhot.py
./SRPGW/FindPathes.py
./SRPGW/FindSubPathes.py
./SRPGW/Flux2Mag.py
./SRPGW/GetApPhot.py
./SRPGW/GetCommandStr.py
./SRPGW/GetFits.py
./SRPGW/GetGAIAxMatch.py
./SRPGW/GetGLADExMatch.py
./SRPGW/GetHeadVal.py
./SRPGW/GetIGAIA.py
./SRPGW/GetIGAIAxMatch.py
./SRPGW/GetLEDAxMatch.py
./SRPGW/GetNEDMatch .py
./SRPGW/GetPSFPhot.py
./SRPGW/GetPanSTARRS.py
./SRPGW/GetPics.py
./SRPGW/GetPixVal.py
./SRPGW/GetPixXY.py
./SRPGW/GetSDSSxMatch.py
./SRPGW/GetSimbad.py
./SRPGW/GetSimbadxMatch.py
./SRPGW/GetSkyBot.py
./SRPGW/GetSkyBotMatch.py
./SRPGW/GetTNS.py
./SRPGW/GetTest.py
./SRPGW/GetUSNOxMatch.py
./SRPGW/GetWeights.py
./SRPGW/IsCoordIn.py
./SRPGW/MyPhot.py
./SRPGW/ReadDate.py
./SRPGW/Score.py
./SRPGW/SexPhot.py
./SRPGW/__init__.py
Docs/SRPAstro.GW.pdf
SRPAstro.GW.egg-info/PKG-INFO
SRPAstro.GW.egg-info/SOURCES.txt
SRPAstro.GW.egg-info/dependency_links.txt
SRPAstro.GW.egg-info/requires.txt
SRPAstro.GW.egg-info/top_level.txt
SRPGW/ApyPSFPhot.py
SRPGW/ApyPhot.py
SRPGW/CheckMagDiff.py
SRPGW/Chi2.py
SRPGW/DaoPSFPhot.py
SRPGW/DaoPhot.py
SRPGW/FindPathes.py
SRPGW/FindSubPathes.py
SRPGW/Flux2Mag.py
SRPGW/GetApPhot.py
SRPGW/GetCommandStr.py
SRPGW/GetFits.py
SRPGW/GetGAIAxMatch.py
SRPGW/GetGLADExMatch.py
SRPGW/GetHeadVal.py
SRPGW/GetIGAIA.py
SRPGW/GetIGAIAxMatch.py
SRPGW/GetLEDAxMatch.py
SRPGW/GetNEDMatch .py
SRPGW/GetPSFPhot.py
SRPGW/GetPanSTARRS.py
SRPGW/GetPics.py
SRPGW/GetPixVal.py
SRPGW/GetPixXY.py
SRPGW/GetSDSSxMatch.py
SRPGW/GetSimbad.py
SRPGW/GetSimbadxMatch.py
SRPGW/GetSkyBot.py
SRPGW/GetSkyBotMatch.py
SRPGW/GetTNS.py
SRPGW/GetTest.py
SRPGW/GetUSNOxMatch.py
SRPGW/GetWeights.py
SRPGW/IsCoordIn.py
SRPGW/MyPhot.py
SRPGW/ReadDate.py
SRPGW/Score.py
SRPGW/SexPhot.py
SRPGW/__init__.py
SRPGW/Data/.DS_Store
SRPGW/Data/Predef_parset.dat
SRPGW/Data/tcshScripts/.DS_Store
SRPGW/Data/tcshScripts/00.CIMP.Generale.csh
SRPGW/Data/tcshScripts/00.CIMP.Generale_1epoch.csh
SRPGW/Data/tcshScripts/00.Marcon.Generale.csh
SRPGW/Data/tcshScripts/00.REMROS2.Generale_1epoch.csh
SRPGW/Data/tcshScripts/00.VST.Generale.csh
SRPGW/Data/tcshScripts/00.VST.Generale_1epoch.csh
SRPGW/Data/tcshScripts/01.CIMP.Preparazione.csh
SRPGW/Data/tcshScripts/01.CIMP.Preparazione_1epoch.csh
SRPGW/Data/tcshScripts/01.CNEOST.Preparazione.csh
SRPGW/Data/tcshScripts/01.Marcon.Preparazione.csh
SRPGW/Data/tcshScripts/01.REMROS2.Preparazione_1epoch.csh
SRPGW/Data/tcshScripts/01.VST.Preparazione.csh
SRPGW/Data/tcshScripts/01.VST.Preparazione_1epoch.csh
SRPGW/Data/tcshScripts/02.CIMP.Analisi.csh
SRPGW/Data/tcshScripts/02.CIMP.Analisi_1epoch.csh
SRPGW/Data/tcshScripts/02.CNEOST.Analisi.csh
SRPGW/Data/tcshScripts/02.Marcon.Analisi.csh
SRPGW/Data/tcshScripts/02.REMROS2.Analisi_1epoch.csh
SRPGW/Data/tcshScripts/02.VST.Analisi.csh
SRPGW/Data/tcshScripts/02.VST.Analisi_1epoch.csh
SRPGW/Data/tcshScripts/03.CIMP.Selezione.csh
SRPGW/Data/tcshScripts/03.CIMP.Selezione_1epoch.csh
SRPGW/Data/tcshScripts/03.REMROS2.Selezione_1epoch.csh
SRPGW/Data/tcshScripts/03.VST.Selezione.csh
SRPGW/Data/tcshScripts/03.VST.Selezione_1epoch.csh
SRPGW/Data/tcshScripts/04.VST.Candidati.csh
Scripts/SRPGWAdaptSelect
Scripts/SRPGWAnalysis
Scripts/SRPGWCalc
Scripts/SRPGWCandSelect
Scripts/SRPGWFITSStamp
Scripts/SRPGWImportCats
Scripts/SRPGWImportParSet
Scripts/SRPGWMagNormVar
Scripts/SRPGWMatch
Scripts/SRPGWPICSStamp
Scripts/SRPGWQuery
Scripts/SRPGWSelect
Scripts/SRPGWSourceFinder
Scripts/SRPGWStat
Scripts/SRPGWTabPlot
Scripts/SRPGWTabSearch
Scripts/SRPGWTabViewer
Scripts/SRPGWUnionMatch
Scripts/SRPGWVSTPointing
Scripts/SRPGWVersion
\ No newline at end of file
SRPAstro>=4.2.13
PyPrind
mysql-connector-python
sep>=0.5
photutils
astropy>=1.1.1
aplpy
pyds9
SRPAstro.FITS>=2.4.3
astlib
feets
pydl
SRPGW
""" Utility functions and classes for SRP
Context : SRP
Module : SRPGW
Version : 1.3.2
Author : Stefano Covino
Date : 01/10/2019
E-mail : stefano.covino@inaf.it
URL: : http://www.merate.mi.astro.it/utenti/covino
Usage : DaoPSFPhot
Remarks :
History : (16/12/2016) First version.
: (06/12/2017) PSF from image.
: (07/12/2017) Better coding.
: (29/05/2019) Improvements in PSF modeling.
: (03/06/2019) Correction for PSF aperture photomerty radius.
: (04/09/2019) In any case the central object should be included.
: (23/09/2019) Bug correction.
: (01/10/2019) Parameter fine-tuning.
"""
import SRPGW as GW
import numpy as np
from photutils.psf import DAOGroup
from photutils.background import MMMBackground, MADStdBackgroundRMS
from astropy.modeling.fitting import LevMarLSQFitter
from astropy.stats import gaussian_sigma_to_fwhm
from astropy.stats import sigma_clipped_stats
from photutils.psf import BasicPSFPhotometry
from astropy.table import Table
from photutils.detection import DAOStarFinder
from photutils.psf import extract_stars
from astropy.nddata import NDData
from photutils import EPSFBuilder
from photutils import CircularAperture
from photutils import aperture_photometry
OVERSAMPLING = 4
def ApyPSFPhot(x,y,px,py,data,rds=(5,10,15),fwhm=5,zp=30.0,cent=False):
pflux = []
pfluxerr = []
#
sigma_psf = fwhm/gaussian_sigma_to_fwhm
bkgrms = MADStdBackgroundRMS()
daogroup = DAOGroup(3.0*sigma_psf*gaussian_sigma_to_fwhm)
mmm_bkg = MMMBackground()
fitter = LevMarLSQFitter()
size = np.rint(rds[0]*15).astype(np.int)
#
psfpos = Table(names=['x', 'y'], data=[px,py])
mean_val, median_val, std_val = sigma_clipped_stats(data, sigma=2.)
datas = data - median_val
nddata = NDData(data=datas)
stars = extract_stars(nddata, psfpos, size=2*rds[2])
epsf_builder = EPSFBuilder(oversampling=OVERSAMPLING, maxiters=3, progress_bar=False)
epsf, fitted_stars = epsf_builder(stars)
#
# compute the correction factor
aper = CircularAperture([(epsf.shape[0]/2.,epsf.shape[1]/2.)], r=rds[0]*OVERSAMPLING)
phap = aperture_photometry(epsf.data, aper)
corrfact = phap['aperture_sum']
#if not cent:
# epsf.x_0.fixed = True
# epsf.y_0.fixed = True
# It is convenient to fix the positions anyway at this stage
epsf.x_0.fixed = True
epsf.y_0.fixed = True
#
for o in range(len(x)):
i = np.rint(x[o]).astype(np.int)-1
l = np.rint(y[o]).astype(np.int)-1
image = data[l-size:l+size,i-size:i+size]
#
try:
std = bkgrms(image)
except TypeError:
std = 0.0
#
daofind = DAOStarFinder(threshold=5.*std+mmm_bkg(image), fwhm=fwhm, exclude_border=True)
dobj = daofind.find_stars(image)
dobj.rename_column('xcentroid', 'x_0')
dobj.rename_column('ycentroid', 'y_0')
#
photfitter = LevMarLSQFitter()
photometry = BasicPSFPhotometry(group_maker=daogroup,bkg_estimator=mmm_bkg,psf_model=epsf,fitter=photfitter,fitshape=2*int(rds[1])+1,aperture_radius=rds[0])
#
if len(dobj) == 0:
pos = Table(names=['x_0', 'y_0'], data=[[x[o]-i+size],[y[o]-l+size]])
rt = photometry(image=image, init_guesses=pos)
else:
if np.min(np.sqrt((dobj['x_0'] - size)**2 + (dobj['y_0'] - size)**2)) >= fwhm:
dobj.add_row([dobj['id'][-1]+1,float(size),float(size),0.5,0.,0.,50,0.0,100,100,-1])
rt = photometry(image=image, init_guesses=dobj)
#
dist = np.sqrt((rt['x_fit'] - size)**2 + (rt['y_fit'] - size)**2)
mdist = np.min(dist)
flu = rt[dist == mdist]['flux_fit'][0]
flue = rt[dist == mdist]['flux_unc'][0]
#
flu0 = rt[dist == mdist]['flux_0'][0]
#
flu = flu*corrfact/OVERSAMPLING**2
flue = flue*corrfact/OVERSAMPLING**2
#
pflux.append(float(flu))
pfluxerr.append(float(flue))
#
return pflux, pfluxerr, pflux, pfluxerr
""" Utility functions and classes for SRP
Context : SRP
Module : SRPGW
Version : 1.0.4
Author : Stefano Covino
Date : 14/01/2020
E-mail : stefano.covino@brera.inaf.it
URL: : http://www.merate.mi.astro.it/utenti/covino
Usage : GetApPhot
Remarks :
History : (11/02/2016) First version.
: (13/02/2016) Improved error estimate.
: (18/02/2016) Quicker photometry.
: (23/08/2017) SRPFITS version.
: (14/01/2020) GAIN and RON as parameters.
"""
import SRPGW as GW
#import numpy
#from photutils import CircularAperture, CircularAnnulus, aperture_photometry
#from astropy.table import hstack
import SRPFITS.Photometry.ApyPhot as SPA
def ApyPhot(x,y,data,rds=(5,10,15),backgr=True,gain=GW.VSTgain,ron=GW.VSTron):
return SPA.ApyPhot(x,y,data,rds,backgr,gain,ron)
""" Utility functions and classes for SRP
Context : SRP
Module : SRPGW
Version : 1.0.0
Author : Stefano Covino
Date : 21/12/2017
E-mail : stefano.covino@brera.inaf.it
URL: : http://www.merate.mi.astro.it/utenti/covino
Usage : Score
Remarks :
History : (21/12/2017) First version.
"""
import numpy as np
def CheckMagDiff (m1, em1, m2, em2, th, mode='all'):
err = np.where( ((em1 < 90) & (em2 < 90)), np.sqrt(em1**2+em2**2),
np.where( ((em1 > 90) & (em2 < 90)), em2,
np.where( ((em1 < 90) & (em2 > 90) ), em1, 99.)))
#
if mode == 'all':
return np.where((m1<90) & (m2<90), abs(m1-m2) >= th+err, False)
elif mode == 'high':
return np.where((m1<90) & (m2<90), m1-m2 >= th+err, False)
elif mode == 'low':
return np.where((m1<90) & (m2<90), m1-m2 <= th+err, False)
""" Utility functions and classes for SRP
Context : SRP
Module : SRPGW
Version : 1.1.0
Author : Stefano Covino
Date : 25/03/2019
E-mail : stefano.covino@brera.inaf.it
URL: : http://www.merate.mi.astro.it/utenti/covino
Usage :
Remarks :
History : (23/12/2016) First version.
: (25/03/2019) Fluxes rather than magnitudes.
"""
import numpy as np
from SRP.SRPStatistics.WeightedMean import WeightedMean
import SRPGW as GW
def Chi2(tab):
res = []
#
fs = []
efs = []
#
for e in tab.columns.keys():
if GW.FLUX in e and e.find(GW.FLUX) == 0:
fs.append(e)
if len(fs) == 0:
return -99
#
for e in tab.columns.keys():
if GW.eFLUX in e:
efs.append(e)
if (len(efs) == 0) or (len(fs) != len(efs)):
return -99
#
for e in tab:
c = [(e[i],e[j]) for i,j in zip(fs,efs)]
res.append(WeightedMean(c)[3])
return res
""" Utility functions and classes for SRP
Context : SRP
Module : SRPGW
Version : 1.1.1
Author : Stefano Covino
Date : 14/01/2020
E-mail : stefano.covino@brera.inaf.it
URL: : http://www.merate.mi.astro.it/utenti/covino
Usage : DaoPSFPhot
Remarks :
History : (24/02/2016) First version.
: (13/07/2016) Case of single object.
: (16/12/2016) FWHM in PSF computation.
: (14/01/2020) Gain and ron as parameters.
"""
import SRPGW as GW
import numpy
from PythonPhot import aper
from PythonPhot import getpsf
from PythonPhot import pkfit
def DaoPSFPhot(x,y,px,py,data,rds=(5,10,15),fwhm=5,zp=30.0,cent=False,bck=True,gain=GW.VSTgain,ron=GW.VSTron):
mag,magerr,flux,fluxerr,sky,skyerr,badflag,outstr = aper.aper(data,px,py,phpadu=gain,apr=rds[0],zeropoint=zp,skyrad=[rds[1],rds[2]],verbose=False)
gauss,psf,psfmag = getpsf.getpsf(data,px,py,mag,sky,ronois=ron,phpadu=gain,idpsf=numpy.arange(len(px)),psfrad=rds[2],fitrad=fwhm,psfname='/dev/null')
pk = pkfit.pkfit_class(data,gauss,psf,ronois=ron,phpadu=gain)
#
mag,magerr,flux,fluxerr,sky,skyerr,badflag,outstr = aper.aper(data,x,y,phpadu=gain,apr=rds[0],zeropoint=zp,skyrad=[rds[1],rds[2]],verbose=False)
#
pflux = []
pfluxerr = []
if len(x) < 2:
x = [x,]
y = [y,]
sky = [sky,]
for x,y,s in zip(x,y,sky):
errmag,chi,sharp,niter,scale = pk.pkfit(1,x,y,s,radius=rds[0],recenter=cent)
f = scale*10**(0.4*(zp-psfmag))
ef = errmag*10**(0.4*(zp-psfmag))
pflux.append(float(f))
pfluxerr.append(float(ef))
#
return flux.flatten(), fluxerr.flatten(), pflux, pfluxerr
""" Utility functions and classes for SRP
Context : SRP
Module : SRPGW
Version : 1.1.1
Author : Stefano Covino
Date : 14/01/2020
E-mail : stefano.covino@brera.inaf.it
URL: : http://www.merate.mi.astro.it/utenti/covino
Usage : GetApPhot
Remarks :
History : (25/02/2016) First version.
: (22/08/2017) SRPFITS version.
: (14/01/2020) Gain and Ron as parameters.
"""
import SRPGW as GW
import SRPFITS.Photometry.DaoPhot as SPD
#import numpy
#from PythonPhot import aper
def DaoPhot(x,y,data,rds=(5,10,15),backgr=True,gain=GW.VSTgain,ron=GW.VSTron):
return SPD.DaoPhot(x,y,data,rds,backgr,gain,ron)
X_IMAGE
Y_IMAGE
NUMBER
EXT_NUMBER
FLUX_RADIUS
MAG_APER
MAGERR_APER
MAG_AUTO
MAGERR_AUTO
BACKGROUND
FLUX_MAX
ISOAREA_IMAGE
XMIN_IMAGE
YMIN_IMAGE
XMAX_IMAGE
YMAX_IMAGE
X_WORLD
Y_WORLD
CXX_IMAGE
CYY_IMAGE
CXY_IMAGE
CXX_WORLD
CYY_WORLD
CXY_WORLD
A_IMAGE
B_IMAGE
ELLIPTICITY
CLASS_STAR
FWHM_IMAGE
THETA_IMAGE
ELONGATION
KRON_RADIUS
FLAGS
\ No newline at end of file
#!/bin/csh -f
#
# 29/04/2019 V. 0.2.0
#
if ($#argv == 0) exit 1
#
echo "Arguments: " $argv
#
set ppre = ""
set fpre = "/data01/CIin/GW20170225"
set ocpth = "/data02/ownCloud/Shared/GWshare/ps"
set prepc = "01.CIMP.Preparazione.csh"
set anac = "02.CIMP.Analisi.csh"
set selc = "03.CIMP.Selezione.csh"
set mjdgw = "57912.084219"
set logprep = "logprep.txt"
set logana = "logana.txt"
set noglob
# Work dir
#
foreach p ($argv)
echo "Pointing $ppre$p..."
if !(-e $ppre$p:r) then
mkdir $ppre$p:r
endif
#
cd $ppre$p:r
#
cp ../$prepc .
cp ../$anac .
cp ../$selc .
chmod u+x $prepc $anac $selc
#
set res = `find $fpre -name "*$ppre$p*.fits" -print | sort `
if ($#res > 0) then
set strl = ""
foreach f ($res)
set strl = "$strl $f "
end
#
set cmd = "./$prepc $strl"
echo $cmd
$cmd >> $logprep
#
set anacmd = `tail -1 $logprep`
echo $anacmd
$anacmd >> $logana
#
set selcmd = `tail -1 $logana`
echo $selcmd
$selcmd
#
tar cvzf $ppre$p.tar.gz GWPics $logprep $logana Ep_all_13.tab Ep_all_14.tab Ep_all_13.skycat Ep_all_14.skycat Ep_all_13.vo Ep_all_14.vo
mv $ppre$p.tar.gz $ocpth
endif
#
cd ..
end
#
#!/bin/csh -f
#
# 29/04/2019 V. 0.2.0
#
if ($#argv == 0) exit 1
#
echo "Arguments: " $argv
#
set ppre = ""
set fpre = "/data01/CIin/GW20170225"
set ocpth = "/data02/ownCloud/Shared/GWshare/ps"
set prepc = "01.CIMP.Preparazione_1epoch.csh"
set anac = "02.CIMP.Analisi_1epoch.csh"
set selc = "03.CIMP.Selezione_1epoch.csh"
set mjdgw = "57912.084219"
set logprep = "logprep.txt"
set logana = "logana.txt"
set noglob
# Work dir
#
foreach p ($argv)
echo "Field $ppre$p..."
if !(-e $ppre$p:r) then
mkdir $ppre$p:r
endif
#
cd $ppre$p:r
#
cp ../$prepc .
cp ../$anac .
cp ../$selc .
chmod u+x $prepc $anac $selc
#
set res = `ls $fpre/"$ppre$p"`
if ($#res > 0) then
set strl = ""
foreach f ($res)
set strl = "$strl $f "
end
#
set cmd = "./$prepc $strl"
echo $cmd
$cmd >> $logprep
#
set anacmd = `tail -1 $logprep`
echo $anacmd
$anacmd >> $logana
#
set selcmd = `tail -1 $logana`
echo $selcmd
$selcmd
#
tar cvzf $ppre$p:r.tar.gz $logprep $logana Ep_all_4.vo Ep_all_7.vo Ep_all_4.skycat Ep_all_7.skycat
mv $ppre$p:r.tar.gz $ocpth
endif
#
cd ..
end
#
#!/bin/csh -f
#
# 29/04/2019 V. 0.2.0
#
if ($#argv == 0) exit 1
#
echo "Arguments: " $argv
#
set ppre = ""
set fpre = "/Users/covino/GINAF/Lab/REM/Cagliari/FRBz"
set ocpth = "."
set prepc = "01.Marcon.Preparazione.csh"
set anac = "02.Marcon.Analisi.csh"
set selc = "03.Marcon.Selezione.csh"
set logprep = "logprep.txt"
set logana = "logana.txt"
set noglob
# Work dir
#
foreach p ($argv)
echo "Pointing $ppre$p..."
if !(-e $ppre$p) then
mkdir $ppre$p
endif
#
cd $ppre$p
#
cp ../$prepc .
cp ../$anac .
cp ../$selc .
chmod u+x $prepc $anac $selc
#
set res = `find $fpre -name "$ppre$p*.fit" -print | sort `
if ($#res > 0) then
set strl = ""
foreach f ($res)
set strl = "$strl $f "
end
#
set cmd = "./$prepc $strl"
echo $cmd
$cmd >> $logprep
#
set anacmd = `tail -1 $logprep`
echo $anacmd
$anacmd >> $logana
#
set selcmd = `tail -1 $logana`
echo $selcmd
$selcmd
#
tar cvzf $ppre$p.tar.gz GWPics $logprep $logana Ep_all_13.tab Ep_all_14.tab
#
endif
#
cd ..
end
#
#!/bin/csh -f
#
# 27/04/2019 V. 0.1.0
#
if ($#argv == 0) exit 1
#
echo "Arguments: " $argv
#
#set ppre = "p"
set ppre = ""
set fpre = "/Users/covino/Desktop"
set ocpth = "."
set prepc = "01.REMROS2.Preparazione_1epoch.csh"
set anac = "02.REMROS2.Analisi_1epoch.csh"
set selc = "03.REMROS2.Selezione_1epoch.csh"
set mjdgw = "57979.437998"
set logprep = "logprep.txt"
set logana = "logana.txt"
set noglob
# Work dir
#
foreach p ($argv)
echo "Field $ppre$p..."
if !(-e $ppre$p:r) then
mkdir $ppre$p:r
endif
#
cd $ppre$p:r
#
cp ../$prepc .
cp ../$anac .
cp ../$selc .
chmod u+x $prepc $anac $selc
#
set res = `find $fpre -name "$ppre$p" -print `
if ($#res > 0) then
set strl = ""
foreach f ($res)
set strl = "$strl $f"
end
#
set cmd = "./$prepc $strl"
echo $cmd
$cmd >> $logprep
#
set anacmd = `tail -1 $logprep`
echo $anacmd
$anacmd >> $logana
#
set selcmd = `tail -1 $logana`
echo $selcmd
$selcmd
#
tar cvzf $ppre$p:r.tar.gz $logprep $logana Ep_all_7.tab Ep_all_10.tab
mv $ppre$p:r.tar.gz $ocpth
endif
#
cd ..
end
#
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment