Changeset 40483 for branches/czw_branch/20170908/ippToPsps
- Timestamp:
- Jun 27, 2018, 3:31:55 PM (8 years ago)
- Location:
- branches/czw_branch/20170908
- Files:
-
- 26 edited
- 3 copied
-
. (modified) (1 prop)
-
ippToPsps/config/latextables (copied) (copied from trunk/ippToPsps/config/latextables )
-
ippToPsps/config/tables.DO.vot (modified) (1 diff)
-
ippToPsps/config/tables.IN.vot (modified) (8 diffs)
-
ippToPsps/config/tables.OB.vot (modified) (1 diff)
-
ippToPsps/config/tables.ST.vot (modified) (13 diffs)
-
ippToPsps/jython/batch.py (modified) (1 diff)
-
ippToPsps/jython/detectionbatch.py (modified) (3 diffs)
-
ippToPsps/jython/diffbatch.py (modified) (2 diffs)
-
ippToPsps/jython/diffobjectbatch.py (modified) (1 diff)
-
ippToPsps/jython/dvo.py (modified) (7 diffs)
-
ippToPsps/jython/dvodetections.py (modified) (1 diff)
-
ippToPsps/jython/dvodiffdetections.py (modified) (2 diffs)
-
ippToPsps/jython/dvoforcedobjects.py (modified) (1 diff)
-
ippToPsps/jython/forcedwarpbatch.py (modified) (8 diffs)
-
ippToPsps/jython/gpc1db.py (modified) (8 diffs)
-
ippToPsps/jython/ippjytest (modified) (1 diff)
-
ippToPsps/jython/ipptopspsdb.py (modified) (1 diff)
-
ippToPsps/jython/objectbatch.py (modified) (1 diff)
-
ippToPsps/jython/queue.py (modified) (2 diffs)
-
ippToPsps/jython/scratchdb.py (modified) (5 diffs)
-
ippToPsps/jython/stackbatch.py (modified) (13 diffs)
-
ippToPsps/jython/testCode.py (modified) (4 diffs)
-
ippToPsps/test/fulltest.sh (modified) (17 diffs)
-
ippToPsps/test/gdb.sh (copied) (copied from trunk/ippToPsps/test/gdb.sh )
-
ippToPsps/test/mkgpc1.sh (modified) (5 diffs)
-
ippToPsps/test/mkgpc1data.dr2.dvo (copied) (copied from trunk/ippToPsps/test/mkgpc1data.dr2.dvo )
-
ippToPsps/test/mkgpc1data.dvo (modified) (22 diffs)
-
ippToPsps/test/notes.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/czw_branch/20170908
- Property svn:mergeinfo changed
-
branches/czw_branch/20170908/ippToPsps/config/tables.DO.vot
r39255 r40483 7 7 <PARAM arraysize="1" datatype="char" ucd="meta.bib.author" name="Author" value="PSPS"></PARAM> 8 8 <FIELD name="diffObjName" arraysize="32" datatype="char" unit="dimensionless" default="NA"> 9 <DESCRIPTION>IAU name for this object.</DESCRIPTION>9 <DESCRIPTION>IAU-approved name for this object.</DESCRIPTION> 10 10 </FIELD> 11 <FIELD name="diffObj PSOName" arraysize="32" datatype="char" unit="dimensionless" default="NA">12 <DESCRIPTION>Alternate Pan-STARRSname for this object.</DESCRIPTION>11 <FIELD name="diffObjNameHMS" arraysize="32" datatype="char" unit="dimensionless" default="NA"> 12 <DESCRIPTION>Alternate Sexigesimal name for this object.</DESCRIPTION> 13 13 </FIELD> 14 14 <FIELD name="diffObjAltName1" arraysize="32" datatype="char" unit="dimensionless" default=""> -
branches/czw_branch/20170908/ippToPsps/config/tables.IN.vot
r40101 r40483 576 576 <TABLEDATA> 577 577 <TR><TD>NEW</TD> <TD>0x00000000</TD><TD>0</TD><TD>No relphot / relastro attempted.</TD></TR> 578 <TR><TD>PHOTOM_NOCAL</TD> <TD>0x00000001</TD><TD>1</TD><TD>Used within relphot to mean 'don't apply fit'. | user-set value used withing relphot: ignore (EAM!)</TD></TR>579 <TR><TD>PHOTOM_POOR</TD> <TD>0x00000002</TD><TD>2</TD><TD>Relphot says image is bad (dMcal > limit). (EAM!)</TD></TR>580 <TR><TD>PHOTOM_SKIP</TD> <TD>0x00000004</TD><TD>4</TD><TD>External information image has bad photometry (EAM).</TD></TR>578 <TR><TD>PHOTOM_NOCAL</TD> <TD>0x00000001</TD><TD>1</TD><TD>Used within relphot to mean 'don't apply fit'.</TD></TR> 579 <TR><TD>PHOTOM_POOR</TD> <TD>0x00000002</TD><TD>2</TD><TD>Relphot says image is bad (dMcal > limit).</TD></TR> 580 <TR><TD>PHOTOM_SKIP</TD> <TD>0x00000004</TD><TD>4</TD><TD>External information image has bad photometry.</TD></TR> 581 581 <TR><TD>PHOTOM_FEW</TD> <TD>0x00000008</TD><TD>8</TD><TD>Currently too few measurements for good value for photometry.</TD></TR> 582 <TR><TD>ASTROM_NOCAL</TD> <TD>0x00000010</TD><TD>16</TD><TD>User-set value used within relastro: ignore (EAM!).</TD></TR>582 <TR><TD>ASTROM_NOCAL</TD> <TD>0x00000010</TD><TD>16</TD><TD>User-set value used within relastro: ignore.</TD></TR> 583 583 <TR><TD>ASTROM_POOR</TD> <TD>0x00000020</TD><TD>32</TD><TD>Relastro says image is bad (dR,dD > limit).</TD></TR> 584 584 <TR><TD>ASTROM_FAIL</TD> <TD>0x00000040</TD><TD>64</TD><TD>Relastro fit diverged, fit not applied.</TD></TR> 585 <TR><TD>ASTROM_SKIP</TD> <TD>0x00000080</TD><TD>128</TD><TD>External information image has bad astrometry. (EAM)</TD></TR>585 <TR><TD>ASTROM_SKIP</TD> <TD>0x00000080</TD><TD>128</TD><TD>External information image has bad astrometry.</TD></TR> 586 586 <TR><TD>ASTROM_FEW</TD> <TD>0x00000100</TD><TD>256</TD><TD>Currently too few measurements for good value for astrometry.</TD></TR> 587 587 <TR><TD>PHOTOM_UBERCAL</TD><TD>0x00000200</TD><TD>512</TD><TD>Externally-supplied photometry zero point from ubercal analysis.</TD></TR> … … 614 614 <TR><TD>EXTMODEL</TD> <TD>0x00000002</TD><TD>2 </TD><TD>Source fitted with an extended-source model.</TD></TR> 615 615 <TR><TD>FITTED</TD> <TD>0x00000004</TD><TD>4 </TD><TD>Source fitted with non-linear model (PSF or EXT; good or bad).</TD></TR> 616 <TR><TD>FAIL</TD> <TD>0x00000008</TD><TD>8 </TD><TD>Fit (non-linear) failed (non-converge , off-edge,run to zero).</TD></TR>616 <TR><TD>FAIL</TD> <TD>0x00000008</TD><TD>8 </TD><TD>Fit (non-linear) failed (non-converge; off-edge; run to zero).</TD></TR> 617 617 <TR><TD>POOR</TD> <TD>0x00000010</TD><TD>16 </TD><TD>Fit succeeds, but low-S/N, high-Chisq, or large (for PSF -- drop?).</TD></TR> 618 618 <TR><TD>PAIR</TD> <TD>0x00000020</TD><TD>32 </TD><TD>Source fitted with a double PSF.</TD></TR> … … 669 669 <TR><TD>DIFF_WITH_SINGLE</TD> <TD>0x00000001</TD><TD>1 </TD><TD>Difference source matched to a single positive detection.</TD></TR> 670 670 <TR><TD>DIFF_WITH_DOUBLE</TD> <TD>0x00000002</TD><TD>2 </TD><TD>Difference source matched to positive detections in both images.</TD></TR> 671 <TR><TD>MATCHED</TD> <TD>0x00000004</TD><TD>4 </TD><TD> source generated based on another image (forced photometry at source location).</TD></TR>671 <TR><TD>MATCHED</TD> <TD>0x00000004</TD><TD>4 </TD><TD>Source generated based on another image (forced photometry at source location).</TD></TR> 672 672 <TR><TD>ON_SPIKE</TD> <TD>0x00000008</TD><TD>8 </TD><TD>More than 25% of (PSF-weighted) pixels land on diffraction spike.</TD></TR> 673 673 <TR><TD>ON_STARCORE</TD> <TD>0x00000010</TD><TD>16 </TD><TD>More than 25% of (PSF-weighted) pixels land on starcore.</TD></TR> … … 715 715 <TABLEDATA> 716 716 <TR><TD>DEFAULT</TD> <TD>0x00000000</TD><TD>0 </TD><TD>Initial value; resets all bits.</TD></TR> 717 <TR><TD>NOCAL</TD> <TD>0x00000001</TD><TD>1 </TD><TD>Detection ignored for this analysis (photcode ,time range) -- internal only.</TD></TR>717 <TR><TD>NOCAL</TD> <TD>0x00000001</TD><TD>1 </TD><TD>Detection ignored for this analysis (photcode; time range) -- internal only.</TD></TR> 718 718 <TR><TD>POOR_PHOTOM</TD> <TD>0x00000002</TD><TD>2 </TD><TD>Detection is photometry outlier.</TD></TR> 719 719 <TR><TD>SKIP_PHOTOM</TD> <TD>0x00000004</TD><TD>4 </TD><TD>Detection was ignored for photometry measurement.</TD></TR> … … 770 770 <TR><TD>FEW</TD> <TD>0x00000001</TD><TD>1 </TD><TD>Used within relphot; skip star.</TD></TR> 771 771 <TR><TD>POOR</TD> <TD>0x00000002</TD><TD>2 </TD><TD>Used within relphot; skip star.</TD></TR> 772 <TR><TD>ICRF_QSO</TD> <TD>0x00000004</TD><TD>4 </TD><TD> object IDed with known ICRF quasar (may have ICRF position measurement)</TD></TR>773 <TR><TD>HERN_QSO_P60</TD> <TD>0x00000008</TD><TD>8 </TD><TD> identified as likely QSO (Hernitschek et al 2015), P_QSO >= 0.60</TD></TR>774 <TR><TD>HERN_QSO_P05</TD> <TD>0x00000010</TD><TD>16 </TD><TD> identified as possible QSO (Hernitschek et al 2015), P_QSO >= 0.05</TD></TR>775 <TR><TD>HERN_RRL_P60</TD> <TD>0x00000020</TD><TD>32 </TD><TD> identified as likely RR Lyra (Hernitschek et al 2015), P_RRLyra >= 0.60</TD></TR>776 <TR><TD>HERN_RRL_P05</TD> <TD>0x00000040</TD><TD>64 </TD><TD> identified as possible RR Lyra (Hernitschek et al 2015), P_RRLyra >= 0.05</TD></TR>777 <TR><TD>HERN_VARIABLE</TD> <TD>0x00000080</TD><TD>128 </TD><TD> identified as a variable based on ChiSq(Hernitschek et al 2015)</TD></TR>778 <TR><TD>TRANSIENT</TD> <TD>0x00000100</TD><TD>256 </TD><TD> identified as a non-periodic (stationary) transient</TD></TR>779 <TR><TD>HAS_SOLSYS_DET</TD> <TD>0x00000200</TD><TD>512 </TD><TD> at least one detection identified with a known solar-system object (asteroid or other).</TD></TR>780 <TR><TD>MOST_SOLSYS_DET</TD> <TD>0x00000400</TD><TD>1024 </TD><TD> most detections identified with a known solar-system object (asteroid or other).</TD></TR>781 <TR><TD>LARGE_PM</TD> <TD>0x00000800</TD><TD>2048 </TD><TD> star with large proper motion</TD></TR>782 <TR><TD>RAW_AVE</TD> <TD>0x00001000</TD><TD>4096 </TD><TD> simple weighted average position was used (no IRLS fitting)</TD></TR>783 <TR><TD>FIT_AVE</TD> <TD>0x00002000</TD><TD>8192 </TD><TD> average position was fitted</TD></TR>784 <TR><TD>FIT_PM</TD> <TD>0x00004000</TD><TD>16384 </TD><TD> proper motion model was fitted</TD></TR>785 <TR><TD>FIT_PAR</TD> <TD>0x00008000</TD><TD>32768 </TD><TD> parallax model was fitted</TD></TR>786 <TR><TD>USE_AVE</TD> <TD>0x00010000</TD><TD>65536 </TD><TD> average position used (not PM or PAR)</TD></TR>787 <TR><TD>USE_PM</TD> <TD>0x00020000</TD><TD>131072 </TD><TD> proper motion used (not AVE or PAR)</TD></TR>788 <TR><TD>USE_PAR</TD> <TD>0x00040000</TD><TD>262144 </TD><TD> parallax used (not AVE or PM)</TD></TR>789 <TR><TD>NO_MEAN_ASTROM</TD> <TD>0x00080000</TD><TD>524288 </TD><TD> mean astrometry could not be measured</TD></TR>790 <TR><TD>STACK_FOR_MEAN</TD> <TD>0x00100000</TD><TD>1048576 </TD><TD> stack position used for mean astrometry</TD></TR>791 <TR><TD>MEAN_FOR_STACK</TD> <TD>0x00200000</TD><TD>2097152 </TD><TD> mean astrometry used for stack position</TD></TR>792 <TR><TD>BAD_PM</TD> <TD>0x00400000</TD><TD>4194304 </TD><TD> failure to measure proper-motion model</TD></TR>793 <TR><TD>EXT</TD> <TD>0x00800000</TD><TD>8388608 </TD><TD> extended in our data (eg,PS)</TD></TR>794 <TR><TD>EXT_ALT</TD> <TD>0x01000000</TD><TD>16777216 </TD><TD> extended in external data (eg,2MASS)</TD></TR>795 <TR><TD>GOOD</TD> <TD>0x02000000</TD><TD>33554432 </TD><TD> good-quality measurement in our data (eg,PS)</TD></TR>796 <TR><TD>GOOD_ALT</TD> <TD>0x04000000</TD><TD>67108864 </TD><TD> good-quality measurement in external data (eg,2MASS)</TD></TR>797 <TR><TD>GOOD_STACK</TD> <TD>0x08000000</TD><TD>134217728 </TD><TD> good-quality object in the stack (> 1 good stack measurement)</TD></TR>798 <TR><TD>BEST_STACK</TD> <TD>0x10000000</TD><TD>268435456 </TD><TD> the primary stack measurements are the best measurements</TD></TR>799 <TR><TD>SUSPECT_STACK</TD> <TD>0x20000000</TD><TD>536870912 </TD><TD> suspect object in the stack (no more than 1 good measurement, 2 or more suspect or good stack measurement)</TD></TR>800 <TR><TD>BAD_STACK</TD> <TD>0x40000000</TD><TD>1073741824 </TD><TD> poor-quality stack object (no more than 1 good or suspect measurement)</TD></TR>772 <TR><TD>ICRF_QSO</TD> <TD>0x00000004</TD><TD>4 </TD><TD>Object IDed with known ICRF quasar (may have ICRF position measurement)</TD></TR> 773 <TR><TD>HERN_QSO_P60</TD> <TD>0x00000008</TD><TD>8 </TD><TD>Identified as likely QSO (Hernitschek et al 2015), P_QSO >= 0.60</TD></TR> 774 <TR><TD>HERN_QSO_P05</TD> <TD>0x00000010</TD><TD>16 </TD><TD>Identified as possible QSO (Hernitschek et al 2015), P_QSO >= 0.05</TD></TR> 775 <TR><TD>HERN_RRL_P60</TD> <TD>0x00000020</TD><TD>32 </TD><TD>Identified as likely RR Lyra (Hernitschek et al 2015), P_RRLyra >= 0.60</TD></TR> 776 <TR><TD>HERN_RRL_P05</TD> <TD>0x00000040</TD><TD>64 </TD><TD>Identified as possible RR Lyra (Hernitschek et al 2015), P_RRLyra >= 0.05</TD></TR> 777 <TR><TD>HERN_VARIABLE</TD> <TD>0x00000080</TD><TD>128 </TD><TD>Identified as a variable based on ChiSq? (Hernitschek et al 2015)</TD></TR> 778 <TR><TD>TRANSIENT</TD> <TD>0x00000100</TD><TD>256 </TD><TD>Identified as a non-periodic (stationary) transient</TD></TR> 779 <TR><TD>HAS_SOLSYS_DET</TD> <TD>0x00000200</TD><TD>512 </TD><TD>At least one detection identified with a known solar-system object (asteroid or other).</TD></TR> 780 <TR><TD>MOST_SOLSYS_DET</TD> <TD>0x00000400</TD><TD>1024 </TD><TD>Most detections identified with a known solar-system object (asteroid or other).</TD></TR> 781 <TR><TD>LARGE_PM</TD> <TD>0x00000800</TD><TD>2048 </TD><TD>Star with large proper motion</TD></TR> 782 <TR><TD>RAW_AVE</TD> <TD>0x00001000</TD><TD>4096 </TD><TD>Simple weighted average position was used (no IRLS fitting)</TD></TR> 783 <TR><TD>FIT_AVE</TD> <TD>0x00002000</TD><TD>8192 </TD><TD>Average position was fitted</TD></TR> 784 <TR><TD>FIT_PM</TD> <TD>0x00004000</TD><TD>16384 </TD><TD>Proper motion model was fitted</TD></TR> 785 <TR><TD>FIT_PAR</TD> <TD>0x00008000</TD><TD>32768 </TD><TD>Parallax model was fitted</TD></TR> 786 <TR><TD>USE_AVE</TD> <TD>0x00010000</TD><TD>65536 </TD><TD>Average position used (not PM or PAR)</TD></TR> 787 <TR><TD>USE_PM</TD> <TD>0x00020000</TD><TD>131072 </TD><TD>Proper motion used (not AVE or PAR)</TD></TR> 788 <TR><TD>USE_PAR</TD> <TD>0x00040000</TD><TD>262144 </TD><TD>Parallax used (not AVE or PM)</TD></TR> 789 <TR><TD>NO_MEAN_ASTROM</TD> <TD>0x00080000</TD><TD>524288 </TD><TD>Mean astrometry could not be measured</TD></TR> 790 <TR><TD>STACK_FOR_MEAN</TD> <TD>0x00100000</TD><TD>1048576 </TD><TD>Stack position used for mean astrometry</TD></TR> 791 <TR><TD>MEAN_FOR_STACK</TD> <TD>0x00200000</TD><TD>2097152 </TD><TD>Mean astrometry used for stack position</TD></TR> 792 <TR><TD>BAD_PM</TD> <TD>0x00400000</TD><TD>4194304 </TD><TD>Failure to measure proper-motion model</TD></TR> 793 <TR><TD>EXT</TD> <TD>0x00800000</TD><TD>8388608 </TD><TD>Extended in our data (eg; PS)</TD></TR> 794 <TR><TD>EXT_ALT</TD> <TD>0x01000000</TD><TD>16777216 </TD><TD>Extended in external data (eg; 2MASS)</TD></TR> 795 <TR><TD>GOOD</TD> <TD>0x02000000</TD><TD>33554432 </TD><TD>Good-quality measurement in our data (eg; PS)</TD></TR> 796 <TR><TD>GOOD_ALT</TD> <TD>0x04000000</TD><TD>67108864 </TD><TD>Good-quality measurement in external data (eg; 2MASS)</TD></TR> 797 <TR><TD>GOOD_STACK</TD> <TD>0x08000000</TD><TD>134217728 </TD><TD>Good-quality object in the stack (> 1 good stack measurement)</TD></TR> 798 <TR><TD>BEST_STACK</TD> <TD>0x10000000</TD><TD>268435456 </TD><TD>The primary stack measurements are the best measurements</TD></TR> 799 <TR><TD>SUSPECT_STACK</TD> <TD>0x20000000</TD><TD>536870912 </TD><TD>Suspect object in the stack (no more than 1 good measurement, 2 or more suspect or good stack measurement)</TD></TR> 800 <TR><TD>BAD_STACK</TD> <TD>0x40000000</TD><TD>1073741824 </TD><TD>Poor-quality stack object (no more than 1 good or suspect measurement).</TD></TR> 801 801 </TABLEDATA> 802 802 </DATA> … … 822 822 <DATA> 823 823 <TABLEDATA> 824 <TR><TD>DEFAULT</TD> <TD>0x00000000</TD><TD>0 </TD><TD>Initial value; resets all bits.</TD></TR> 825 <TR><TD>SECF_STAR_FEW</TD> <TD>0x00000001</TD><TD>1 </TD><TD>Used within relphot: skip star.</TD></TR> 826 <TR><TD>SECF_STAR_POOR</TD> <TD>0x00000002</TD><TD>2 </TD><TD>Used within relphot: skip star.</TD></TR> 827 <TR><TD>SECF_USE_SYNTH</TD> <TD>0x00000004</TD><TD>4 </TD><TD>Synthetic photometry used in average measurement.</TD></TR> 828 <TR><TD>SECF_USE_UBERCAL</TD> <TD>0x00000008</TD><TD>8 </TD><TD>Ubercal photometry used in average measurement.</TD></TR> 829 <TR><TD>SECF_HAS_PS1</TD> <TD>0x00000010</TD><TD>16 </TD><TD>PS1 photometry used in average measurement.</TD></TR> 830 <TR><TD>SECF_HAS_PS1_STACK</TD><TD>0x00000020</TD><TD>32 </TD><TD>PS1 stack photometry exists.</TD></TR> 831 832 <TR><TD>SECF_HAS_TYCHO</TD> <TD>0x00000040</TD><TD>64 </TD><TD>Tycho photometry used for synthetic magnitudes.</TD></TR> 833 <TR><TD>SECF_FIX_SYNTH</TD> <TD>0x00000080</TD><TD>128 </TD><TD>Synthetic magnitudes repaired with zeropoint map.</TD></TR> 834 835 <TR><TD>SECF_RANK_0</TD> <TD>0x00000100</TD><TD>256 </TD><TD>Average magnitude uses only rank 0 detections.</TD></TR> 836 <TR><TD>SECF_RANK_1</TD> <TD>0x00000200</TD><TD>512 </TD><TD>Average magnitude uses only rank 1 detections.</TD></TR> 837 <TR><TD>SECF_RANK_2</TD> <TD>0x00000400</TD><TD>1024 </TD><TD>Average magnitude uses only rank 2 detections.</TD></TR> 838 <TR><TD>SECF_RANK_3</TD> <TD>0x00000800</TD><TD>2048 </TD><TD>Average magnitude uses only rank 3 detections.</TD></TR> 839 <TR><TD>SECF_RANK_4</TD> <TD>0x00001000</TD><TD>4096 </TD><TD>Average magnitude uses only rank 4 detections.</TD></TR> 840 <TR><TD>SECF_STACK_PRIMARY</TD><TD>0x00004000</TD><TD>16384 </TD><TD>PS1 stack photometry comes from primary skycell.</TD></TR> 841 <TR><TD>SECF_STACK_BESTDET</TD><TD>0x00008000</TD><TD>32768 </TD><TD>PS1 stack best measurement is a detection (not forced).</TD></TR> 842 <TR><TD>SECF_STACK_PRIMDET</TD><TD>0x00010000</TD><TD>65536 </TD><TD>PS1 stack primary measurement is a detection (not forced).</TD></TR> 843 <TR><TD>SECF_HAS_SDSS</TD> <TD>0x00100000</TD><TD>1048576 </TD><TD>This photcode has SDSS photometry (EAM??).</TD></TR> 844 <TR><TD>SECF_HAS_HSC</TD> <TD>0x00200000</TD><TD>2097152 </TD><TD>This photcode has HSC photometry (EAM??).</TD></TR> 845 <TR><TD>SECF_HAS_CFH</TD> <TD>0x00400000</TD><TD>4194304 </TD><TD>This photcode has CFH photometry (mostly Megacam) (EAM??).</TD></TR> 846 <TR><TD>SECF_HAS_DES</TD> <TD>0x00800000</TD><TD>8388608 </TD><TD>This photcode has DES photometry (EAM??).</TD></TR> 847 <TR><TD>SECF_OBJ_EXT</TD> <TD>0x01000000</TD><TD>16777216 </TD><TD>Extended in this band.</TD></TR> 824 <TR><TD>DEFAULT</TD> <TD>0x00000000</TD><TD>0 </TD><TD>Initial value; resets all bits.</TD></TR> 825 <TR><TD>SECF_STAR_FEW</TD> <TD>0x00000001</TD><TD>1 </TD><TD>Used within relphot: skip star.</TD></TR> 826 <TR><TD>SECF_STAR_POOR</TD> <TD>0x00000002</TD><TD>2 </TD><TD>Used within relphot: skip star.</TD></TR> 827 <TR><TD>SECF_USE_SYNTH</TD> <TD>0x00000004</TD><TD>4 </TD><TD>Synthetic photometry used in average measurement.</TD></TR> 828 <TR><TD>SECF_USE_UBERCAL</TD> <TD>0x00000008</TD><TD>8 </TD><TD>Ubercal photometry used in average measurement.</TD></TR> 829 <TR><TD>SECF_HAS_PS1</TD> <TD>0x00000010</TD><TD>16 </TD><TD>PS1 photometry used in average measurement.</TD></TR> 830 <TR><TD>SECF_HAS_PS1_STACK</TD> <TD>0x00000020</TD><TD>32 </TD><TD>PS1 stack photometry exists.</TD></TR> 831 832 <TR><TD>SECF_HAS_TYCHO</TD> <TD>0x00000040</TD><TD>64 </TD><TD>Tycho photometry used for synthetic magnitudes.</TD></TR> 833 <TR><TD>SECF_FIX_SYNTH</TD> <TD>0x00000080</TD><TD>128 </TD><TD>Synthetic magnitudes repaired with zeropoint map.</TD></TR> 834 835 <TR><TD>SECF_RANK_0</TD> <TD>0x00000100</TD><TD>256 </TD><TD>Average magnitude calculated in 0th pass.</TD></TR> 836 <TR><TD>SECF_RANK_1</TD> <TD>0x00000200</TD><TD>512 </TD><TD>Average magnitude calculated in 1st pass.</TD></TR> 837 <TR><TD>SECF_RANK_2</TD> <TD>0x00000400</TD><TD>1024 </TD><TD>Average magnitude calculated in 2nd pass.</TD></TR> 838 <TR><TD>SECF_RANK_3</TD> <TD>0x00000800</TD><TD>2048 </TD><TD>Average magnitude calculated in 3rd pass.</TD></TR> 839 <TR><TD>SECF_RANK_4</TD> <TD>0x00001000</TD><TD>4096 </TD><TD>Average magnitude calculated in 4th pass.</TD></TR> 840 <TR><TD>SECF_STACK_PRIMARY</TD> <TD>0x00004000</TD><TD>16384 </TD><TD>PS1 stack photometry includes a primary skycell.</TD></TR> 841 <TR><TD>SECF_STACK_BESTDET</TD> <TD>0x00008000</TD><TD>32768 </TD><TD>PS1 stack best measurement is a detection (not forced).</TD></TR> 842 <TR><TD>SECF_STACK_PRIMDET</TD> <TD>0x00010000</TD><TD>65536 </TD><TD>PS1 stack primary measurement is a detection (not forced).</TD></TR> 843 <TR><TD>SECF_STACK_PRIMARY_MULTIPLE</TD><TD>0x00010000</TD><TD>65536 </TD><TD>PS1 stack object has multiple primary measurements.</TD></TR> 844 <TR><TD>SECF_HAS_SDSS</TD> <TD>0x00100000</TD><TD>1048576 </TD><TD>This photcode has SDSS photometry.</TD></TR> 845 <TR><TD>SECF_HAS_HSC</TD> <TD>0x00200000</TD><TD>2097152 </TD><TD>This photcode has HSC photometry.</TD></TR> 846 <TR><TD>SECF_HAS_CFH</TD> <TD>0x00400000</TD><TD>4194304 </TD><TD>This photcode has CFH photometry (mostly Megacam).</TD></TR> 847 <TR><TD>SECF_HAS_DES</TD> <TD>0x00800000</TD><TD>8388608 </TD><TD>This photcode has DES photometry.</TD></TR> 848 <TR><TD>SECF_OBJ_EXT</TD> <TD>0x01000000</TD><TD>16777216 </TD><TD>Extended in this band.</TD></TR> 848 849 </TABLEDATA> 849 850 </DATA> … … 869 870 <TABLEDATA> 870 871 <TR><TD>DEFAULT</TD> <TD>0x00000000</TD><TD>0 </TD><TD>Initial value; resets all bits.</TD></TR> 871 <TR><TD>QF_OBJ_EXT</TD> <TD>0x00000001</TD><TD>1 </TD><TD>Extended in our data (eg ,PS).</TD></TR>872 <TR><TD>QF_OBJ_EXT_ALT</TD> <TD>0x00000002</TD><TD>2 </TD><TD>Extended in external data (eg ,2MASS).</TD></TR>873 <TR><TD>QF_OBJ_GOOD</TD> <TD>0x00000004</TD><TD>4 </TD><TD>Good-quality measurement in our data (eg ,PS).</TD></TR>874 <TR><TD>QF_OBJ_GOOD_ALT</TD> <TD>0x00000008</TD><TD>8 </TD><TD>Good-quality measurement in external data (eg ,2MASS).</TD></TR>875 <TR><TD>QF_OBJ_GOOD_STACK</TD> <TD>0x00000010</TD><TD>16 </TD><TD> good-quality object in the stack (> 1 good stack measurement)</TD></TR>876 <TR><TD>QF_OBJ_BEST_STACK</TD> <TD>0x00000020</TD><TD>32 </TD><TD> the primary stack measurements are the best measurements.</TD></TR>877 <TR><TD>QF_OBJ_SUSPECT_STACK</TD><TD>0x00000040</TD><TD>64 </TD><TD> suspect object in the stack (no more than 1 good measurement, 2 or more suspect or good stack measurement).</TD></TR>878 <TR><TD>QF_OBJ_BAD_STACK</TD> <TD>0x00000080</TD><TD>128 </TD><TD> poor-quality stack object (no more than 1 good or suspect measurement).</TD></TR>872 <TR><TD>QF_OBJ_EXT</TD> <TD>0x00000001</TD><TD>1 </TD><TD>Extended in our data (eg; PS).</TD></TR> 873 <TR><TD>QF_OBJ_EXT_ALT</TD> <TD>0x00000002</TD><TD>2 </TD><TD>Extended in external data (eg; 2MASS).</TD></TR> 874 <TR><TD>QF_OBJ_GOOD</TD> <TD>0x00000004</TD><TD>4 </TD><TD>Good-quality measurement in our data (eg; PS).</TD></TR> 875 <TR><TD>QF_OBJ_GOOD_ALT</TD> <TD>0x00000008</TD><TD>8 </TD><TD>Good-quality measurement in external data (eg; 2MASS).</TD></TR> 876 <TR><TD>QF_OBJ_GOOD_STACK</TD> <TD>0x00000010</TD><TD>16 </TD><TD>Good-quality object in the stack (> 1 good stack measurement).</TD></TR> 877 <TR><TD>QF_OBJ_BEST_STACK</TD> <TD>0x00000020</TD><TD>32 </TD><TD>The primary stack measurements are the best measurements.</TD></TR> 878 <TR><TD>QF_OBJ_SUSPECT_STACK</TD><TD>0x00000040</TD><TD>64 </TD><TD>Suspect object in the stack (no more than 1 good measurement, 2 or more suspect or good stack measurement).</TD></TR> 879 <TR><TD>QF_OBJ_BAD_STACK</TD> <TD>0x00000080</TD><TD>128 </TD><TD>Poor-quality stack object (no more than 1 good or suspect measurement).</TD></TR> 879 880 </TABLEDATA> 880 881 </DATA> … … 900 901 <TABLEDATA> 901 902 <TR><TD>NO_ERROR</TD> <TD>0x00000000</TD><TD>0 </TD><TD>No error condition raised.</TD></TR> 902 <TR><TD>FAIL_FIT</TD> <TD>0x00000001</TD><TD>1 </TD><TD> fit failed to converge or was degenerate</TD></TR>903 <TR><TD>TOO_FEW</TD> <TD>0x00000002</TD><TD>2 </TD><TD> not enough points to fit the model</TD></TR>904 <TR><TD>OUT_OF_RANGE</TD> <TD>0x00000004</TD><TD>4 </TD><TD> fit minimum too far outside data range</TD></TR>905 <TR><TD>BAD_ERROR</TD> <TD>0x00000008</TD><TD>8 </TD><TD> invalid size error (nan or inf)</TD></TR>903 <TR><TD>FAIL_FIT</TD> <TD>0x00000001</TD><TD>1 </TD><TD>Fit failed to converge or was degenerate</TD></TR> 904 <TR><TD>TOO_FEW</TD> <TD>0x00000002</TD><TD>2 </TD><TD>Not enough points to fit the model</TD></TR> 905 <TR><TD>OUT_OF_RANGE</TD> <TD>0x00000004</TD><TD>4 </TD><TD>Fit minimum too far outside data range</TD></TR> 906 <TR><TD>BAD_ERROR</TD> <TD>0x00000008</TD><TD>8 </TD><TD>Invalid size error (nan or inf)</TD></TR> 906 907 </TABLEDATA> 907 908 </DATA> -
branches/czw_branch/20170908/ippToPsps/config/tables.OB.vot
r39255 r40483 9 9 <PARAM arraysize="1" datatype="char" ucd="meta.bib.author" name="Author" value="PSPS"></PARAM> 10 10 <FIELD name="objName" arraysize="32" datatype="char" unit="dimensionless" default="NA"> 11 <DESCRIPTION>IAU name for this object.</DESCRIPTION>12 </FIELD> 13 <FIELD name="obj PSOName" arraysize="32" datatype="char" unit="dimensionless" default="NA">14 <DESCRIPTION>Alternate Pan-STARRSname for this object.</DESCRIPTION>11 <DESCRIPTION>IAU-approved name for this object.</DESCRIPTION> 12 </FIELD> 13 <FIELD name="objNameHMS" arraysize="32" datatype="char" unit="dimensionless" default="NA"> 14 <DESCRIPTION>Alternate Sexigesimal name for this object.</DESCRIPTION> 15 15 </FIELD> 16 16 <FIELD name="objAltName1" arraysize="32" datatype="char" unit="dimensionless" default="NA"> -
branches/czw_branch/20170908/ippToPsps/config/tables.ST.vot
r39268 r40483 93 93 </FIELD> 94 94 <FIELD name="photoZero" arraysize="1" datatype="float" unit="magnitudes" default="-999"> 95 <DESCRIPTION>Locally derived photometric zero point for this stack.</DESCRIPTION> 95 <DESCRIPTION>Locally derived photometric zero point for this stack (PSF-like measurements only).</DESCRIPTION> 96 </FIELD> 97 <FIELD name="photoZeroAperture" arraysize="1" datatype="float" unit="magnitudes" default="-999"> 98 <DESCRIPTION>Locally derived photometric zero point for this stack (Aperture-like measurements only).</DESCRIPTION> 96 99 </FIELD> 97 100 <FIELD name="ctype1" arraysize="100" datatype="char" unit="dimensionless" default=""> … … 231 234 <DESCRIPTION>Information flag bitmask indicating details of the g filter stack photometry. Values listed in DetectionFlags3.</DESCRIPTION> 232 235 </FIELD> 236 <FIELD name="ginfoFlag4" arraysize="1" datatype="int" unit="dimensionless" default="0"> 237 <DESCRIPTION>Information flag bitmask indicating details of the g filter stack photometry. Values listed in ObjectFilterFlags.</DESCRIPTION> 238 </FIELD> 233 239 <FIELD name="gnFrames" arraysize="1" datatype="int" unit="dimensionless" default="-999"> 234 240 <DESCRIPTION>Number of input frames/exposures contributing to the g filter stack detection.</DESCRIPTION> … … 287 293 <DESCRIPTION>Information flag bitmask indicating details of the r filter stack photometry. Values listed in DetectionFlags3.</DESCRIPTION> 288 294 </FIELD> 295 <FIELD name="rinfoFlag4" arraysize="1" datatype="int" unit="dimensionless" default="0"> 296 <DESCRIPTION>Information flag bitmask indicating details of the r filter stack photometry. Values listed in ObjectFilterFlags.</DESCRIPTION> 297 </FIELD> 289 298 <FIELD name="rnFrames" arraysize="1" datatype="int" unit="dimensionless" default="-999"> 290 299 <DESCRIPTION>Number of input frames/exposures contributing to the r filter stack detection.</DESCRIPTION> … … 343 352 <DESCRIPTION>Information flag bitmask indicating details of the i filter stack photometry. Values listed in DetectionFlags3.</DESCRIPTION> 344 353 </FIELD> 354 <FIELD name="iinfoFlag4" arraysize="1" datatype="int" unit="dimensionless" default="0"> 355 <DESCRIPTION>Information flag bitmask indicating details of the i filter stack photometry. Values listed in ObjectFilterFlags.</DESCRIPTION> 356 </FIELD> 345 357 <FIELD name="inFrames" arraysize="1" datatype="int" unit="dimensionless" default="-999"> 346 358 <DESCRIPTION>Number of input frames/exposures contributing to the i filter stack detection.</DESCRIPTION> … … 399 411 <DESCRIPTION>Information flag bitmask indicating details of the z filter stack photometry. Values listed in DetectionFlags3.</DESCRIPTION> 400 412 </FIELD> 413 <FIELD name="zinfoFlag4" arraysize="1" datatype="int" unit="dimensionless" default="0"> 414 <DESCRIPTION>Information flag bitmask indicating details of the z filter stack photometry. Values listed in ObjectFilterFlags.</DESCRIPTION> 415 </FIELD> 401 416 <FIELD name="znFrames" arraysize="1" datatype="int" unit="dimensionless" default="-999"> 402 417 <DESCRIPTION>Number of input frames/exposures contributing to the z filter stack detection.</DESCRIPTION> … … 454 469 <FIELD name="yinfoFlag3" arraysize="1" datatype="int" unit="dimensionless" default="0"> 455 470 <DESCRIPTION>Information flag bitmask indicating details of the y filter stack photometry. Values listed in DetectionFlags3.</DESCRIPTION> 471 </FIELD> 472 <FIELD name="yinfoFlag4" arraysize="1" datatype="int" unit="dimensionless" default="0"> 473 <DESCRIPTION>Information flag bitmask indicating details of the y filter stack photometry. Values listed in ObjectFilterFlags.</DESCRIPTION> 456 474 </FIELD> 457 475 <FIELD name="ynFrames" arraysize="1" datatype="int" unit="dimensionless" default="-999"> … … 463 481 </TABLE> 464 482 465 <!-- StackObjectAttributes eTable ************************************************** -->483 <!-- StackObjectAttributes Table ************************************************** --> 466 484 <TABLE name="StackObjectAttributes"> 467 485 <DESCRIPTION>Contains the PSF, Kron (1980), and aperture fluxes for all filters in a single row, along with point-source object shape parameters. See StackObjectThin table for discussion of primary, secondary, and best detections. References: Kron, R. G. 1980, ApJS, 43, 305.</DESCRIPTION> … … 587 605 </FIELD> 588 606 <FIELD name="gzp" arraysize="1" datatype="float" unit="magnitudes" default="0"> 589 <DESCRIPTION>Photometric zeropoint for the g filter stack. Necessary for converting listed fluxes and magnitudes back to measured ADU counts.</DESCRIPTION> 607 <DESCRIPTION>Photometric zeropoint for the g filter stack (PSF-like magnitudes only). Necessary for converting listed fluxes and magnitudes back to measured ADU counts.</DESCRIPTION> 608 </FIELD> 609 <FIELD name="gzpAPER" arraysize="1" datatype="float" unit="magnitudes" default="0"> 610 <DESCRIPTION>Photometric zeropoint for the g filter stack (APERTURE-like magnitudes only). Necessary for converting listed fluxes and magnitudes back to measured ADU counts.</DESCRIPTION> 590 611 </FIELD> 591 612 <FIELD name="gPlateScale" arraysize="1" datatype="float" unit="arcsec/pixel" default="0"> … … 694 715 </FIELD> 695 716 <FIELD name="rzp" arraysize="1" datatype="float" unit="magnitudes" default="0"> 696 <DESCRIPTION>Photometric zeropoint for the r filter stack. Necessary for converting listed fluxes and magnitudes back to measured ADU counts.</DESCRIPTION> 717 <DESCRIPTION>Photometric zeropoint for the r filter stack (PSF-like magnitudes only). Necessary for converting listed fluxes and magnitudes back to measured ADU counts.</DESCRIPTION> 718 </FIELD> 719 <FIELD name="rzpAPER" arraysize="1" datatype="float" unit="magnitudes" default="0"> 720 <DESCRIPTION>Photometric zeropoint for the r filter stack (APERTURE-like magnitudes only). Necessary for converting listed fluxes and magnitudes back to measured ADU counts.</DESCRIPTION> 697 721 </FIELD> 698 722 <FIELD name="rPlateScale" arraysize="1" datatype="float" unit="arcsec/pixel" default="0"> … … 801 825 </FIELD> 802 826 <FIELD name="izp" arraysize="1" datatype="float" unit="magnitudes" default="0"> 803 <DESCRIPTION>Photometric zeropoint for the i filter stack. Necessary for converting listed fluxes and magnitudes back to measured ADU counts.</DESCRIPTION> 827 <DESCRIPTION>Photometric zeropoint for the i filter stack (PSF-like magnitudes only). Necessary for converting listed fluxes and magnitudes back to measured ADU counts.</DESCRIPTION> 828 </FIELD> 829 <FIELD name="izpAPER" arraysize="1" datatype="float" unit="magnitudes" default="0"> 830 <DESCRIPTION>Photometric zeropoint for the i filter stack (APERTURE-like magnitudes only). Necessary for converting listed fluxes and magnitudes back to measured ADU counts.</DESCRIPTION> 804 831 </FIELD> 805 832 <FIELD name="iPlateScale" arraysize="1" datatype="float" unit="arcsec/pixel" default="0"> … … 908 935 </FIELD> 909 936 <FIELD name="zzp" arraysize="1" datatype="float" unit="magnitudes" default="0"> 910 <DESCRIPTION>Photometric zeropoint for the z filter stack. Necessary for converting listed fluxes and magnitudes back to measured ADU counts.</DESCRIPTION> 937 <DESCRIPTION>Photometric zeropoint for the z filter stack (PSF-like magnitudes only). Necessary for converting listed fluxes and magnitudes back to measured ADU counts.</DESCRIPTION> 938 </FIELD> 939 <FIELD name="zzpAPER" arraysize="1" datatype="float" unit="magnitudes" default="0"> 940 <DESCRIPTION>Photometric zeropoint for the z filter stack (APERTURE-like magnitudes only). Necessary for converting listed fluxes and magnitudes back to measured ADU counts.</DESCRIPTION> 911 941 </FIELD> 912 942 <FIELD name="zPlateScale" arraysize="1" datatype="float" unit="arcsec/pixel" default="0"> … … 1015 1045 </FIELD> 1016 1046 <FIELD name="yzp" arraysize="1" datatype="float" unit="magnitudes" default="0"> 1017 <DESCRIPTION>Photometric zeropoint for the y filter stack. Necessary for converting listed fluxes and magnitudes back to measured ADU counts.</DESCRIPTION> 1047 <DESCRIPTION>Photometric zeropoint for the y filter stack (PSF-like magnitudes only). Necessary for converting listed fluxes and magnitudes back to measured ADU counts.</DESCRIPTION> 1048 </FIELD> 1049 <FIELD name="yzpAPER" arraysize="1" datatype="float" unit="magnitudes" default="0"> 1050 <DESCRIPTION>Photometric zeropoint for the y filter stack (APERTURE-like magnitudes only). Necessary for converting listed fluxes and magnitudes back to measured ADU counts.</DESCRIPTION> 1018 1051 </FIELD> 1019 1052 <FIELD name="yPlateScale" arraysize="1" datatype="float" unit="arcsec/pixel" default="0"> … … 4790 4823 </FIELD> 4791 4824 <FIELD name="zp" arraysize="1" datatype="float" unit="magnitudes" default="0"> 4792 <DESCRIPTION>Photometric zeropoint . Necessary for converting listed fluxes and magnitudes back to measured ADU counts.</DESCRIPTION>4825 <DESCRIPTION>Photometric zeropoint of frame/exposure. Necessary for converting listed fluxes and magnitudes back to measured ADU counts.</DESCRIPTION> 4793 4826 </FIELD> 4794 4827 <FIELD name="expTime" arraysize="1" datatype="float" unit="seconds" default="-999"> -
branches/czw_branch/20170908/ippToPsps/jython/batch.py
r39785 r40483 68 68 raise 69 69 else: 70 logger.errorPair("missing fits item ?", str(id))70 logger.errorPair("missing fits item for batch ID" + str(id), "continue") 71 71 72 72 # define the dvo table names -
branches/czw_branch/20170908/ippToPsps/jython/detectionbatch.py
r39544 r40483 60 60 meta = self.gpc1Db.getCameraStageMeta(self.id) 61 61 if not meta: 62 self.logger.errorPair("Could not get", "camera metadata") 63 raise 62 self.logger.infoPair("Could not get camera metadata", "trying with no warp id") 63 meta = self.gpc1Db.getCameraStageMetaNoWarpID(self.id) 64 if not meta: 65 self.logger.errorPair("Could not get camera metadata", "now what?") 66 raise 67 64 68 65 69 # set a flag indicating that we have the new columns added in version 5 of the … … 80 84 self.chipID = meta[6]; 81 85 self.warpID = meta[7]; 82 86 87 83 88 if not self.analysisVer: self.analysisVer = -999 84 89 … … 815 820 sqlLine.group("a.ra", "b.ra") 816 821 sqlLine.group("a.dec", "b.dec_") 817 sqlLine.group("a.zp", "b.zp ")822 sqlLine.group("a.zp", "b.zpPSF") 818 823 sqlLine.group("a.telluricExt", "b.telluricExt") 819 824 sqlLine.group("a.airmass", "b.airmass") 820 825 sqlLine.group("a.infoFlag3", "b.flags") 821 826 sqlLine.group("a.expTime", "b.expTime") 822 sqlLine.group("a.psfFlux", "a.psfFlux * b.zpFactor ")823 sqlLine.group("a.psfFluxErr", "a.psfFluxErr * b.zpFactor ")824 sqlLine.group("a.apFlux", "a.apFlux * b.zpFactor ")825 sqlLine.group("a.apFluxErr", "a.apFluxErr * b.zpFactor ")826 sqlLine.group("a.kronFlux", "a.kronFlux * b.zpFactor ")827 sqlLine.group("a.kronFluxErr", "a.kronFluxErr * b.zpFactor ")828 sqlLine.group("a.sky", "a.sky * b.zpFactor ")829 sqlLine.group("a.skyErr", "a.skyErr * b.zpFactor ")827 sqlLine.group("a.psfFlux", "a.psfFlux * b.zpFactorPSF") 828 sqlLine.group("a.psfFluxErr", "a.psfFluxErr * b.zpFactorPSF") 829 sqlLine.group("a.apFlux", "a.apFlux * b.zpFactorAPER") 830 sqlLine.group("a.apFluxErr", "a.apFluxErr * b.zpFactorAPER") 831 sqlLine.group("a.kronFlux", "a.kronFlux * b.zpFactorAPER") 832 sqlLine.group("a.kronFluxErr", "a.kronFluxErr * b.zpFactorAPER") 833 sqlLine.group("a.sky", "a.sky * b.zpFactorAPER") 834 sqlLine.group("a.skyErr", "a.skyErr * b.zpFactorAPER") 830 835 831 836 sql = sqlLine.makeEquals("WHERE a.ippDetectID = b.ippDetectID AND b.imageID = " + str(imageID)) 832 837 833 ## a.psfFlux = a.psfFlux * 3630.78 * POW(10.0, -0.4*b.zp ), \838 ## a.psfFlux = a.psfFlux * 3630.78 * POW(10.0, -0.4*b.zpPSF), \ 834 839 835 840 # instrumental flux vs Janskies: 836 # b. ZPis defined to include the airmass term and zero point offset from relative calibration or ubercal841 # b.zpPSF is defined to include the airmass term and zero point offset from relative calibration or ubercal 837 842 # (see dvopsps/src/insert_detections_dvopsps_catalog.c:311 838 843 # mag_AB = -2.5*log(flux_DN/sec) + ZP -
branches/czw_branch/20170908/ippToPsps/jython/diffbatch.py
r39322 r40483 457 457 sqlLine.group("a.raErr", "b.raErr") # NOTE: This is supplied above as well, is this needed?? 458 458 sqlLine.group("a.decErr", "b.decErr") # NOTE: This is supplied above as well, is this needed?? 459 sqlLine.group("a.zp", "b.zp ")459 sqlLine.group("a.zp", "b.zpPSF") 460 460 sqlLine.group("a.telluricExt", "b.telluricExt") 461 461 sqlLine.group("a.airmass", "b.airmass") … … 633 633 a.ra = b.ra, \ 634 634 a.dec = b.dec_, \ 635 a.zp = b.zp , \635 a.zp = b.zpPSF, \ 636 636 a.telluricExt = b.telluricExt, \ 637 637 a.airmass = b.airmass, \ 638 638 a.expTime = b.expTime, \ 639 639 a.DinfoFlag3 = b.flags \ 640 a.DpsfFlux = a.DpsfFlux * b.zpFactor , \641 a.DpsfFluxErr = a.DpsfFluxErr * b.zpFactor , \642 a.apFlux = a.apFlux * b.zpFactor , \643 a.apFluxErr = a.apFluxErr * b.zpFactor , \644 a.kronFlux = a.kronFlux * b.zpFactor , \645 a.kronFluxErr = a.kronFluxErr * b.zpFactor \646 a.sky = a.sky * b.zpFactor , \647 a.skyErr = a.skyErr * b.zpFactor \640 a.DpsfFlux = a.DpsfFlux * b.zpFactorPSF, \ 641 a.DpsfFluxErr = a.DpsfFluxErr * b.zpFactorPSF, \ 642 a.apFlux = a.apFlux * b.zpFactorAPER, \ 643 a.apFluxErr = a.apFluxErr * b.zpFactorAPER, \ 644 a.kronFlux = a.kronFlux * b.zpFactorAPER, \ 645 a.kronFluxErr = a.kronFluxErr * b.zpFactorAPER \ 646 a.sky = a.sky * b.zpFactorAPER, \ 647 a.skyErr = a.skyErr * b.zpFactorAPER \ 648 648 WHERE a.ippDetectID = b.ippDetectID \ 649 649 AND b.imageID = " + str(imageID) -
branches/czw_branch/20170908/ippToPsps/jython/diffobjectbatch.py
r39255 r40483 265 265 sqlLine.group("ra", "RA_MEAN") 266 266 sqlLine.group("dec_", "DEC_MEAN") 267 sqlLine.group("diffObjName", " IAU_NAME")268 sqlLine.group("diffObj PSOName", "PSO_NAME")267 sqlLine.group("diffObjName", "PSO_NAME") 268 sqlLine.group("diffObjNameHMS", "PSX_NAME") 269 269 sqlLine.group("nDetections", "'0'") 270 270 sql = sqlLine.makeRaw(") SELECT ", " FROM " + cptTableName) -
branches/czw_branch/20170908/ippToPsps/jython/dvo.py
r40011 r40483 101 101 102 102 if not self.loadImages(): 103 self.logger.debugPair("FAILED to load images", "exiting") 103 104 os._exit(1) 104 105 106 print "DONE load images (resetAllTables)" 105 107 106 108 ''' … … 145 147 self.logger.infoPair("DVO Images.dat file", "NOT up-to-date") 146 148 149 # check on the format: 150 try: 151 imagesHeaderPHU = self.readFitsHeader("PHU", path) 152 except Exception,e: 153 # print the error, wait a few secs then try again 154 print str(e) 155 self.logger.infoPair("Failed to find PHU for Images.dat", path) 156 raise 157 158 if "FORMAT" in imagesHeaderPHU: 159 fileFormat = imagesHeaderPHU["FORMAT"] 160 else: 161 self.logger.infoPair("Missing FORMAT for Images.dat", path) 162 raise 163 164 self.logger.infoPair("got FORMAT for Images.dat", fileFormat) 165 166 if not (fileFormat == "PS1_V6"): 167 self.logger.infoPair("Invalid FORMAT for Images.dat (PS1_V6)", fileFormat) 168 return False 169 147 170 self.importFits( 148 171 path, 149 "SOURCE_ID IMAGE_ID EXTERN_ID FLAGS MCAL SECZ PHOTCODE XPIX_SYS_ERR YPIX_SYS_ERR N_FIT_ASTROM MAG_SYS_ERR N_FIT_PHOTOM",172 "SOURCE_ID IMAGE_ID EXTERN_ID FLAGS MCAL_PSF MCAL_APER SECZ PHOTCODE XPIX_SYS_ERR YPIX_SYS_ERR N_FIT_ASTROM MAG_SYS_ERR N_FIT_PHOTOM", 150 173 self.scratchDb.dvoImagesTable) 151 174 self.logger.infoPair("Adding primary key to", self.scratchDb.dvoImagesTable) … … 559 582 self.logger.debugPair("Reading IPP table", table.name) 560 583 table = stilts.tpipe(table, cmd='explodeall') 561 #adds an index to all the tables 562 # table = stilts.tpipe(table, cmd='addcol table_index $0') 584 585 # adds an index to all the tables 586 # table = stilts.tpipe(table, cmd='addcol table_index $0') 563 587 564 588 # IPP FITS files are littered with infinity values. Remove them … … 566 590 table = stilts.tpipe(table, cmd='replaceval -Infinity null *') 567 591 table = stilts.tpipe(table, cmd='replaceval Infinity null *') 592 593 # verify that all columns in 'columns' exist in the tabl 594 ## myColumns = table.columns() 595 ## for wcol in columns: 596 ## foundCol = False 597 ## for tcol in myColumns: 598 ## if (wcol == tcol.name): 599 ## print "found wcol " + wcol 600 ## foundCol = True; 601 ## break 602 ## if not foundCol: 568 603 569 604 attempts = 0 … … 575 610 table.cmd_keepcols(columns).write(self.scratchDb.url + '#' + tableName) 576 611 break 577 except: 578 # wait a few secs then try again 612 except Exception,e: 613 # print the error, wait a few secs then try again 614 print str(e) 579 615 time.sleep(2) 580 616 attempts = attempts + 1 … … 663 699 664 700 ''' 701 Find and read a header extension. 702 ''' 703 def readFitsHeader(self, extname, filename): 704 705 cmd = "fhead -n %s %s" % (extname, filename) 706 p = Popen(cmd, shell=True, stdout=PIPE) 707 output = p.communicate()[0] 708 709 header = {} 710 711 # split the output header bytes into key/value pairs for each 80-byte line 712 for i in range(0, len(output), 80): 713 # print "line %d : %s" % (i, output[i:i+80]) 714 record = output[i:i+80] 715 716 match = re.match('^(HIERARCH )*([a-zA-Z0-9-_\.]+)\s*=\s+\'*([a-zA-Z0-9-+_\.:\s@#\(\)\,]+)\'*\\/*', record) 717 718 if match: 719 param = match.group(2) 720 value = match.group(3).strip() 721 if value == "NaN": value = "NULL" 722 header[param] = value 723 724 return header 725 726 ''' 665 727 ingest skyregion into MySQL database using the native DVO program dvopsps 666 728 Populates dvoDetections and dvoDone with FITS tables from DVO for the defined sky area, this … … 688 750 689 751 # make sure we have an up-to-date Images table 690 self.loadImages() # this is in nativeIngestDetections (remove?) 752 if not self.loadImages(): # this is in nativeIngestDetections (remove?) 753 self.logger.debugPair("FAILED to load images", "exiting") 754 os._exit(1) 755 756 print "DONE load images (nativeIngestDetections)" 691 757 692 758 # the box dimensions are the area used to select the items of -
branches/czw_branch/20170908/ippToPsps/jython/dvodetections.py
r39007 r40483 24 24 25 25 super(DvoDetections, self).__init__(logger, config, skychunk, ippToPspsDb, scratchDb, gpc1Db) 26 26 27 print "----- DvoDetections is not used, is it?? -----" 27 28 os._exit(1) -
branches/czw_branch/20170908/ippToPsps/jython/dvodiffdetections.py
r38883 r40483 14 14 ''' 15 15 A class for ingesting DVO detections into MySQL 16 XXX EAM 20151029 : I do not believe this class is used at all. I am poisoning it with an exit 16 17 ''' 17 18 class DvoDetections(Dvo): … … 25 26 super(DvoDetections, self).__init__(logger, config, skychunk, ippToPspsDb, scratchDb, gpc1Db) 26 27 # super(DvoDetections, self).__init__(logger, config, skychunk, ippToPspsDb, scratchDb) 28 29 print "----- DvoDetections is not used, is it?? -----" 30 os._exit(1) 27 31 28 32 # declare DVO file types of interest -
branches/czw_branch/20170908/ippToPsps/jython/dvoforcedobjects.py
r39008 r40483 48 48 cmd += " -cpt " + region 49 49 50 if self.config.test: 51 cmd += " -test-mode" 52 50 53 if self.skychunk.parallel: 51 54 if self.scratchDb.dbHost == "localhost": -
branches/czw_branch/20170908/ippToPsps/jython/forcedwarpbatch.py
r40011 r40483 424 424 # self.selectDvoObjIDs() 425 425 self.logger.infoPair("inserting dvo info: find imageID", "from externID") 426 imageID = self.scratchDb.getImageIDFromExternIDandPhotcodeRange(self.warpSkyFileID[num],12000,12500) 427 self.logger.infoPair("I don't like this", "it is hardwired to gpc1") 426 427 # get the imageID: this code has cases for simtest vs gpc1 cameras 428 # if self.config.test: 429 self.logger.infoPair("current camera is", self.config.camera) 430 if self.config.camera == "gpc1": 431 self.logger.infoPair("I don't like this", "it is hardwired to gpc1") 432 imageID = self.scratchDb.getImageIDFromExternIDandPhotcodeRange(self.warpSkyFileID[num],12000,12500) 433 if self.config.camera == "simtest": 434 imageID = self.scratchDb.getImageIDFromExternIDandPhotcodeRange(self.warpSkyFileID[num],15100,15500) 435 if imageID == 0: 436 self.logger.infoPair ("failed to get imageID for", str(num)) 437 raise 438 428 439 self.logger.infoPair("updating", pspsTableName) 429 440 … … 433 444 sqlLine.group("a.ippObjID", "b.ippObjID") 434 445 sqlLine.group("a.dvoRegionID","b.catID") 435 sqlLine.group("a.zp", "b.zp ")446 sqlLine.group("a.zp", "b.zpPSF") 436 447 sqlLine.group("a.telluricExt","b.telluricExt") 437 448 sqlLine.group("a.airmass", "b.airmass") 438 449 sqlLine.group("a.FinfoFlag3", "b.flags") 439 450 440 sqlLine.group("a.FpsfFlux", "a.FpsfFlux * b.zpFactor ")441 sqlLine.group("a.FpsfFluxErr", "a.FpsfFluxErr * b.zpFactor ")442 sqlLine.group("a.FapFlux", "a.FapFlux * b.zpFactor ")443 sqlLine.group("a.FapFluxErr", "a.FapFluxErr * b.zpFactor ")444 sqlLine.group("a.FkronFlux", "a.FkronFlux * b.zpFactor ")445 sqlLine.group("a.FkronFluxErr", "a.FkronFluxErr * b.zpFactor ")446 sqlLine.group("a.Fsky", "a.Fsky * b.zpFactor ")447 sqlLine.group("a.FskyErr", "a.FskyErr * b.zpFactor ")451 sqlLine.group("a.FpsfFlux", "a.FpsfFlux * b.zpFactorPSF") 452 sqlLine.group("a.FpsfFluxErr", "a.FpsfFluxErr * b.zpFactorPSF") 453 sqlLine.group("a.FapFlux", "a.FapFlux * b.zpFactorAPER") 454 sqlLine.group("a.FapFluxErr", "a.FapFluxErr * b.zpFactorAPER") 455 sqlLine.group("a.FkronFlux", "a.FkronFlux * b.zpFactorAPER") 456 sqlLine.group("a.FkronFluxErr", "a.FkronFluxErr * b.zpFactorAPER") 457 sqlLine.group("a.Fsky", "a.Fsky * b.zpFactorAPER") 458 sqlLine.group("a.FskyErr", "a.FskyErr * b.zpFactorAPER") 448 459 449 460 sql = sqlLine.makeEquals("WHERE a.ippDetectID = b.ippDetectID AND b.imageID = " +str( imageID)) … … 457 468 self.logger.infoPair("row count of ForcedWarpMeasurement after cull of null objID ", rowCountAfter) 458 469 if rowCountAfter == 0: 459 self.skipBatch = True 460 self.logger.infoPair ("skip this batch", "it is bad") 461 return False 470 if self.haveLensPSF[num] ==0: 471 self.logger.infoPair("skipping this table", "no lenspsf and no dvo, run this:") 472 self.logger.infoPair("update addRun join addProcessedExp using (add_id) set fault = 43 where add_id = ",str(self.number[num])) 473 self.skipBatch = True 474 return False 475 else: 476 self.skipBatch = True 477 self.logger.infoPair ("skip this batch", "it is bad") 478 return False 479 480 462 481 463 482 self.logger.infoPair("Adding 'row' columns to", pspsTableName) … … 557 576 558 577 sqlLine = sqlUtility("UPDATE " + pspsTableName + " as a, " + self.scratchDb.dvoDetectionTable + " as b SET ") 559 sqlLine.group("a.flxR5", "a.flxR5 * b.zpFactor ")560 sqlLine.group("a.flxR5Err", "a.flxR5Err * b.zpFactor ")561 sqlLine.group("a.flxR5Std", "a.flxR5Std * b.zpFactor ")562 563 sqlLine.group("a.flxR6", "a.flxR6 * b.zpFactor ")564 sqlLine.group("a.flxR6Err", "a.flxR6Err * b.zpFactor ")565 sqlLine.group("a.flxR6Std", "a.flxR6Std * b.zpFactor ")566 567 sqlLine.group("a.flxR7", "a.flxR7 * b.zpFactor ")568 sqlLine.group("a.flxR7Err", "a.flxR7Err * b.zpFactor ")569 sqlLine.group("a.flxR7Std", "a.flxR7Std * b.zpFactor ")578 sqlLine.group("a.flxR5", "a.flxR5 * b.zpFactorAPER") 579 sqlLine.group("a.flxR5Err", "a.flxR5Err * b.zpFactorAPER") 580 sqlLine.group("a.flxR5Std", "a.flxR5Std * b.zpFactorAPER") 581 582 sqlLine.group("a.flxR6", "a.flxR6 * b.zpFactorAPER") 583 sqlLine.group("a.flxR6Err", "a.flxR6Err * b.zpFactorAPER") 584 sqlLine.group("a.flxR6Std", "a.flxR6Std * b.zpFactorAPER") 585 586 sqlLine.group("a.flxR7", "a.flxR7 * b.zpFactorAPER") 587 sqlLine.group("a.flxR7Err", "a.flxR7Err * b.zpFactorAPER") 588 sqlLine.group("a.flxR7Std", "a.flxR7Std * b.zpFactorAPER") 570 589 571 590 sql = sqlLine.makeEquals("WHERE a.ippDetectID = b.ippDetectID AND b.imageID = " +str( imageID)) … … 657 676 # each of the "populate*" methods below add their tables to the list: 658 677 self.tablesToExport=[] 678 tables = [] # list of tables to calculate min/max objid on... 659 679 660 680 for num in self.number: … … 671 691 self.logger.infoPair("Populating", myTable) 672 692 if not self.populateForcedWarpMeasurement(num): 673 self.logger.infoPair (" skipppingForcedWarpMeasurement", str(num))693 self.logger.infoPair ("failed on ForcedWarpMeasurement", str(num)) 674 694 #continue 675 695 raise 676 696 self.tablesToExport.append(myTable) 677 678 self.logger.infoPair("setting min/max objid from", myTable) 679 self.setMinMaxObjID([myTable]) 697 tables.append(myTable) 698 #self.logger.infoPair("setting min/max objid from", myTable) 699 700 #self.setMinMaxObjID([myTable]) 680 701 681 702 # populateForcedWarpMeasurement also populates ForcedWarpMasked (from ForcedWarpMeasurement) … … 697 718 self.populateForcedWarpToImage(num) 698 719 self.tablesToExport.append(myTable) 720 self.logger.infoPair("setting min/max objid from", "all the fw tables") 721 self.setMinMaxObjID(tables) 722 self.logger.infoPair("finishing","populatePspsTables") 723 699 724 700 self.logger.infoPair("finishing","populatePspsTables")701 702 725 703 726 return True … … 762 785 self.haveLensPSF[num] = 0 763 786 self.haveLensing[num] = 0 787 764 788 for table in tables: 765 789 # check for AP_NPIX columns: missing for SAS39 -
branches/czw_branch/20170908/ippToPsps/jython/gpc1db.py
r40011 r40483 511 511 files = glob.glob(pathBase + ".cmf") 512 512 513 if len(files) < 1: 514 self.logger.errorPair("No files found for forced warp path", pathBase) 515 return None 513 516 514 if len(files) < 1: return None515 517 fits = Fits(self.logger, self.config, files[0]) 516 518 self.logger.infoPair("cmf file",files[0]) … … 760 762 761 763 meta = [] 764 765 762 766 sql = "SELECT exp_id, exp_name, camRun.dist_group, camRun.software_ver, rawExp.bg, rawExp.bg_stdev, chip_id, warp_id \ 763 767 FROM camRun \ … … 773 777 rs.first() 774 778 except: 775 self.logger.errorPair("Can't query for", "camera meta data") 776 779 self.logger.errorPair("Can't query for", "camera meta data") 777 780 try: 778 781 meta.append(rs.getInt(1)) … … 786 789 except: 787 790 self.logger.errorPair("getCameraStageMeta()", "empty meta data") 788 789 791 return meta 792 793 def getCameraStageMetaNoWarpID(self, camID): 794 795 self.logger.debug("Querying GPC1 for camera meta data") 796 797 meta = [] 798 799 800 sql = "SELECT exp_id, exp_name, camRun.dist_group, camRun.software_ver, rawExp.bg, rawExp.bg_stdev, chip_id, -999 \ 801 FROM camRun \ 802 JOIN chipRun USING(chip_id) \ 803 JOIN rawExp USING(exp_id) \ 804 LEFT JOIN fakeRun USING(cam_id) \ 805 LEFT JOIN warpRun USING(fake_id) \ 806 WHERE camRun.cam_id = %d" % camID 807 808 try: 809 rs = self.executeQuery(sql) 810 rs.first() 811 except: 812 self.logger.errorPair("Can't query for", "camera meta data") 813 try: 814 meta.append(rs.getInt(1)) 815 meta.append(rs.getString(2)) 816 meta.append(rs.getString(3)) 817 meta.append(rs.getString(4)) 818 meta.append(rs.getString(5)) 819 meta.append(rs.getString(6)) 820 meta.append(rs.getInt(7)) 821 meta.append(rs.getInt(8)) 822 except: 823 self.logger.errorPair("getCameraStageMeta()", "empty meta data") 824 825 return meta 826 827 828 790 829 791 830 ''' … … 818 857 files = [] 819 858 820 821 859 #there are a couple of states for smfversion 822 860 … … 829 867 # use (file).smf if camRun.state = 'full' and if there is only a .smf 830 868 # fault out if camRun.state != 'full' -- that is a race condition we don't want. 831 832 869 833 870 if (smfversion == "not_reproc") or (smfversion == "use_new"): … … 904 941 905 942 self.logger.infoPair("smf files:", files) 906 if len(files) < 1: return None 943 if len(files) < 1: 944 self.logger.errorPair("No files found for cam path", path) 945 return None 907 946 908 947 return Fits(self.logger, self.config, files[0]) # TODO just returning first file - check … … 974 1013 975 1014 # print "stack cmf files:", files 976 if len(files) < 1: return None 1015 if len(files) < 1: 1016 self.logger.errorPair("No files found for stack path", pathBase) 1017 return None 977 1018 978 1019 # if we get here, then the cmf is readable, now check the stack_id -
branches/czw_branch/20170908/ippToPsps/jython/ippjytest
r39304 r40483 14 14 set JARDIR = $datadir/jar 15 15 set JYDIR = $datadir/jython 16 #set JYDIR = .16 set JYDIR = . 17 17 18 18 setenv IPPTOPSPS_DATA $datadir/ipptopsps -
branches/czw_branch/20170908/ippToPsps/jython/ipptopspsdb.py
r39786 r40483 27 27 self.skychunk = skychunk 28 28 29 self.MAX_FAILS = 529 self.MAX_FAILS = 15 30 30 31 31 ''' -
branches/czw_branch/20170908/ippToPsps/jython/objectbatch.py
r39661 r40483 312 312 sqlLine.group("raMean", "RA_MEAN") 313 313 sqlLine.group("decMean", "DEC_MEAN") 314 sqlLine.group("objName", " IAU_NAME")315 sqlLine.group("obj PSOName", "PSO_NAME")314 sqlLine.group("objName", "PSO_NAME") 315 sqlLine.group("objNameHMS", "PSX_NAME") 316 316 sqlLine.group("epochMean", "EPOCH_MEAN") 317 317 sqlLine.group("raMeanErr", "RA_ERR") -
branches/czw_branch/20170908/ippToPsps/jython/queue.py
r39785 r40483 134 134 #if (dec > 85): raise 135 135 # this may be a problem for poles # HAF XXX 136 if (dec > 90): raise136 ####if (dec > 90): raise 137 137 # print "dec, dD: ", dec, dD ,self.skychunk.maxDec 138 138 … … 178 178 dec = dec + 2*dD 179 179 #if (dec > 85): raise 180 if (dec > 90): raise180 ###if (dec > 90): raise 181 181 #dR = 0.5*self.skychunk.boxSize / math.cos(math.radians(dec)) 182 182 dR = 0.5*self.skychunk.boxSize -
branches/czw_branch/20170908/ippToPsps/jython/scratchdb.py
r40011 r40483 271 271 zeroPoint = -999 272 272 273 sql = "SELECT MCAL, SECZ, C_LAM, K FROM %s AS a JOIN %s as b WHERE EXTERN_ID = %s AND a.PHOTCODE = b.CODE" % (self.dvoImagesTable, self.dvoPhotcodesTable, (externID)) 273 # MCAL_PSF, MCAL_APER, SECZ are from dvoImagesTabl 274 # C_LAM, K are from dvoPhotcodeTable 275 sql = "SELECT MCAL_PSF, SECZ, C_LAM, K FROM %s AS a JOIN %s as b WHERE EXTERN_ID = %s AND a.PHOTCODE = b.CODE" % (self.dvoImagesTable, self.dvoPhotcodesTable, (externID)) 274 276 rs = self.executeQuery(sql) 275 277 if not rs: … … 288 290 zeroPoint = 0.001*Clam + Klam*(airmass - 1.0) - Mcal 289 291 return zeroPoint 292 293 ''' 294 Gets zero point for image (PSF and APER) 295 ''' 296 def getStackZeroPoint(self, externID): 297 298 zeroPointPSF = -999 299 zeroPointAPER = -999 300 301 # MCAL_PSF, MCAL_APER, SECZ are from dvoImagesTabl 302 # C_LAM, K are from dvoPhotcodeTable 303 sql = "SELECT MCAL_PSF, MCAL_APER, SECZ, C_LAM, K FROM %s AS a JOIN %s as b WHERE EXTERN_ID = %s AND a.PHOTCODE = b.CODE" % (self.dvoImagesTable, self.dvoPhotcodesTable, (externID)) 304 rs = self.executeQuery(sql) 305 if not rs: 306 print "missing result set for imageID query" 307 os._exit(2) 308 309 if not rs.first(): 310 self.logger.infoPair("no zero point; image is missing, externID: ", externID) 311 return zeroPoint 312 313 McalPSF = rs.getFloat(1) 314 McalAPER = rs.getFloat(2) 315 airmass = rs.getFloat(3) 316 Clam = rs.getFloat(4) 317 Klam = rs.getFloat(5) 318 319 zeroPointPSF = 0.001*Clam + Klam*(airmass - 1.0) - McalPSF 320 zeroPointAPER = 0.001*Clam + Klam*(airmass - 1.0) - McalAPER 321 return (zeroPointPSF, zeroPointAPER) 290 322 291 323 ''' … … 576 608 EXTERN_ID INT, \ 577 609 FLAGS INT, \ 578 MCAL FLOAT, \ 610 MCAL_PSF FLOAT, \ 611 MCAL_APER FLOAT, \ 579 612 SECZ FLOAT, \ 580 613 PHOTCODE SMALLINT, \ … … 607 640 raErr FLOAT, \ 608 641 decErr FLOAT, \ 609 zp FLOAT, \ 610 zpFactor FLOAT, \ 642 zpPSF FLOAT, \ 643 zpFactorPSF FLOAT, \ 644 zpAPER FLOAT, \ 645 zpFactorAPER FLOAT, \ 611 646 telluricExt FLOAT, \ 612 647 airmass FLOAT, \ … … 620 655 flags INT, \ 621 656 objflags INT, \ 657 filtflags INT, \ 622 658 PRIMARY KEY (imageID, ippDetectID), \ 623 659 KEY (objID, detectID), \ -
branches/czw_branch/20170908/ippToPsps/jython/stackbatch.py
r39764 r40483 307 307 308 308 # zp correction should comes from DVO (unless image is not in DVO) 309 zpImage = self.scratchDb.getImageZeroPoint(stackID) 310 311 if (zpImage == "NULL"): 312 zpImage = zp 309 (zpImagePSF, zpImageAPER) = self.scratchDb.getStackZeroPoint(stackID) 310 311 # zp is the value in the header, zpImage includes the McalPSF value from DVO 312 if (zpImagePSF == "NULL"): zpImagePSF = zp 313 if (zpImageAPER == "NULL"): zpImageAPER = zpImagePSF 313 314 314 315 detectionThreshold = "NULL" 315 if (magref != "NULL") and (zpImage != "NULL") and (expTime != "NULL"):316 detectionThreshold = magref + zpImage + 2.5 * math.log10(expTime)316 if (magref != "NULL") and (zpImagePSF != "NULL") and (expTime != "NULL"): 317 detectionThreshold = magref + zpImagePSF + 2.5 * math.log10(expTime) 317 318 318 319 # insert stack metadata into table … … 340 341 # sqlLine.group("psfFwhm_max", fwhm_maj_uq) 341 342 sqlLine.group("astroScat", astroscat) 342 sqlLine.group("photoZero", zpImage) 343 sqlLine.group("photoZero", zpImagePSF) 344 sqlLine.group("photoZeroAperture", zpImageAPER) 343 345 sqlLine.group("photoScat", zpErr) 344 346 sqlLine.group("nAstroRef", header['NASTRO']) … … 429 431 sqlLine.group("a."+filter+"Epoch", str(stackEpoch)) 430 432 431 sqlLine.group("a."+filter+"PSFMag", "b.Mpsf") 433 # the Mag values below are set in dvopsps/insert_detections_dvopsps_catalog.c using either zpPSF (PSFMag) or zpAPER (KronMag, ApMag) 434 sqlLine.group("a."+filter+"PSFMag", "b.Mpsf") 432 435 sqlLine.group("a."+filter+"PSFMagErr", "b.dMpsf") 433 436 sqlLine.group("a."+filter+"KronMag", "b.Mkron") … … 440 443 441 444 sqlLine.group("a."+filter+"infoFlag3", "b.flags") 445 sqlLine.group("a."+filter+"infoFlag4", "b.filtflags") 442 446 sql = sqlLine.makeEquals("WHERE a.objID = b.objID AND a." + filter + "ippDetectID = b.ippDetectID AND b.imageID = " + str(imageID)) 443 447 … … 557 561 sqlLine = sqlUtility("UPDATE " + tablename + " AS a, " + self.scratchDb.dvoDetectionTable + " as b SET") 558 562 sqlLine.group("a."+filter+"expTime", "b.expTime") 559 sqlLine.group("a."+filter+"zp", "b.zp") 560 sqlLine.group("a."+filter+"PSFFlux", "a."+filter+"PSFFlux * b.zpFactor") 561 sqlLine.group("a."+filter+"PSFFluxErr", "a."+filter+"PSFFluxErr * b.zpFactor") 562 sqlLine.group("a."+filter+"ApFlux", "a."+filter+"ApFlux * b.zpFactor") 563 sqlLine.group("a."+filter+"ApFluxErr", "a."+filter+"ApFluxErr * b.zpFactor") 564 sqlLine.group("a."+filter+"KronFlux", "a."+filter+"KronFlux * b.zpFactor") 565 sqlLine.group("a."+filter+"KronFluxErr", "a."+filter+"KronFluxErr * b.zpFactor") 566 567 sqlLine.group("a."+filter+"sky", "a."+filter+"sky * b.zpFactor") 568 sqlLine.group("a."+filter+"skyErr", "a."+filter+"skyErr * b.zpFactor") 563 sqlLine.group("a."+filter+"zp", "b.zpPSF") 564 sqlLine.group("a."+filter+"zpAPER", "b.zpAPER") 565 sqlLine.group("a."+filter+"PSFFlux", "a."+filter+"PSFFlux * b.zpFactorPSF") 566 sqlLine.group("a."+filter+"PSFFluxErr", "a."+filter+"PSFFluxErr * b.zpFactorPSF") 567 sqlLine.group("a."+filter+"ApFlux", "a."+filter+"ApFlux * b.zpFactorAPER") 568 sqlLine.group("a."+filter+"ApFluxErr", "a."+filter+"ApFluxErr * b.zpFactorAPER") 569 sqlLine.group("a."+filter+"KronFlux", "a."+filter+"KronFlux * b.zpFactorAPER") 570 sqlLine.group("a."+filter+"KronFluxErr", "a."+filter+"KronFluxErr * b.zpFactorAPER") 571 572 sqlLine.group("a."+filter+"sky", "a."+filter+"sky * b.zpFactorAPER") 573 sqlLine.group("a."+filter+"skyErr", "a."+filter+"skyErr * b.zpFactorAPER") 569 574 570 575 # where should these go? … … 700 705 imageID = self.imageIDs[filter] 701 706 self.logger.infoPair("selecting imageID", imageID) 707 708 # NOTE: for model magnitudes, we use zpPSF not zpAPER since they are PSF-matched 709 # (maybe that is the wrong solution?) 702 710 703 711 # model calibrated magnitude = instrumental magnitude + 2.5*log10(exptime) + ZP (added below from dvoDetectionTable) … … 765 773 sqlLine = sqlUtility("UPDATE " + tablename + " AS a, " + self.scratchDb.dvoDetectionTable + " as b SET") 766 774 767 sqlLine.group("a." + filter + model + "Mag", "a." + filter + model + "Mag + b.zp ")775 sqlLine.group("a." + filter + model + "Mag", "a." + filter + model + "Mag + b.zpPSF") 768 776 769 777 sql = sqlLine.makeEquals("WHERE a.objID = b.objID AND a." + filter + "ippDetectID = b.ippDetectID AND b.imageID = " + str(imageID)) … … 884 892 # PETRO_MAG is instrumental + 2.5log(exptime) + FPA.ZP 885 893 # we want to apply the DVO zero point, so remove FPA.ZP: 886 ## XXX is this statement true: is FPA.ZP + 2.5log(exptime) applied to PETRO_MAG?887 894 888 895 hdrZP = str(self.zpImage[filter]) … … 897 904 sqlLine.group("a."+filter+"haveData", "'1'") 898 905 899 sqlLine.group("a." + filter + "petMag", "b.PETRO_MAG - " + hdrZP) 906 sqlLine.group("a." + filter + "petMag", "b.PETRO_MAG - " + hdrZP) # note that this is **subtracting** the hdrZP (zpAPER is added in below) 900 907 sqlLine.group("a." + filter + "petMagErr", "1.0 / b.PETRO_MAG_ERR") # still inverted? (yes) 901 908 … … 913 920 # modify petMag to apply the zero point 914 921 sqlLine = sqlUtility("UPDATE " + tablename + " AS a, " + self.scratchDb.dvoDetectionTable + " as b SET") 915 sqlLine.group("a." + filter + "petMag", "a." + filter + "petMag + b.zp ")922 sqlLine.group("a." + filter + "petMag", "a." + filter + "petMag + b.zpAPER") 916 923 sql = sqlLine.makeEquals("WHERE a.objID = b.objID AND a." + filter + "ippDetectID = b.ippDetectID AND b.imageID = " + str(imageID)) 917 924 … … 1019 1026 # care of this, but does not? 1020 1027 1021 sqlLine = sqlUtility("UPDATE " + tablename + " SET") 1022 for radius in [1, 2, 3, 4, 5, 6, 7, 8, 9]: 1023 if radius < minRadius: continue 1024 if radius > maxRadius: continue 1025 pspsRadius = radius + 2 1026 sqlLine.group(filter + prefix + "flxR" + str(pspsRadius), "-999") 1027 sqlLine.group(filter + prefix + "flxR" + str(pspsRadius) + "Err", "-999") 1028 sqlLine.group(filter + prefix + "flxR" + str(pspsRadius) + "Std", "-999") 1029 sqlLine.group(filter + prefix + "flxR" + str(pspsRadius) + "Fill", "-999") 1030 1031 sql = sqlLine.makeEquals("") 1032 1033 try: self.scratchDb.execute(sql) 1034 except: 1035 self.logger.errorPair('failed sql',sql) 1036 raise 1028 # chopping this out to see if it still works 1029 1030 #sqlLine = sqlUtility("UPDATE " + tablename + " SET") 1031 #for radius in [1, 2, 3, 4, 5, 6, 7, 8, 9]: 1032 # if radius < minRadius: continue 1033 # if radius > maxRadius: continue 1034 # pspsRadius = radius + 2 1035 # sqlLine.group(filter + prefix + "flxR" + str(pspsRadius), "-999") 1036 # sqlLine.group(filter + prefix + "flxR" + str(pspsRadius) + "Err", "-999") 1037 # sqlLine.group(filter + prefix + "flxR" + str(pspsRadius) + "Std", "-999") 1038 # sqlLine.group(filter + prefix + "flxR" + str(pspsRadius) + "Fill", "-999")# 1039 1040 #sql = sqlLine.makeEquals("") 1041 1042 # try: self.scratchDb.execute(sql) 1043 # except: 1044 # self.logger.errorPair('failed sql',sql) 1045 # raise 1037 1046 1038 1047 # set the flux values from the cmf file … … 1110 1119 pspsNum = str(int(number) + 2) 1111 1120 field = filter + prefix + "flxR" + pspsNum 1112 sqlLine.group(field, field + " * b.zpFactor ")1113 sqlLine.group(field + "Err", field + "err" + " * b.zpFactor ")1114 sqlLine.group(field + "Std", field + "Std" + " * b.zpFactor ")1121 sqlLine.group(field, field + " * b.zpFactorAPER") 1122 sqlLine.group(field + "Err", field + "err" + " * b.zpFactorAPER") 1123 sqlLine.group(field + "Std", field + "Std" + " * b.zpFactorAPER") 1115 1124 1116 1125 sql = sqlLine.makeEquals("WHERE a.objID = b.objID AND a." + filter + "ippDetectID = b.ippDetectID AND b.imageID = " + str(imageID)) … … 1120 1129 self.logger.infoPair("failed sql",sql) 1121 1130 raise 1131 1122 1132 ''' 1123 1133 Populates the StackToImage table -
branches/czw_branch/20170908/ippToPsps/jython/testCode.py
r39134 r40483 46 46 def importIppTables(self): 47 47 48 if len(sys.argv) != 2: 49 print "USAGE: ippjython testCode.py (filename)" 50 os._exit(2) 51 52 self.filename = sys.argv[1] 53 48 54 try: 49 55 tables = stilts.treads(self.filename) … … 54 60 for table in tables: 55 61 56 print "import smftable " + table.name62 print "import table " + table.name 57 63 58 64 # need to generate an index on the IPP_IDET column 59 65 # table = stilts.tpipe(table, cmd='addcol table_index $0') 60 table = stilts.tpipe(table, cmd='explodeall') 66 try: 67 table = stilts.tpipe(table, cmd='explodeall') 68 except Exception,e: 69 # print the error, wait a few secs then try again 70 print str(e) 71 return False 61 72 62 print "read smf table " + table.name 73 try: 74 myColumns = table.columns() 75 except Exception,e: 76 # print the error, wait a few secs then try again 77 print str(e) 78 return False 79 80 print "got myColumns" 81 82 try: 83 for column in myColumns: 84 print "got column " + column.name 85 except Exception,e: 86 # print the error, wait a few secs then try again 87 print str(e) 88 return False 89 90 print "read table " + table.name 63 91 64 92 # drop any previous tables before import … … 69 97 70 98 # IPP FITS files are littered with infinities, so remove these 71 print "Removing Infinity values from all columns"72 table = stilts.tpipe(table, cmd='replaceval -Infinity null *')73 table = stilts.tpipe(table, cmd='replaceval Infinity null *')74 75 try:76 table.write(self.url + '#' + table.name)77 except:78 print "Problem writing table '" + table.name + "' to the database"79 os._exit(4)99 ## print "Removing Infinity values from all columns" 100 ## table = stilts.tpipe(table, cmd='replaceval -Infinity null *') 101 ## table = stilts.tpipe(table, cmd='replaceval Infinity null *') 102 ## 103 ## try: 104 ## table.write(self.url + '#' + table.name) 105 ## except: 106 ## print "Problem writing table '" + table.name + "' to the database" 107 ## os._exit(4) 80 108 81 109 return True … … 103 131 print "alt word1" 104 132 133 self.importIppTables() 105 134 106 135 # self.connectMysql(argv) -
branches/czw_branch/20170908/ippToPsps/test/fulltest.sh
r39165 r40483 16 16 end 17 17 setenv IPPTOPSPS_DATA $datadir/ipptopsps 18 19 set DRversion = "DR2" 20 set myScript = "none" 21 if ($DRversion == "DR1") then 22 set myScript = mkgpc1data.dvo 23 set CATDIR_CAM = catdir.cam 24 set CATDIR_STK = catdir.stk 25 set CATDIR_WRP = catdir.wrp 26 set CATDIR_DIF = catdir.dif 27 endif 28 if ($DRversion == "DR2") then 29 set myScript = mkgpc1data.dr2.dvo 30 set CATDIR_CAM = catdir.mrg 31 set CATDIR_STK = catdir.mrg 32 set CATDIR_WRP = catdir.mrg 33 set CATDIR_DIF = catdir.dif 34 endif 35 if ($DRversion == "none") then 36 echo "invalid DRversion $DRversion" 37 exit 2 38 endif 39 40 set coords = `$myScript -dump-region` 18 41 19 42 # before running this test, you must have a mysql user: … … 217 240 if ($mkgpc1) then 218 241 echo "" 219 echo " ---- mkgpc1data.dvo: creating the dvo & gpc1 database entries ----"220 mkgpc1data.dvo242 echo " ---- $myScript : creating the dvo & gpc1 database entries ----" 243 $myScript 221 244 if ($status) then 222 245 echo "failed to generate the data & dvo, quitting" … … 283 306 echo "0 " >> initbatch.dat # queue_FW 284 307 echo "0 " >> initbatch.dat # queue_FO 308 echo "0 " >> initbatch.dat # queue_FG 309 echo "0 " >> initbatch.dat # queue_GO 285 310 echo "1 " >> initbatch.dat # active 286 311 echo "0 " >> initbatch.dat # parallel … … 313 338 echo "0 " >> cambatch.dat # datastore_publish 314 339 echo "catdir.cam " >> cambatch.dat # dvo_label 315 echo "$OUTDIR/ catdir.cam" >> cambatch.dat # dvo_location316 echo " 9" >> cambatch.dat # min_ra317 echo " 11" >> cambatch.dat # max_ra318 echo " 19" >> cambatch.dat # min_dec319 echo " 21" >> cambatch.dat # max_dec340 echo "$OUTDIR/$CATDIR_CAM " >> cambatch.dat # dvo_location 341 echo "$coords[1] " >> cambatch.dat # min_ra 342 echo "$coords[2] " >> cambatch.dat # max_ra 343 echo "$coords[3] " >> cambatch.dat # min_dec 344 echo "$coords[4] " >> cambatch.dat # max_dec 320 345 echo "2 " >> cambatch.dat # box_size 321 346 echo "$OUTDIR " >> cambatch.dat # base_path … … 334 359 echo "0 " >> cambatch.dat # queue_FW 335 360 echo "0 " >> cambatch.dat # queue_FO 361 echo "0 " >> cambatch.dat # queue_FG 362 echo "0 " >> cambatch.dat # queue_GO 336 363 echo "1 " >> cambatch.dat # active 337 364 echo "0 " >> cambatch.dat # parallel … … 366 393 echo "0 " >> objectbatch.dat # datastore_publish 367 394 echo "catdir.cam " >> objectbatch.dat # dvo_label 368 echo "$OUTDIR/ catdir.cam" >> objectbatch.dat # dvo_location369 echo " 9" >> objectbatch.dat # min_ra370 echo " 11" >> objectbatch.dat # max_ra371 echo " 19" >> objectbatch.dat # min_dec372 echo " 21" >> objectbatch.dat # max_dec395 echo "$OUTDIR/$CATDIR_CAM " >> objectbatch.dat # dvo_location 396 echo "$coords[1] " >> objectbatch.dat # min_ra 397 echo "$coords[2] " >> objectbatch.dat # max_ra 398 echo "$coords[3] " >> objectbatch.dat # min_dec 399 echo "$coords[4] " >> objectbatch.dat # max_dec 373 400 echo "2 " >> objectbatch.dat # box_size 374 401 echo "$OUTDIR " >> objectbatch.dat # base_path … … 387 414 echo "0 " >> objectbatch.dat # queue_FW 388 415 echo "0 " >> objectbatch.dat # queue_FO 416 echo "0 " >> objectbatch.dat # queue_FG 417 echo "0 " >> objectbatch.dat # queue_GO 389 418 echo "1 " >> objectbatch.dat # active 390 419 echo "0 " >> objectbatch.dat # parallel … … 419 448 echo "0 " >> stackbatch.dat # datastore_publish 420 449 echo "catdir.stk " >> stackbatch.dat # dvo_label 421 echo "$OUTDIR/ catdir.stk" >> stackbatch.dat # dvo_location422 echo " 9" >> stackbatch.dat # min_ra423 echo " 11" >> stackbatch.dat # max_ra424 echo " 19" >> stackbatch.dat # min_dec425 echo " 21" >> stackbatch.dat # max_dec450 echo "$OUTDIR/$CATDIR_STK " >> stackbatch.dat # dvo_location 451 echo "$coords[1] " >> stackbatch.dat # min_ra 452 echo "$coords[2] " >> stackbatch.dat # max_ra 453 echo "$coords[3] " >> stackbatch.dat # min_dec 454 echo "$coords[4] " >> stackbatch.dat # max_dec 426 455 echo "2 " >> stackbatch.dat # box_size 427 456 echo "$OUTDIR " >> stackbatch.dat # base_path … … 440 469 echo "0 " >> stackbatch.dat # queue_FW 441 470 echo "0 " >> stackbatch.dat # queue_FO 471 echo "0 " >> stackbatch.dat # queue_FG 472 echo "0 " >> stackbatch.dat # queue_GO 442 473 echo "1 " >> stackbatch.dat # active 443 474 echo "0 " >> stackbatch.dat # parallel … … 472 503 echo "0 " >> forcebatch.dat # datastore_publish 473 504 echo "catdir.wrp " >> forcebatch.dat # dvo_label 474 echo "$OUTDIR/ catdir.wrp" >> forcebatch.dat # dvo_location475 echo " 9" >> forcebatch.dat # min_ra476 echo " 11" >> forcebatch.dat # max_ra477 echo " 19" >> forcebatch.dat # min_dec478 echo " 21" >> forcebatch.dat # max_dec505 echo "$OUTDIR/$CATDIR_WRP " >> forcebatch.dat # dvo_location 506 echo "$coords[1] " >> forcebatch.dat # min_ra 507 echo "$coords[2] " >> forcebatch.dat # max_ra 508 echo "$coords[3] " >> forcebatch.dat # min_dec 509 echo "$coords[4] " >> forcebatch.dat # max_dec 479 510 echo "2 " >> forcebatch.dat # box_size 480 511 echo "$OUTDIR " >> forcebatch.dat # base_path … … 493 524 echo "1 " >> forcebatch.dat # queue_FW 494 525 echo "0 " >> forcebatch.dat # queue_FO 526 echo "0 " >> forcebatch.dat # queue_FG 527 echo "0 " >> forcebatch.dat # queue_GO 495 528 echo "1 " >> forcebatch.dat # active 496 529 echo "0 " >> forcebatch.dat # parallel … … 525 558 echo "0 " >> forcedobjectbatch.dat # datastore_publish 526 559 echo "catdir.wrp " >> forcedobjectbatch.dat # dvo_label 527 echo "$OUTDIR/ catdir.wrp" >> forcedobjectbatch.dat # dvo_location528 echo " 9" >> forcedobjectbatch.dat # min_ra529 echo " 11" >> forcedobjectbatch.dat # max_ra530 echo " 19" >> forcedobjectbatch.dat # min_dec531 echo " 21" >> forcedobjectbatch.dat # max_dec560 echo "$OUTDIR/$CATDIR_WRP " >> forcedobjectbatch.dat # dvo_location 561 echo "$coords[1] " >> forcedobjectbatch.dat # min_ra 562 echo "$coords[2] " >> forcedobjectbatch.dat # max_ra 563 echo "$coords[3] " >> forcedobjectbatch.dat # min_dec 564 echo "$coords[4] " >> forcedobjectbatch.dat # max_dec 532 565 echo "2 " >> forcedobjectbatch.dat # box_size 533 566 echo "$OUTDIR " >> forcedobjectbatch.dat # base_path … … 546 579 echo "0 " >> forcedobjectbatch.dat # queue_FW 547 580 echo "1 " >> forcedobjectbatch.dat # queue_FO 581 echo "0 " >> forcedobjectbatch.dat # queue_FG 582 echo "0 " >> forcedobjectbatch.dat # queue_GO 548 583 echo "1 " >> forcedobjectbatch.dat # active 549 584 echo "0 " >> forcedobjectbatch.dat # parallel … … 579 614 echo "0 " >> diffbatch.dat # datastore_publish 580 615 echo "catdir.dif " >> diffbatch.dat # dvo_label 581 echo "$OUTDIR/ catdir.dif" >> diffbatch.dat # dvo_location582 echo " 9" >> diffbatch.dat # min_ra583 echo " 11" >> diffbatch.dat # max_ra584 echo " 19" >> diffbatch.dat # min_dec585 echo " 21" >> diffbatch.dat # max_dec616 echo "$OUTDIR/$CATDIR_DIF " >> diffbatch.dat # dvo_location 617 echo "$coords[1] " >> diffbatch.dat # min_ra 618 echo "$coords[2] " >> diffbatch.dat # max_ra 619 echo "$coords[3] " >> diffbatch.dat # min_dec 620 echo "$coords[4] " >> diffbatch.dat # max_dec 586 621 echo "2 " >> diffbatch.dat # box_size 587 622 echo "$OUTDIR " >> diffbatch.dat # base_path … … 600 635 echo "0 " >> diffbatch.dat # queue_FW 601 636 echo "0 " >> diffbatch.dat # queue_FO 637 echo "0 " >> diffbatch.dat # queue_FG 638 echo "0 " >> diffbatch.dat # queue_GO 602 639 echo "1 " >> diffbatch.dat # active 603 640 echo "0 " >> diffbatch.dat # parallel … … 631 668 echo "0 " >> diffobjbatch.dat # datastore_publish 632 669 echo "catdir.dif " >> diffobjbatch.dat # dvo_label 633 echo "$OUTDIR/ catdir.dif" >> diffobjbatch.dat # dvo_location634 echo " 9" >> diffobjbatch.dat # min_ra635 echo " 11" >> diffobjbatch.dat # max_ra636 echo " 19" >> diffobjbatch.dat # min_dec637 echo " 21" >> diffobjbatch.dat # max_dec670 echo "$OUTDIR/$CATDIR_DIF " >> diffobjbatch.dat # dvo_location 671 echo "$coords[1] " >> diffobjbatch.dat # min_ra 672 echo "$coords[2] " >> diffobjbatch.dat # max_ra 673 echo "$coords[3] " >> diffobjbatch.dat # min_dec 674 echo "$coords[4] " >> diffobjbatch.dat # max_dec 638 675 echo "2 " >> diffobjbatch.dat # box_size 639 676 echo "$OUTDIR " >> diffobjbatch.dat # base_path … … 652 689 echo "0 " >> diffobjbatch.dat # queue_FW 653 690 echo "0 " >> diffobjbatch.dat # queue_FO 691 echo "0 " >> diffobjbatch.dat # queue_FG 692 echo "0 " >> diffobjbatch.dat # queue_GO 654 693 echo "1 " >> diffobjbatch.dat # active 655 694 echo "0 " >> diffobjbatch.dat # parallel -
branches/czw_branch/20170908/ippToPsps/test/mkgpc1.sh
r39021 r40483 15 15 endif 16 16 17 if ("$1" == "user.sudo") then 18 if ($#argv != 4) goto usage; 19 set dbhost = $2 20 set dbuser = $3 21 set dbpass = $4 22 23 sudo mysql -h $dbhost -u root -p -e "grant all on *.* to $dbuser@"$dbhost" identified by '$dbpass'" 24 exit 0; 25 endif 26 17 27 if ("$1" == "create") then 18 28 if ($#argv < 4) goto usage; … … 28 38 # create a database with completely minimal tables needed to test 29 39 mysql -h $dbhost -u $dbuser $dbpass -e "CREATE DATABASE $dbname" 40 if ($status) then 41 echo "ERROR: failed to create mysql database $dbname ($0)" 42 echo " NOTE: before running this test, you must have a mysql user:" 43 echo " mkgpc1.sh user localhost dvo dvo (requires root password)" 44 exit 1 45 endif 30 46 mysql -h $dbhost -u $dbuser $dbpass $dbname < gpc1schema.sql 31 47 exit 0; … … 45 61 (mysql -B -h $dbhost -u $dbuser $dbpass -e "show databases" | grep ^$dbname\$) >& /dev/null 46 62 if ($status) then 47 echo " database $dbname does not yet exist"63 echo "INFO: database $dbname does not yet exist ($0)" 48 64 exit 0 49 65 endif 50 66 51 # mysql -h $dbhost -u $dbuser $dbpass $dbname -e "show tables" 67 echo mysql -B -h $dbhost -u $dbuser $dbpass $dbname -e "show tables" 68 mysql -h $dbhost -u $dbuser $dbpass $dbname -e "show tables" 52 69 mysql -h $dbhost -u $dbuser $dbpass $dbname -e "describe ippToPspsFake" >& /dev/null 53 70 if ($status) then … … 91 108 endif 92 109 110 echo mysql -B -h $dbhost -u $dbuser $dbpass $dbname -e "show tables" 93 111 set ntable = `mysql -B -h $dbhost -u $dbuser $dbpass $dbname -e "show tables" | wc -l` 94 112 echo ntable: $ntable … … 112 130 echo " delete an existing test db (enter pass 3x)" 113 131 echo "" 132 echo " mkgpc1.sh forcedelete (dbhost) (dbname) (dbuser) [dbpass]" 133 echo " delete an existing test db (enter pass 3x), even if the number of tables is wrong" 134 echo "" 114 135 echo " mkgpc1.sh user (dbhost) (dbuser) (password)" 115 136 echo " create a new user and password for the test db" 116 137 echo "" 138 echo " mkgpc1.sh user.sudo (dbhost) (dbuser) (password)" 139 echo " create a new user and password for the test db, using sudo mysql" 140 echo " (this option is needed if your mysql installation uses the auth_socket plugin" 141 echo "" 117 142 exit 2 -
branches/czw_branch/20170908/ippToPsps/test/mkgpc1data.dvo
r39165 r40483 17 17 $RA = 10.0 18 18 $DEC = 20.0 19 $SKYCELL = "skycell.1133.081" 20 $TESS_ID = "RINGS.V3" 21 $BAD_PSFQF_FRAC = 0.2 19 $SKYCELL = skycell.1133.081 20 $TESS_ID = RINGS.V3 21 $BAD_PSFQF_FRAC = 0.0 22 $ADDNOISE = "-no-noise" 23 24 # a note on double quotes and TESS_ID: 25 # since the variables TESS_ID and SKYCELL are used below to construct the list, their values should NOT be wrapped in double quotes 26 # or those double quotes are embedded in the strings in the list 27 # when TESS_ID and SKYCELL appear in mysql commands as values they need to be protected with double quotes so mysql does not 28 # interpret them as db table fields 22 29 23 30 # imagedata describes the full fake exposure set. the fields are 24 31 list imagedata 25 # exp_id stk_id filebase M_off date time warpfilefilter difffile26 1 1 $OUTDIR/test. 01 0.000 2010/01/01 01:00:00 $OUTDIR/warp.01 g $OUTDIR/diff.0127 2 1 $OUTDIR/test. 02 -0.025 2010/01/01 02:00:00 $OUTDIR/warp.02 g $OUTDIR/diff.0228 3 1 $OUTDIR/test. 03 0.025 2010/01/01 03:00:00 $OUTDIR/warp.03 g $OUTDIR/diff.0329 4 1 $OUTDIR/test. 04 0.010 2010/01/01 04:00:00 $OUTDIR/warp.04 g $OUTDIR/diff.0430 5 2 $OUTDIR/test. 05 0.000 2010/01/01 05:00:00 $OUTDIR/warp.05 g $OUTDIR/diff.0531 6 2 $OUTDIR/test. 06 -0.025 2010/01/01 06:00:00 $OUTDIR/warp.06 g $OUTDIR/diff.0632 7 2 $OUTDIR/test. 07 0.025 2010/01/01 07:00:00 $OUTDIR/warp.07 g $OUTDIR/diff.0733 8 2 $OUTDIR/test. 08 0.010 2010/01/01 08:00:00 $OUTDIR/warp.08 g $OUTDIR/diff.0834 9 3 $OUTDIR/test. 09 0.000 2010/01/01 09:00:00 $OUTDIR/warp.09 g $OUTDIR/diff.0935 10 3 $OUTDIR/test. 10 -0.025 2010/01/01 10:00:00 $OUTDIR/warp.10 g $OUTDIR/diff.1036 11 3 $OUTDIR/test. 11 0.025 2010/01/01 11:00:00 $OUTDIR/warp.11 g $OUTDIR/diff.1137 12 3 $OUTDIR/test. 12 0.010 2010/01/01 12:00:00 $OUTDIR/warp.12 g $OUTDIR/diff.1238 13 4 $OUTDIR/test. 13 -0.025 2010/01/02 01:00:00 $OUTDIR/warp.13 r $OUTDIR/diff.1339 14 4 $OUTDIR/test. 14 0.025 2010/01/02 02:00:00 $OUTDIR/warp.14 r $OUTDIR/diff.1440 15 4 $OUTDIR/test. 15 0.010 2010/01/02 03:00:00 $OUTDIR/warp.15 r $OUTDIR/diff.1541 16 4 $OUTDIR/test. 16 0.000 2010/01/02 04:00:00 $OUTDIR/warp.16 r $OUTDIR/diff.1642 17 5 $OUTDIR/test. 17 -0.025 2010/01/02 05:00:00 $OUTDIR/warp.17 r $OUTDIR/diff.1743 18 5 $OUTDIR/test. 18 0.025 2010/01/02 06:00:00 $OUTDIR/warp.18 r $OUTDIR/diff.1844 19 5 $OUTDIR/test. 19 0.010 2010/01/02 07:00:00 $OUTDIR/warp.19 r $OUTDIR/diff.1945 20 5 $OUTDIR/test. 20 0.000 2010/01/02 08:00:00 $OUTDIR/warp.20 r $OUTDIR/diff.2046 21 6 $OUTDIR/test. 21 -0.025 2010/01/02 09:00:00 $OUTDIR/warp.21 r $OUTDIR/diff.2147 22 6 $OUTDIR/test. 22 0.025 2010/01/02 10:00:00 $OUTDIR/warp.22 r $OUTDIR/diff.2248 23 6 $OUTDIR/test. 23 0.010 2010/01/02 11:00:00 $OUTDIR/warp.23 r $OUTDIR/diff.2349 24 6 $OUTDIR/test. 24 -0.020 2010/01/02 12:00:00 $OUTDIR/warp.24 r $OUTDIR/diff.2432 # exp_id stk_id filebase M_off date time warpfile filter difffile 33 1 1 $OUTDIR/test.cam 0.000 2010/01/01 01:00:00 $OUTDIR/$TESS_ID.$SKYCELL.wrp g $OUTDIR/$TESS_ID.$SKYCELL.diff 34 2 1 $OUTDIR/test.cam -0.025 2010/01/01 02:00:00 $OUTDIR/$TESS_ID.$SKYCELL.wrp g $OUTDIR/$TESS_ID.$SKYCELL.diff 35 3 1 $OUTDIR/test.cam 0.025 2010/01/01 03:00:00 $OUTDIR/$TESS_ID.$SKYCELL.wrp g $OUTDIR/$TESS_ID.$SKYCELL.diff 36 4 1 $OUTDIR/test.cam 0.010 2010/01/01 04:00:00 $OUTDIR/$TESS_ID.$SKYCELL.wrp g $OUTDIR/$TESS_ID.$SKYCELL.diff 37 5 2 $OUTDIR/test.cam 0.000 2010/01/01 05:00:00 $OUTDIR/$TESS_ID.$SKYCELL.wrp g $OUTDIR/$TESS_ID.$SKYCELL.diff 38 6 2 $OUTDIR/test.cam -0.025 2010/01/01 06:00:00 $OUTDIR/$TESS_ID.$SKYCELL.wrp g $OUTDIR/$TESS_ID.$SKYCELL.diff 39 7 2 $OUTDIR/test.cam 0.025 2010/01/01 07:00:00 $OUTDIR/$TESS_ID.$SKYCELL.wrp g $OUTDIR/$TESS_ID.$SKYCELL.diff 40 8 2 $OUTDIR/test.cam 0.010 2010/01/01 08:00:00 $OUTDIR/$TESS_ID.$SKYCELL.wrp g $OUTDIR/$TESS_ID.$SKYCELL.diff 41 9 3 $OUTDIR/test.cam 0.000 2010/01/01 09:00:00 $OUTDIR/$TESS_ID.$SKYCELL.wrp g $OUTDIR/$TESS_ID.$SKYCELL.diff 42 10 3 $OUTDIR/test.cam -0.025 2010/01/01 10:00:00 $OUTDIR/$TESS_ID.$SKYCELL.wrp g $OUTDIR/$TESS_ID.$SKYCELL.diff 43 11 3 $OUTDIR/test.cam 0.025 2010/01/01 11:00:00 $OUTDIR/$TESS_ID.$SKYCELL.wrp g $OUTDIR/$TESS_ID.$SKYCELL.diff 44 12 3 $OUTDIR/test.cam 0.010 2010/01/01 12:00:00 $OUTDIR/$TESS_ID.$SKYCELL.wrp g $OUTDIR/$TESS_ID.$SKYCELL.diff 45 13 4 $OUTDIR/test.cam -0.025 2010/01/02 01:00:00 $OUTDIR/$TESS_ID.$SKYCELL.wrp r $OUTDIR/$TESS_ID.$SKYCELL.diff 46 14 4 $OUTDIR/test.cam 0.025 2010/01/02 02:00:00 $OUTDIR/$TESS_ID.$SKYCELL.wrp r $OUTDIR/$TESS_ID.$SKYCELL.diff 47 15 4 $OUTDIR/test.cam 0.010 2010/01/02 03:00:00 $OUTDIR/$TESS_ID.$SKYCELL.wrp r $OUTDIR/$TESS_ID.$SKYCELL.diff 48 16 4 $OUTDIR/test.cam 0.000 2010/01/02 04:00:00 $OUTDIR/$TESS_ID.$SKYCELL.wrp r $OUTDIR/$TESS_ID.$SKYCELL.diff 49 17 5 $OUTDIR/test.cam -0.025 2010/01/02 05:00:00 $OUTDIR/$TESS_ID.$SKYCELL.wrp r $OUTDIR/$TESS_ID.$SKYCELL.diff 50 18 5 $OUTDIR/test.cam 0.025 2010/01/02 06:00:00 $OUTDIR/$TESS_ID.$SKYCELL.wrp r $OUTDIR/$TESS_ID.$SKYCELL.diff 51 19 5 $OUTDIR/test.cam 0.010 2010/01/02 07:00:00 $OUTDIR/$TESS_ID.$SKYCELL.wrp r $OUTDIR/$TESS_ID.$SKYCELL.diff 52 20 5 $OUTDIR/test.cam 0.000 2010/01/02 08:00:00 $OUTDIR/$TESS_ID.$SKYCELL.wrp r $OUTDIR/$TESS_ID.$SKYCELL.diff 53 21 6 $OUTDIR/test.cam -0.025 2010/01/02 09:00:00 $OUTDIR/$TESS_ID.$SKYCELL.wrp r $OUTDIR/$TESS_ID.$SKYCELL.diff 54 22 6 $OUTDIR/test.cam 0.025 2010/01/02 10:00:00 $OUTDIR/$TESS_ID.$SKYCELL.wrp r $OUTDIR/$TESS_ID.$SKYCELL.diff 55 23 6 $OUTDIR/test.cam 0.010 2010/01/02 11:00:00 $OUTDIR/$TESS_ID.$SKYCELL.wrp r $OUTDIR/$TESS_ID.$SKYCELL.diff 56 24 6 $OUTDIR/test.cam -0.020 2010/01/02 12:00:00 $OUTDIR/$TESS_ID.$SKYCELL.wrp r $OUTDIR/$TESS_ID.$SKYCELL.diff 50 57 end 51 58 52 59 list stackdata 53 # stk_id sky_id filename M_off filter forcedgalaxy54 1 1 $OUTDIR/ stack.01 0.010 g $OUTDIR/fgal.0155 2 2 $OUTDIR/ stack.02 0.020 g $OUTDIR/fgal.0256 3 3 $OUTDIR/ stack.03 0.030 g $OUTDIR/fgal.0357 4 1 $OUTDIR/ stack.04 0.025 r $OUTDIR/fgal.0458 5 2 $OUTDIR/ stack.05 0.035 r $OUTDIR/fgal.0559 6 3 $OUTDIR/ stack.06 0.045 r $OUTDIR/fgal.0660 # stk_id sky_id filename M_off filter forcedgalaxy 61 1 1 $OUTDIR/$TESS_ID.$SKYCELL.stk 0.010 g $OUTDIR/$TESS_ID.$SKYCELL.fgal 62 2 2 $OUTDIR/$TESS_ID.$SKYCELL.stk 0.020 g $OUTDIR/$TESS_ID.$SKYCELL.fgal 63 3 3 $OUTDIR/$TESS_ID.$SKYCELL.stk 0.030 g $OUTDIR/$TESS_ID.$SKYCELL.fgal 64 4 1 $OUTDIR/$TESS_ID.$SKYCELL.stk 0.025 r $OUTDIR/$TESS_ID.$SKYCELL.fgal 65 5 2 $OUTDIR/$TESS_ID.$SKYCELL.stk 0.035 r $OUTDIR/$TESS_ID.$SKYCELL.fgal 66 6 3 $OUTDIR/$TESS_ID.$SKYCELL.stk 0.045 r $OUTDIR/$TESS_ID.$SKYCELL.fgal 60 67 end 61 68 … … 67 74 mkcatdir.dif PS1_DV5 PS1_V5 68 75 insert.stack.set 76 77 exec rm -rf testdata/catdir.mrg 78 exec dvomerge -matched-tables testdata/catdir.cam into testdata/catdir.mrg 79 exec dvomerge -matched-tables testdata/catdir.stk into testdata/catdir.mrg 80 exec dvomerge -matched-tables testdata/catdir.wrp into testdata/catdir.mrg 81 82 # relphot -D CATDIR testdata/catdir.mrg -D CAMERA simtest -region 8 12 18 22 -update -vv -averages -boundary-tree tess.3pi.fits 83 exec relphot -D CATDIR testdata/catdir.mrg -D CAMERA simtest -region 8 12 18 22 -update -vv -images g,r -reset -reset-zpts -D STAR_TOOFEW 0 -boundary-tree tess.3pi.fits -cloud-limit 0.1 69 84 end 70 85 … … 75 90 $dbuser = dvo 76 91 $dbpass = dvo 77 # $dbuser = czw 78 # $dbpass = czw 79 92 93 $gscfile = `gconfig GSCFILE` 94 if ("$gscfile" == "not found") 95 echo "problem with dvo / ptolemy configuration. check ~/.ptolemyrc" 96 break 97 end 98 80 99 exec mkgpc1.sh delete $dbhost $dbname $dbuser $dbpass 81 100 exec mkgpc1.sh create $dbhost $dbname $dbuser $dbpass … … 85 104 # system-wide info 86 105 dbinsert ippToPspsFake (my_id) values (2) 87 dbinsert skycell (radeg, decdeg, tess_id, skycell_id) values ($RA, $DEC, $TESS_ID, $SKYCELL)106 dbinsert skycell (radeg, decdeg, tess_id, skycell_id) values ($RA, $DEC, "$TESS_ID", "$SKYCELL") 88 107 end 89 108 … … 110 129 $ID = $word:0 111 130 $stkID = $word:1 112 $rawfile = $word:2\.txt113 $cmffile = $word:2\.smf131 sprintf rawfile "%s.%02d.txt" $word:2 $ID 132 sprintf cmffile "%s.%02d.smf" $word:2 $ID 114 133 $offset = $word:3 115 134 sprintf myDATE "%s" $word:4 … … 172 191 173 192 mkinput $offset $rawfile 174 echo mkcmf -photcode SIMTEST.$filter.Chip -no-noise -append $rawfile $cmffile -date $myDATE -time $myTIME -mjd $mjd -radec $RA $DEC -type $1 -imageID $ID -sourceID 0175 exec mkcmf -photcode SIMTEST.$filter.Chip -no-noise -append $rawfile $cmffile -date $myDATE -time $myTIME -mjd $mjd -radec $RA $DEC -type $1 -imageID $ID -sourceID 0193 echo mkcmf -photcode SIMTEST.$filter.Chip $ADDNOISE -append $rawfile $cmffile -date $myDATE -time $myTIME -mjd $mjd -radec $RA $DEC -type $1 -imageID $ID -sourceID 0 -coords 194 exec mkcmf -photcode SIMTEST.$filter.Chip $ADDNOISE -append $rawfile $cmffile -date $myDATE -time $myTIME -mjd $mjd -radec $RA $DEC -type $1 -imageID $ID -sourceID 0 -coords 176 195 177 196 if ($i == 3) … … 198 217 199 218 if ($SMALLTEST) 200 echo relphot -D CATDIR $catdir - region 8 12 18 22 -images g,r,i,z,y -nloop 0 -D STAR_TOOFEW 0 -update201 exec relphot -D CATDIR $catdir - region 8 12 18 22 -images g,r,i,z,y -nloop 0 -D STAR_TOOFEW 0 -update202 203 echo relastro -v -D CATDIR $catdir - images -update-chips -region 8 12 18 22 -update -apply-offsets204 exec relastro -v -D CATDIR $catdir - images -update-chips -region 8 12 18 22 -update -apply-offsets219 echo relphot -D CATDIR $catdir -D CAMERA simtest -region 8 12 18 22 -images g,r,i,z,y -nloop 0 -D STAR_TOOFEW 0 -update 220 exec relphot -D CATDIR $catdir -D CAMERA simtest -region 8 12 18 22 -images g,r,i,z,y -nloop 0 -D STAR_TOOFEW 0 -update 221 222 echo relastro -v -D CATDIR $catdir -D CAMERA simtest -images -update-chips -update-all-cameras -region 8 12 18 22 -update -apply-offsets 223 exec relastro -v -D CATDIR $catdir -D CAMERA simtest -images -update-chips -update-all-cameras -region 8 12 18 22 -update -apply-offsets 205 224 else 206 echo relphot -D CATDIR $catdir - region 8 12 18 22 -images g,r,i,z,y -update207 exec relphot -D CATDIR $catdir - region 8 12 18 22 -images g,r,i,z,y -update225 echo relphot -D CATDIR $catdir -D CAMERA simtest -region 8 12 18 22 -images g,r,i,z,y -update 226 exec relphot -D CATDIR $catdir -D CAMERA simtest -region 8 12 18 22 -images g,r,i,z,y -update 208 227 end 209 228 … … 246 265 $stkID = $word:0 247 266 $skyID = $word:1 248 $rawfile = $word:2\.txt249 $cmffile = $word:2\.cmf267 sprintf rawfile "%s.%02d.txt" $word:2 $stkID 268 sprintf cmffile "%s.%02d.cmf" $word:2 $stkID 250 269 $offset = $word:3 251 270 $filter = $word:4 … … 255 274 256 275 mkinput $offset $rawfile 257 echo mkcmf -stack -photcode SIMTEST.$filter.SkyChip $ rawfile $cmffile -extroot SkyChip -date 2008/1/1 -time $i\:00:00 -mjd 54466.0 -radec $RA $DEC -type $1 -imageID $stkID -sourceID 1 -tess_id $TESS_ID -skycell $SKYCELL258 exec mkcmf -stack -photcode SIMTEST.$filter.SkyChip $ rawfile $cmffile -extroot SkyChip -date 2008/1/1 -time $i\:00:00 -mjd 54466.0 -radec $RA $DEC -type $1 -imageID $stkID -sourceID 1 -tess_id $TESS_ID -skycell $SKYCELL276 echo mkcmf -stack -photcode SIMTEST.$filter.SkyChip $ADDNOISE $rawfile $cmffile -extroot SkyChip -date 2008/1/1 -time $i\:00:00 -mjd 54466.0 -radec $RA $DEC -type $1 -imageID $stkID -sourceID 1 -tess_id $TESS_ID -skycell $SKYCELL -coords 277 exec mkcmf -stack -photcode SIMTEST.$filter.SkyChip $ADDNOISE $rawfile $cmffile -extroot SkyChip -date 2008/1/1 -time $i\:00:00 -mjd 54466.0 -radec $RA $DEC -type $1 -imageID $stkID -sourceID 1 -tess_id $TESS_ID -skycell $SKYCELL -coords 259 278 260 279 # add some required header keywords: … … 267 286 268 287 if ($SMALLTEST) 269 echo relphot -D CATDIR $catdir - region 8 12 18 22 -averages -update270 exec relphot -D CATDIR $catdir - region 8 12 18 22 -averages -update288 echo relphot -D CATDIR $catdir -D CAMERA simtest -region 8 12 18 22 -averages -update 289 exec relphot -D CATDIR $catdir -D CAMERA simtest -region 8 12 18 22 -averages -update 271 290 else 272 echo relphot -D CATDIR $catdir - region 8 12 18 22 -images g,r,i,z,y -update273 exec relphot -D CATDIR $catdir - region 8 12 18 22 -images g,r,i,z,y -update291 echo relphot -D CATDIR $catdir -D CAMERA simtest -region 8 12 18 22 -images g,r,i,z,y -update 292 exec relphot -D CATDIR $catdir -D CAMERA simtest -region 8 12 18 22 -images g,r,i,z,y -update 274 293 end 275 294 … … 315 334 $ID = $word:0 316 335 $stkID = $word:1 317 $rawfile = $word:2\.txt; # use the cam-stage rawfile318 $cmffile = $word:6\.cmf336 sprintf rawfile "%s.%02d.txt" $word:2 $ID; # use the cam-stage rawfile 337 sprintf cmffile "%s.%02d.smf" $word:6 $ID 319 338 $offset = $word:3 320 339 sprintf myDATE "%s" $word:4 … … 330 349 331 350 mkinput $offset $rawfile 332 echo mkcmf -forcedwarp -photcode SIMTEST.$filter.ForcedWarp $ rawfile $cmffile -extroot SkyChip -date $myDATE -time $myTIME -mjd $mjd -radec $RA $DEC -type $1 -imageID $ID -sourceID 2 -tess_id $TESS_ID -skycell $SKYCELL -bad-psfqf-frac $BAD_PSFQF_FRAC333 exec mkcmf -forcedwarp -photcode SIMTEST.$filter.ForcedWarp $ rawfile $cmffile -extroot SkyChip -date $myDATE -time $myTIME -mjd $mjd -radec $RA $DEC -type $1 -imageID $ID -sourceID 2 -tess_id $TESS_ID -skycell $SKYCELL -bad-psfqf-frac $BAD_PSFQF_FRAC351 echo mkcmf -forcedwarp -photcode SIMTEST.$filter.ForcedWarp $ADDNOISE $rawfile $cmffile -extroot SkyChip -date $myDATE -time $myTIME -mjd $mjd -radec $RA $DEC -type $1 -imageID $ID -sourceID 2 -tess_id $TESS_ID -skycell $SKYCELL -bad-psfqf-frac $BAD_PSFQF_FRAC -coords 352 exec mkcmf -forcedwarp -photcode SIMTEST.$filter.ForcedWarp $ADDNOISE $rawfile $cmffile -extroot SkyChip -date $myDATE -time $myTIME -mjd $mjd -radec $RA $DEC -type $1 -imageID $ID -sourceID 2 -tess_id $TESS_ID -skycell $SKYCELL -bad-psfqf-frac $BAD_PSFQF_FRAC -coords 334 353 335 354 echo addstar -D SKY_DEPTH 4 -D CATDIR $catdir -D CAMERA simtest $cmffile -D CATFORMAT $2 -quick-airmass -xrad … … 341 360 list word -split $stackdata:$i 342 361 $stkID = $word:0 343 $rawfile = $word:2\.txt344 $cmffile = $word:5\.cmf362 sprintf rawfile "%s.%02d.txt" $word:2 $stkID 363 sprintf cmffile "%s.%02d.smf" $word:5 $stkID 345 364 $offset = $word:3 346 365 $filter = $word:4 … … 349 368 if ($SMALLTEST && ($stkID != 1) && ($stkID != 4)) continue 350 369 351 echo mkcmf -forcedgalaxy -photcode SIMTEST.$filter.ForcedWarp $ rawfile $cmffile -extroot SkyChip -date 2008/1/1 -time $i\:00:00 -mjd 54466.0 -radec $RA $DEC -type $1 -imageID $stkID -sourceID 1 -tess_id $TESS_ID -skycell $SKYCELL352 exec mkcmf -forcedgalaxy -photcode SIMTEST.$filter.ForcedWarp $ rawfile $cmffile -extroot SkyChip -date 2008/1/1 -time $i\:00:00 -mjd 54466.0 -radec $RA $DEC -type $1 -imageID $stkID -sourceID 1 -tess_id $TESS_ID -skycell $SKYCELL353 354 echo loadgalphot -D CATDIR $catdir - photcode SIMTEST.$filter.ForcedWarp -image-id $stkID $cmffile355 exec loadgalphot -D CATDIR $catdir - photcode SIMTEST.$filter.ForcedWarp -image-id $stkID $cmffile370 echo mkcmf -forcedgalaxy -photcode SIMTEST.$filter.ForcedWarp $ADDNOISE $rawfile $cmffile -extroot SkyChip -date 2008/1/1 -time $i\:00:00 -mjd 54466.0 -radec $RA $DEC -type $1 -imageID $stkID -sourceID 1 -tess_id $TESS_ID -skycell $SKYCELL -coords 371 exec mkcmf -forcedgalaxy -photcode SIMTEST.$filter.ForcedWarp $ADDNOISE $rawfile $cmffile -extroot SkyChip -date 2008/1/1 -time $i\:00:00 -mjd 54466.0 -radec $RA $DEC -type $1 -imageID $stkID -sourceID 1 -tess_id $TESS_ID -skycell $SKYCELL -coords 372 373 echo loadgalphot -D CATDIR $catdir -D CAMERA simtest -photcode SIMTEST.$filter.ForcedWarp -image-id $stkID $cmffile 374 exec loadgalphot -D CATDIR $catdir -D CAMERA simtest -photcode SIMTEST.$filter.ForcedWarp -image-id $stkID $cmffile 356 375 end 357 376 358 377 if ($SMALLTEST) 359 echo relphot -D CATDIR $catdir - region 8 12 18 22 -averages -update360 exec relphot -D CATDIR $catdir - region 8 12 18 22 -averages -update378 echo relphot -D CATDIR $catdir -D CAMERA simtest -region 8 12 18 22 -averages -update 379 exec relphot -D CATDIR $catdir -D CAMERA simtest -region 8 12 18 22 -averages -update 361 380 else 362 echo relphot -D CATDIR $catdir - region 8 12 18 22 -images g,r,i,z,y -update363 exec relphot -D CATDIR $catdir - region 8 12 18 22 -images g,r,i,z,y -update364 end 365 366 echo dvolens -D CATDIR $catdir - region 8 12 18 22 -update-objects -update367 exec dvolens -D CATDIR $catdir - region 8 12 18 22 -update-objects -update381 echo relphot -D CATDIR $catdir -D CAMERA simtest -region 8 12 18 22 -images g,r,i,z,y -update 382 exec relphot -D CATDIR $catdir -D CAMERA simtest -region 8 12 18 22 -images g,r,i,z,y -update 383 end 384 385 echo dvolens -D CATDIR $catdir -D CAMERA simtest -region 8 12 18 22 -update-objects -update 386 exec dvolens -D CATDIR $catdir -D CAMERA simtest -region 8 12 18 22 -update-objects -update 368 387 369 388 if ($PARALLEL) … … 406 425 dbinsert camProcessedExp (cam_id, path_base, fault) values ($myID, "$filename", 0) 407 426 dbinsert fakeRun (fake_id, cam_id) values ($myID, $myID) 408 dbinsert warpRun (warp_id, fake_id, tess_id, state) values ($myID, $myID, $TESS_ID, "full")409 dbinsert warpSkyCellMap (warp_id, skycell_id, class_id) values ($myID, $SKYCELL, "XY00")410 dbinsert warpImfile (warp_id, skycell_id, warp_skyfile_id) values ($myID, $SKYCELL, $myID)427 dbinsert warpRun (warp_id, fake_id, tess_id, state) values ($myID, $myID, "$TESS_ID", "full") 428 dbinsert warpSkyCellMap (warp_id, skycell_id, class_id) values ($myID, "$SKYCELL", "XY00") 429 dbinsert warpImfile (warp_id, skycell_id, warp_skyfile_id) values ($myID, "$SKYCELL", $myID) 411 430 412 431 dbinsert addRun (add_id, stage, state, stage_id, minidvodb_name) values ($myID, "cam", "full", $myID, "catdir.cam") … … 452 471 $skycalID = $stkID + 20 453 472 454 dbinsert stackRun (stack_id, skycell_id, filter, software_ver) values ($stkID, $SKYCELL, "$filter.00000", "37500")473 dbinsert stackRun (stack_id, skycell_id, filter, software_ver) values ($stkID, "$SKYCELL", "$filter.00000", "37500") 455 474 456 475 # we have a single fullForceRun for each stack, so we can match fullForceRun ids to stackRun ids … … 520 539 $ID = $word:0 521 540 $stkID = $word:1 522 $rawfile = $word:2\.txt523 $cmffile = $word:8\.cmf524 $invfile = $word:8\.inv.cmf541 sprintf rawfile "%s.%02d.txt" $word:2 $stkID 542 sprintf cmffile "%s.%02d.smf" $word:8 $stkID 543 sprintf invfile "%s.%02d.inv.smf" $word:8 $stkID 525 544 $offset = $word:3 526 545 sprintf myDATE "%s" $word:4 … … 535 554 mkinput $offset $rawfile 536 555 $diff_skyfile_id = $ID + 25 537 echo mkcmf -diff -photcode SIMTEST.$filter.SkyChip -no-noise -extroot SkyChip $rawfile $cmffile -date $myDATE -time $myTIME -mjd $mjd -radec $RA $DEC -type $1 -imageID $diff_skyfile_id -sourceID 36 -bad-psfqf-frac $BAD_PSFQF_FRAC538 exec mkcmf -diff -photcode SIMTEST.$filter.SkyChip -no-noise -extroot SkyChip $rawfile $cmffile -date $myDATE -time $myTIME -mjd $mjd -radec $RA $DEC -type $1 -imageID $diff_skyfile_id -sourceID 36 -bad-psfqf-frac $BAD_PSFQF_FRAC539 540 echo mkcmf -diff -photcode SIMTEST.$filter.SkyChip -no-noise -extroot SkyChip $rawfile $invfile -date $myDATE -time $myTIME -mjd $mjd -radec $RA $DEC -type $1 -imageID $diff_skyfile_id -sourceID 36 -bad-psfqf-frac $BAD_PSFQF_FRAC541 exec mkcmf -diff -photcode SIMTEST.$filter.SkyChip -no-noise -extroot SkyChip $rawfile $invfile -date $myDATE -time $myTIME -mjd $mjd -radec $RA $DEC -type $1 -imageID $diff_skyfile_id -sourceID 36 -bad-psfqf-frac $BAD_PSFQF_FRAC556 echo mkcmf -diff -photcode SIMTEST.$filter.SkyChip $ADDNOISE -extroot SkyChip $rawfile $cmffile -date $myDATE -time $myTIME -mjd $mjd -radec $RA $DEC -type $1 -imageID $diff_skyfile_id -sourceID 36 -bad-psfqf-frac $BAD_PSFQF_FRAC -coords 557 exec mkcmf -diff -photcode SIMTEST.$filter.SkyChip $ADDNOISE -extroot SkyChip $rawfile $cmffile -date $myDATE -time $myTIME -mjd $mjd -radec $RA $DEC -type $1 -imageID $diff_skyfile_id -sourceID 36 -bad-psfqf-frac $BAD_PSFQF_FRAC -coords 558 559 echo mkcmf -diff -photcode SIMTEST.$filter.SkyChip $ADDNOISE -extroot SkyChip $rawfile $invfile -date $myDATE -time $myTIME -mjd $mjd -radec $RA $DEC -type $1 -imageID $diff_skyfile_id -sourceID 36 -bad-psfqf-frac $BAD_PSFQF_FRAC -coords 560 exec mkcmf -diff -photcode SIMTEST.$filter.SkyChip $ADDNOISE -extroot SkyChip $rawfile $invfile -date $myDATE -time $myTIME -mjd $mjd -radec $RA $DEC -type $1 -imageID $diff_skyfile_id -sourceID 36 -bad-psfqf-frac $BAD_PSFQF_FRAC -coords 542 561 543 562 insert.dif $ID $ID $stkID $word:8 … … 557 576 end 558 577 if ($SMALLTEST) 559 echo relphot -D CATDIR $catdir - region 8 12 18 22 -images g,r,i,z,y -nloop 0 -D STAR_TOOFEW 0 -update -boundary-tree tess.3pi.fits -is-diff-db -statmode WT_MEAN560 exec relphot -D CATDIR $catdir - region 8 12 18 22 -images g,r,i,z,y -nloop 0 -D STAR_TOOFEW 0 -update -boundary-tree tess.3pi.fits -is-diff-db -statmode WT_MEAN578 echo relphot -D CATDIR $catdir -D CAMERA simtest -region 8 12 18 22 -images g,r,i,z,y -nloop 0 -D STAR_TOOFEW 0 -update -boundary-tree tess.3pi.fits -is-diff-db -statmode WT_MEAN 579 exec relphot -D CATDIR $catdir -D CAMERA simtest -region 8 12 18 22 -images g,r,i,z,y -nloop 0 -D STAR_TOOFEW 0 -update -boundary-tree tess.3pi.fits -is-diff-db -statmode WT_MEAN 561 580 else 562 echo relphot -D CATDIR $catdir - region 8 12 18 22 -images g,r,i,z,y -update563 exec relphot -D CATDIR $catdir - region 8 12 18 22 -images g,r,i,z,y -update581 echo relphot -D CATDIR $catdir -D CAMERA simtest -region 8 12 18 22 -images g,r,i,z,y -update 582 exec relphot -D CATDIR $catdir -D CAMERA simtest -region 8 12 18 22 -images g,r,i,z,y -update 564 583 end 565 584 … … 592 611 $stkID = $word:0 593 612 $skyID = $word:1 594 $cmffile = $word:2613 sprintf cmffile "%s.%02d.cmf" $word:2 $stkID 595 614 $filter = $word:4 596 615 … … 652 671 dbinsert addProcessedExp (add_id, fault) values ($addID, 0) 653 672 654 dbinsert diffRun (diff_id, tess_id, state, diff_mode, software_ver) values ($difID, $TESS_ID, "full", 2, "38000M")655 dbinsert diffInputSkyfile (diff_id, warp1, stack2, diff_skyfile_id, tess_id, skycell_id) values ($difID, $wrpID, $stkID, $diffSkyfileID, $TESS_ID, $SKYCELL)656 dbinsert diffSkyfile (diff_id, skycell_id, path_base) values ($difID, $SKYCELL, "$filename")673 dbinsert diffRun (diff_id, tess_id, state, diff_mode, software_ver) values ($difID, "$TESS_ID", "full", 2, "38000M") 674 dbinsert diffInputSkyfile (diff_id, warp1, stack2, diff_skyfile_id, tess_id, skycell_id) values ($difID, $wrpID, $stkID, $diffSkyfileID, "$TESS_ID", "$SKYCELL" ) 675 dbinsert diffSkyfile (diff_id, skycell_id, path_base) values ($difID, "$SKYCELL", "$filename") 657 676 end 658 677 … … 669 688 exec rm -f $output 670 689 671 local i j 690 local i j ra dec 672 691 output $output 673 692 for i 10 1024 100 674 693 for j 10 1024 100 675 fprintf " %6.1f %6.1f %7.3f" $i $j {-15.0 + $1 + 2.5*($i + $j)/1000.0} 694 $ra = 10.0 + $i*0.25/3600 695 $dec = 20.0 + $j*0.25/3600 696 fprintf " %10.6f %10.6f %7.3f %6.1f %6.1f %7.3f" $ra $dec {10.0 + $1 + 2.5*($i + $j)/1000.0} $i $j {-15.0 + $1 + 2.5*($i + $j)/1000.0} 676 697 end 677 698 end 678 699 # XXX add 2 duplicate detections 679 700 $i = 110; $j = 210 680 fprintf " %6.1f %6.1f %7.3f" $i $j {-15.0 + $1 + 2.5*($i + $j)/1000.0} 701 # fprintf " %10.6f %10.6f %7.3f %6.1f %6.1f %7.3f" $ra $dec {10.0 + $1 + 2.5*($i + $j)/1000.0} $i $j {-15.0 + $1 + 2.5*($i + $j)/1000.0} 702 # fprintf " %6.1f %6.1f %7.3f" $i $j {-15.0 + $1 + 2.5*($i + $j)/1000.0} 681 703 $i = 210; $j = 110 682 fprintf " %6.1f %6.1f %7.3f" $i $j {-15.0 + $1 + 2.5*($i + $j)/1000.0} 704 # fprintf " %10.6f %10.6f %7.3f %6.1f %6.1f %7.3f" $ra $dec {10.0 + $1 + 2.5*($i + $j)/1000.0} $i $j {-15.0 + $1 + 2.5*($i + $j)/1000.0} 705 # fprintf " %6.1f %6.1f %7.3f" $i $j {-15.0 + $1 + 2.5*($i + $j)/1000.0} 683 706 output stdout 707 end 708 709 macro check.mags 710 711 # NOTE: relphot refuses to set the warp averages if there is no boundary tree: otherwise it cannot choose the correct subset of measurements 712 # relphot -D CATDIR testdata/catdir.mrg -D CAMERA simtest -region 8 12 18 22 -update -vv -averages -boundary-tree tess.3pi.fits 713 # relphot -D CATDIR testdata/catdir.mrg -D CAMERA simtest -region 8 12 18 22 -update -vv -images g,r -reset -reset-zpts -D STAR_TOOFEW 0 -boundary-tree tess.3pi.fits 714 715 catdir testdata/catdir.mrg 716 skyregion 8 12 18 22 717 avextract ra dec g:psf:chp g:kron:chp g:psf:stk g:psf:wrp 718 719 set dg:psf:chp:stk = g:psf:chp - g:psf:stk 720 set dg:psf:chp:wrp = g:psf:chp - g:psf:wrp 721 lim g:psf:chp dg:psf:chp:stk; clear; box; plot g:psf:chp dg:psf:chp:stk -c blue -pt 7; plot g:psf:chp dg:psf:chp:wrp -c red -pt 2 722 723 # for i 0 10 724 # echo ra[$i] dec[$i] g:psf:chp[$i] g:kron:chp[$i] g:psf:stk[$i] g:psf:wrp[$i] 725 # end 726 end 727 728 macro check.mags.meas 729 730 # NOTE: relphot refuses to set the warp averages if there is no boundary tree: otherwise it cannot choose the correct subset of measurements 731 # relphot -D CATDIR testdata/catdir.mrg -D CAMERA simtest -region 8 12 18 22 -update -vv -averages -boundary-tree tess.3pi.fits 732 # relphot -D CATDIR testdata/catdir.mrg -D CAMERA simtest -region 8 12 18 22 -update -vv -images g,r -reset -reset-zpts -D STAR_TOOFEW 0 -boundary-tree tess.3pi.fits 733 734 catdir testdata/catdir.mrg 735 skyregion 8 12 18 22 736 737 mextract ra dec mag:rel:psf mag:rel:kron mag:ave:psf mag:ave:kron photcode 738 set dM:psf = mag:ave:psf - mag:rel:psf 739 lim -n 0 mag:ave:psf dM:psf; clear; box; plot mag:ave:psf dM:psf 740 741 set dM:kron = mag:ave:kron - mag:rel:kron 742 lim -n 1 mag:ave:kron dM:kron; clear; box; plot mag:ave:kron dM:kron 684 743 end 685 744 -
branches/czw_branch/20170908/ippToPsps/test/notes.txt
r35097 r40483 1 2 2017.11.28 EAM: 3 4 updating the test suite (using my desktop kukui -- ubuntu 14.04). 5 6 * need to install xmllint to run ipptopsps 1 7 2 8 In order to have a reasonably complete test, I need to have a bunch of things that mimic the IPP infrastructure
Note:
See TracChangeset
for help on using the changeset viewer.
