IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 37988


Ignore:
Timestamp:
Mar 21, 2015, 10:46:25 AM (11 years ago)
Author:
mhuber
Message:

merge update for new SNIa data product and MD isolation config mods with psastro

Location:
tags/ipp-20141024
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • tags/ipp-20141024/ippconfig/gpc1/ppStack.config

    r37290 r37988  
    277277
    278278
     279
     280
     281STACK_CNP_PV3_IQ_1DG  METADATA       ## revised -- based on STACK_THREEPI/STACK_MD_DEEP_1DG
     282    OUTPUT.NOCOMP           BOOL  TRUE
     283    OUTPUT.LOGFLUX          BOOL  FALSE
     284    STACK.TYPE              STR   DEEP_STACK
     285    PSF.INPUT.CLIP.SIMPLE   BOOL  True
     286    PSF.INPUT.MAX           F32   10.0    # 
     287    PSF.INPUT.CLIP.NSIGMA   F32   100.0
     288    PSF.INPUT.THRESH        F32   NAN
     289    PSF.INPUT.ASYMMETRY     F32   NAN
     290    MATCH.REJ        F32    4.0
     291    SAFE                 BOOL   F
     292    PSF.TARGET.AS.MAX        BOOL  TRUE   # Set the target PSF FWHM as the maximum of accepted input FWHM values.
     293    PSF.TARGET.AS.MAX.EPSILON F32 0.1     # set the target PSF FWHM larger than the maximum input. Target = eps + max(input)
     294    THRESHOLD.MASK  F32     0.1          # Threshold for mask deconvolution (0..1)
     295    COMBINE.ITER    F32     0.5          # Number of rejection iterations per input
     296    COMBINE.REJ     F32     3.0          # Rejection threshold in combination (sigma)
     297    COMBINE.SYS     F32     0.1          # Relative systematic error in combination
     298    COMBINE.DISCARD F32     0.2          # Discard fraction for Olympic weighted mean
     299    IMAGE.REJ       F32     0.1          # Rejected pixel fraction threshold for rejecting entire image
     300    NMINPIX         S32     3            # Minimum input per pixel     
     301    MASK.VAL        STR     SUSPECT,MASK.VALUE,CONV.BAD,GHOST # Mask value of input bad pixels
     302    MASK.BLANKBORDER S32    20              # Mask blank border in final stack output
     303    BSCALEOFFSET    BOOL    FALSE           # MUST be FALSE for PV3
     304END
     305
     306STACK_CNP_PV3_REF_1DG  METADATA  ## revised CNP PV3 REF stack --
     307    OUTPUT.NOCOMP            BOOL  TRUE   # pointed field -- no compression, no logflux
     308    OUTPUT.LOGFLUX           BOOL  FALSE  #
     309    OUTPUT.REPLICATE         BOOL  TRUE
     310    STACK.TYPE               STR   DEEP_STACK 
     311    PSF.INPUT.CLIP.SIMPLE    BOOL  True
     312    PSF.INPUT.MAX            F32   10.0   # CNP large FWHM, center/edge vary 1-2 pix?
     313    PSF.INPUT.CLIP.NSIGMA    F32   0.0    # sample typically on rising side of distribution
     314    PSF.INPUT.THRESH         F32   NAN
     315    PSF.INPUT.ASYMMETRY      F32   NAN
     316    MATCH.REJ                F32   4.0    # need ot tune?
     317    SAFE                     BOOL  FALSE
     318    PSF.TARGET.AS.MAX        BOOL  TRUE   # Set the target PSF FWHM as the maximum of accepted input FWHM values.
     319    PSF.TARGET.AS.MAX.EPSILON F32 0.1     # set the target PSF FWHM larger than the maximum input. Target = eps + max(input)
     320    THRESHOLD.MASK  F32     0.1          # Threshold for mask deconvolution (0..1)
     321    COMBINE.ITER    F32     0.5          # Number of rejection iterations per input
     322    COMBINE.REJ     F32     3.0          # Rejection threshold in combination (sigma)
     323    COMBINE.SYS     F32     0.1          # Relative systematic error in combination
     324    COMBINE.DISCARD F32     0.2          # Discard fraction for Olympic weighted mean
     325    IMAGE.REJ       F32     0.1          # Rejected pixel fraction threshold for rejecting entire image
     326    NMINPIX         S32     3            # Minimum input per pixel
     327    MASK.VAL        STR     SUSPECT,MASK.VALUE,CONV.BAD,GHOST # Mask value of input bad pixels
     328    MASK.BLANKBORDER S32    20           # Mask blank border in final stack output
     329    BSCALEOFFSET    BOOL    FALSE        # MUST be FALSE for PV3
     330END
     331
     332STACK_CNP_PV3_DEEP_1DG  METADATA   ## --
     333    OUTPUT.NOCOMP           BOOL  TRUE
     334    OUTPUT.LOGFLUX          BOOL  FALSE
     335    OUTPUT.REPLICATE        BOOL  TRUE
     336    STACK.TYPE              STR   DEEP_STACK
     337    PSF.INPUT.CLIP.SIMPLE   BOOL  True
     338    PSF.INPUT.MAX           F32   16.0    # large FWHM images up to 20 -- 
     339    PSF.INPUT.CLIP.NSIGMA   F32   100.0   # do not want to clip really
     340    PSF.INPUT.THRESH        F32   NAN
     341    PSF.INPUT.ASYMMETRY     F32   NAN
     342    MATCH.REJ               F32   4.0     # need ot tune?
     343    SAFE                    BOOL  FALSE
     344    PSF.TARGET.AS.MAX  BOOL  TRUE
     345    PSF.TARGET.AS.MAX.EPSILON F32 0.1
     346    THRESHOLD.MASK  F32     0.1             # Threshold for mask deconvolution (0..1)
     347    COMBINE.ITER    F32     0.5             # Number of rejection iterations per input
     348    COMBINE.REJ     F32     3.0             # Rejection threshold in combination (sigma)
     349    COMBINE.SYS     F32     0.1             # Relative systematic error in combination
     350    COMBINE.DISCARD F32     0.2             # Discard fraction for Olympic weighted mean
     351    IMAGE.REJ       F32     0.1             # Rejected pixel fraction threshold for rejecting entire image
     352    NMINPIX         S32     3               # Minimum input per pixel -- more and get crazy structures..
     353    MASK.VAL        STR     SUSPECT,MASK.VALUE,CONV.BAD,GHOST # Mask value of input bad pixels -- many, dont trust SUSPECT
     354    MASK.BLANKBORDER S32    20              # Mask blank border in final stack output
     355    BSCALEOFFSET    BOOL    FALSE           # MUST be FALSE for PV3 (PV2 bias hack fix)
     356END
     357
     358
     359STACK_MD_PV3_NIGHT_1DG  METADATA   ## Revised MD 8 input NIGHT stacks for PV3 -- not complete
     360    OUTPUT.NOCOMP             BOOL  FALSE
     361    OUTPUT.LOGFLUX            BOOL  FALSE
     362    PSF.INPUT.CLIP.SIMPLE     BOOL  True
     363    PSF.INPUT.MAX             F32   12.0    # what FWHM does diffim become mostly useless, if any?
     364    PSF.INPUT.CLIP.NSIGMA     F32   1000.0  # want to use up to MAX, but sig could possibly be small?
     365    PSF.INPUT.THRESH        F32   NAN
     366    PSF.INPUT.ASYMMETRY     F32   NAN
     367    MATCH.REJ               F32   4.0   # need ot tune?
     368    SAFE                    BOOL  FALSE
     369    ##
     370    PSF.TARGET.AS.MAX       BOOL  TRUE      # Set the target PSF FWHM as the maximum of accepted input FWHM values.
     371    PSF.TARGET.AS.MAX.EPSILON F32 0.1       # Amount to set the target PSF FWHM larger than the maximum input. Target = eps + max(input)
     372    THRESHOLD.MASK  F32     0.1             # Threshold for mask deconvolution (0..1)
     373    COMBINE.ITER    F32     0.5             # Number of rejection iterations per input
     374    COMBINE.REJ     F32     3.0             # Rejection threshold in combination (sigma)
     375    COMBINE.SYS     F32     0.1             # Relative systematic error in combination
     376    COMBINE.DISCARD F32     0.2             # Discard fraction for Olympic weighted mean
     377    IMAGE.REJ       F32     0.1             # Rejected pixel fraction threshold for rejecting entire image
     378    NMINPIX         S32     4               # Minimum input per pixel
     379    MASK.VAL        STR     SUSPECT,MASK.VALUE,CONV.BAD,GHOST # Mask value of input bad pixels
     380    MASK.BLANKBORDER S32    20              # Mask blank border in final stack output
     381    BSCALEOFFSET    BOOL    FALSE           # MUST be FALSE for PV3
     382END
     383
     384STACK_MD_PV3_IQ_1DG       METADATA  ## revised config for MD PV3 IQ stacks -- not complete
     385    OUTPUT.NOCOMP           BOOL  TRUE
     386    OUTPUT.LOGFLUX          BOOL  FALSE
     387    OUTPUT.REPLICATE        BOOL  TRUE
     388    STACK.TYPE              STR   DEEP_STACK  ## needed?
     389    PSF.INPUT.CLIP.SIMPLE   BOOL  True
     390    PSF.INPUT.MAX           F32   10.0   # center/edge can vary 1-2 pix, prefer <6 pix but needs to be <10 pix for edges until code improved..
     391    PSF.INPUT.CLIP.NSIGMA   F32   100.0  # any change to inputs can greatly impact edge filling factor..
     392    PSF.INPUT.THRESH        F32   NAN
     393    PSF.INPUT.ASYMMETRY     F32   NAN
     394    MATCH.REJ               F32   4.0   # need ot tune?
     395    SAFE                    BOOL  FALSE
     396    PSF.TARGET.AS.MAX       BOOL  TRUE      # Set the target PSF FWHM as the maximum of accepted input FWHM values.
     397    PSF.TARGET.AS.MAX.EPSILON F32 0.1       # Amount to set the target PSF FWHM larger than the maximum input. Target = eps + max(input)
     398    THRESHOLD.MASK  F32     0.1             # Threshold for mask deconvolution (0..1)
     399    COMBINE.ITER    F32     0.5             # Number of rejection iterations per input
     400    COMBINE.REJ     F32     3.0             # Rejection threshold in combination (sigma)
     401    COMBINE.SYS     F32     0.1             # Relative systematic error in combination
     402    COMBINE.DISCARD F32     0.2             # Discard fraction for Olympic weighted mean
     403    IMAGE.REJ       F32     0.1             # Rejected pixel fraction threshold for rejecting entire image
     404    NMINPIX         S32     4               # Minimum input per pixel
     405    MASK.VAL        STR     SUSPECT,MASK.VALUE,CONV.BAD,GHOST # Mask value of input bad pixels
     406    MASK.BLANKBORDER S32    20              # Mask blank border in final stack output
     407    BSCALEOFFSET    BOOL    FALSE           # MUST be FALSE for PV3
     408END
     409
     410STACK_MD_PV3_REF_1DG       METADATA  ## revised config for MD PV3 refstacks -- not complete
     411    OUTPUT.NOCOMP           BOOL  TRUE
     412    OUTPUT.LOGFLUX          BOOL  FALSE
     413    OUTPUT.REPLICATE        BOOL  TRUE
     414    STACK.TYPE              STR   DEEP_STACK  ## needed?
     415    PSF.INPUT.CLIP.SIMPLE   BOOL  True
     416    PSF.INPUT.MAX           F32   7.0   # center/edge can vary 1-2 pix, prefer <6 pix but needs to be <7 pix for edges
     417    PSF.INPUT.CLIP.NSIGMA   F32   1.0   # sample typically on rising side of distribution (set even smaller?)
     418    PSF.INPUT.THRESH        F32   NAN
     419    PSF.INPUT.ASYMMETRY     F32   NAN
     420    MATCH.REJ               F32   4.0   # need ot tune?
     421    SAFE                    BOOL  FALSE
     422    PSF.TARGET.AS.MAX       BOOL  TRUE      # Set the target PSF FWHM as the maximum of accepted input FWHM values.
     423    PSF.TARGET.AS.MAX.EPSILON F32 0.1       # Amount to set the target PSF FWHM larger than the maximum input. Target = eps + max(input)
     424    THRESHOLD.MASK  F32     0.1             # Threshold for mask deconvolution (0..1)
     425    COMBINE.ITER    F32     0.5             # Number of rejection iterations per input
     426    COMBINE.REJ     F32     3.0             # Rejection threshold in combination (sigma)
     427    COMBINE.SYS     F32     0.1             # Relative systematic error in combination
     428    COMBINE.DISCARD F32     0.2             # Discard fraction for Olympic weighted mean
     429    IMAGE.REJ       F32     0.1             # Rejected pixel fraction threshold for rejecting entire image
     430    NMINPIX         S32     4               # Minimum input per pixel
     431    MASK.VAL        STR     SUSPECT,MASK.VALUE,CONV.BAD,GHOST # Mask value of input bad pixels
     432    MASK.BLANKBORDER S32    20              # Mask blank border in final stack output
     433    BSCALEOFFSET    BOOL    FALSE           # MUST be FALSE for PV3
     434END
     435
     436STACK_MD_PV3_DEEP_1DG     METADATA   ## revised config for MD PV3 deepstack -- not complete
     437    OUTPUT.NOCOMP           BOOL  TRUE
     438    OUTPUT.LOGFLUX          BOOL  FALSE
     439    OUTPUT.REPLICATE        BOOL  TRUE
     440    STACK.TYPE              STR   DEEP_STACK
     441    PSF.INPUT.CLIP.SIMPLE   BOOL  True
     442    PSF.INPUT.MAX           F32   10.0    # 
     443    PSF.INPUT.CLIP.NSIGMA   F32   100.0
     444    PSF.INPUT.THRESH        F32   NAN
     445    PSF.INPUT.ASYMMETRY     F32   NAN
     446    MATCH.REJ               F32   4.0     # need ot tune?
     447    SAFE                    BOOL  FALSE
     448    PSF.TARGET.AS.MAX  BOOL  TRUE
     449    PSF.TARGET.AS.MAX.EPSILON F32 0.1
     450    THRESHOLD.MASK  F32     0.1             # Threshold for mask deconvolution (0..1)
     451    COMBINE.ITER    F32     0.5             # Number of rejection iterations per input
     452    COMBINE.REJ     F32     3.0             # Rejection threshold in combination (sigma)
     453    COMBINE.SYS     F32     0.1             # Relative systematic error in combination
     454    COMBINE.DISCARD F32     0.2             # Discard fraction for Olympic weighted mean
     455    IMAGE.REJ       F32     0.1             # Rejected pixel fraction threshold for rejecting entire image
     456    NMINPIX         S32     30              # Minimum input per pixel
     457    MASK.VAL        STR     SUSPECT,MASK.VALUE,CONV.BAD,GHOST # Mask value of input bad pixels
     458    MASK.BLANKBORDER S32    20              # Mask blank border in final stack output
     459    BSCALEOFFSET    BOOL    FALSE           # MUST be FALSE for PV3
     460END
     461
     462
     463
    279464# Recipe overrides for STACK
    280465STACKPHOT METADATA
  • tags/ipp-20141024/ippconfig/gpc1/psastro.config

    r37960 r37988  
    398398END
    399399
     400MD_ASTRO METADATA
     401   ZERO.POINT.BY.EXPOSURE      BOOL  TRUE
     402   ZERO.POINT.USE.MEAN         BOOL  TRUE
     403   DVO.GETSTAR.MAX.RHO         F32   6000.0  # was globally changed to 10k, seems >6k more than 1600 NREF
     404   PSASTRO.GRID.NREF.MAX       S32   1600    # max stars for grid search from ref catalog
     405   PSASTRO.GRID.NRAW.MAX       S32   800     # max stars for grid search from raw/image 
     406   DVO.GETSTAR.MIN.MAG         F32   12.0    # leave similar to default, MD in marginal weather and can lose 1-3 mags
     407   DVO.GETSTAR.MIN.MAG.INST    F32   -25.0
     408   PSASTRO.CATDIR              STR   PS1.REF.20140713
     409   ## refcat may be okay astrom but not faint phot -- so need to be able to further limit by ZP
     410   ## -- concern w/ new refcat >20 extra sources w/ larger merr over-dominating scatter in ZP
     411   ## -- CLAMP will limit both astrom and zp --
     412   REFSTAR_CLAMP_MAG_MAX       F32   22.0
     413   REFSTAR.ZP.MIN.MAG          F32   12.0
     414   REFSTAR.ZP.MAX.MAG          F32   19.0
     415   ## for ZP need extra limit by filter to avoid poorer photometry scatter on faint end
     416   ## -- cannot restrict on bright end due to possible marginal nights
     417   ## -- set for merr<0.02-0.03 in refcat, ~similar for each MD field
     418#   PHOTCODE.DATA MULTI UPDATE
     419   PHOTCODE.DATA MULTI   
     420   PHOTCODE.DATA METADATA
     421     FILTER   STR g
     422     PHOTCODE STR g
     423     REFSTAR.ZP.MAX.MAG    F32  19.0
     424   END
     425   PHOTCODE.DATA METADATA
     426     FILTER   STR r
     427     PHOTCODE STR r
     428     REFSTAR.ZP.MAX.MAG    F32  19.0
     429   END
     430   PHOTCODE.DATA METADATA
     431     FILTER   STR i
     432     PHOTCODE STR i
     433     REFSTAR.ZP.MAX.MAG    F32  18.5
     434   END
     435   PHOTCODE.DATA METADATA
     436     FILTER   STR z
     437     PHOTCODE STR z
     438     REFSTAR.ZP.MAX.MAG    F32  18.5
     439   END
     440   PHOTCODE.DATA METADATA
     441     FILTER   STR y
     442     PHOTCODE STR y
     443     REFSTAR.ZP.MAX.MAG    F32  17.5
     444   END
     445END
     446
     447
     448CNP_ASTRO_PV3 METADATA
     449   PSASTRO.MAX.ALLOWED.FWHM    F32   25  # larger number typical >12, so include 2x larger
     450   PSASTRO.CATDIR              STR   PS1.REF.20140713
     451   PSASTRO.GRID.MIN.ANGLE      F32   -20
     452   PSASTRO.GRID.MAX.ANGLE      F32   +20
     453   PSASTRO.GRID.DEL.ANGLE      F32   0.5
     454   PSASTRO.FIELD.PADDING       F32   0.5
     455   DVO.GETSTAR.MAX.RHO         F32   5000.0  # globally changed to 10k, huge numbers in soln and larger sigma
     456   DVO.GETSTAR.MIN.MAG         F32   8.0     # can go brighter in marginal nights (like MD done every night as possible)
     457   PSASTRO.GRID.NREF.MAX       S32   1600    # defaults
     458   PSASTRO.GRID.NRAW.MAX       S32   800   
     459   PSASTRO.MIN.INST.MAG.RAW       F32     -15.0   # min instrumental magnitude for stars accepted for fitting
     460   PSASTRO.MAX.INST.MAG.RAW       F32      -8.5   # reduce instrumental faint end a bit (cuts most if rho>5k anyways)
     461   PSASTRO.GRID.MIN.INST.MAG.RAW  F32     -15.0   # min instrumental magnitude for stars accepted for grid search
     462   PSASTRO.GRID.MAX.INST.MAG.RAW  F32      -8.0   # max instrumental magnitude for stars accepted for grid search
     463
     464   ZERO.POINT.USE.MEAN         BOOL  TRUE 
     465   ## refcat -- want to be able to further limit for ZP, general settings
     466   ## -- concern w/ new refcat >20 extra sources w/ larger merr can over-dominating scatter in ZP
     467   ## -- CLAMP will limit both astrom and zp -- CNP are shorter exposures
     468   REFSTAR_CLAMP_MAG_MAX       F32   20.0 
     469   REFSTAR.ZP.MIN.MAG          F32   8.0   
     470   REFSTAR.ZP.MAX.MAG          F32   19.0
     471   ## for ZP need extra restriction by filter to avoid poorer photometry scatter on faint end
     472   ## -- ZP is by exposure so can easily reduce numbers 
     473   ## -- cannot restrict on bright end due to possible marginal nights
     474   ## -- set for merr<0.03 in refcat, similar to MD
     475#   PHOTCODE.DATA MULTI UPDATE
     476   PHOTCODE.DATA MULTI   
     477   PHOTCODE.DATA METADATA
     478     FILTER   STR g
     479     PHOTCODE STR g
     480     #REFSTAR.ZP.MAX.MAG    F32  19.0
     481     REFSTAR.ZP.MAX.MAG    F32  18.0  # changed after PV3.20141111 run to match raw merr
     482   END
     483   PHOTCODE.DATA METADATA
     484     FILTER   STR r
     485     PHOTCODE STR r
     486     REFSTAR.ZP.MAX.MAG    F32  18.0
     487   END
     488   PHOTCODE.DATA METADATA
     489     FILTER   STR i
     490     PHOTCODE STR i
     491     REFSTAR.ZP.MAX.MAG    F32  18.0
     492   END
     493   PHOTCODE.DATA METADATA
     494     FILTER   STR z
     495     PHOTCODE STR z
     496     REFSTAR.ZP.MAX.MAG    F32  18.0
     497   END
     498   PHOTCODE.DATA METADATA
     499     FILTER   STR y
     500     PHOTCODE STR y
     501     REFSTAR.ZP.MAX.MAG    F32  17.0
     502   END
     503END
     504
     505MD_ASTRO_PV3 METADATA
     506   ZERO.POINT.BY.EXPOSURE      BOOL  TRUE
     507   ZERO.POINT.USE.MEAN         BOOL  TRUE
     508   DVO.GETSTAR.MAX.RHO         F32   6000.0  # was globally changed to 10k
     509   PSASTRO.GRID.NREF.MAX       S32   1600    # max stars for grid search from ref catalog
     510   PSASTRO.GRID.NRAW.MAX       S32   800     # max stars for grid search from raw/image 
     511   DVO.GETSTAR.MIN.MAG         F32   12.0    # leave similar to default, MD in marginal weather and can lose 1-3 mags
     512   DVO.GETSTAR.MIN.MAG.INST    F32   -25.0
     513   PSASTRO.CATDIR              STR   PS1.REF.20140713
     514   ## refcat may be okay astrom but not faint phot -- so need to be able to further limit by ZP
     515   ## -- concern w/ new refcat >20 extra sources w/ larger merr over-dominating scatter in ZP
     516   ## -- CLAMP will limit both astrom and zp --
     517   REFSTAR_CLAMP_MAG_MAX       F32   22.0
     518   REFSTAR.ZP.MIN.MAG          F32   12.0
     519   REFSTAR.ZP.MAX.MAG          F32   19.0
     520   ## for ZP need extra limit by filter to avoid poorer photometry scatter on faint end
     521   ## -- cannot restrict on bright end due to possible marginal nights
     522   ## -- set for merr<0.02-0.03 in refcat, ~similar for each MD field
     523#   PHOTCODE.DATA MULTI UPDATE
     524   PHOTCODE.DATA MULTI   
     525   PHOTCODE.DATA METADATA
     526     FILTER   STR g
     527     PHOTCODE STR g
     528     REFSTAR.ZP.MAX.MAG    F32  19.0
     529   END
     530   PHOTCODE.DATA METADATA
     531     FILTER   STR r
     532     PHOTCODE STR r
     533     REFSTAR.ZP.MAX.MAG    F32  19.0
     534   END
     535   PHOTCODE.DATA METADATA
     536     FILTER   STR i
     537     PHOTCODE STR i
     538     REFSTAR.ZP.MAX.MAG    F32  18.5
     539   END
     540   PHOTCODE.DATA METADATA
     541     FILTER   STR z
     542     PHOTCODE STR z
     543     REFSTAR.ZP.MAX.MAG    F32  18.5
     544   END
     545   PHOTCODE.DATA METADATA
     546     FILTER   STR y
     547     PHOTCODE STR y
     548     REFSTAR.ZP.MAX.MAG    F32  17.5
     549   END
     550END
     551
     552
    400553TEST_REFCAT METADATA
    401554   PSASTRO.CATDIR               STR /data/ipp064.0/ipp/ippRefs/catdir.refcat.20120524.v0
     
    526679END
    527680
     681## MD version
     682## revised setup for DEEP/MDS stacks with range of inputs, should work for N~2(edges)--500 inputs with large MIN/MAX.INST.MAG.RAW
     683STATICSKY_MD_DEEPCAL   METADATA
     684   #PSASTRO.CATDIR                  STR   PS1.REF.20120524  # reset here to ensure same catalog is used when reprocessing set uniformly
     685   #PSASTRO.CATDIR                  STR   PS1.REF.20140605  # ensure same catalog is used when reprocessing MD set uniformly (BAD catalog)
     686   PSASTRO.CATDIR                  STR   PS1.REF.20140713
     687   REFSTAR_MASK                    BOOL  FALSE
     688   PSASTRO.SAVE.REFMATCH           BOOL  FALSE
     689   PSASTRO.FIX.CHIPS               BOOL  FALSE
     690   PSASTRO.USE.MODEL               BOOL  FALSE
     691   PSASTRO.MOSAIC.MODE             BOOL  FALSE
     692   ZERO.POINT.USE.MEAN             BOOL  TRUE
     693   PSASTRO.FIELD.PADDING           F32   0.01   # skycells are well defined, don't need large padding. 1% of 6400 is 64 pixels
     694   PSASTRO.MAX.NRAW                S32   1500   # include more than MAX.NREF to account for extras like false-positives
     695   PSASTRO.MAX.NREF                S32   1000   # if edge skycell ~10% then try ~50 to match. increase to help odd bulk offsets
     696   PSASTRO.MIN.INST.MAG.RAW        F32   -25.0  #
     697   PSASTRO.MAX.INST.MAG.RAW        F32   -5.0
     698   PSASTRO.GRID.SEARCH             BOOL  FALSE  # skycell/stack and astrom well known, when used could cause problems and not help
     699   #PSASTRO.GRID.NRAW.MAX           S32   2000
     700   #PSASTRO.GRID.NREF.MAX           S32   2000
     701   #PSASTRO.GRID.MIN.INST.MAG.RAW   F32   -21.0
     702   #PSASTRO.GRID.MAX.INST.MAG.RAW   F32   -14.0
     703   DVO.GETSTAR.MAX.RHO             F32   6000.0  # N/sqdeg, slightly larger than MAX.NREF
     704   DVO.GETSTAR.MIN.MAG.INST        F32   -25.0   # set absurd range to cover large range of exptime, then clamp...
     705   DVO.GETSTAR.MIN.MAG             F32   16.5    # only used if keyword problem so also using CLAMP_MAG_MIN
     706   REFSTAR_CLAMP_MAG_MIN           F32   16.5    # saturation in MD ~14 even in y-band, so toss out brighter in the list. seeing offset in brighter stars
     707   DVO.GETSTAR.FIXED.ZEROPT        F32   0.0     # not really needed, exptime overly dominates
     708 
     709   ## for skycell/stack astrom well known, radius shouldn't need to be as large as 90 pixel default. in deeper stacks can be problems
     710   PSASTRO.MATCH.RADIUS.N0         F32   5
     711   PSASTRO.MATCH.RADIUS.N1         F32   3
     712   PSASTRO.MATCH.RADIUS.N2         F32   1
     713   PSASTRO.MATCH.RADIUS.N3         F32   0.5
     714   PSASTRO.MATCH.FIT.NITER         S32   4
     715   PSASTRO.MAX.ERROR               F32   0.2  # in arcsec units, still liberal limit for well known astrometry for skycells
     716   PSASTRO.MIN.NSTAR               S32   10   # edges may not have many and require special treatment
     717
     718   KH.CORRECT.APPLY              BOOL     FALSE
     719END
     720
     721
    528722## if defined for MD, needs to have MD name in group so shouldn't be modified except for MD work
    529 ## -- ad hoc limit for NREF due to issues fainter than 19 mag in all filters and brighter than 17.0 mag (except y ~16.5) in MD
    530 ## -- better solution and other issues need to really be dealt with for PV3
    531 STATICSKY_MD_DEEPCAL   METADATA
     723## -- was ad hoc limit for NREF~150, rho~6000 due to issues fainter than 19 mag in all filters and brighter than 17.0 mag (except y ~16.5) in MD
     724## -- for PV3 add refcat min/max mag REFSTAR.ZP.MIN.MAG for ZP range only
     725STATICSKY_MD_PV3_DEEPCAL   METADATA
    532726   PSASTRO.CATDIR                  STR   PS1.REF.20140713
    533727   REFSTAR_MASK                    BOOL  FALSE
     
    539733   PSASTRO.FIELD.PADDING           F32   0.01   # skycells are well defined, don't need large padding. 1% of 6400 is 64 pixels
    540734   PSASTRO.MAX.NRAW                S32   1500   # include more than MAX.NREF to account for extras like false-positives
    541    PSASTRO.MAX.NREF                S32   150    # if edge skycell ~10% then try ~50 to match. increase to help odd bulk offsets
     735   PSASTRO.MAX.NREF                S32   500    # if edge skycell ~10% then try ~50 to match. increase to help odd bulk offsets
    542736   PSASTRO.MIN.INST.MAG.RAW        F32   -25.0  #
    543737   PSASTRO.MAX.INST.MAG.RAW        F32   -5.0
     
    546740   DVO.GETSTAR.MAX.RHO             F32   6000.0  # N/sqdeg, slightly larger than MAX.NREF
    547741   DVO.GETSTAR.MIN.MAG.INST        F32   -25.0   # set absurd range to cover large range of exptime, then clamp...
    548    DVO.GETSTAR.MIN.MAG             F32   17.0    # only used if keyword problem so also using CLAMP_MAG_MIN
    549    REFSTAR_CLAMP_MAG_MIN           F32   17.0    # saturation in MD ~14 even in y-band, so toss out brighter in the list. seeing offset in brighter stars
     742   DVO.GETSTAR.MIN.MAG             F32   15.0    # only used if keyword problem so also using CLAMP_MAG_MIN
     743   REFSTAR_CLAMP_MAG_MIN           F32   15.0    # saturation in MD ~14 even in y-band, so toss out brighter in the list. offset in brighter stars
    550744   DVO.GETSTAR.FIXED.ZEROPT        F32   0.0     # not really needed, exptime overly dominates
    551745
     
    559753   PSASTRO.MIN.NSTAR               S32   10   # edges may not have many and require special treatment
    560754
    561    KH.CORRECT.APPLY              BOOL     FALSE
    562 END
     755   KH.CORRECT.APPLY                BOOL     FALSE
     756
     757   REFSTAR.ZP.MIN.MAG      F32  15.0  # general refcat zp min/max setting -- need to use photcode below
     758   REFSTAR.ZP.MAX.MAG      F32  19.0
     759   ## set min to avoid bright turnover and max to limit merr<0.04
     760   ## --
     761#   PHOTCODE.DATA MULTI UPDATE
     762   PHOTCODE.DATA MULTI
     763   PHOTCODE.DATA METADATA
     764     FILTER   STR g
     765     PHOTCODE STR g
     766     REFSTAR.ZP.MIN.MAG    F32  17.0  #
     767     REFSTAR.ZP.MAX.MAG    F32  20.0  #
     768   END
     769   PHOTCODE.DATA METADATA
     770     FILTER   STR r
     771     PHOTCODE STR r
     772     REFSTAR.ZP.MIN.MAG    F32  17.0  #
     773     REFSTAR.ZP.MAX.MAG    F32  19.0  #
     774   END
     775   PHOTCODE.DATA METADATA
     776     FILTER   STR i
     777     PHOTCODE STR i
     778     REFSTAR.ZP.MIN.MAG    F32  17.0  #
     779     REFSTAR.ZP.MAX.MAG    F32  19.0  #
     780   END
     781   PHOTCODE.DATA METADATA
     782     FILTER   STR z
     783     PHOTCODE STR z
     784     REFSTAR.ZP.MIN.MAG    F32  16.0  #
     785     REFSTAR.ZP.MAX.MAG    F32  18.0  #
     786   END
     787   PHOTCODE.DATA METADATA
     788     FILTER   STR y
     789     PHOTCODE STR y
     790     REFSTAR.ZP.MIN.MAG    F32  15.0  #
     791     REFSTAR.ZP.MAX.MAG    F32  17.0  #
     792   END
     793END
  • tags/ipp-20141024/ippconfig/recipes/nightly_science.config

    r36841 r37988  
    8787END
    8888TARGETS METADATA
     89  NAME         STR SNIa
     90  DISTRIBUTION STR SNIa.test
     91  TESS         STR RINGS.V3
     92  OBSMODE      STR SNIa
     93  STACKABLE   BOOL FALSE
     94  DIFFABLE    BOOL FALSE
     95  OFFNIGHT_DIFFS BOOL FALSE
     96  ## change days till cleanup
     97#  CHIP           S16  7
     98#  WARP           S16  7
     99#  DIFF           S16  7
     100END
     101TARGETS METADATA
    89102  NAME      STR  MD01
    90103  DISTRIBUTION STR MD01
     
    95108  MIN_STACK U16 8
    96109  DIFFABLE  BOOL FALSE
     110  REDUCTION STR MD_DEFAULT
    97111  DIST      S16  30
    98112END
     
    106120  MIN_STACK U16 8
    107121  DIFFABLE  BOOL FALSE
     122  REDUCTION STR MD_DEFAULT
    108123  DIST      S16 30
    109124END
     
    117132  MIN_STACK U16 8
    118133  DIFFABLE  BOOL FALSE
     134  REDUCTION STR MD_DEFAULT
    119135  DIST      S16 30
    120136END
     
    128144  MIN_STACK U16 8
    129145  DIFFABLE  BOOL FALSE
     146  REDUCTION STR MD_DEFAULT
    130147  DIST      S16 30
    131148END
     
    139156  MIN_STACK U16 8
    140157  DIFFABLE  BOOL FALSE
    141   DIST      S16 30
     158  REDUCTION STR MD_DEFAULT
     159  DIST      S16 30
     160  ## change days till cleanup
     161  #CHIP S16 60
     162  WARP S16 60
     163  DIFF S16 60
    142164END
    143165TARGETS METADATA
     
    150172  MIN_STACK U16 8
    151173  DIFFABLE  BOOL FALSE
    152   DIST      S16 30
     174  REDUCTION STR MD_DEFAULT
     175  DIST      S16 30
     176  ## change days till cleanup
     177  #CHIP S16 60
     178  WARP S16 60
     179  DIFF S16 60
    153180END
    154181TARGETS METADATA
     
    161188  MIN_STACK U16 8
    162189  DIFFABLE  BOOL FALSE
    163   DIST      S16 30
     190  REDUCTION STR MD_DEFAULT
     191  DIST      S16 30
     192  ## change days till cleanup
     193  #CHIP S16 60
     194  WARP S16 60
     195  DIFF S16 60
    164196END
    165197TARGETS METADATA
     
    172204  MIN_STACK U16 8
    173205  DIFFABLE  BOOL FALSE
    174   DIST      S16 30
     206  REDUCTION STR MD_DEFAULT
     207  DIST      S16 30
     208  ## change days till cleanup
     209  #CHIP S16 60
     210  WARP S16 60
     211  DIFF S16 60
    175212END
    176213TARGETS METADATA
     
    183220  MIN_STACK U16 8
    184221  DIFFABLE  BOOL FALSE
     222  REDUCTION STR MD_DEFAULT
    185223  DIST      S16 30
    186224END
     
    194232  MIN_STACK U16 8
    195233  DIFFABLE  BOOL FALSE
     234  REDUCTION STR MD_DEFAULT
    196235  DIST      S16 30
    197236END
  • tags/ipp-20141024/ippconfig/recipes/ppStack.config

    r37274 r37988  
    169169STACK_THREEPI_ALT  METADATA
    170170END
     171
    171172STACK_CNP  METADATA
    172173END
     
    199200STACK_MDTHREEPI_DEEP_1DG   METADATA
    200201END
     202
     203STACK_MD_PV3_IQ_1DG    METADATA
     204END
     205
     206STACK_MD_PV3_REF_1DG    METADATA
     207END
     208
     209STACK_MD_PV3_DEEP_1DG   METADATA
     210END
     211
     212STACK_MD_PV3_NIGHT_1DG  METADATA
     213    STACK.TYPE      STR     NIGHTLY_STACK
     214END
     215
     216STACK_CNP_PV3_IQ_1DG    METADATA
     217END
     218
     219STACK_CNP_PV3_REF_1DG    METADATA
     220END
     221
     222STACK_CNP_PV3_DEEP_1DG   METADATA
     223END
     224
     225
    201226
    202227
  • tags/ipp-20141024/ippconfig/recipes/psastro.config

    r37420 r37988  
    174174REFSTAR_CLAMP_MAG_MAX           F32 30.0
    175175
     176# restrict ref catalog for zero point determination
     177# -- can be put into photcode groups as well
     178REFSTAR.ZP.MAX.MAG  F32  30.0
     179REFSTAR.ZP.MIN.MAG  F32  -3.0
     180
    176181EXTRACT_MAX_MAG                 F32 -15.0
    177182
     
    276281END
    277282
     283MD_ASTRO METADATA
     284END
     285
     286CNP_ASTRO_PV3 METADATA
     287END
     288
     289MD_ASTRO_PV3 METADATA
     290END
     291
    278292SYNTH_CAT METADATA
    279293END
     
    301315END
    302316
     317STATICSKY_MD_PV3_DEEPCAL   METADATA
     318END
     319
  • tags/ipp-20141024/ippconfig/recipes/reductionClasses.mdc

    r37415 r37988  
    200200END
    201201
    202 
     202# MD basic/nightly science analysis
     203MD_DEFAULT              METADATA
     204        CHIP_PPIMAGE      STR     CHIP
     205        CHIP_PSPHOT       STR     CHIP
     206        WARP_PSWARP       STR     WARP
     207        STACK_PPSTACK     STR     STACK
     208        STACK_PPSUB       STR     STACK
     209        STACK_PSPHOT      STR     STACK
     210        DIFF_PPSUB        STR     DIFF
     211        DIFF_PSPHOT       STR     DIFF
     212        JPEG_BIN1         STR     PPIMAGE_J1
     213        JPEG_BIN2         STR     PPIMAGE_J2
     214        FAKEPHOT          STR     FAKEPHOT
     215        ADDSTAR           STR     ADDSTAR
     216        PSASTRO           STR     MD_ASTRO
     217        STACKPHOT_PSPHOT  STR     STACKPHOT
     218        STACKPHOT_PPSUB   STR     STACKPHOT
     219        STACKPHOT_PPSTACK STR     STACKPHOT
     220        STACKPHOT_SINGLE_PSPHOT  STR     STACKPHOT_SINGLE
     221        BACKGROUND_PPBACKGROUND STR     BACKGROUND
     222        BACKGROUND_PSWARP       STR     BACKGROUND
     223        PSVIDEOPHOT             STR     PSVIDEOPHOT
     224        STATICSKY_CALIBRATION   STR     STATICSKY_CAL
     225        FULLFORCE_PSPHOT  STR   FULLFORCE_WARP
     226END
    203227
    204228# basic science analysis
     
    569593        JPEG_BIN1       STR     PPIMAGE_J1
    570594        JPEG_BIN2       STR     PPIMAGE_J2
     595END
     596
     597# specific for PV3 WSdiff processing to do inverse phot
     598WARPSTACK_PV3       METADATA
     599        DIFF_PPSUB      STR     WARPSTACK_PV3
     600        DIFF_PSPHOT     STR     DIFF
     601        JPEG_BIN1       STR     PPIMAGE_J1
     602        JPEG_BIN2       STR     PPIMAGE_J2
    571603END
    572604
     
    716748      STATICSKY_CALIBRATION   STR     STATICSKY_MD_DEEPCAL
    717749END
     750
     751## MD stacks -- PV3 version (NO bscale correction and other changes)
     752MD_PV3_NIGHT_STACK_1DG         METADATA
     753      STACK_PPSTACK   STR      STACK_MD_PV3_NIGHT_1DG
     754      STACK_PPSUB     STR      STACK_1DG
     755      STACK_PSPHOT    STR      STACK
     756      STACKPHOT_PSPHOT        STR     STACKPHOT
     757      STATICSKY_CALIBRATION   STR     STATICSKY_NIGHTCAL
     758END
     759
     760MD_PV3_IQ_STACK_1DG            METADATA
     761      STACK_PPSTACK           STR     STACK_MD_PV3_IQ_1DG
     762      STACK_PPSUB             STR     STACK_1DG
     763      STACK_PSPHOT            STR     STACK
     764      STACKPHOT_PSPHOT        STR     STACKPHOT
     765      STACKPHOT_PPSUB         STR     STACKPHOT_1DG
     766      STACKPHOT_PPSTACK       STR     STACKPHOT
     767      STACKPHOT_SINGLE_PSPHOT STR     STACKPHOT_SINGLE
     768      STATICSKY_CALIBRATION   STR     STATICSKY_MD_PV3_DEEPCAL
     769END
     770
     771MD_PV3_REF_STACK_1DG            METADATA
     772      STACK_PPSTACK           STR     STACK_MD_PV3_REF_1DG
     773      STACK_PPSUB             STR     STACK_1DG
     774      STACK_PSPHOT            STR     STACK
     775      STACKPHOT_PSPHOT        STR     STACKPHOT
     776      STACKPHOT_PPSUB         STR     STACKPHOT_1DG
     777      STACKPHOT_PPSTACK       STR     STACKPHOT
     778      STACKPHOT_SINGLE_PSPHOT STR     STACKPHOT_SINGLE
     779      STATICSKY_CALIBRATION   STR     STATICSKY_MD_PV3_DEEPCAL
     780END
     781
     782MD_PV3_DEEP_STACK_1DG            METADATA
     783      STACK_PPSTACK           STR     STACK_MD_PV3_DEEP_1DG
     784      STACK_PPSUB             STR     STACK_1DG
     785      STACK_PSPHOT            STR     STACK
     786      STACKPHOT_PSPHOT        STR     STACKPHOT
     787      STACKPHOT_PPSUB         STR     STACKPHOT_1DG
     788      STACKPHOT_PPSTACK       STR     STACKPHOT
     789      STACKPHOT_SINGLE_PSPHOT STR     STACKPHOT_SINGLE
     790      STATICSKY_CALIBRATION   STR     STATICSKY_MD_PV3_DEEPCAL
     791END
     792
     793## CNP stacks -- PV3 version (NO bscale correction and other changes)
     794CNP_PV3_IQ_STACK_1DG            METADATA
     795      STACK_PPSTACK           STR     STACK_CNP_PV3_IQ_1DG
     796      STACK_PPSUB             STR     STACK_1DG
     797      STACK_PSPHOT            STR     STACK
     798      STACKPHOT_PSPHOT        STR     STACKPHOT
     799      STACKPHOT_PPSUB         STR     STACKPHOT_1DG
     800      STACKPHOT_PPSTACK       STR     STACKPHOT
     801      STACKPHOT_SINGLE_PSPHOT STR     STACKPHOT_SINGLE
     802      STATICSKY_CALIBRATION   STR     STATICSKY_MD_PV3_DEEPCAL
     803END
     804
     805CNP_PV3_REF_STACK_1DG            METADATA
     806      STACK_PPSTACK           STR     STACK_CNP_PV3_REF_1DG
     807      STACK_PPSUB             STR     STACK_1DG
     808      STACK_PSPHOT            STR     STACK
     809      STACKPHOT_PSPHOT        STR     STACKPHOT
     810      STACKPHOT_PPSUB         STR     STACKPHOT_1DG
     811      STACKPHOT_PPSTACK       STR     STACKPHOT
     812      STACKPHOT_SINGLE_PSPHOT STR     STACKPHOT_SINGLE
     813      STATICSKY_CALIBRATION   STR     STATICSKY_MD_PV3_DEEPCAL
     814END
     815
     816CNP_PV3_DEEP_STACK_1DG            METADATA
     817      STACK_PPSTACK           STR     STACK_CNP_PV3_DEEP_1DG
     818      STACK_PPSUB             STR     STACK_1DG
     819      STACK_PSPHOT            STR     STACK
     820      STACKPHOT_PSPHOT        STR     STACKPHOT
     821      STACKPHOT_PPSUB         STR     STACKPHOT_1DG
     822      STACKPHOT_PPSTACK       STR     STACKPHOT
     823      STACKPHOT_SINGLE_PSPHOT STR     STACKPHOT_SINGLE
     824      STATICSKY_CALIBRATION   STR     STATICSKY_MD_PV3_DEEPCAL
     825END
     826
     827
     828
    718829
    719830
     
    13111422        STATICSKY_CALIBRATION   STR     STATICSKY_CAL
    13121423END
     1424
     1425CNP_PV3     METADATA
     1426        CHIP_PPIMAGE      STR     CHIP
     1427        CHIP_PSPHOT       STR     CHIP
     1428        WARP_PSWARP       STR     WARP
     1429        STACK_PPSTACK     STR     STACK
     1430        STACK_PPSUB       STR     STACK
     1431        STACK_PSPHOT      STR     STACK
     1432        DIFF_PPSUB        STR     DIFF
     1433        DIFF_PSPHOT       STR     DIFF
     1434        JPEG_BIN1         STR     PPIMAGE_J1
     1435        JPEG_BIN2         STR     PPIMAGE_J2
     1436        FAKEPHOT          STR     FAKEPHOT
     1437        ADDSTAR           STR     ADDSTAR
     1438        PSASTRO           STR     CNP_ASTRO_PV3
     1439        STACKPHOT_PSPHOT  STR     STACKPHOT
     1440        STACKPHOT_PPSUB   STR     STACKPHOT
     1441        STACKPHOT_PPSTACK STR     STACKPHOT
     1442        STACKPHOT_SINGLE_PSPHOT  STR     STACKPHOT_SINGLE
     1443        BACKGROUND_PPBACKGROUND STR     BACKGROUND
     1444        BACKGROUND_PSWARP       STR     BACKGROUND
     1445        PSVIDEOPHOT             STR     PSVIDEOPHOT
     1446        STATICSKY_CALIBRATION   STR     STATICSKY_CAL
     1447END
     1448
     1449MD_PV3     METADATA
     1450        CHIP_PPIMAGE      STR     CHIP
     1451        CHIP_PSPHOT       STR     CHIP
     1452        WARP_PSWARP       STR     WARP
     1453        STACK_PPSTACK     STR     STACK_1DG
     1454        STACK_PPSUB       STR     STACK
     1455        STACK_PSPHOT      STR     STACK_1DG
     1456        DIFF_PPSUB        STR     DIFF
     1457        DIFF_PSPHOT       STR     DIFF
     1458        JPEG_BIN1         STR     PPIMAGE_J1
     1459        JPEG_BIN2         STR     PPIMAGE_J2
     1460        FAKEPHOT          STR     FAKEPHOT
     1461        ADDSTAR           STR     ADDSTAR
     1462        PSASTRO           STR     MD_ASTRO_PV3
     1463        STACKPHOT_PSPHOT  STR     STACKPHOT
     1464        STACKPHOT_PPSUB   STR     STACKPHOT
     1465        STACKPHOT_PPSTACK STR     STACKPHOT
     1466        STACKPHOT_SINGLE_PSPHOT  STR     STACKPHOT_SINGLE
     1467        BACKGROUND_PPBACKGROUND STR     BACKGROUND
     1468        BACKGROUND_PSWARP       STR     BACKGROUND
     1469        PSVIDEOPHOT             STR     PSVIDEOPHOT
     1470        STATICSKY_CALIBRATION   STR     STATICSKY_MD_PV3_DEEPCAL
     1471END
     1472
    13131473
    13141474# random user tests (may not be stable or consistent)
  • tags/ipp-20141024/psastro/src/psastro.h

    r36837 r37988  
    154154
    155155bool              psastroZeroPoint (pmConfig *config);
    156 psVector         *psastroZeroPointReadoutAccum(psVector *dMag, pmReadout *readout, float exptime);
     156psVector         *psastroZeroPointReadoutAccum(psVector *dMag, pmReadout *readout, float exptime, float refminMag, float refmaxMag);
    157157bool              psastroZeroPointAnalysis (psMetadata *header, psVector *dMag, float zeropt, psMetadata *recipe);
    158158bool              psastroZeroPointFromRecipe (float *zeropt, float *exptime, float *ghostMaxMag, pmFPA *fpa, psMetadata *recipe);
     159bool              psastroZeroPointRefMagLimitFromRecipe (float *refminMag, float *refmaxMag, pmFPA *fpa, psMetadata *recipe);
    159160
    160161psStats          *psastroStatsPercentile (psVector *myVector, psMetadata *recipe);
  • tags/ipp-20141024/psastro/src/psastroChooseRefstars.c

    r37420 r37988  
    6666    psF32 clampMagMin = psMetadataLookupF32 (&status, recipe, "REFSTAR_CLAMP_MAG_MIN");
    6767    if (!status) clampMagMin = -5.0;
    68     //MEH test
     68    //MEH adding max option as well -- really should not be hardcoded..
    6969    psF32 clampMagMax = psMetadataLookupF32 (&status, recipe, "REFSTAR_CLAMP_MAG_MAX");
    7070    if (!status) clampMagMax = 30.0;
     71    psWarning("Will skip/clamp refstar with brighter/fainter magnitude %f/%f\n",clampMagMin,clampMagMax);
    7172
    7273
     
    113114
    114115                    if (ref->Mag < clampMagMin) {
    115                         psWarning("Skipping refstar with abusrd magnitude %f ra: %f dec: %f\n",
    116                             ref->Mag, RAD_TO_DEG(ref->sky->r), RAD_TO_DEG(ref->sky->d));
     116                        //psWarning("Skipping refstar with abusrd magnitude %f ra: %f dec: %f\n",
     117                        //    ref->Mag, RAD_TO_DEG(ref->sky->r), RAD_TO_DEG(ref->sky->d));
     118                        psTrace ("psastro", 6, "Skipping by clamp refstar with bright magnitude %f ra: %f dec: %f\n",
     119                                 ref->Mag, RAD_TO_DEG(ref->sky->r), RAD_TO_DEG(ref->sky->d));
    117120                        goto skip;
    118121                    }
    119                     //MEH test
     122                    //MEH option for max mag clamp also -- need to change psWarning (to log) to trace and above for bright..
    120123                    if (ref->Mag > clampMagMax) {
    121                         psWarning("Skipping by clamp refstar with faint magnitude %f ra: %f dec: %f\n",
    122                             ref->Mag, RAD_TO_DEG(ref->sky->r), RAD_TO_DEG(ref->sky->d));
     124                        //psWarning("Skipping by clamp refstar with faint magnitude %f ra: %f dec: %f\n",
     125                        //    ref->Mag, RAD_TO_DEG(ref->sky->r), RAD_TO_DEG(ref->sky->d));
     126                        psTrace ("psastro", 6, "Skipping by clamp refstar with faint magnitude %f ra: %f dec: %f\n",
     127                                 ref->Mag, RAD_TO_DEG(ref->sky->r), RAD_TO_DEG(ref->sky->d));
    123128                        goto skip;
    124129                    }
  • tags/ipp-20141024/psastro/src/psastroZeroPoint.c

    r33643 r37988  
    2020    pmCell *cell = NULL;
    2121    pmReadout *readout = NULL;
     22    float refminMag,refmaxMag;
    2223
    2324    // select the current recipe
     
    5960    }
    6061
     62    // MEH -- RefMagLimit for ZP with photcode option (merr probably better but not an option)
     63    // -- defualt is to use general config value (no hardcode..)
     64    if (!psastroZeroPointRefMagLimitFromRecipe (&refminMag, &refmaxMag, fpa, recipe)) {
     65        psLogMsg ("psastro", PS_LOG_INFO, "failed to load ref min,maxMag data from recipe");
     66        return false;
     67    }
     68
    6169    // if we measure the zero point by exposure, accumulate the dMag values here:
    6270    psVector *dMag = NULL;
     71    // MEH -- also the number of refcat sources used
     72    int zpt_nref = 0;
    6373
    6474    float fpaZP = 0.0;                  // Average zero point
     
    8191
    8292                // calculate dMag for the matched stars
    83                 dMag = psastroZeroPointReadoutAccum (dMag, readout, exptime);
    84 
     93                //dMag = psastroZeroPointReadoutAccum (dMag, readout, exptime);
     94                // MEH -- additional limits should be available for ZP if just robust mean and w/ stack skycal
     95                dMag = psastroZeroPointReadoutAccum (dMag, readout, exptime, refminMag, refmaxMag);
    8596                if (!byExposure) {
    8697                    // calculate dMag for the matched stars just for this readout (well, chip)
    8798                    psMetadata *header = psMetadataLookupMetadata (&status, readout->analysis, "PSASTRO.HEADER");
    8899                    psastroZeroPointAnalysis (header, dMag, zeropt, recipe);
     100                    // MEH -- per readout N refcat, min/max mag  -- added here, not part of median/edge process
     101                    zpt_nref += dMag->n;
     102                    psMetadataAddS32 (header, PS_LIST_TAIL, "ZPT_NREF", PS_META_REPLACE, "N refcat sources for zero point", dMag->n);
     103                    psMetadataAddF32 (header, PS_LIST_TAIL, "ZPT_MIN", PS_META_REPLACE, "min refcat mag for zero point", refminMag);
     104                    psMetadataAddF32 (header, PS_LIST_TAIL, "ZPT_MAX", PS_META_REPLACE, "max refcat mag for zero point", refmaxMag);
    89105                    psFree (dMag);
    90106                    dMag = NULL;
     
    95111                        numZP++;
    96112                    }
     113
    97114
    98115
     
    110127        }
    111128        psastroZeroPointAnalysis (header, dMag, zeropt, recipe);
     129        //MEH -- all N refcat sources here
     130        zpt_nref = dMag->n;
    112131        psFree (dMag);
    113132        dMag = NULL;
     
    141160                    // calculate dMag for the matched stars just for this readout (well, chip)
    142161                    psMetadata *header = psMetadataLookupMetadata (&status, readout->analysis, "PSASTRO.HEADER");
    143 
    144162                    psMetadataAddF32 (header, PS_LIST_TAIL, "ZPT_OBS", PS_META_REPLACE, "measured zero point",  zptObs);
    145163                    psMetadataAddF32 (header, PS_LIST_TAIL, "ZPT_REF", PS_META_REPLACE, "reference zero point", zptRef);
    146164                    psMetadataAddF32 (header, PS_LIST_TAIL, "ZPT_ERR", PS_META_REPLACE, "error on zero point",  zptErr);
    147165                    psMetadataAddF32 (header, PS_LIST_TAIL, "ZPT_OFF", PS_META_REPLACE, "zero point offset",    zptOff);
     166                    //MEH -- per readout  N refcat, MIN/MAX for consistency
     167                    psMetadataAddS32 (header, PS_LIST_TAIL, "ZPT_NREF", PS_META_REPLACE, "N refcat sources for zero point", zpt_nref);
     168                    psMetadataAddF32 (header, PS_LIST_TAIL, "ZPT_MIN", PS_META_REPLACE, "min refcat mag for zero point", refminMag);
     169                    psMetadataAddF32 (header, PS_LIST_TAIL, "ZPT_MAX", PS_META_REPLACE, "max refcat mag for zero point", refmaxMag);
    148170                }
    149171            }
     
    151173    }
    152174
     175    // MEH add N refcat, min/max mag to primary header
     176    psMetadata *header = psMetadataLookupMetadata (&status, fpa->analysis, "PSASTRO.HEADER");
     177    if (!header) {
     178        header = psMetadataAlloc ();
     179        psMetadataAddMetadata (fpa->analysis, PS_LIST_TAIL, "PSASTRO.HEADER",  PS_META_REPLACE, "psastro header stats", header);
     180        psFree (header);
     181    }
     182    psMetadataAddS32 (header, PS_LIST_TAIL, "ZPT_NREF", PS_META_REPLACE, "Total N refcat sources for zero point", zpt_nref);
     183    psMetadataAddF32 (header, PS_LIST_TAIL, "ZPT_MIN", PS_META_REPLACE, "min refcat mag for zero point", refminMag);
     184    psMetadataAddF32 (header, PS_LIST_TAIL, "ZPT_MAX", PS_META_REPLACE, "max refcat mag for zero point", refmaxMag);
    153185
    154186    psMetadataItem *item = psMetadataLookup(fpa->concepts, "FPA.ZP");
     
    162194 * accumulate the dMag values from this readout
    163195 */
    164 psVector *psastroZeroPointReadoutAccum(psVector *dMag, pmReadout *readout, float exptime) {
     196psVector *psastroZeroPointReadoutAccum(psVector *dMag, pmReadout *readout, float exptime, float refminMag, float refmaxMag) {
    165197
    166198    bool status;
     
    191223      // XXX I should be applying the airmass term here or in psastroLoadRefstars
    192224      // (ie, ref->Mag would be a prediction for a given star.
    193       float value = ref->Mag - raw->Mag - 2.5*log10(exptime);
    194       psVectorAppend (dMag, value);
     225      // MEH -- only append if in allowed ref mag range -- may want merr but not available..
     226      if ( ref->Mag >= refminMag && ref->Mag <= refmaxMag ){
     227        float value = ref->Mag - raw->Mag - 2.5*log10(exptime);
     228        psVectorAppend (dMag, value);
     229      }
    195230    }
    196231    return dMag;
     
    490525                continue;
    491526            }
    492         }
     527            //MEH null is a pain.. so only log if set
     528            psLogMsg ("psastro", PS_LOG_INFO, "found GHOST_MAX_MAG %f",*ghostMaxMag);
     529        }
     530        //MEH what zpt is set to
     531        psLogMsg ("psastro", PS_LOG_INFO, "found ZEROPT  %f",*zeropt);
    493532        psFree (iter);
    494533        return true;
     
    497536    return false;
    498537}
     538
     539
     540
     541bool psastroZeroPointRefMagLimitFromRecipe (float *refminMag, float *refmaxMag, pmFPA *fpa, psMetadata *recipe) {
     542
     543    bool status;
     544    float tmpmin,tmpmax;
     545
     546    // MEH -- duplicate psastroZeroPointFromRecipe for ZeroPoint adding RefMag limits with photcode option for extra restrictions
     547    // must have non-photcode dependent setting -- use as default rather than a hardcoded value
     548    *refminMag = psMetadataLookupF32 (&status, recipe, "REFSTAR.ZP.MIN.MAG");
     549    //if (!status) *refminMag = -5.0;
     550    if (!status) {
     551        psLogMsg ("psastro", PS_LOG_INFO, "RefMagLimit is missing REFSTAR.ZP.MIN.MAG");
     552        return false;
     553    }
     554    *refmaxMag = psMetadataLookupF32 (&status, recipe, "REFSTAR.ZP.MAX.MAG");
     555    //if (!status) *refmaxMag = 30.0;
     556    if (!status) {
     557        psLogMsg ("psastro", PS_LOG_INFO, "RefMagLimit is missing REFSTAR.ZP.MAX.MAG");
     558        return false;
     559    }
     560
     561    // select the filter; default to any photcode and mag limit otherwise
     562    char *filter = psMetadataLookupStr (&status, fpa->concepts, "FPA.FILTERID");
     563    if (!status) ESCAPE ("RefMagLimit missing FPA.FILTER in concepts");
     564
     565    // need to select the PHOTCODE.DATA folder that matches our filter
     566    psMetadataItem *item = psMetadataLookup (recipe, "PHOTCODE.DATA");
     567    if (!item) ESCAPE ("RefMagLimit PHOTCODE.DATA folders missing");
     568    if (item->type != PS_DATA_METADATA_MULTI) ESCAPE ("RefMagLimit PHOTCODE.DATA not a multi");
     569
     570    // PHOTCODE.DATA is a multi of metadata items
     571    psListIterator *iter = psListIteratorAlloc(item->data.list, PS_LIST_HEAD, false);
     572
     573    psMetadataItem *refItem = NULL;
     574    while ((refItem = psListGetAndIncrement (iter))) {
     575        if (refItem->type != PS_DATA_METADATA) ESCAPE ("RefMagLimit PHOTCODE.DATA entry is not a metadata folder");
     576
     577        char *refFilter = psMetadataLookupStr (&status, refItem->data.md, "FILTER");
     578        if (!status) {
     579            // always seems to happen once, commented out in ZeroPoint above as well
     580            //psLogMsg ("psastro", PS_LOG_INFO, "RefMagLimit PHOTCODE.DATA recipe folder is missing FILTER");
     581            continue;
     582        }
     583
     584        // does this entry match the current filter?
     585        if (strcmp (refFilter, filter)) continue;
     586
     587        psLogMsg ("psastro", PS_LOG_DETAIL, "RefMagLimit PHOTCODE.DATA found for filter %s", filter);
     588
     589        // -- may set one or other or both -- no reason to log if found or often not
     590        tmpmin = psMetadataLookupF32 (&status, refItem->data.md, "REFSTAR.ZP.MIN.MAG");
     591        if (status) {
     592            *refminMag = tmpmin;
     593        }
     594        tmpmax = psMetadataLookupF32 (&status, refItem->data.md, "REFSTAR.ZP.MAX.MAG");
     595        if (status) {
     596            *refmaxMag = tmpmax;
     597        }
     598        // once finds filter, should free and return true but multiple groups cause issue so just go through all groups now
     599        //psFree (iter);
     600        //return true;
     601    }
     602
     603    // log out set values
     604    psLogMsg ("psastro", PS_LOG_INFO, "using REFSTAR.ZP.MIN.MAG %f",*refminMag);
     605    psLogMsg ("psastro", PS_LOG_INFO, "using REFSTAR.ZP.MAX.MAG %f",*refmaxMag);
     606
     607    psFree (iter);
     608    return true;
     609}
     610
Note: See TracChangeset for help on using the changeset viewer.