Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optionally match to DR10 Tractor photometry #2079

Merged
merged 6 commits into from Jul 12, 2023
Merged

optionally match to DR10 Tractor photometry #2079

merged 6 commits into from Jul 12, 2023

Conversation

moustakas
Copy link
Member

[WIP]

Adds the option of matching an input catalog to DR10 rather than the default, DR9.

@moustakas
Copy link
Member Author

Example with this branch:

import fitsio
from astropy.table import Table
from desispec.io.photo import gather_tractorphot

cat = Table(fitsio.read('/global/cfs/cdirs/desi/spectro/redux/daily/tiles/cumulative/83390/20230614/redrock-1-83390-thru20230614.fits', 'FIBERMAP'))
gather_tractorphot(cat, legacysurveydir='/global/cfs/cdirs/desi/external//legacysurvey/dr10')
<Table length=500>
RELEASE BRICKID BRICKNAME OBJID BRICK_PRIMARY MASKBITS FITBITS TYPE         RA         ...  SHAPE_R   SHAPE_R_IVAR   SHAPE_E1   SHAPE_E1_IVAR    SHAPE_E2   SHAPE_E2_IVAR       LS_ID             TARGETID
 int16   int32     str8   int32      bool      int16    int16  str3      float64       ...  float32     float32      float32       float32       float32       float32          int64              int64
------- ------- --------- ----- ------------- -------- ------- ---- ------------------ ... ---------- ------------ ------------ ------------- ------------- ------------- ----------------- -------------------
  10000  188903  1967m255  5500          True        0       0  REX  196.8569555422378 ... 0.56688607    33441.062          0.0           0.0           0.0           0.0 10995128657712508   39089837533316505
  10000  190207  1969m252  1165          True        0     128  SER 196.89418677404694 ...  1.4480075    399959.56  -0.03949909     410237.84   0.079156734     527159.06 10995128743167117   39089837533316947
  10000  190206  1967m252  4770          True        0       0  SER 196.78531078007364 ...  2.4383051    24940.207   0.09201398     117065.17      -0.22945      212817.0 10995128743105186   39089837533316811
  10000  190207  1969m252  1437          True        0     128  PSF 196.90849994377794 ...        0.0          0.0          0.0           0.0           0.0           0.0 10995128743167389 2305843055313299114
  10000  190206  1967m252  2362          True        0       0  REX 196.67051102286956 ...   0.792563     65927.56          0.0           0.0           0.0           0.0 10995128743102778   39089837533316778
      0       0               0         False        0       0                     0.0 ...        0.0          0.0          0.0           0.0           0.0           0.0                 0          -833901399
  10000  190206  1967m252  4080          True        0       0  REX  196.7500892218281 ... 0.97721446     18226.24          0.0           0.0           0.0           0.0 10995128743104496   39089837533316799
  10000  190207  1969m252   784          True        0       0  SER 196.87641816612924 ...  2.1923208    38339.363   0.37790316     236162.02  -0.010731013     113576.58 10995128743166736   39089837533316943
  10000  190206  1967m252  4761          True        0     128  DEV  196.7849515629786 ...  1.0525038    277154.78    0.2241769      509425.0 -0.0058159432     301205.94 10995128743105177   39089837533316810
      0       0               0         False        0       0                     0.0 ...        0.0          0.0          0.0           0.0           0.0           0.0                 0          -833901446
      0       0               0         False        0       0                     0.0 ...        0.0          0.0          0.0           0.0           0.0           0.0                 0          -833901416
      0       0               0         False        0       0                     0.0 ...        0.0          0.0          0.0           0.0           0.0           0.0                 0          -833901379
    ...     ...       ...   ...           ...      ...     ...  ...                ... ...        ...          ...          ...           ...           ...           ...               ...                 ...
  10000  192822  1969m247  4857          True        0       0  REX 196.99935175553583 ...  0.7885594    26483.791          0.0           0.0           0.0           0.0 10995128914547449   39089837533307552
  10000  192823  1971m247  1699          True        0       0  SER  197.1230080959247 ...  1.1225121    41459.457   0.12924863      42931.01    0.20650044      59306.42 10995128914609827   39089837533312251
  10000  192820  1963m247  2884          True        0       0  SER  196.3258913067712 ...  1.9719462    52147.832  -0.27866587     227372.42   -0.34124395     259132.81 10995128914414404   39089837533306337
  10000  192822  1969m247  4999          True        0       0  SER 197.00754508630604 ...  3.2684672     8387.051 -0.024537584      65777.84   0.049808104      126456.0 10995128914547591   39089837533307558
  10000  192820  1963m247  3663          True        0       0  SER  196.3545634108193 ...   4.896448    29761.902   0.02671344      354038.7     0.1349614      854966.1 10995128914415183   39089837533299284
  10000  192820  1963m247  4049          True        0       0  EXP  196.3718885752425 ...  1.2011356     235581.6    0.2171669     355878.62   -0.07302352     246265.31 10995128914415569   39089837533306359
  10000  192822  1969m247  5112          True        0       0  SER  197.0136729653569 ...   8.566035     96771.29    0.7190072     1605946.0   -0.08574591      513666.1 10995128914547704   39089837533307563
      0       0               0         False        0       0                     0.0 ...        0.0          0.0          0.0           0.0           0.0           0.0                 0          -833901168
  10000  192820  1963m247  3473          True        0       0  SER 196.34665358672868 ...  1.3403912   122447.695  0.023702698     148987.75    0.20384443     263900.75 10995128914414993   39089837533306353
      0       0               0         False        0       0                     0.0 ...        0.0          0.0          0.0           0.0           0.0           0.0                 0          -833901350
  10000  192822  1969m247  4865          True        0    4224  PSF 197.00004293083362 ...        0.0          0.0          0.0           0.0           0.0           0.0 10995128914547457   39089837533307553
  10000  192820  1963m247  5912          True        0       0  DEV 196.45165669702416 ...  2.2625468    1077.1671     0.663156      9220.024    -0.2620119      7305.407 10995128914417432   39089837533306386
  10000  192823  1971m247  1331          True        0       0  SER 197.10304587634818 ...  1.2422434    10424.022    0.2956111     14771.846   -0.35186607    15689.4795 10995128914609459   39089837533312243

Copy link
Contributor

@sbailey sbailey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put one maintenance/stylistic comment inline, but otherwise this looks good. You flagged this as WIP in your original post, but go ahead and merge when you are ready as long as the changes are only to io/photo.py .

py/desispec/io/photo.py Outdated Show resolved Hide resolved
moustakas added a commit to desihub/fastspecfit that referenced this pull request Jul 12, 2023
@moustakas moustakas merged commit 879da1e into main Jul 12, 2023
24 checks passed
@moustakas moustakas deleted the dr10 branch July 12, 2023 18:56
moustakas added a commit that referenced this pull request Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants