diff --git a/csst/common/data/data.py b/csst/common/data.py similarity index 92% rename from csst/common/data/data.py rename to csst/common/data.py index 8b314b7fc4d50fa91e8c2a769313955db41487a4..e7872cfc687a73cba1139c8d0c45f6e830b21a9a 100644 --- a/csst/common/data/data.py +++ b/csst/common/data.py @@ -3,9 +3,11 @@ from collections import OrderedDict import astropy.io.fits as fits from astropy.io.fits import HDUList, PrimaryHDU -from ..CsstException import CsstException +from csst.common.CsstException import CsstException +__all__ = ["CsstData", "INSTRUMENT_LIST"] + INSTRUMENT_LIST = ["MSC", ] @@ -46,12 +48,12 @@ class CsstData: """ if ext == 'pri': try: - value = self._primary_hdu.header.get(key) + return self._primary_hdu.header.get(key) except Exception as e: print(e) elif ext == 'img': try: - value = self._l0data.header.get(key) + return self._l0data.header.get(key) except Exception as e: print(e) else: diff --git a/csst/common/data/__init__.py b/csst/common/data/__init__.py deleted file mode 100644 index 6f24a9fa391e3a6dfad7771f8a33b675490afce3..0000000000000000000000000000000000000000 --- a/csst/common/data/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from .data import CsstData -from .mscdata import CsstMscData, CsstMscImgData diff --git a/csst/common/factory.py b/csst/common/factory.py index 725d2c8fb2b8556daf92de4d42f787c1f701fe24..8c71674b4b32d892bbc77f9a76ac19534a365eb6 100644 --- a/csst/common/factory.py +++ b/csst/common/factory.py @@ -1,7 +1,7 @@ from astropy.io import fits -from .data.data import INSTRUMENT_LIST -from csst.common.data.mscdata import CsstMscImgData +from csst.common.data import INSTRUMENT_LIST +from csst.msc.mscdata import CsstMscImgData class CsstDataFactory: diff --git a/csst/msc/astrometry/__init__.py b/csst/msc/astrometry/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/csst/msc/astrometry/raw/__init__.py b/csst/msc/astrometry/raw/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/csst/msc/astrometry/raw/_notes.md b/csst/msc/astrometry/raw/_notes.md new file mode 100644 index 0000000000000000000000000000000000000000..3f4c3265a4a389a681cc538c11279e958999c509 --- /dev/null +++ b/csst/msc/astrometry/raw/_notes.md @@ -0,0 +1,30 @@ +### Astrometry module + +--- +Adapted from JD Nie on 2022-02-23. + +```commandline +├── __init__.py +├── csst_realtime.conv [sextractor] convolution kernel +├── csst_realtime.nnw [sextractor] neural network weights +├── csst_realtime.param [sextractor] parameter names +├── csst_realtime.sex unused +├── default.missfits [missfits] config file +├── default.param unused +├── default.scamp [scamp] wcs config file +├── default2.scamp unused +├── new_csst_realtime.no.weight.sex [sextractor] config file +├── readme example +└── run_astrom_csst.py main program +``` + + +pipeline steps: +```commandline + +``` + + + +simulated data: +tulip: /share/Cycle-3-SimuData/ \ No newline at end of file diff --git a/csst/msc/astrometry/raw/csst_realtime.conv b/csst/msc/astrometry/raw/csst_realtime.conv new file mode 100644 index 0000000000000000000000000000000000000000..1e79313c93c6bbc09c04e743d747eaeeb65905cb --- /dev/null +++ b/csst/msc/astrometry/raw/csst_realtime.conv @@ -0,0 +1,7 @@ +CONV NORM +# 5x5 convolution mask of a gaussian PSF with FWHM = 2.5 pixels. +0.034673 0.119131 0.179633 0.119131 0.034673 +0.119131 0.409323 0.617200 0.409323 0.119131 +0.179633 0.617200 0.930649 0.617200 0.179633 +0.119131 0.409323 0.617200 0.409323 0.119131 +0.034673 0.119131 0.179633 0.119131 0.034673 diff --git a/csst/msc/astrometry/raw/csst_realtime.nnw b/csst/msc/astrometry/raw/csst_realtime.nnw new file mode 100644 index 0000000000000000000000000000000000000000..4b521bd432f70b333331b2c88b11b63cf38dc5b4 --- /dev/null +++ b/csst/msc/astrometry/raw/csst_realtime.nnw @@ -0,0 +1,28 @@ +NNW +# Neural Network Weights for the SExtractor star/galaxy classifier (V1.3) +# inputs: 9 for profile parameters + 1 for seeing. +# outputs: ``Stellarity index'' (0.0 to 1.0) +# Seeing FWHM range: from 0.025 to 5.5'' (images must have 1.5 < FWHM < 5 pixels) +# Optimized for Moffat profiles with 2<= beta <= 4. + + 3 10 10 1 + +-1.56604e+00 -2.48265e+00 -1.44564e+00 -1.24675e+00 -9.44913e-01 -5.22453e-01 4.61342e-02 8.31957e-01 2.15505e+00 2.64769e-01 + 3.03477e+00 2.69561e+00 3.16188e+00 3.34497e+00 3.51885e+00 3.65570e+00 3.74856e+00 3.84541e+00 4.22811e+00 3.27734e+00 + +-3.22480e-01 -2.12804e+00 6.50750e-01 -1.11242e+00 -1.40683e+00 -1.55944e+00 -1.84558e+00 -1.18946e-01 5.52395e-01 -4.36564e-01 -5.30052e+00 + 4.62594e-01 -3.29127e+00 1.10950e+00 -6.01857e-01 1.29492e-01 1.42290e+00 2.90741e+00 2.44058e+00 -9.19118e-01 8.42851e-01 -4.69824e+00 +-2.57424e+00 8.96469e-01 8.34775e-01 2.18845e+00 2.46526e+00 8.60878e-02 -6.88080e-01 -1.33623e-02 9.30403e-02 1.64942e+00 -1.01231e+00 + 4.81041e+00 1.53747e+00 -1.12216e+00 -3.16008e+00 -1.67404e+00 -1.75767e+00 -1.29310e+00 5.59549e-01 8.08468e-01 -1.01592e-02 -7.54052e+00 + 1.01933e+01 -2.09484e+01 -1.07426e+00 9.87912e-01 6.05210e-01 -6.04535e-02 -5.87826e-01 -7.94117e-01 -4.89190e-01 -8.12710e-02 -2.07067e+01 +-5.31793e+00 7.94240e+00 -4.64165e+00 -4.37436e+00 -1.55417e+00 7.54368e-01 1.09608e+00 1.45967e+00 1.62946e+00 -1.01301e+00 1.13514e-01 + 2.20336e-01 1.70056e+00 -5.20105e-01 -4.28330e-01 1.57258e-03 -3.36502e-01 -8.18568e-02 -7.16163e+00 8.23195e+00 -1.71561e-02 -1.13749e+01 + 3.75075e+00 7.25399e+00 -1.75325e+00 -2.68814e+00 -3.71128e+00 -4.62933e+00 -2.13747e+00 -1.89186e-01 1.29122e+00 -7.49380e-01 6.71712e-01 +-8.41923e-01 4.64997e+00 5.65808e-01 -3.08277e-01 -1.01687e+00 1.73127e-01 -8.92130e-01 1.89044e+00 -2.75543e-01 -7.72828e-01 5.36745e-01 +-3.65598e+00 7.56997e+00 -3.76373e+00 -1.74542e+00 -1.37540e-01 -5.55400e-01 -1.59195e-01 1.27910e-01 1.91906e+00 1.42119e+00 -4.35502e+00 + +-1.70059e+00 -3.65695e+00 1.22367e+00 -5.74367e-01 -3.29571e+00 2.46316e+00 5.22353e+00 2.42038e+00 1.22919e+00 -9.22250e-01 -2.32028e+00 + + + 0.00000e+00 + 1.00000e+00 diff --git a/csst/msc/astrometry/raw/csst_realtime.param b/csst/msc/astrometry/raw/csst_realtime.param new file mode 100755 index 0000000000000000000000000000000000000000..0e86f48e7b13d389797fb315970b4d656683b9fc --- /dev/null +++ b/csst/msc/astrometry/raw/csst_realtime.param @@ -0,0 +1,53 @@ +NUMBER #Running object number +#MAG_APER(1) #Fixed aperture magnitude vector [mag] +#MAGERR_APER(1) #RMS error vector for fixed aperture mag. [mag] +MAG_APER #Fixed aperture magnitude vector [mag] +MAGERR_APER #RMS error vector for fixed aperture mag. [mag] +MAG_AUTO #Kron-like elliptical aperture magnitude [mag] +MAGERR_AUTO #RMS error for AUTO magnitude [mag] +MAG_PETRO #Petrosian-like elliptical aperture magnitude [mag] +MAGERR_PETRO #RMS error for PETROsian magnitude [mag] +FLUX_AUTO #Flux of AUTO +FLUXERR_AUTO #RMS error for AUTO flux +SNR_WIN #Gaussian-weighted SNR +KRON_RADIUS #Kron apertures in units of A or B +PETRO_RADIUS #Petrosian apertures in units of A or B +X_IMAGE #Object position along x [pixel] +Y_IMAGE #Object position along y [pixel] +ALPHA_J2000 #Right ascension of barycenter (J2000) [deg] +DELTA_J2000 #Declination of barycenter (J2000) [deg] +X2_IMAGE #Variance along x [pixel**2] +Y2_IMAGE #Variance along y [pixel**2] +A_IMAGE #Profile RMS along major axis [pixel] +B_IMAGE #Profile RMS along minor axis [pixel] +THETA_IMAGE #Position angle (CCW/x) [deg] +ERRX2_IMAGE #Variance of position along x [pixel**2] +ERRY2_IMAGE #Variance of position along y [pixel**2] +ERRA_IMAGE #RMS position error along major axis [pixel] +ERRB_IMAGE #RMS position error along minor axis [pixel] +ERRTHETA_IMAGE #Error ellipse position angle (CCW/x) [deg] +XWIN_IMAGE #Windowed position estimate along x [pixel] +YWIN_IMAGE #Windowed position estimate along y [pixel] +ALPHAWIN_J2000 #Windowed right ascension (J2000) [deg] +DELTAWIN_J2000 #windowed declination (J2000) [deg] +X2WIN_IMAGE #Windowed variance along x [pixel**2] +Y2WIN_IMAGE #Windowed variance along y [pixel**2] +AWIN_IMAGE #Windowed profile RMS along major axis [pixel] +BWIN_IMAGE #Windowed profile RMS along minor axis [pixel] +THETAWIN_IMAGE #Windowed position angle (CCW/x) [deg] +ERRX2WIN_IMAGE #Variance of windowed pos along x [pixel**2] +ERRY2WIN_IMAGE #Variance of windowed pos along y [pixel**2] +ERRAWIN_IMAGE #RMS windowed pos error along major axis [pixel] +ERRBWIN_IMAGE #RMS windowed pos error along minor axis [pixel] +ERRAWIN_WORLD +ERRBWIN_WORLD +ERRTHETAWIN_IMAGE #Windowed error ellipse pos angle (CCW/x) [deg] +ERRTHETAWIN_J2000 +FLAGS #Extraction flags +#IMAFLAGS_ISO #FLAG-image flags OR'ed over the iso. profile +#NIMAFLAGS_ISO +FWHM_IMAGE #FWHM assuming a gaussian core [pixel] +#ELONGATION #A_IMAGE/B_IMAGE +ELLIPTICITY #1 - B_IMAGE/A_IMAGE +CLASS_STAR #S/G classifier output + diff --git a/csst/msc/astrometry/raw/csst_realtime.sex b/csst/msc/astrometry/raw/csst_realtime.sex new file mode 100755 index 0000000000000000000000000000000000000000..969a6fb867e1a4d7163973f7bb0256ce6591ec9b --- /dev/null +++ b/csst/msc/astrometry/raw/csst_realtime.sex @@ -0,0 +1,105 @@ +# Default configuration file for SExtractor 2.12.4 +# EB 2010-10-10 +# + +#-------------------------------- Catalog ------------------------------------ + +CATALOG_NAME test.fits # name of the output catalog +CATALOG_TYPE FITS_LDAC # NONE,ASCII,ASCII_HEAD, ASCII_SKYCAT, + # ASCII_VOTABLE, FITS_1.0 or FITS_LDAC +PARAMETERS_NAME /line17/wfst/prog/config/wfst_realtime.param # name of the file containing catalog contents + +#------------------------------- Extraction ---------------------------------- + +DETECT_TYPE CCD # CCD (linear) or PHOTO (with gamma correction) +DETECT_MINAREA 3 # min. # of pixels above threshold +DETECT_MAXAREA 0 # max. # of pixels above threshold (0=unlimited) +THRESH_TYPE RELATIVE # threshold type: RELATIVE (in sigmas) + # or ABSOLUTE (in ADUs) +DETECT_THRESH 3 # or , in mag.arcsec-2 +ANALYSIS_THRESH 3 # or , in mag.arcsec-2 + +FILTER Y # apply filter for detection (Y or N)? +FILTER_NAME /line17/wfst/prog/config/wfst_realtime.conv # name of the file containing the filter + +DEBLEND_NTHRESH 64 # Number of deblending sub-thresholds +DEBLEND_MINCONT 0.0005 # Minimum contrast parameter for deblending + +CLEAN Y # Clean spurious detections? (Y or N)? +CLEAN_PARAM 0.5 # Cleaning efficiency + +MASK_TYPE CORRECT # type of detection MASKing: can be one of + # NONE, BLANK or CORRECT + +#-------------------------------- WEIGHTing ---------------------------------- + +WEIGHT_TYPE MAP_WEIGHT # type of WEIGHTing: NONE, BACKGROUND, + # MAP_RMS, MAP_VAR or MAP_WEIGHT +WEIGHT_IMAGE weight.fits # weight-map filename + +#------------------------------ Photometry ----------------------------------- + +# similiar to BASS, use D=36 pixel to do flux calibration, d~=12arsec +PHOT_APERTURES 10 +#PHOT_APERTURES 32 # MAG_APER aperture diameter(s) in pixels +PHOT_AUTOPARAMS 2.5, 3.5 # MAG_AUTO parameters: , +PHOT_PETROPARAMS 2.0, 3.5 # MAG_PETRO parameters: , + # +PHOT_AUTOAPERS 0.0,0.0 # , minimum apertures + # for MAG_AUTO and MAG_PETRO + +SATUR_LEVEL 65535.0 # level (in ADUs) at which arises saturation +SATUR_KEY safSATURATE # keyword for saturation level (in ADUs) + +MAG_ZEROPOINT 0.0 # magnitude zero-point +MAG_GAMMA 7.0 # gamma of emulsion (for photographic scans) +GAIN 1.0 # detector gain in e-/ADU +GAIN_KEY asdfGAIN # keyword for detector gain in e-/ADU +PIXEL_SCALE 0 # size of pixel in arcsec (0=use FITS WCS info) + +#------------------------- Star/Galaxy Separation ---------------------------- + +SEEING_FWHM 1.2 # stellar FWHM in arcsec +STARNNW_NAME /line17/wfst/prog/config/wfst_realtime.nnw # Neural-Network_Weight table filename + +#------------------------------ Background ----------------------------------- + +BACK_TYPE AUTO # AUTO or MANUAL +BACK_VALUE 0.0 # Default background value in MANUAL mode +BACK_SIZE 256 # Background mesh: or , +BACK_FILTERSIZE 3 # Background filter: or , + +BACKPHOTO_TYPE LOCAL # can be GLOBAL or LOCAL +BACKPHOTO_THICK 24 # thickness (pix) of background rectangular aperture for LOCAL + +#------------------------------ Check Image ---------------------------------- + +CHECKIMAGE_TYPE NONE # can be NONE, BACKGROUND, BACKGROUND_RMS, + # MINIBACKGROUND, MINIBACK_RMS, -BACKGROUND, + # FILTERED, OBJECTS, -OBJECTS, SEGMENTATION, + # or APERTURES +CHECKIMAGE_NAME check.fits # Filename for the check-image + +#--------------------- Memory (change with caution!) ------------------------- + +MEMORY_OBJSTACK 3000 # number of objects in stack +MEMORY_PIXSTACK 300000 # number of pixels in stack +MEMORY_BUFSIZE 1024 # number of lines in buffer + +#------------------------------- ASSOCiation --------------------------------- + +ASSOC_NAME sky.list # name of the ASCII file to ASSOCiate +ASSOC_DATA 2,3,4 # columns of the data to replicate (0=all) +ASSOC_PARAMS 2,3,4 # columns of xpos,ypos[,mag] +ASSOC_RADIUS 2.0 # cross-matching radius (pixels) +ASSOC_TYPE NEAREST # ASSOCiation method: FIRST, NEAREST, MEAN, + # MAG_MEAN, SUM, MAG_SUM, MIN or MAX +ASSOCSELEC_TYPE MATCHED # ASSOC selection type: ALL, MATCHED or -MATCHED + +#----------------------------- Miscellaneous --------------------------------- + +VERBOSE_TYPE NORMAL # can be QUIET, NORMAL or FULL +HEADER_SUFFIX .head # Filename extension for additional headers +WRITE_XML N # Write XML file (Y/N)? +XML_NAME sex.xml # Filename for XML output + diff --git a/csst/msc/astrometry/raw/default.missfits b/csst/msc/astrometry/raw/default.missfits new file mode 100644 index 0000000000000000000000000000000000000000..089605f339379f317730266eeaf3b67c7b43b689 --- /dev/null +++ b/csst/msc/astrometry/raw/default.missfits @@ -0,0 +1,50 @@ +# Default configuration file for MissFITS 2.8.0 +# EB CM 2015-08-27 +# +#------------------------------- FITS keywords -------------------------------- +REMOVE_KEYWORD # Remove a FITS keyword from the headers +REPLACE_KEYWORD # Replace a FITS keyword with another + # Syntax: OLD_KEY1:NEW_KEY1, + # OLD_KEY2:NEW_KEY2,... +SLICE_KEYWORD # Replace the keyword + # SLICE_KEYWORD+SLICEKEY_FORMAT + # with SLICE_KEYWORD for every slice + # or viceversa building cubes +SLICEKEY_FORMAT %03d # format of slice referring keywords +DISPLAY_KEYWORD OBJECT # Display the following keywords while + # processing the files + +HEADER_SUFFIX .head # Filename extension for add. headers + +#------------------------------ FITS properties ------------------------------- + +NEXTENSIONS_MIN 0 # Minimum number of extensions (warns + # if less are found) +OUTFILE_TYPE SAME # Basic or Multi-FITS output: + # "SAME", "MULTI", "SPLIT", + # "SLICE", "CUBE" or "DIR" +SPLIT_SUFFIX .%03d.fits # Suffix expected for split FITS files +SLICE_SUFFIX .%03d.fits # Suffix expected for sliced FITS files + +#-------------------------------- FITS data ---------------------------------- + +PROCESS_TYPE NONE # Operations on FITS data: + # "NONE", "TOBITPIX16", "COMPRESS" or "UNCOMPRESS" + +CHECKSUM_TYPE NONE # Checksum operations: + # "NONE", "COMPUTE", "VERIFY" or + # "UPDATE" +#------------------------------- Output filename ----------------------------- + +SAVE_TYPE BACKUP # Behaviour towards output filename: + # "NONE", "BACKUP", "NEW" or "REPLACE" + +NEW_SUFFIX .miss # suffix to add in SAVE_TYPE NEW mode + +#------------------------------ Miscellaneous --------------------------------- + +VERBOSE_TYPE NORMAL # "QUIET","NORMAL" or "FULL" +WRITE_XML N # Write XML file (Y/N)? +XML_NAME missfits.xml # Filename for XML output +NTHREADS 1 # 1 single thread + diff --git a/csst/msc/astrometry/raw/default.param b/csst/msc/astrometry/raw/default.param new file mode 100644 index 0000000000000000000000000000000000000000..058e4d8042fc3ddc2fb184c3eedf492a9678a990 --- /dev/null +++ b/csst/msc/astrometry/raw/default.param @@ -0,0 +1,421 @@ +#NUMBER Running object number +#EXT_NUMBER FITS extension number +#FLUX_ISO Isophotal flux [count] +#FLUXERR_ISO RMS error for isophotal flux [count] +#MAG_ISO Isophotal magnitude [mag] +#MAGERR_ISO RMS error for isophotal magnitude [mag] +#FLUX_ISOCOR Corrected isophotal flux [count] +#FLUXERR_ISOCOR RMS error for corrected isophotal flux [count] +#MAG_ISOCOR Corrected isophotal magnitude [mag] +#MAGERR_ISOCOR RMS error for corrected isophotal magnitude [mag] +#FLUX_APER Flux vector within fixed circular aperture(s) [count] +#FLUXERR_APER RMS error vector for aperture flux(es) [count] +#MAG_APER Fixed aperture magnitude vector [mag] +#MAGERR_APER RMS error vector for fixed aperture mag. [mag] +#FLUX_AUTO Flux within a Kron-like elliptical aperture [count] +#FLUXERR_AUTO RMS error for AUTO flux [count] +#MAG_AUTO Kron-like elliptical aperture magnitude [mag] +#MAGERR_AUTO RMS error for AUTO magnitude [mag] +#FLUX_PETRO Flux within a Petrosian-like elliptical aperture [count] +#FLUXERR_PETRO RMS error for PETROsian flux [count] +#MAG_PETRO Petrosian-like elliptical aperture magnitude [mag] +#MAGERR_PETRO RMS error for PETROsian magnitude [mag] +#FLUX_BEST Best of FLUX_AUTO and FLUX_ISOCOR [count] +#FLUXERR_BEST RMS error for BEST flux [count] +#MAG_BEST Best of MAG_AUTO and MAG_ISOCOR [mag] +#MAGERR_BEST RMS error for MAG_BEST [mag] +#FLUX_WIN Gaussian-weighted flux [count] +#FLUXERR_WIN RMS error for WIN flux [count] +#MAG_WIN Gaussian-weighted magnitude [mag] +#MAGERR_WIN RMS error for MAG_WIN [mag] +#SNR_WIN Gaussian-weighted SNR +#FLUX_SOMFIT Flux derived from SOM fit [count] +#FLUXERR_SOMFIT RMS error for SOMFIT flux [count] +#MAG_SOMFIT Magnitude derived from SOM fit [mag] +#MAGERR_SOMFIT Magnitude error derived from SOM fit [mag] +#ERROR_SOMFIT Reduced Chi-square error of the SOM fit +#VECTOR_SOMFIT Position vector of the winning SOM node +#KRON_RADIUS Kron apertures in units of A or B +#PETRO_RADIUS Petrosian apertures in units of A or B +#BACKGROUND Background at centroid position [count] +#THRESHOLD Detection threshold above background [count] +#FLUX_MAX Peak flux above background [count] +#ISOAREA_IMAGE Isophotal area above Analysis threshold [pixel**2] +#ISOAREAF_IMAGE Isophotal area (filtered) above Detection threshold [pixel**2] +#XMIN_IMAGE Minimum x-coordinate among detected pixels [pixel] +#YMIN_IMAGE Minimum y-coordinate among detected pixels [pixel] +#XMAX_IMAGE Maximum x-coordinate among detected pixels [pixel] +#YMAX_IMAGE Maximum y-coordinate among detected pixels [pixel] +#XPEAK_IMAGE x-coordinate of the brightest pixel [pixel] +#YPEAK_IMAGE y-coordinate of the brightest pixel [pixel] +#XPEAK_FOCAL Focal-plane x coordinate of the brightest pixel +#YPEAK_FOCAL Focal-plane y coordinate of the brightest pixel +#XPEAK_WORLD World-x coordinate of the brightest pixel [deg] +#YPEAK_WORLD World-y coordinate of the brightest pixel [deg] +#ALPHAPEAK_SKY Right ascension of brightest pix (native) [deg] +#DELTAPEAK_SKY Declination of brightest pix (native) [deg] +#ALPHAPEAK_J2000 Right ascension of brightest pix (J2000) [deg] +#DELTAPEAK_J2000 Declination of brightest pix (J2000) [deg] +#ALPHAPEAK_B1950 Right ascension of brightest pix (B1950) [deg] +#DELTAPEAK_B1950 Declination of brightest pix (B1950) [deg] +#X_IMAGE Object position along x [pixel] +#Y_IMAGE Object position along y [pixel] +#X_IMAGE_DBL Object position along x (double precision) [pixel] +#Y_IMAGE_DBL Object position along y (double precision) [pixel] +#X_FOCAL Barycenter position along focal-plane x axis +#Y_FOCAL Barycenter position along focal-plane y axis +#X_WORLD Barycenter position along world x axis [deg] +#Y_WORLD Barycenter position along world y axis [deg] +#X_MAMA Barycenter position along MAMA x axis [m**(-6)] +#Y_MAMA Barycenter position along MAMA y axis [m**(-6)] +#ALPHA_SKY Right ascension of barycenter (native) [deg] +#DELTA_SKY Declination of barycenter (native) [deg] +#ALPHA_J2000 Right ascension of barycenter (J2000) [deg] +#DELTA_J2000 Declination of barycenter (J2000) [deg] +#ALPHA_B1950 Right ascension of barycenter (B1950) [deg] +#DELTA_B1950 Declination of barycenter (B1950) [deg] +#X2_IMAGE Variance along x [pixel**2] +#Y2_IMAGE Variance along y [pixel**2] +#XY_IMAGE Covariance between x and y [pixel**2] +#X2_WORLD Variance along X-WORLD (alpha) [deg**2] +#Y2_WORLD Variance along Y-WORLD (delta) [deg**2] +#XY_WORLD Covariance between X-WORLD and Y-WORLD [deg**2] +#CXX_IMAGE Cxx object ellipse parameter [pixel**(-2)] +#CYY_IMAGE Cyy object ellipse parameter [pixel**(-2)] +#CXY_IMAGE Cxy object ellipse parameter [pixel**(-2)] +#CXX_WORLD Cxx object ellipse parameter (WORLD units) [deg**(-2)] +#CYY_WORLD Cyy object ellipse parameter (WORLD units) [deg**(-2)] +#CXY_WORLD Cxy object ellipse parameter (WORLD units) [deg**(-2)] +#A_IMAGE Profile RMS along major axis [pixel] +#B_IMAGE Profile RMS along minor axis [pixel] +#THETA_IMAGE Position angle (CCW/x) [deg] +#A_WORLD Profile RMS along major axis (world units) [deg] +#B_WORLD Profile RMS along minor axis (world units) [deg] +#THETA_WORLD Position angle (CCW/world-x) [deg] +#THETA_SKY Position angle (east of north) (native) [deg] +#THETA_J2000 Position angle (east of north) (J2000) [deg] +#THETA_B1950 Position angle (east of north) (B1950) [deg] +#ERRX2_IMAGE Variance of position along x [pixel**2] +#ERRY2_IMAGE Variance of position along y [pixel**2] +#ERRXY_IMAGE Covariance of position between x and y [pixel**2] +#ERRX2_WORLD Variance of position along X-WORLD (alpha) [deg**2] +#ERRY2_WORLD Variance of position along Y-WORLD (delta) [deg**2] +#ERRXY_WORLD Covariance of position X-WORLD/Y-WORLD [deg**2] +#ERRCXX_IMAGE Cxx error ellipse parameter [pixel**(-2)] +#ERRCYY_IMAGE Cyy error ellipse parameter [pixel**(-2)] +#ERRCXY_IMAGE Cxy error ellipse parameter [pixel**(-2)] +#ERRCXX_WORLD Cxx error ellipse parameter (WORLD units) [deg**(-2)] +#ERRCYY_WORLD Cyy error ellipse parameter (WORLD units) [deg**(-2)] +#ERRCXY_WORLD Cxy error ellipse parameter (WORLD units) [deg**(-2)] +#ERRA_IMAGE RMS position error along major axis [pixel] +#ERRB_IMAGE RMS position error along minor axis [pixel] +#ERRTHETA_IMAGE Error ellipse position angle (CCW/x) [deg] +#ERRA_WORLD World RMS position error along major axis [deg] +#ERRB_WORLD World RMS position error along minor axis [deg] +#ERRTHETA_WORLD Error ellipse pos. angle (CCW/world-x) [deg] +#ERRTHETA_SKY Native error ellipse pos. angle (east of north) [deg] +#ERRTHETA_J2000 J2000 error ellipse pos. angle (east of north) [deg] +#ERRTHETA_B1950 B1950 error ellipse pos. angle (east of north) [deg] +#XWIN_IMAGE Windowed position estimate along x [pixel] +#YWIN_IMAGE Windowed position estimate along y [pixel] +#XWIN_FOCAL Windowed position along focal-plane x axis +#YWIN_FOCAL Windowed position along focal-plane y axis +#XWIN_WORLD Windowed position along world x axis [deg] +#YWIN_WORLD Windowed position along world y axis [deg] +#ALPHAWIN_SKY Windowed right ascension (native) [deg] +#DELTAWIN_SKY Windowed declination (native) [deg] +#ALPHAWIN_J2000 Windowed right ascension (J2000) [deg] +#DELTAWIN_J2000 windowed declination (J2000) [deg] +#ALPHAWIN_B1950 Windowed right ascension (B1950) [deg] +#DELTAWIN_B1950 Windowed declination (B1950) [deg] +#X2WIN_IMAGE Windowed variance along x [pixel**2] +#Y2WIN_IMAGE Windowed variance along y [pixel**2] +#XYWIN_IMAGE Windowed covariance between x and y [pixel**2] +#X2WIN_WORLD Windowed variance along X-WORLD (alpha) [deg**2] +#Y2WIN_WORLD Windowed variance along Y-WORLD (delta) [deg**2] +#XYWIN_WORLD Windowed covariance between X-WORLD and Y-WORLD [deg**2] +#CXXWIN_IMAGE Windowed Cxx object ellipse parameter [pixel**(-2)] +#CYYWIN_IMAGE Windowed Cyy object ellipse parameter [pixel**(-2)] +#CXYWIN_IMAGE Windowed Cxy object ellipse parameter [pixel**(-2)] +#CXXWIN_WORLD Windowed Cxx object ellipse parameter (WORLD units) [deg**(-2)] +#CYYWIN_WORLD Windowed Cyy object ellipse parameter (WORLD units) [deg**(-2)] +#CXYWIN_WORLD Windowed Cxy object ellipse parameter (WORLD units) [deg**(-2)] +#AWIN_IMAGE Windowed profile RMS along major axis [pixel] +#BWIN_IMAGE Windowed profile RMS along minor axis [pixel] +#THETAWIN_IMAGE Windowed position angle (CCW/x) [deg] +#AWIN_WORLD Windowed profile RMS along major axis (world units) [deg] +#BWIN_WORLD Windowed profile RMS along minor axis (world units) [deg] +#THETAWIN_WORLD Windowed position angle (CCW/world-x) [deg] +#THETAWIN_SKY Windowed position angle (east of north) (native) [deg] +#THETAWIN_J2000 Windowed position angle (east of north) (J2000) [deg] +#THETAWIN_B1950 Windowed position angle (east of north) (B1950) [deg] +#ERRX2WIN_IMAGE Variance of windowed pos along x [pixel**2] +#ERRY2WIN_IMAGE Variance of windowed pos along y [pixel**2] +#ERRXYWIN_IMAGE Covariance of windowed pos between x and y [pixel**2] +#ERRX2WIN_WORLD Variance of windowed pos along X-WORLD (alpha) [deg**2] +#ERRY2WIN_WORLD Variance of windowed pos along Y-WORLD (delta) [deg**2] +#ERRXYWIN_WORLD Covariance of windowed pos X-WORLD/Y-WORLD [deg**2] +#ERRCXXWIN_IMAGE Cxx windowed error ellipse parameter [pixel**(-2)] +#ERRCYYWIN_IMAGE Cyy windowed error ellipse parameter [pixel**(-2)] +#ERRCXYWIN_IMAGE Cxy windowed error ellipse parameter [pixel**(-2)] +#ERRCXXWIN_WORLD Cxx windowed error ellipse parameter (WORLD units) [deg**(-2)] +#ERRCYYWIN_WORLD Cyy windowed error ellipse parameter (WORLD units) [deg**(-2)] +#ERRCXYWIN_WORLD Cxy windowed error ellipse parameter (WORLD units) [deg**(-2)] +#ERRAWIN_IMAGE RMS windowed pos error along major axis [pixel] +#ERRBWIN_IMAGE RMS windowed pos error along minor axis [pixel] +#ERRTHETAWIN_IMAGE Windowed error ellipse pos angle (CCW/x) [deg] +#ERRAWIN_WORLD World RMS windowed pos error along major axis [deg] +#ERRBWIN_WORLD World RMS windowed pos error along minor axis [deg] +#ERRTHETAWIN_WORLD Windowed error ellipse pos. angle (CCW/world-x) [deg] +#ERRTHETAWIN_SKY Native windowed error ellipse pos. angle (east of north) [deg] +#ERRTHETAWIN_J2000 J2000 windowed error ellipse pos. angle (east of north) [deg] +#ERRTHETAWIN_B1950 B1950 windowed error ellipse pos. angle (east of north) [deg] +#NITER_WIN Number of iterations for WIN centering +#MU_THRESHOLD Analysis threshold above background [mag * arcsec**(-2)] +#MU_MAX Peak surface brightness above background [mag * arcsec**(-2)] +#ISOAREA_WORLD Isophotal area above Analysis threshold [deg**2] +#ISOAREAF_WORLD Isophotal area (filtered) above Detection threshold [deg**2] +#ISO0 Isophotal area at level 0 [pixel**2] +#ISO1 Isophotal area at level 1 [pixel**2] +#ISO2 Isophotal area at level 2 [pixel**2] +#ISO3 Isophotal area at level 3 [pixel**2] +#ISO4 Isophotal area at level 4 [pixel**2] +#ISO5 Isophotal area at level 5 [pixel**2] +#ISO6 Isophotal area at level 6 [pixel**2] +#ISO7 Isophotal area at level 7 [pixel**2] +#FLAGS Extraction flags +#FLAGS_WEIGHT Weighted extraction flags +#FLAGS_WIN Flags for WINdowed parameters +#IMAFLAGS_ISO FLAG-image flags OR'ed over the iso. profile +#NIMAFLAGS_ISO Number of flagged pixels entering IMAFLAGS_ISO +#NLOWWEIGHT_ISO Nb of pixels with low weight over the iso. profile +#NLOWDWEIGHT_ISO Nb of pixels with low det. weight over the iso. profile +#FWHM_IMAGE FWHM assuming a gaussian core [pixel] +#FWHM_WORLD FWHM assuming a gaussian core [deg] +#ELONGATION A_IMAGE/B_IMAGE +#ELLIPTICITY 1 - B_IMAGE/A_IMAGE +#POLAR_IMAGE (A_IMAGE^2 - B_IMAGE^2)/(A_IMAGE^2 + B_IMAGE^2) +#POLAR_WORLD (A_WORLD^2 - B_WORLD^2)/(A_WORLD^2 + B_WORLD^2) +#POLARWIN_IMAGE (AWIN^2 - BWIN^2)/(AWIN^2 + BWIN^2) +#POLARWIN_WORLD (AWIN^2 - BWIN^2)/(AWIN^2 + BWIN^2) +#CLASS_STAR S/G classifier output +#VIGNET Pixel data around detection [count] +#VIGNET_SHIFT Pixel data around detection, corrected for shift [count] +#VECTOR_ASSOC ASSOCiated parameter vector +#NUMBER_ASSOC Number of ASSOCiated IDs +#THRESHOLDMAX Maximum threshold possible for detection [count] +#FLUX_GROWTH Cumulated growth-curve [count] +#FLUX_GROWTHSTEP Step for growth-curves [pixel] +#MAG_GROWTH Cumulated magnitude growth-curve [mag] +#MAG_GROWTHSTEP Step for growth-curves [pixel] +#FLUX_RADIUS Fraction-of-light radii [pixel] +#FWHMPSF_IMAGE FWHM of the local PSF model [pixel] +#FWHMPSF_WORLD FWHM of the local PSF model (world units) [deg] +#XPSF_IMAGE X coordinate from PSF-fitting [pixel] +#YPSF_IMAGE Y coordinate from PSF-fitting [pixel] +#XPSF_WORLD PSF position along world x axis [deg] +#YPSF_WORLD PSF position along world y axis [deg] +#ALPHAPSF_SKY Right ascension of the fitted PSF (native) [deg] +#DELTAPSF_SKY Declination of the fitted PSF (native) [deg] +#ALPHAPSF_J2000 Right ascension of the fitted PSF (J2000) [deg] +#DELTAPSF_J2000 Declination of the fitted PSF (J2000) [deg] +#ALPHAPSF_B1950 Right ascension of the fitted PSF (B1950) [deg] +#DELTAPSF_B1950 Declination of the fitted PSF (B1950) [deg] +#FLUX_PSF Flux from PSF-fitting [count] +#FLUXERR_PSF RMS flux error for PSF-fitting [count] +#MAG_PSF Magnitude from PSF-fitting [mag] +#MAGERR_PSF RMS magnitude error from PSF-fitting [mag] +#NITER_PSF Number of iterations for PSF-fitting +#CHI2_PSF Reduced chi2 from PSF-fitting +#ERRX2PSF_IMAGE Variance of PSF position along x [pixel**2] +#ERRY2PSF_IMAGE Variance of PSF position along y [pixel**2] +#ERRXYPSF_IMAGE Covariance of PSF position between x and y [pixel**2] +#ERRX2PSF_WORLD Variance of PSF position along X-WORLD (alpha) [deg**2] +#ERRY2PSF_WORLD Variance of PSF position along Y-WORLD (delta) [deg**2] +#ERRXYPSF_WORLD Covariance of PSF position X-WORLD/Y-WORLD [deg**2] +#ERRCXXPSF_IMAGE Cxx PSF error ellipse parameter [pixel**(-2)] +#ERRCYYPSF_IMAGE Cyy PSF error ellipse parameter [pixel**(-2)] +#ERRCXYPSF_IMAGE Cxy PSF error ellipse parameter [pixel**(-2)] +#ERRCXXPSF_WORLD Cxx PSF error ellipse parameter (WORLD units) [deg**(-2)] +#ERRCYYPSF_WORLD Cyy PSF error ellipse parameter (WORLD units) [deg**(-2)] +#ERRCXYPSF_WORLD Cxy PSF error ellipse parameter (WORLD units) [deg**(-2)] +#ERRAPSF_IMAGE PSF RMS position error along major axis [pixel] +#ERRBPSF_IMAGE PSF RMS position error along minor axis [pixel] +#ERRTHETAPSF_IMAGE PSF error ellipse position angle (CCW/x) [deg] +#ERRAPSF_WORLD World PSF RMS position error along major axis [pixel] +#ERRBPSF_WORLD World PSF RMS position error along minor axis [pixel] +#ERRTHETAPSF_WORLD PSF error ellipse pos. angle (CCW/world-x) [deg] +#ERRTHETAPSF_SKY Native PSF error ellipse pos. angle (east of north) [deg] +#ERRTHETAPSF_J2000 J2000 PSF error ellipse pos. angle (east of north) [deg] +#ERRTHETAPSF_B1950 B1950 PSF error ellipse pos. angle (east of north) [deg] +#DURATION_ANALYSIS Duration of analysis for this source [s] +#VECTOR_MODEL Model-fitting coefficients +#VECTOR_MODELERR Model-fitting coefficient uncertainties +#MATRIX_MODELERR Model-fitting covariance matrix +#CHI2_MODEL Reduced Chi2 of the fit +#FLAGS_MODEL Model-fitting flags +#NITER_MODEL Number of iterations for model-fitting +#FLUX_MODEL Flux from model-fitting [count] +#FLUXERR_MODEL RMS error on model-fitting flux [count] +#MAG_MODEL Magnitude from model-fitting [mag] +#MAGERR_MODEL RMS error on model-fitting magnitude [mag] +#FLUX_HYBRID Hybrid flux from model-fitting [count] +#FLUXERR_HYBRID RMS error on hybrid flux [count] +#MAG_HYBRID Hybrid magnitude from model-fitting [mag] +#MAGERR_HYBRID RMS error on hybrid magnitude [mag] +#FLUX_MAX_MODEL Peak model flux above background [count] +#FLUX_EFF_MODEL Effective model flux above background [count] +#FLUX_MEAN_MODEL Mean effective model flux above background [count] +#MU_MAX_MODEL Peak model surface brightness above background [mag * arcsec**(-2)] +#MU_EFF_MODEL Effective model surface brightness above background [mag * arcsec**(-2)] +#MU_MEAN_MODEL Mean effective model surface brightness above background [mag * arcsec**(-2)] +#XMODEL_IMAGE X coordinate from model-fitting [pixel] +#YMODEL_IMAGE Y coordinate from model-fitting [pixel] +#XFOCAL_WORLD Fitted position along focal-plane x axis +#YFOCAL_WORLD Fitted position along focal-plane y axis +#XMODEL_WORLD Fitted position along world x axis [deg] +#YMODEL_WORLD Fitted position along world y axis [deg] +#ALPHAMODEL_SKY Fitted position along right ascension (native) [deg] +#DELTAMODEL_SKY Fitted position along declination (native) [deg] +#ALPHAMODEL_J2000 Fitted position along right ascension (J2000) [deg] +#DELTAMODEL_J2000 Fitted position along declination (J2000) [deg] +#ALPHAMODEL_B1950 Fitted position along right ascension (B1950) [deg] +#DELTAMODEL_B1950 Fitted position along declination (B1950) [deg] +#ERRX2MODEL_IMAGE Variance of fitted position along x [pixel**2] +#ERRY2MODEL_IMAGE Variance of fitted position along y [pixel**2] +#ERRXYMODEL_IMAGE Covariance of fitted position between x and y [pixel**2] +#ERRX2MODEL_WORLD Variance of fitted position along X-WORLD (alpha) [deg**2] +#ERRY2MODEL_WORLD Variance of fitted position along Y-WORLD (delta) [deg**2] +#ERRXYMODEL_WORLD Covariance of fitted position X-WORLD/Y-WORLD [deg**2] +#ERRCXXMODEL_IMAGE Cxx error ellipse parameter of fitted position [pixel**(-2)] +#ERRCYYMODEL_IMAGE Cyy error ellipse parameter of fitted position [pixel**(-2)] +#ERRCXYMODEL_IMAGE Cxy error ellipse parameter of fitted position [pixel**(-2)] +#ERRCXXMODEL_WORLD Cxx fitted error ellipse parameter (WORLD units) [deg**(-2)] +#ERRCYYMODEL_WORLD Cyy fitted error ellipse parameter (WORLD units) [deg**(-2)] +#ERRCXYMODEL_WORLD Cxy fitted error ellipse parameter (WORLD units) [deg**(-2)] +#ERRAMODEL_IMAGE RMS error of fitted position along major axis [pixel] +#ERRBMODEL_IMAGE RMS error of fitted position along minor axis [pixel] +#ERRTHETAMODEL_IMAGE Error ellipse pos.angle of fitted position (CCW/x) [deg] +#ERRAMODEL_WORLD World RMS error of fitted position along major axis [deg] +#ERRBMODEL_WORLD World RMS error of fitted position along minor axis [deg] +#ERRTHETAMODEL_WORLD Error ellipse pos.angle of fitted position (CCW/world-x) [deg] +#ERRTHETAMODEL_SKY Native fitted error ellipse pos. angle (east of north) [deg] +#ERRTHETAMODEL_J2000 J2000 fitted error ellipse pos. angle (east of north) [deg] +#ERRTHETAMODEL_B1950 B1950 fitted error ellipse pos. angle (east of north) [deg] +#X2MODEL_IMAGE Variance along x from model-fitting [pixel**2] +#Y2MODEL_IMAGE Variance along y from model-fitting [pixel**2] +#XYMODEL_IMAGE Covariance between x and y from model-fitting [pixel**2] +#ELLIP1MODEL_IMAGE Ellipticity component from model-fitting +#ELLIP2MODEL_IMAGE Ellipticity component from model-fitting +#POLAR1MODEL_IMAGE Ellipticity component (quadratic) from model-fitting +#POLAR2MODEL_IMAGE Ellipticity component (quadratic) from model-fitting +#ELLIP1ERRMODEL_IMAGE Ellipticity component std.error from model-fitting +#ELLIP2ERRMODEL_IMAGE Ellipticity component std.error from model-fitting +#ELLIPCORRMODEL_IMAGE Corr.coeff between ellip.components from model-fitting +#POLAR1ERRMODEL_IMAGE Polarisation component std.error from model-fitting +#POLAR2ERRMODEL_IMAGE Polarisation component std.error from model-fitting +#POLARCORRMODEL_IMAGE Corr.coeff between polar. components from fitting +#X2MODEL_WORLD Variance along X-WORLD (alpha) from model-fitting [deg**2] +#Y2MODEL_WORLD Variance along Y_WORLD (delta) from model-fitting [deg**2] +#XYMODEL_WORLD Covariance between X-WORLD and Y-WORLD from model-fitting [deg**2] +#ELLIP1MODEL_WORLD Ellipticity component from model-fitting +#ELLIP2MODEL_WORLD Ellipticity component from model-fitting +#POLAR1MODEL_WORLD Polarisation component from model-fitting +#POLAR2MODEL_WORLD Polarisation component from model-fitting +#ELLIP1ERRMODEL_WORLD Ellipticity component std.error from model-fitting +#ELLIP2ERRMODEL_WORLD Ellipticity component std.error from model-fitting +#ELLIPCORRMODEL_WORLD Corr.coeff between ellip.components from model-fitting +#POLAR1ERRMODEL_WORLD Polarisation component std.error from model-fitting +#POLAR2ERRMODEL_WORLD Polarisation component std.error from model-fitting +#POLARCORRMODEL_WORLD Corr.coeff between polar. components from fitting +#CXXMODEL_IMAGE Cxx ellipse parameter from model-fitting [pixel**(-2)] +#CYYMODEL_IMAGE Cyy ellipse parameter from model-fittinh [pixel**(-2)] +#CXYMODEL_IMAGE Cxy ellipse parameter from model-fitting [pixel**(-2)] +#CXXMODEL_WORLD Cxx ellipse parameter (WORLD) from model-fitting [deg**(-2)] +#CYYMODEL_WORLD Cyy ellipse parameter (WORLD) from model-fitting [deg**(-2)] +#CXYMODEL_WORLD Cxy ellipse parameter (WORLD) from model-fitting [deg**(-2)] +#AMODEL_IMAGE Model RMS along major axis [pixel] +#BMODEL_IMAGE Model RMS along minor axis [pixel] +#THETAMODEL_IMAGE Model position angle (CCW/x) [deg] +#AMODEL_WORLD Model RMS along major axis (WORLD units) [deg] +#BMODEL_WORLD Model RMS along minor axis (WORLD units) [deg] +#THETAMODEL_WORLD Model position angle (CCW/WORLD-x) [deg] +#THETAMODEL_SKY Model position angle (east of north) (native) [deg] +#THETAMODEL_J2000 Model position angle (east of north) (J2000) [deg] +#THETAMODEL_B1950 Model position angle (east of north) (B1950) [deg] +#SPREAD_MODEL Spread parameter from model-fitting +#SPREADERR_MODEL Spread parameter error from model-fitting +#NOISEAREA_MODEL Equivalent noise area of the fitted model [pixel**2] +#FLUX_BACKOFFSET Background offset from fitting [count] +#FLUXERR_BACKOFFSET RMS error on fitted background offset [count] +#FLUX_POINTSOURCE Point source flux from fitting [count] +#FLUXERR_POINTSOURCE RMS error on fitted point source total flux [count] +#FLUXRATIO_POINTSOURCE Point-source flux-to-total ratio from fitting +#FLUXRATIOERR_POINTSOURCE RMS error on point-source flux-to-total ratio +#MAG_POINTSOURCE Point source total magnitude from fitting [mag] +#MAGERR_POINTSOURCE RMS error on fitted point source total magnitude [mag] +#FLUX_SPHEROID Spheroid total flux from fitting [count] +#FLUXERR_SPHEROID RMS error on fitted spheroid total flux [count] +#MAG_SPHEROID Spheroid total magnitude from fitting [mag] +#MAGERR_SPHEROID RMS error on fitted spheroid total magnitude [mag] +#FLUX_MAX_SPHEROID Peak spheroid flux above background [count] +#FLUX_EFF_SPHEROID Effective spheroid flux above background [count] +#FLUX_MEAN_SPHEROID Mean effective spheroid flux above background [count] +#MU_MAX_SPHEROID Peak spheroid surface brightness above background [mag * arcsec**(-2)] +#MU_EFF_SPHEROID Effective spheroid surface brightness above background [mag * arcsec**(-2)] +#MU_MEAN_SPHEROID Mean effective spheroid surface brightness above backgrou [mag * arcsec**(-2)] +#FLUXRATIO_SPHEROID Spheroid flux-to-total ratio from fitting +#FLUXRATIOERR_SPHEROID RMS error on spheroid flux-to-total ratio +#SPHEROID_REFF_IMAGE Spheroid effective radius from fitting [pixel] +#SPHEROID_REFFERR_IMAGE RMS error on fitted spheroid effective radius [pixel] +#SPHEROID_REFF_WORLD Spheroid effective radius from fitting [deg] +#SPHEROID_REFFERR_WORLD RMS error on fitted spheroid effective radius [deg] +#SPHEROID_ASPECT_IMAGE Spheroid aspect ratio from fitting +#SPHEROID_ASPECTERR_IMAGE RMS error on fitted spheroid aspect ratio +#SPHEROID_ASPECT_WORLD Spheroid aspect ratio from fitting +#SPHEROID_ASPECTERR_WORLD RMS error on fitted spheroid aspect ratio +#SPHEROID_THETA_IMAGE Spheroid position angle (CCW/x) from fitting [deg] +#SPHEROID_THETAERR_IMAGE RMS error on spheroid position angle [deg] +#SPHEROID_THETA_WORLD Spheroid position angle (CCW/world-x) [deg] +#SPHEROID_THETAERR_WORLD RMS error on spheroid position angle [deg] +#SPHEROID_THETA_SKY Spheroid position angle (east of north, native) [deg] +#SPHEROID_THETA_J2000 Spheroid position angle (east of north, J2000) [deg] +#SPHEROID_THETA_B1950 Spheroid position angle (east of north, B1950) [deg] +#SPHEROID_SERSICN Spheroid Sersic index from fitting +#SPHEROID_SERSICNERR RMS error on fitted spheroid Sersic index +#FLUX_DISK Disk total flux from fitting [count] +#FLUXERR_DISK RMS error on fitted disk total flux [count] +#MAG_DISK Disk total magnitude from fitting [mag] +#MAGERR_DISK RMS error on fitted disk total magnitude [mag] +#FLUX_MAX_DISK Peak disk flux above background [count] +#FLUX_EFF_DISK Effective disk flux above background [count] +#FLUX_MEAN_DISK Mean effective disk flux above background [count] +#MU_MAX_DISK Peak disk surface brightness above background [mag * arcsec**(-2)] +#MU_EFF_DISK Effective disk surface brightness above background [mag * arcsec**(-2)] +#MU_MEAN_DISK Mean effective disk surface brightness above background [mag * arcsec**(-2)] +#FLUXRATIO_DISK Disk flux-to-total ratio from fitting +#FLUXRATIOERR_DISK RMS error on disk flux-to-total ratio +#DISK_SCALE_IMAGE Disk scalelength from fitting [pixel] +#DISK_SCALEERR_IMAGE RMS error on fitted disk scalelength [pixel] +#DISK_SCALE_WORLD Disk scalelength from fitting (world coords) [deg] +#DISK_SCALEERR_WORLD RMS error on fitted disk scalelength (world coords) [deg] +#DISK_ASPECT_IMAGE Disk aspect ratio from fitting +#DISK_ASPECTERR_IMAGE RMS error on fitted disk aspect ratio +#DISK_ASPECT_WORLD Disk aspect ratio from fitting +#DISK_ASPECTERR_WORLD RMS error on disk aspect ratio +#DISK_INCLINATION Disk inclination from fitting [deg] +#DISK_INCLINATIONERR RMS error on disk inclination from fitting [deg] +#DISK_THETA_IMAGE Disk position angle (CCW/x) from fitting [deg] +#DISK_THETAERR_IMAGE RMS error on fitted disk position angle [deg] +#DISK_THETA_WORLD Disk position angle (CCW/world-x) [deg] +#DISK_THETAERR_WORLD RMS error on disk position angle [deg] +#DISK_THETA_SKY Disk position angle (east of north, native) [deg] +#DISK_THETA_J2000 Disk position angle (east of north, J2000) [deg] +#DISK_THETA_B1950 Disk position angle (east of north, B1950) [deg] +#CHI2_DETMODEL Reduced Chi2 of the det. model fit to measurement image +#FLAGS_DETMODEL Detection model-fitting flags +#NITER_DETMODEL Number of iterations for detection model-fitting +#FLUX_DETMODEL Flux from detection model-fitting [count] +#FLUXERR_DETMODEL RMS error on detection model-fitting flux [count] +#MAG_DETMODEL Magnitude from detection model-fitting [mag] +#MAGERR_DETMODEL RMS error on detection model-fitting magnitude [mag] diff --git a/csst/msc/astrometry/raw/default.scamp b/csst/msc/astrometry/raw/default.scamp new file mode 100755 index 0000000000000000000000000000000000000000..54b22c925de373f38468cb0118e80ba4a66dec25 --- /dev/null +++ b/csst/msc/astrometry/raw/default.scamp @@ -0,0 +1,142 @@ +# Default configuration file for SCAMP 2.0.4 +# EB 2016-11-04 +# + +#----------------------------- Field grouping --------------------------------- + +FGROUP_RADIUS 2.0 # Max dist (deg) between field groups + +#---------------------------- Reference catalogs ------------------------------ + +REF_SERVER cocat1.u-strasbg.fr # Internet addresses of catalog servers +REF_PORT 80 # Ports to connect to catalog servers +CDSCLIENT_EXEC aclient_cgi # CDSclient executable +ASTREF_CATALOG FILE # NONE, FILE, USNO-A1,USNO-A2,USNO-B1, + # GSC-1.3,GSC-2.2,GSC-2.3, + # TYCHO-2, UCAC-1,UCAC-2,UCAC-3,UCAC-4, + # NOMAD-1, PPMX, CMC-14, 2MASS, DENIS-3, + # SDSS-R3,SDSS-R5,SDSS-R6,SDSS-R7, + # SDSS-R8, SDSS-R9 +ASTREF_BAND DEFAULT # Photom. band for astr.ref.magnitudes + # or DEFAULT, BLUEST, or REDDEST +ASTREFCAT_NAME ref.cat # Local astrometric reference catalogs +ASTREFCENT_KEYS X_WORLD,Y_WORLD # Local ref.cat. centroid parameters +ASTREFERR_KEYS ERRA_WORLD, ERRB_WORLD , ERRTHETA_WORLD + # Local ref.cat. err. ellipse params +ASTREFMAG_KEY MAG # Local ref.cat. magnitude parameter +ASTREFMAGERR_KEY MAGERR # Local ref.cat. mag. error parameter +ASTREFOBSDATE_KEY OBSDATE # Local ref.cat. obs. date parameter +ASTREFMAG_LIMITS -99,99 # Select magnitude range in ASTREF_BAND +SAVE_REFCATALOG Y # Save ref catalogs in FITS-LDAC format? +REFOUT_CATPATH ./ # Save path for reference catalogs + +#--------------------------- Merged output catalogs --------------------------- + +MERGEDOUTCAT_TYPE FITS_LDAC # NONE, ASCII_HEAD, ASCII, FITS_LDAC +MERGEDOUTCAT_NAME merged.cat # Merged output catalog filename + +#--------------------------- Full output catalogs --------------------------- + +FULLOUTCAT_TYPE FITS_LDAC # NONE, ASCII_HEAD, ASCII, FITS_LDAC +FULLOUTCAT_NAME full.cat # Full output catalog filename + +#----------------------------- Pattern matching ------------------------------- + +MATCH Y # Do pattern-matching (Y/N) ? +MATCH_NMAX 0 # Max.number of detections for MATCHing + # (0=auto) +PIXSCALE_MAXERR 2.0 # Max scale-factor uncertainty +POSANGLE_MAXERR 2.0 # Max position-angle uncertainty (deg) +POSITION_MAXERR 2.0 # Max positional uncertainty (arcmin) +MATCH_RESOL 0 # Matching resolution (arcsec); 0=auto +MATCH_FLIPPED Y # Allow matching with flipped axes? +MOSAIC_TYPE FIX_FOCALPLANE # UNCHANGED, SAME_CRVAL, SHARE_PROJAXIS, + # FIX_FOCALPLANE or LOOSE +FIXFOCALPLANE_NMIN 1 # Min number of dets for FIX_FOCALPLANE + +#---------------------------- Cross-identification ---------------------------- + +CROSSID_RADIUS 2.5 # Cross-id initial radius (arcsec) + +#---------------------------- Astrometric solution ---------------------------- + +SOLVE_ASTROM Y # Compute astrometric solution (Y/N) ? +PROJECTION_TYPE TAN # SAME, TPV or TAN +ASTRINSTRU_KEY FILTER,QRUNID # FITS keyword(s) defining the astrom +STABILITY_TYPE EXPOSURE # EXPOSURE, PRE-DISTORTED or INSTRUMENT +CENTROID_KEYS XWIN_IMAGE,YWIN_IMAGE # Cat. parameters for centroiding +CENTROIDERR_KEYS ERRAWIN_IMAGE,ERRBWIN_IMAGE,ERRTHETAWIN_IMAGE + # Cat. params for centroid err ellipse +DISTORT_KEYS XWIN_IMAGE,YWIN_IMAGE # Cat. parameters or FITS keywords +DISTORT_GROUPS 1,1 # Polynom group for each context key +DISTORT_DEGREES 2 # Polynom degree for each group +FOCDISTORT_DEGREE 1 # Polynom degree for focal plane coords +ASTREF_WEIGHT 1000000.0 # Relative weight of ref.astrom.ca +ASTRACCURACY_TYPE SIGMA-PIXEL # SIGMA-PIXEL, SIGMA-ARCSEC, + # or TURBULENCE-ARCSEC +ASTRACCURACY_KEY ASTRACCU # FITS keyword for ASTR_ACCURACY param. +ASTR_ACCURACY 0.00000001 # Astrom. uncertainty floor parameter +ASTRCLIP_NSIGMA 3 # Astrom. clipping threshold in sigmas +COMPUTE_PARALLAXES N # Compute trigonom. parallaxes (Y/N)? +COMPUTE_PROPERMOTIONS N # Compute proper motions (Y/N)? +CORRECT_COLOURSHIFTS N # Correct for colour shifts (Y/N)? +INCLUDE_ASTREFCATALOG N # Include ref.cat in prop.motions (Y/N)? +ASTR_FLAGSMASK 0x00fc # Astrometry rejection mask on SEx FLAGS +ASTR_IMAFLAGSMASK 0x0 # Astrometry rejection mask on IMAFLAGS + +#---------------------------- Photometric solution ---------------------------- + +SOLVE_PHOTOM Y # Compute photometric solution (Y/N) ? +MAGZERO_OUT 0.0 # Magnitude zero-point(s) in output +MAGZERO_INTERR 0.01 # Internal mag.zero-point accuracy +MAGZERO_REFERR 0.03 # Photom.field mag.zero-point accuracy +PHOTINSTRU_KEY FILTER # FITS keyword(s) defining the photom. +MAGZERO_KEY PHOT_C # FITS keyword for the mag zero-point +EXPOTIME_KEY EXPTIME # FITS keyword for the exposure time (s) +AIRMASS_KEY AIRMASS # FITS keyword for the airmass +EXTINCT_KEY PHOT_K # FITS keyword for the extinction coeff +PHOTOMFLAG_KEY PHOTFLAG # FITS keyword for the photometry flag +PHOTFLUX_KEY FLUX_AUTO # Catalog param. for the flux measurement +PHOTFLUXERR_KEY FLUXERR_AUTO # Catalog parameter for the flux error +PHOTCLIP_NSIGMA 3.0 # Photom.clipping threshold in sigmas +PHOT_ACCURACY 1e-3 # Photometric uncertainty floor (frac.) +PHOT_FLAGSMASK 0x00fc # Photometry rejection mask on SEx FLAGS +PHOT_IMAFLAGSMASK 0x0 # Photometry rejection mask on IMAFLAGS + +#------------------------------- Check-plots ---------------------------------- + +CHECKPLOT_CKEY SCAMPCOL # FITS keyword for PLPLOT field colour +CHECKPLOT_DEV NULL # NULL, XWIN, TK, PS, PSC, XFIG, PNG, + # JPEG, AQT, PDF or SVG +CHECKPLOT_RES 0 # Check-plot resolution (0 = default) +CHECKPLOT_ANTIALIAS N # Anti-aliasing using convert (Y/N) ? +CHECKPLOT_TYPE FGROUPS,DISTORTION,ASTR_INTERROR2D,ASTR_INTERROR1D,ASTR_REFERROR2D,ASTR_REFERROR1D,ASTR_CHI2,PHOT_ERROR +CHECKPLOT_NAME fgroups,distort,astr_interror2d,astr_interror1d,astr_referror2d,astr_referror1d,astr_chi2,psphot_error # Check-plot filename(s) + +#------------------------------- Check-images --------------------------------- + +CHECKIMAGE_TYPE NONE # NONE, AS_PAIR, AS_REFPAIR, or AS_XCORR +CHECKIMAGE_NAME check.fits # Check-image filename(s) + +#------------------------------ Miscellaneous --------------------------------- + +SN_THRESHOLDS 10.0,100.0 # S/N thresholds (in sigmas) for all and + # high-SN sample +FWHM_THRESHOLDS 0.0,100.0 # FWHM thresholds (in pixels) for sources +ELLIPTICITY_MAX 0.5 # Max. source ellipticity +FLAGS_MASK 0x00f0 # Global rejection mask on SEx FLAGS +WEIGHTFLAGS_MASK 0x00ff # Global rejec. mask on SEx FLAGS_WEIGHT +IMAFLAGS_MASK 0x0 # Global rejec. mask on SEx IMAFLAGS_ISO +AHEADER_GLOBAL scamp.abcdhead # Filename of the global INPUT header +AHEADER_SUFFIX .abcdhead # Filename extension for additional + # INPUT headers +HEADER_SUFFIX .head # Filename extension for OUTPUT headers +HEADER_TYPE NORMAL # NORMAL or FOCAL_PLANE +VERBOSE_TYPE NORMAL # QUIET, NORMAL, LOG or FULL +WRITE_XML N # Write XML file (Y/N)? +XML_NAME scamp.xml # Filename for XML output +XSL_URL file:///usr/local/share/scamp/scamp.xsl + # Filename for XSL style-sheet +NTHREADS 0 # Number of simultaneous threads for + # the SMP version of SCAMP + # 0 = automatic diff --git a/csst/msc/astrometry/raw/default2.scamp b/csst/msc/astrometry/raw/default2.scamp new file mode 100755 index 0000000000000000000000000000000000000000..e78460f029a4a9cecfbbbb97f4eed1d87c010c38 --- /dev/null +++ b/csst/msc/astrometry/raw/default2.scamp @@ -0,0 +1,142 @@ +# Default configuration file for SCAMP 2.0.4 +# EB 2016-11-04 +# + +#----------------------------- Field grouping --------------------------------- + +FGROUP_RADIUS 2.0 # Max dist (deg) between field groups + +#---------------------------- Reference catalogs ------------------------------ + +REF_SERVER cocat1.u-strasbg.fr # Internet addresses of catalog servers +REF_PORT 80 # Ports to connect to catalog servers +CDSCLIENT_EXEC aclient_cgi # CDSclient executable +ASTREF_CATALOG FILE # NONE, FILE, USNO-A1,USNO-A2,USNO-B1, + # GSC-1.3,GSC-2.2,GSC-2.3, + # TYCHO-2, UCAC-1,UCAC-2,UCAC-3,UCAC-4, + # NOMAD-1, PPMX, CMC-14, 2MASS, DENIS-3, + # SDSS-R3,SDSS-R5,SDSS-R6,SDSS-R7, + # SDSS-R8, SDSS-R9 +ASTREF_BAND DEFAULT # Photom. band for astr.ref.magnitudes + # or DEFAULT, BLUEST, or REDDEST +ASTREFCAT_NAME ref.cat # Local astrometric reference catalogs +ASTREFCENT_KEYS X_WORLD,Y_WORLD # Local ref.cat. centroid parameters +ASTREFERR_KEYS ERRA_WORLD, ERRB_WORLD , ERRTHETA_WORLD + # Local ref.cat. err. ellipse params +ASTREFMAG_KEY MAG # Local ref.cat. magnitude parameter +ASTREFMAGERR_KEY MAGERR # Local ref.cat. mag. error parameter +ASTREFOBSDATE_KEY OBSDATE # Local ref.cat. obs. date parameter +ASTREFMAG_LIMITS -99,99 # Select magnitude range in ASTREF_BAND +SAVE_REFCATALOG Y # Save ref catalogs in FITS-LDAC format? +REFOUT_CATPATH ./ # Save path for reference catalogs + +#--------------------------- Merged output catalogs --------------------------- + +MERGEDOUTCAT_TYPE FITS_LDAC # NONE, ASCII_HEAD, ASCII, FITS_LDAC +MERGEDOUTCAT_NAME merged.cat # Merged output catalog filename + +#--------------------------- Full output catalogs --------------------------- + +FULLOUTCAT_TYPE FITS_LDAC # NONE, ASCII_HEAD, ASCII, FITS_LDAC +FULLOUTCAT_NAME full.cat # Full output catalog filename + +#----------------------------- Pattern matching ------------------------------- + +MATCH Y # Do pattern-matching (Y/N) ? +MATCH_NMAX 0 # Max.number of detections for MATCHing + # (0=auto) +PIXSCALE_MAXERR 2.0 # Max scale-factor uncertainty +POSANGLE_MAXERR 2.0 # Max position-angle uncertainty (deg) +POSITION_MAXERR 2.0 # Max positional uncertainty (arcmin) +MATCH_RESOL 0 # Matching resolution (arcsec); 0=auto +MATCH_FLIPPED Y # Allow matching with flipped axes? +MOSAIC_TYPE FIX_FOCALPLANE # UNCHANGED, SAME_CRVAL, SHARE_PROJAXIS, + # FIX_FOCALPLANE or LOOSE +FIXFOCALPLANE_NMIN 1 # Min number of dets for FIX_FOCALPLANE + +#---------------------------- Cross-identification ---------------------------- + +CROSSID_RADIUS 2.0 # Cross-id initial radius (arcsec) + +#---------------------------- Astrometric solution ---------------------------- + +SOLVE_ASTROM Y # Compute astrometric solution (Y/N) ? +PROJECTION_TYPE TAN # SAME, TPV or TAN +ASTRINSTRU_KEY FILTER,QRUNID # FITS keyword(s) defining the astrom +STABILITY_TYPE EXPOSURE # EXPOSURE, PRE-DISTORTED or INSTRUMENT +CENTROID_KEYS XWIN_IMAGE,YWIN_IMAGE # Cat. parameters for centroiding +CENTROIDERR_KEYS ERRAWIN_IMAGE,ERRBWIN_IMAGE,ERRTHETAWIN_IMAGE + # Cat. params for centroid err ellipse +DISTORT_KEYS XWIN_IMAGE,YWIN_IMAGE # Cat. parameters or FITS keywords +DISTORT_GROUPS 1,1 # Polynom group for each context key +DISTORT_DEGREES 2 # Polynom degree for each group +FOCDISTORT_DEGREE 1 # Polynom degree for focal plane coords +ASTREF_WEIGHT 1000000.0 # Relative weight of ref.astrom.ca +ASTRACCURACY_TYPE SIGMA-PIXEL # SIGMA-PIXEL, SIGMA-ARCSEC, + # or TURBULENCE-ARCSEC +ASTRACCURACY_KEY ASTRACCU # FITS keyword for ASTR_ACCURACY param. +ASTR_ACCURACY 0.00000001 # Astrom. uncertainty floor parameter +ASTRCLIP_NSIGMA 3 # Astrom. clipping threshold in sigmas +COMPUTE_PARALLAXES N # Compute trigonom. parallaxes (Y/N)? +COMPUTE_PROPERMOTIONS N # Compute proper motions (Y/N)? +CORRECT_COLOURSHIFTS N # Correct for colour shifts (Y/N)? +INCLUDE_ASTREFCATALOG N # Include ref.cat in prop.motions (Y/N)? +ASTR_FLAGSMASK 0x00fc # Astrometry rejection mask on SEx FLAGS +ASTR_IMAFLAGSMASK 0x0 # Astrometry rejection mask on IMAFLAGS + +#---------------------------- Photometric solution ---------------------------- + +SOLVE_PHOTOM Y # Compute photometric solution (Y/N) ? +MAGZERO_OUT 0.0 # Magnitude zero-point(s) in output +MAGZERO_INTERR 0.01 # Internal mag.zero-point accuracy +MAGZERO_REFERR 0.03 # Photom.field mag.zero-point accuracy +PHOTINSTRU_KEY FILTER # FITS keyword(s) defining the photom. +MAGZERO_KEY PHOT_C # FITS keyword for the mag zero-point +EXPOTIME_KEY EXPTIME # FITS keyword for the exposure time (s) +AIRMASS_KEY AIRMASS # FITS keyword for the airmass +EXTINCT_KEY PHOT_K # FITS keyword for the extinction coeff +PHOTOMFLAG_KEY PHOTFLAG # FITS keyword for the photometry flag +PHOTFLUX_KEY FLUX_AUTO # Catalog param. for the flux measurement +PHOTFLUXERR_KEY FLUXERR_AUTO # Catalog parameter for the flux error +PHOTCLIP_NSIGMA 3.0 # Photom.clipping threshold in sigmas +PHOT_ACCURACY 1e-3 # Photometric uncertainty floor (frac.) +PHOT_FLAGSMASK 0x00fc # Photometry rejection mask on SEx FLAGS +PHOT_IMAFLAGSMASK 0x0 # Photometry rejection mask on IMAFLAGS + +#------------------------------- Check-plots ---------------------------------- + +CHECKPLOT_CKEY SCAMPCOL # FITS keyword for PLPLOT field colour +CHECKPLOT_DEV NULL # NULL, XWIN, TK, PS, PSC, XFIG, PNG, + # JPEG, AQT, PDF or SVG +CHECKPLOT_RES 0 # Check-plot resolution (0 = default) +CHECKPLOT_ANTIALIAS N # Anti-aliasing using convert (Y/N) ? +CHECKPLOT_TYPE FGROUPS,DISTORTION,ASTR_INTERROR2D,ASTR_INTERROR1D,ASTR_REFERROR2D,ASTR_REFERROR1D,ASTR_CHI2,PHOT_ERROR +CHECKPLOT_NAME fgroups,distort,astr_interror2d,astr_interror1d,astr_referror2d,astr_referror1d,astr_chi2,psphot_error # Check-plot filename(s) + +#------------------------------- Check-images --------------------------------- + +CHECKIMAGE_TYPE NONE # NONE, AS_PAIR, AS_REFPAIR, or AS_XCORR +CHECKIMAGE_NAME check.fits # Check-image filename(s) + +#------------------------------ Miscellaneous --------------------------------- + +SN_THRESHOLDS 10.0,100.0 # S/N thresholds (in sigmas) for all and + # high-SN sample +FWHM_THRESHOLDS 0.0,100.0 # FWHM thresholds (in pixels) for sources +ELLIPTICITY_MAX 0.5 # Max. source ellipticity +FLAGS_MASK 0x00f0 # Global rejection mask on SEx FLAGS +WEIGHTFLAGS_MASK 0x00ff # Global rejec. mask on SEx FLAGS_WEIGHT +IMAFLAGS_MASK 0x0 # Global rejec. mask on SEx IMAFLAGS_ISO +AHEADER_GLOBAL scamp.abcdhead # Filename of the global INPUT header +AHEADER_SUFFIX .ahead # Filename extension for additional + # INPUT headers +HEADER_SUFFIX .head # Filename extension for OUTPUT headers +HEADER_TYPE NORMAL # NORMAL or FOCAL_PLANE +VERBOSE_TYPE NORMAL # QUIET, NORMAL, LOG or FULL +WRITE_XML N # Write XML file (Y/N)? +XML_NAME scamp.xml # Filename for XML output +XSL_URL file:///usr/local/share/scamp/scamp.xsl + # Filename for XSL style-sheet +NTHREADS 0 # Number of simultaneous threads for + # the SMP version of SCAMP + # 0 = automatic diff --git a/csst/msc/astrometry/raw/new_csst_realtime.no.weight.sex b/csst/msc/astrometry/raw/new_csst_realtime.no.weight.sex new file mode 100644 index 0000000000000000000000000000000000000000..ddb216ea309c50ea6c49f096a594135cbfe4c1a5 --- /dev/null +++ b/csst/msc/astrometry/raw/new_csst_realtime.no.weight.sex @@ -0,0 +1,123 @@ +# Default configuration file for SExtractor 2.19.5 +# EB 2016-08-21 +# + +#-------------------------------- Catalog ------------------------------------ + +CATALOG_NAME test.fits # name of the output catalog +CATALOG_TYPE FITS_LDAC # NONE,ASCII,ASCII_HEAD, ASCII_SKYCAT, + # ASCII_VOTABLE, FITS_1.0 or FITS_LDAC +PARAMETERS_NAME /line17/Jundan/csst/c3_data/pro/csst_realtime.param # name of the file containing catalog contents + +#------------------------------- Extraction ---------------------------------- + +DETECT_TYPE CCD # CCD (linear) or PHOTO (with gamma correction) +DETECT_MINAREA 15 # min. # of pixels above threshold +DETECT_MAXAREA 0 # max. # of pixels above threshold (0=unlimited) +THRESH_TYPE RELATIVE # threshold type: RELATIVE (in sigmas) + # or ABSOLUTE (in ADUs) +DETECT_THRESH 3 # or , in mag.arcsec-2 +ANALYSIS_THRESH 3 # or , in mag.arcsec-2 + +FILTER Y # apply filter for detection (Y or N)? +FILTER_NAME /line17/Jundan/csst/c3_data/pro/csst_realtime.conv # name of the file containing the filter +FILTER_THRESH # Threshold[s] for retina filtering + +DEBLEND_NTHRESH 64 # Number of deblending sub-thresholds +DEBLEND_MINCONT 0.0005 # Minimum contrast parameter for deblending + +CLEAN Y # Clean spurious detections? (Y or N)? +CLEAN_PARAM 0.5 # Cleaning efficiency + +MASK_TYPE CORRECT # type of detection MASKing: can be one of + # NONE, BLANK or CORRECT + +#-------------------------------- FLAGging ----------------------------------- + +FLAG_IMAGE flag.fits # filename for an input FLAG-image +FLAG_TYPE OR # flag pixel combination: OR, AND, MIN, MAX + # or MOST + +#------------------------------ Photometry ----------------------------------- + +PHOT_APERTURES 10 # MAG_APER aperture diameter(s) in pixels +PHOT_AUTOPARAMS 2.5, 3.5 # MAG_AUTO parameters: , +PHOT_PETROPARAMS 2.0, 3.5 # MAG_PETRO parameters: , + # +PHOT_AUTOAPERS 0.0,0.0 # , minimum apertures + # for MAG_AUTO and MAG_PETRO +PHOT_FLUXFRAC 0.5 # flux fraction[s] used for FLUX_RADIUS + +SATUR_LEVEL 65535.0 # level (in ADUs) at which arises saturation +SATUR_KEY safSATURATE # keyword for saturation level (in ADUs) + +MAG_ZEROPOINT 0.0 # magnitude zero-point +MAG_GAMMA 7.0 # gamma of emulsion (for photographic scans) +GAIN 1.0 # detector gain in e-/ADU +GAIN_KEY asdfGAIN # keyword for detector gain in e-/ADU +PIXEL_SCALE 0 # size of pixel in arcsec (0=use FITS WCS info) + +#------------------------- Star/Galaxy Separation ---------------------------- + +SEEING_FWHM 1.2 # stellar FWHM in arcsec +STARNNW_NAME /line17/Jundan/csst/c3_data/pro/csst_realtime.nnw # Neural-Network_Weight table filename + +#------------------------------ Background ----------------------------------- + +BACK_TYPE AUTO # AUTO or MANUAL +BACK_VALUE 0.0 # Default background value in MANUAL mode +BACK_SIZE 256 # Background mesh: or , +BACK_FILTERSIZE 3 # Background filter: or , + +BACKPHOTO_TYPE LOCAL # can be GLOBAL or LOCAL +BACKPHOTO_THICK 24 # thickness of the background LOCAL annulus +BACK_FILTTHRESH 0.0 # Threshold above which the background- + # map filter operates + +#------------------------------ Check Image ---------------------------------- + +CHECKIMAGE_TYPE NONE # can be NONE, BACKGROUND, BACKGROUND_RMS, + # MINIBACKGROUND, MINIBACK_RMS, -BACKGROUND, + # FILTERED, OBJECTS, -OBJECTS, SEGMENTATION, + # or APERTURES +CHECKIMAGE_NAME check.fits # Filename for the check-image + +#--------------------- Memory (change with caution!) ------------------------- + +MEMORY_OBJSTACK 3000 # number of objects in stack +MEMORY_PIXSTACK 300000 # number of pixels in stack +MEMORY_BUFSIZE 1024 # number of lines in buffer + +#------------------------------- ASSOCiation --------------------------------- + +ASSOC_NAME sky.list # name of the ASCII file to ASSOCiate +ASSOC_DATA 2,3,4 # columns of the data to replicate (0=all) +ASSOC_PARAMS 2,3,4 # columns of xpos,ypos[,mag] +ASSOCCOORD_TYPE PIXEL # ASSOC coordinates: PIXEL or WORLD +ASSOC_RADIUS 2.0 # cross-matching radius (pixels) +ASSOC_TYPE NEAREST # ASSOCiation method: FIRST, NEAREST, MEAN, + # MAG_MEAN, SUM, MAG_SUM, MIN or MAX +ASSOCSELEC_TYPE MATCHED # ASSOC selection type: ALL, MATCHED or -MATCHED + +#----------------------------- Miscellaneous --------------------------------- + +VERBOSE_TYPE NORMAL # can be QUIET, NORMAL or FULL +HEADER_SUFFIX .abcdhead # Filename extension for additional headers +WRITE_XML N # Write XML file (Y/N)? +XML_NAME sex.xml # Filename for XML output +XSL_URL file:///usr/local/share/sextractor/sextractor.xsl + # Filename for XSL style-sheet +NTHREADS 1 # 1 single thread + +FITS_UNSIGNED N # Treat FITS integer values as unsigned (Y/N)? +INTERP_MAXXLAG 16 # Max. lag along X for 0-weight interpolation +INTERP_MAXYLAG 16 # Max. lag along Y for 0-weight interpolation +INTERP_TYPE ALL # Interpolation type: NONE, VAR_ONLY or ALL + +#--------------------------- Experimental Stuff ----------------------------- + +PSF_NAME default.psf # File containing the PSF model +PSF_NMAX 1 # Max.number of PSFs fitted simultaneously +PATTERN_TYPE RINGS-HARMONIC # can RINGS-QUADPOLE, RINGS-OCTOPOLE, + # RINGS-HARMONICS or GAUSS-LAGUERRE +SOM_NAME default.som # File containing Self-Organizing Map weights diff --git a/csst/msc/astrometry/raw/readme b/csst/msc/astrometry/raw/readme new file mode 100644 index 0000000000000000000000000000000000000000..bee040f585d0b16d7261dbbefb7610233bad43fa --- /dev/null +++ b/csst/msc/astrometry/raw/readme @@ -0,0 +1,2 @@ +python3.8 run_astrom_csst.v5.py '/line17/Jundan/csst/c3_data/input_v3/MSC*fits' +-o /line17/Jundan/csst/c3_data/out_put/v5/ -df diff --git a/csst/msc/astrometry/raw/run_astrom_csst.py b/csst/msc/astrometry/raw/run_astrom_csst.py new file mode 100644 index 0000000000000000000000000000000000000000..e490c38261d4a40f71191177eb6ab8ff467d2630 --- /dev/null +++ b/csst/msc/astrometry/raw/run_astrom_csst.py @@ -0,0 +1,548 @@ +#!/usr/bin/env python3.8 +#code for astrometry +#written by Jundan NIE +#history +#2021.6 not use missfits + +import os +import numpy as np +from astropy.wcs import WCS +from astropy.table import Table +from astropy.coordinates import SkyCoord +from astropy import units as u +import healpy as hp +from astropy import table +from astropy.io import fits +from astropy.time import Time +import time +import matplotlib.pyplot as plt +from subprocess import Popen, PIPE +from multiprocessing import Pool +from functools import partial +from astropy import units as u +import re + +def prepare_data(fitslist,image_prefix,path_config,output_dir): + """ + Prepare data for running scamp; Combine all image data, weight files, flag files to their one frame. + + Parameters + ---------- + fitslist: the image name, e.g.,/line17/Jundan/csst/combine/MSC_210304093000_0000000_06_img.fits + image_prefix: the prefix of the combined image fits, e.g.,MSC_210304093000_0000000 + path_config:path of the configure files + output_dir: directory of output + + Outputs + ---------- + The joined multi-extension file(not stacked), weight,flag files. e.g., MSC_210304093000_0000000_img.fits,MSC_210304093000_0000000_wht.fits, MSC_210304093000_0000000_flg.fits. + """ + + print('################## use missfits to combine images ###################') + + fn=output_dir+image_prefix + miss_fits1='missfits -c '+path_config+'default.missfits -OUTFILE_TYPE MULTI '+fn+' -SPLIT_SUFFIX _%02d_img.fits -SAVE_TYPE NEW -NEW_SUFFIX _img' + miss_fits2='missfits -c '+path_config+'default.missfits -OUTFILE_TYPE MULTI '+fn+' -SPLIT_SUFFIX _%02d_flg.fits -SAVE_TYPE NEW -NEW_SUFFIX _flg' + miss_fits3='missfits -c '+path_config+'default.missfits -OUTFILE_TYPE MULTI '+fn+' -SPLIT_SUFFIX _%02d_wht.fits -SAVE_TYPE NEW -NEW_SUFFIX _wht' + p=Popen(miss_fits1,shell=True) + p.wait() + p=Popen(miss_fits2,shell=True) + p.wait() + p=Popen(miss_fits3,shell=True) + p.wait() + + print('################## missfits done ########################') + +def run_sextractor(fitslist,path_config,output_dir): + """ + Run sextractor + Parameters + ---------- + input file: file name, e.g.,/line17/Jundan/csst/combine/MSC_210304093000_0000000_06_img.fits + Outputs + ---------- + The catalog, with position and flux. + """ + + #run sextractor under specific sex setting. + path_sex=path_config+'new_csst_realtime.no.weight.sex' + image_name=fitslist + fn=fitslist[fitslist.rfind('MSC'):-5] #MSC_210304093000_0000000_06_img + fn_wt=fitslist[:-8]+'wht.fits' + fn_flg=fitslist[:-8]+'flg.fits' + hdul=fits.open(fitslist) + hdr=hdul[1].header + gain=hdr['GAIN1'] + sex_comd1='sex -c '+path_sex+' ' + sex_comd2=fitslist+' -CATALOG_NAME '+output_dir+fn+'.acat' + sex_comd3=' -GAIN '+str(gain) +' -GAIN_KEY '+ 'abcdefg ' + sex_comd4='-PARAMETERS_NAME '+path_config+'csst_realtime.param '+'-FILTER_NAME '+path_config+'csst_realtime.conv '+'-STARNNW_NAME '+path_config+'csst_realtime.nnw' + sex_comd=sex_comd1+sex_comd2+sex_comd3+sex_comd4 + print(sex_comd) + p=Popen(sex_comd,shell=True) + p.wait() + +def check_data(fitslist,path_config,image_prefix,output_dir): + """ + Check the catalog of the sextractor. Extract a good one for running scamp. + Parameters + ---------- + input file: file name, e.g., /line17/Jundan/csst/combine/MSC_210304093000_0000000_06_img.fits + Outputs + ---------- + The joined catalog, e.g.,MSC_210304093000_0000000.acat.fits + """ + + #Join single sextractor catalogs together. not use missfits + fn=output_dir+image_prefix + output_catnm=str(fn+'.acat.fits') + hdul=fits.HDUList() + if (len(fitslist)==18): + for i in range(0,len(fitslist)): + cat_nm=output_dir+fitslist[i][fitslist[i].rfind('MSC'):-5]+'.acat' #MSC*_img.acat + cat_i=fits.open(cat_nm) + hdul.append(cat_i[0]) + hdul.append(cat_i[1]) + hdul.append(cat_i[2]) + hdul.writeto(output_catnm,overwrite=True) + else: + print('the length of fitslist is not equal to 18,needs to check') + + + #check the number of stars of sextractor catalog. + c = output_catnm.index('.acat.fits') + filenm=output_catnm[c-c:c+10] #the file MSC_210304093000_0000000.acat.fits. 10 is the length of '.acat.fits' + hdulist = fits.open(filenm) + cols = 0 + for n in range(0,len(fitslist)): #top header +9ccds of csst(image header +data). need to modify for every survey. + tdata=hdulist[3*n+2].data + cols+=len(tdata) + print ('#detections for '+filenm+':',cols) + if (cols >200): + print('number of stars >200,good') + else: + print('number of stars <200,bad') + stop + print('###############check_data done#######################') + + +def convert_hdu_to_ldac(hdu): + """ + Convert an hdu table to a fits_ldac table (format used by astromatic suite) + + Parameters + ---------- + hdu: `astropy.io.fits.BinTableHDU` or `astropy.io.fits.TableHDU` + HDUList to convert to fits_ldac HDUList + + Returns + ------- + tbl1: `astropy.io.fits.BinTableHDU` + Header info for fits table (LDAC_IMHEAD) + tbl2: `astropy.io.fits.BinTableHDU` + Data table (LDAC_OBJECTS) + """ + tblhdr = np.array([hdu[1].header.tostring()]) + col1 = fits.Column(name='Field Header Card', array=tblhdr, format='13200A') + cols = fits.ColDefs([col1]) + tbl1 = fits.BinTableHDU.from_columns(cols) + tbl1.header['TDIM1'] = '(80, {0})'.format(len(hdu[1].header)) + tbl1.header['EXTNAME'] = 'LDAC_IMHEAD' + + dcol = fits.ColDefs(hdu[1].data) + tbl2 = fits.BinTableHDU.from_columns(dcol) + tbl2.header['EXTNAME'] = 'LDAC_OBJECTS' + return (tbl1, tbl2) + +def get_refcat(image,output_dir,search_radius,path_gaia,silent=True): + """ + Get reference catalog for scamp. The reference cat is GAIA DR2. + Parameters + ---------- + image: a image to get its reference catalog, e.g.,MSC_210304093000_0000000_img.fits. Usually the center of the image is the wcs parameters CRVAL1,CRVAL1. + search_radius: circle radius for searching, units: degree. e.g., 2 degree for a 1x1 deg^2 image. For large ccd size, use larger radius. csst, r=3 deg. + path: directory of the reference catalog. + Returns + ------- + outcat: filename of the cross matched catalog. This catalog is used as a reference catalog for running scamp. e.g.,MSC_000001_r_210103150723gaia.fits + """ + + print('############## getting reference catalog....################') + line = output_dir+image + c = line.index('_img.fits') + fname=line[0:c]+'_img.fits' + gaianame=line[0:c]+'.gaia.fits' + outcat=gaianame + gaialacnm=line[0:c]+'.gaialac.fits' + hdu = fits.open(fname) + header1=hdu[0].header + header2=hdu[1].header + ################proper motion ########## + #oday=header1['DATE-OBS'] + #otime=header1['TIME-OBS'] + #exptime=header1['EXPTIME'] + #odaytime=header1['DATE-OBS']+'T'+header1['TIME-OBS'] + #print('calculating proper motion...',oday, odaytime) + #t = Time(oday, format='isot', scale='utc') + #print('t=', t) + #t.format = 'decimalyear' + #print(t.format) + #t1=Time(2015.5, format='decimalyear', scale='utc') + #print('t1, t.value =', t1, t.value) + #deltatime= t.value -2015.5 + #print('(Time - 2015.5) = deltatime =', deltatime) + #print(deltatime, 'deltatime') + deltatime=0.0 + ra = float(header2['CRVAL1']) + dec = float(header2['CRVAL2']) + c = SkyCoord(ra,dec, unit=(u.deg, u.deg)) + print('ra, dec ra.deg dec.deg= ', ra, dec, c.ra.deg, c.dec.deg) + ra = c.ra.deg + dec = c.dec.deg + c = SkyCoord(ra, dec, unit=(u.deg, u.deg)) + phi = c.ra.deg / (180. / np.pi) + theta = (90. - c.dec.deg) / (180 / np.pi) + vec = hp.ang2vec(theta, phi) # Cartesian coordinates of center of circle: xyz + #find the indices of all the pixels within 2 degrees of that point + # Array of indices of pixels inside circle. Use nside=32,because zhouzhimin gaia catalog is 12*32*32=12288 + list1 = hp.query_disc(nside=32, vec=vec, radius=np.radians(search_radius)) + if -1 in list1: + list1.remove(-1) + ipring = np.array(list1) + # uniq and sort + pix = np.unique(ipring) #pix =00000,03061.... + npix = pix.size + print(ipring, 'ipring', pix, 'pix', npix, 'npix') #check if there are reduplicates + dt = np.dtype([('ra', '>f8'), ('dec', '>f8'), ('ra_error', '>f8'), ('dec_error', '>f8'),('phot_g_mean_mag', '>f8'), + ('pmra', '>f8'), ('pmra_error', '>f8'), ('pmdec', '>f8'), ('pmdec_error', '>f8')]) + refcat = table.Table(dtype=dt) + for i in pix: + print('i= %5.5d' % i, path_gaia) + fname = path_gaia + 'chunk-' + '%5.5d' % i + '.fits' + print('fname=', fname) + if not silent: print('Reading ', fname) + d = table.Table.read(fname) + refcat = [refcat, d] + refcat = table.vstack(refcat, join_type='inner') + refcat.rename_column('ra', 'X_WORLD') + refcat.rename_column('dec', 'Y_WORLD') + # print(refcat) above are just getting gaia information for ra,dec 2 deg ring. + print('delta_time between obs_cat and ref_cat:',deltatime) + + mask = (refcat['pmdec']!=refcat['pmdec']) + refcat['pmdec'][mask]=0 + mask = (refcat['pmra']!=refcat['pmra']) + refcat['pmra'][mask]=0 + refcat['X_WORLD']=refcat['X_WORLD']+deltatime*refcat['pmra']/3600.0/1000.0/np.cos(refcat['Y_WORLD']*np.pi/180.) + refcat['Y_WORLD']=refcat['Y_WORLD']+deltatime*refcat['pmdec']/3600.0/1000.0 + refcat['ra_error']=refcat['ra_error']/1000.0/3600.0 + refcat['dec_error']=refcat['dec_error']/1000.0/3600.0 + refcat.rename_column('ra_error', 'ERRA_WORLD') + refcat.rename_column('dec_error', 'ERRB_WORLD') + refcat.rename_column('phot_g_mean_mag', 'MAG') + if outcat: refcat.write(outcat, format='fits', overwrite=True) + + if os.path.isfile(gaianame): + print('exist') + hdu = fits.open(gaianame) + hdu1= convert_hdu_to_ldac(hdu) + hdup = fits.PrimaryHDU() + hdu=hdu1[0] + tbhdu=hdu1[1] + thdulist = fits.HDUList([hdup,hdu, tbhdu]) + if os.path.isfile(gaialacnm): os.remove(gaialacnm) + thdulist.writeto(gaialacnm) + + print('##################### end #####################') + return (outcat) + +def rewrite_wcs_head(head): + #rewrite the WCS head from Scamp to the standard fits header. + wcshead=head+'.fits' + f = open(head, 'r') + f1 = open(wcshead, 'w') + a='' + i=0 + for u in f.readlines(): + v = re.sub("é", "e", u) + sp='' + asp='' + i+=1 + if len(v)<=81: + sp=' '*(81-len(v)) + if 'END' in v: + asp=' '*80*(36-i%36) + i=i+(36-i%36) + #print(i) + a=a+v+sp+asp + f1.write(a.replace('\n','')) + f1.close() + f.close() + return wcshead + + +def check_astrometry(output_dir,path_config,image_prefix,fitslist,run_twice=False): + #update the header of the image fits + print('############## check the astrometry quality ################') + r1=[] + d1=[] + fn1_1=output_dir+image_prefix + + ################################### + wcshead=rewrite_wcs_head(fn1_1+'.acat.head')#MSC_MS_210525121500_100000001.acat.head->MSC*.acat.head.fits$ + acat=fits.open(fn1_1+'.acat.fits') + acat_change=str(fn1_1+'.acat.change.fits') + cat_suffix='.acat' + + if run_twice: + wcshead=rewrite_wcs_head(fn1_1+'.bcat.head')#MSC_MS_210525121500_100000001.bcat.head->MSC*.bcat.head.fits$ + acat=fits.open(fn1_1+'.bcat.fits') + acat_change=str(fn1_1+'.bcat.change.fits') + #cat_suffix='.bcat' + #################################### + + hdul=fits.HDUList() + if (len(fitslist)==18): + for i in range(0,len(fitslist)): + print(fitslist[i]) + wcshdr=fits.getheader(wcshead,i)# read headers and change to RA---TPV,DEC--TPV for wcs_transfer package + wcshdr['CTYPE1']='RA---TPV' + wcshdr['CTYPE2']='DEC--TPV' + w=WCS(wcshdr) + #print(wcshdr) + cat_nm=output_dir+fitslist[i][fitslist[i].rfind('MSC'):-5]+cat_suffix + cat_i=fits.open(cat_nm) + sexcat=cat_i[2].data + ra_sex=sexcat['ALPHA_J2000'] + dec_sex=sexcat['DELTA_J2000'] + x=sexcat['XWIN_IMAGE'] + y=sexcat['YWIN_IMAGE'] + r,d=w.all_pix2world(x,y,0) #convert xwin,ywin to ra,de + sexcat['ALPHA_J2000']=r + sexcat['DELTA_J2000']=d + cat_i[2].data=sexcat + hdul.append(cat_i[0]) + hdul.append(cat_i[1]) + hdul.append(cat_i[2]) + r1=np.hstack((r1,r)) + d1=np.hstack((d1,d)) + obsc=SkyCoord(ra=r1*u.degree,dec=d1*u.degree) + tmp_cat=np.zeros((len(obsc),2)) + tmp_cat[:,0]=obsc.ra + tmp_cat[:,1]=obsc.dec + np.savetxt(output_dir+'scamp_coord.txt',tmp_cat,fmt="%.10f %.10f",delimiter="\n") + hdul.writeto(acat_change,overwrite=True)#update the cat with new ra,dec (from 1st scamp wcs.) + else: + print('the length of fitslist is not equal to 18,needs to check') + + gaia_cat=Table.read(fn1_1+'.gaia.fits') + gaia_ra=gaia_cat['X_WORLD'] + gaia_dec=gaia_cat['Y_WORLD'] + refc=SkyCoord(ra=gaia_ra*u.degree,dec=gaia_dec*u.degree) + idx, d2d, d3d = obsc.match_to_catalog_sky(refc) + ref_uid=np.unique(idx) + obs_uid=np.full_like(ref_uid,-1) + tmpj=-1 + ccdraoff_med=ccddecoff_med=ccdra_rms=ccddec_rms=-1 + for i in ref_uid: + tmpj=tmpj+1 + iid=(idx == i) + iiid = (d2d.deg[iid] == d2d.deg[iid].min()) + obs_uid[tmpj]=iid.nonzero()[0][iiid.nonzero()[0]][0] + + uidlim=d2d[obs_uid].arcsecond <1. # set match radius=1 arcsec + if uidlim.sum()>0: + obs_uidlim=obs_uid[uidlim] + ref_uidlim=ref_uid[uidlim] + ccdraoff=(obsc[obs_uidlim].ra- refc[ref_uidlim].ra).arcsec*np.cos(obsc[obs_uidlim].dec.deg*np.pi/180.) + ccdraoff_med=np.median(ccdraoff) + ccdra_rms=np.std(ccdraoff) + ccddecoff=(obsc[obs_uidlim].dec- refc[ref_uidlim].dec).arcsec + ccddec_rms=np.std(ccddecoff) + ccddecoff_med=np.median(ccddecoff) + match_num=len(ccdraoff) + print('################# astrometry result: ##############') + if (match_num<100): + print('### bad astrometry ###') + print('median ra_off, dec_off (mas):',ccdraoff_med*1000.,ccddecoff_med*1000.) + print('rms ra_off, dec_off (mas):',ccdra_rms*1000.,ccddec_rms*1000.) + print('############################################') + return ccdraoff,ccddecoff,ccdraoff_med,ccddecoff_med,ccdra_rms,ccddec_rms + + +def write_headers(fitslist,output_dir,run_twice=False): + """ + Wrtie history to header + """ + if run_twice: + head_suffix=output_dir+fitslist[0][fitslist[0].rfind('MSC'):-12]+'.bcat.head.fits' + else: + head_suffix=output_dir+fitslist[0][fitslist[0].rfind('MSC'):-12]+'.acat.head.fits' + print(head_suffix) + hdul2=fits.open(head_suffix) + if (len(fitslist)==18): + for i in range(0,len(fitslist)): + fits_nm=output_dir+fitslist[i][fitslist[i].rfind('MSC'):-5]+'.head' + hdul1=fits.open(fits_nm,mode='update') + hdr=hdul1[0].header + hdr2=hdul2[i].header + hdr.extend(hdr2,unique=True, update=True) + WCS_S=0 + WCS_V='2.0.4' + WCS_P='default.scamp' + WCS_TOL=time.strftime('%Y-%m-%d %H:%M:%S %p') + hdr.set('WCS_S','0','0=done') + hdr.set('WCS_V',WCS_V,'Version of WCS calibration') + hdr.set('WCS_P',WCS_P,'Configure file name of WCS') + hdr.set('WCS_TOL',WCS_TOL,'Time of last wcs calibration') + hdul1.flush() + hdul1.close() + else: + print('total numner of the fits files are not 18.') + + + +def do_astrometry(fitslist,search_radius,path_gaia,path_config,output_dir,plot=False,remove=False,run_twice=False): + fn1_1=fitslist[0][fitslist[0].rfind('MSC'):-12] #MSC_210304093000_0000000 + fn1_2=fitslist[0][fitslist[0].rfind('MSC'):-5] #MSC_210304093000_0000000_06_img + image_prefix=fn1_1 + #######################preparing data######################## + #print('############## preparing data ##############') + prepare_data(fitslist,image_prefix,path_config,output_dir) + + print('############## start running sextractor, in multi-processing ##############') + p=Pool() + prod_x=partial(run_sextractor, path_config=path_config,output_dir=output_dir)#multi-processing with multiple arguments. + result=p.map(prod_x,fitslist) + p.close() + p.join() + print('############## sextractore done ##############') + + # ###############combine and check the sextractor_catalog,extract a good one for running scamp############ + print('############## check sextractor catalog ##############') + check_data(fitslist,path_config,image_prefix,output_dir) + + ###############match with reference catalog##################### + image=image_prefix+'_img.fits' + get_refcat(image,output_dir,search_radius,path_gaia,silent=True) + Popen('cp '+output_dir+image_prefix+'.gaialac.fits '+output_dir+'ref.cat',shell=True) + + ###############run scamp################ + print('############## start running scamp for the first time ##############') + scamp_comd='scamp '+output_dir+image_prefix+'.acat.fits -ASTREFCAT_NAME= '+output_dir+'ref.cat\ + -MERGEDOUTCAT_NAME '+output_dir+'merged.cat -FULLOUTCAT_NAME '+output_dir+'full.cat\ + -c '+path_config+'default.scamp' + print(scamp_comd) + p=Popen(scamp_comd,shell=True) + p.wait() + print('############## scamp done ##############') + + #######################check the astrometry quality######################### + ccdoff=check_astrometry(output_dir,path_config,image_prefix,fitslist,run_twice=run_twice) + + #########################write headers######################### + print('############### updating headers......###############') + write_headers(fitslist,output_dir,run_twice=run_twice) + ############################################# + + ########################## make some analyze plot.####################### + if plot: + print('##### Analyzing the scampe result, making some pltos.... ####') + plt.figure(figsize=(11,5)) + ax1=plt.subplot(121) + bin=0.05 + plt.grid(color='grey',ls='--') + plt.plot(ccdoff[0],ccdoff[1],'ko',markersize=3,alpha=0.3) + plt.xlabel(r'$\Delta$ RA (arcsec)',fontsize=12) + plt.ylabel(r'$\Delta$ Dec (arcsec)',fontsize=12) + ax2=plt.subplot(122) + plt.grid(color='grey',ls='--') + plt.hist(ccdoff[0],bins=np.arange(-1,1, bin),histtype="step",color="r",label=r'$\Delta$RA (arcsec)') + plt.hist(ccdoff[1],bins=np.arange(-1,1, bin),histtype="step",color="b",label=r'$\Delta$Dec (arcsec)') + plt.legend() + a=str(float(ccdoff[2])) + b=str(float(ccdoff[4])) + c=str(float(ccdoff[3])) + d=str(float(ccdoff[5])) + plt.text(-0.95,45,r'$\mu$='+a[0:6]+r', $\sigma$='+b[0:5]+' (arcsec)',color='red') + plt.text(-0.95,35,r'$\mu$='+c[0:6]+r', $\sigma$='+d[0:5]+' (arcsec)',color='blue') + plt.xlabel('coord_diff (arcsec)',fontsize=12) + + plt.savefig(output_dir+image_prefix+'_radec_off.png',dpi=300) + + +###################### remove redundant files######################## + if remove: + print('#################remove tmp files......#################') + if os.path.isfile(output_dir+image_prefix+'_??_img.acat'): os.remove(output_dir+image_prefix+'_??_img.acat') + if os.path.isfile(output_dir+image_prefix+'.gaia.fits'): os.remove(output_dir+image_prefix+'.gaia.fits') + if os.path.isfile(output_dir+image_prefix+'gaialac.fits'): os.remove(output_dir+image_prefix+'gaialac.fits') + if os.path.isfile(output_dir+'scamp.xml'): os.remove(output_dir+'scamp.xml') + if os.path.isfile(output_dir+image_prefix+'_img.fits.back'): os.remove(output_dir+image_prefix+'_img.fits.back') + if os.path.isfile(output_dir+image_prefix+'_wht.fits'): os.remove(output_dir+image_prefix+'_wht.fits') + if os.path.isfile(output_dir+image_prefix+'_flg.fits'): os.remove(output_dir+image_prefix+'_flg.fits') + + print('###################### all steps are done #################') + + +################ main program #################### +def main(): + import argparse + import glob + import time + from fnmatch import fnmatch, fnmatchcase + parser=argparse.ArgumentParser(description='Do astrometry.') + parser.add_argument('fitsfile', metavar='FITSFILE', type=np.str,help='input file for the CCD frame') + parser.add_argument('-r','--search_radius',type=float,help='search radius for getting reference catalog.',default=2.0) + parser.add_argument('-p','--path_gaia',type=str,help='direcotory of the reference catalog',default='/line12/gaia/chunks-gaia-dr2-astrom/') + parser.add_argument('-s','--path_config',type=str,help='path of the config file',default='/line17/Jundan/csst/c3_data/pro/') + parser.add_argument('-o','--path_output',type=str,help='path of the output files',default='/line17/Jundan/csst/c3_data/out_put/') + parser.add_argument("-f", "--figure",action="store_true",help='plot the astrometry result.') + parser.add_argument("-d", "--delete",action="store_true",help='delete redundant files.') + parser.add_argument("-t", "--twice",action="store_true",help='run sextractor and scampe for the second time to get more accurate wcs parameters.') + args = parser.parse_args() + fns=args.fitsfile + fitslist_tmp0=sorted(glob.glob(fns)) + search_radius=args.search_radius + path_gaia=args.path_gaia + path_config=args.path_config + outdir=args.path_output + path_origin=fitslist_tmp0[0][:fitslist_tmp0[0].rfind('MSC')] #e.g.,/line17/Jundan/csst/combine/ + fitslist_tmp1=fitslist_tmp0[0][fitslist_tmp0[0].rfind('MSC'):-8]#the first file,e.g.,MSC_210304093000_0000000_06_img.fits + fitslist_tmp2=outdir+fitslist_tmp1+'img.fits' + fitslist_tmp3=outdir+fitslist_tmp1+'flg.fits' + fitslist_tmp4=outdir+fitslist_tmp1+'wht.fits' + fitslist_tmp5=outdir+fitslist_tmp1+'img.head' + #check if the linked files are exist. If not, make a soft link. + if os.path.isfile(fitslist_tmp2): + print('original MSC*_img.fits already exist') + else: + print('make a soft link to the original data...') + p=Popen('ln -s '+path_origin+'MSC*_img.fits '+outdir,shell=True)#make a soft link to the original data. + p.wait() + if os.path.isfile(fitslist_tmp3): + print('original MSC*_flg.fits already exist') + else: + print('make a soft link to the original data...') + p=Popen('ln -s '+path_origin+'MSC*_flg.fits '+outdir,shell=True)#make a soft link to the original da p.wait() + if os.path.isfile(fitslist_tmp4): + print('original MSC*_wht.fits already exist') + else: + print('make a soft link to the original data...') + p=Popen('ln -s '+path_origin+'MSC*_wht.fits '+outdir,shell=True)#make a soft link to the original da p.wait() + if os.path.isfile(fitslist_tmp5): + print('original MSC*_img.head already exist') + else: + print('original MSC*_img.head does not exist, make a soft link to the original data...') + p=Popen('ln -s '+path_origin+'MSC*_img.head '+outdir,shell=True)#make a soft link to the original da p.wait() + + fitslist1=[fitslist1 for fitslist1 in fitslist_tmp0 if fnmatchcase(fitslist1,'/*_??_img.fits')] + fitslist2=fitslist1 + for i in range(0,len(fitslist1)): + fitslist2[i]=outdir+fitslist1[i][fitslist1[i].rfind('MSC'):] + fitslist=fitslist2 + print('fitslist for reducing:',fitslist) + do_astrometry(fitslist,search_radius=search_radius,path_gaia=path_gaia,path_config=path_config,output_dir=outdir,plot=args.figure,remove=args.delete,run_twice=args.twice) + +if (__name__=="__main__"): + main() diff --git a/csst/common/data/mscdata.py b/csst/msc/mscdata.py similarity index 96% rename from csst/common/data/mscdata.py rename to csst/msc/mscdata.py index 58b88a0a980895d2e4c5d159b9b23385dc5c05d7..51774ff451fc545b66f5d78f1da4a34bb25b6f9a 100644 --- a/csst/common/data/mscdata.py +++ b/csst/msc/mscdata.py @@ -2,7 +2,10 @@ from collections import OrderedDict import astropy.io.fits as fits from astropy.io.fits import HDUList, PrimaryHDU, ImageHDU from astropy.io.fits.header import Header -from csst.common.data import CsstData +from ..common.data import CsstData + + +__all__ = ["CsstMscData", "CsstMscImgData"] class CsstMscData(CsstData): diff --git a/csst/test/untitled0.py b/csst/test/untitled0.py new file mode 100644 index 0000000000000000000000000000000000000000..dd1f7a2e78d085defd9eddd16145e1ea1eba60b5 --- /dev/null +++ b/csst/test/untitled0.py @@ -0,0 +1,12 @@ +#%% code + + +fp = "/Users/cham/projects/csst/test/MSC_MS_210527171000_100000279_16_raw.fits" + +from csst.common.factory import CsstDataFactory + +data = CsstDataFactory.createData(fp) + +print(data) + +print(data.get_l0keyword("pri", "INSTRUME"))