stdpipe 0.2.2__tar.gz → 0.2.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. stdpipe-0.2.4/PKG-INFO +29 -0
  2. {stdpipe-0.2.2 → stdpipe-0.2.4}/setup.py +1 -1
  3. {stdpipe-0.2.2 → stdpipe-0.2.4}/stdpipe/catalogs.py +156 -68
  4. {stdpipe-0.2.2 → stdpipe-0.2.4}/stdpipe/cutouts.py +22 -47
  5. {stdpipe-0.2.2 → stdpipe-0.2.4}/stdpipe/lcs.py +3 -3
  6. {stdpipe-0.2.2 → stdpipe-0.2.4}/stdpipe/photometry.py +131 -45
  7. {stdpipe-0.2.2 → stdpipe-0.2.4}/stdpipe/pipeline.py +24 -8
  8. {stdpipe-0.2.2 → stdpipe-0.2.4}/stdpipe/plots.py +56 -17
  9. {stdpipe-0.2.2 → stdpipe-0.2.4}/stdpipe/resolve.py +1 -1
  10. {stdpipe-0.2.2 → stdpipe-0.2.4}/stdpipe/subtraction.py +2 -2
  11. {stdpipe-0.2.2 → stdpipe-0.2.4}/stdpipe/utils.py +20 -2
  12. stdpipe-0.2.4/stdpipe.egg-info/PKG-INFO +29 -0
  13. stdpipe-0.2.2/PKG-INFO +0 -13
  14. stdpipe-0.2.2/stdpipe.egg-info/PKG-INFO +0 -13
  15. {stdpipe-0.2.2 → stdpipe-0.2.4}/.gitignore +0 -0
  16. {stdpipe-0.2.2 → stdpipe-0.2.4}/LICENSE.md +0 -0
  17. {stdpipe-0.2.2 → stdpipe-0.2.4}/MANIFEST.in +0 -0
  18. {stdpipe-0.2.2 → stdpipe-0.2.4}/README.md +0 -0
  19. {stdpipe-0.2.2 → stdpipe-0.2.4}/setup.cfg +0 -0
  20. {stdpipe-0.2.2 → stdpipe-0.2.4}/stdpipe/__init__.py +0 -0
  21. {stdpipe-0.2.2 → stdpipe-0.2.4}/stdpipe/astrometry.py +0 -0
  22. {stdpipe-0.2.2 → stdpipe-0.2.4}/stdpipe/data/legacysurvey.py +0 -0
  23. {stdpipe-0.2.2 → stdpipe-0.2.4}/stdpipe/data/legacysurvey_bricks.fits.gz +0 -0
  24. {stdpipe-0.2.2 → stdpipe-0.2.4}/stdpipe/data/ps1skycells.txt +0 -0
  25. {stdpipe-0.2.2 → stdpipe-0.2.4}/stdpipe/data/ps1skycells.txt.orig +0 -0
  26. {stdpipe-0.2.2 → stdpipe-0.2.4}/stdpipe/db.py +0 -0
  27. {stdpipe-0.2.2 → stdpipe-0.2.4}/stdpipe/flycheck_catalogs.py +0 -0
  28. {stdpipe-0.2.2 → stdpipe-0.2.4}/stdpipe/psf.py +0 -0
  29. {stdpipe-0.2.2 → stdpipe-0.2.4}/stdpipe/templates.py +0 -0
  30. {stdpipe-0.2.2 → stdpipe-0.2.4}/stdpipe.egg-info/SOURCES.txt +0 -0
  31. {stdpipe-0.2.2 → stdpipe-0.2.4}/stdpipe.egg-info/dependency_links.txt +0 -0
  32. {stdpipe-0.2.2 → stdpipe-0.2.4}/stdpipe.egg-info/requires.txt +0 -0
  33. {stdpipe-0.2.2 → stdpipe-0.2.4}/stdpipe.egg-info/top_level.txt +0 -0
  34. {stdpipe-0.2.2 → stdpipe-0.2.4}/tests/test_dependencies.py +0 -0
stdpipe-0.2.4/PKG-INFO ADDED
@@ -0,0 +1,29 @@
1
+ Metadata-Version: 2.4
2
+ Name: stdpipe
3
+ Version: 0.2.4
4
+ Summary: Simple Transient Detection Pipeline
5
+ Home-page: https://github.com/karpov-sv/stdpipe
6
+ Author: Sergey Karpov
7
+ Author-email: karpov.sv@gmail.com
8
+ License-File: LICENSE.md
9
+ Requires-Dist: numpy
10
+ Requires-Dist: scipy
11
+ Requires-Dist: astropy>=4.1
12
+ Requires-Dist: matplotlib
13
+ Requires-Dist: astroquery>0.4.1
14
+ Requires-Dist: sep
15
+ Requires-Dist: astroscrappy
16
+ Requires-Dist: photutils
17
+ Requires-Dist: statsmodels
18
+ Requires-Dist: tqdm
19
+ Requires-Dist: regions
20
+ Requires-Dist: python-dateutil
21
+ Requires-Dist: requests
22
+ Requires-Dist: sip_tpv
23
+ Requires-Dist: pyfftw
24
+ Dynamic: author
25
+ Dynamic: author-email
26
+ Dynamic: home-page
27
+ Dynamic: license-file
28
+ Dynamic: requires-dist
29
+ Dynamic: summary
@@ -3,7 +3,7 @@
3
3
 
4
4
  from setuptools import setup, find_packages
5
5
 
6
- __version__ = '0.2.2'
6
+ __version__ = '0.2.4'
7
7
 
8
8
  requirements = [
9
9
  'numpy',
@@ -30,8 +30,8 @@ catalogs = {
30
30
  'usnob1': {'vizier': 'I/284/out', 'name': 'USNO-B1'},
31
31
  'gsc': {'vizier': 'I/271/out', 'name': 'GSC 2.2'},
32
32
  'skymapper': {
33
- 'vizier': 'II/358/smss',
34
- 'name': 'SkyMapper DR1.1',
33
+ 'vizier': 'II/379/smssdr4',
34
+ 'name': 'SkyMapper DR4',
35
35
  'extra': [
36
36
  '_RAJ2000',
37
37
  '_DEJ2000',
@@ -46,8 +46,8 @@ catalogs = {
46
46
  'vsx': {'vizier': 'B/vsx/vsx', 'name': 'AAVSO VSX'},
47
47
  'apass': {'vizier': 'II/336/apass9', 'name': 'APASS DR9'},
48
48
  'sdss': {
49
- 'vizier': 'V/147/sdss12',
50
- 'name': 'SDSS DR12',
49
+ 'vizier': 'V/154/sdss16',
50
+ 'name': 'SDSS DR16',
51
51
  'extra': ['_RAJ2000', '_DEJ2000'],
52
52
  },
53
53
  'atlas': {
@@ -82,7 +82,7 @@ def get_cat_vizier(
82
82
  - skymapper - SkyMapper DR1.1
83
83
  - vsx - AAVSO Variable Stars Index
84
84
  - apass - AAVSO APASS DR9
85
- - sdss - SDSS DR12
85
+ - sdss - SDSS DR16
86
86
  - atlas - ATLAS-RefCat2, compilative all-sky reference catalogue with uniform zero-points in Pan-STARRS-like bands. We augment it with Johnson-Cousins B, V, R and I magnitudes the same way as Pan-STARRS.
87
87
  - usnob1 - USNO-B1
88
88
  - gsc - Guide Star Catalogue 2.2
@@ -218,17 +218,16 @@ def get_cat_vizier(
218
218
  )
219
219
  pI1, pI2 = (
220
220
  [
221
- -0.02274814414922734,
222
- 0.048462952908062046,
223
- -0.046965058282604985,
224
- -0.19478935830847588,
221
+ -0.02239162647929074,
222
+ 0.04401240100377888,
223
+ -0.038500349283596795,
224
+ -0.19509051168348646
225
225
  ],
226
226
  [
227
- 0.025124060889537177,
228
- -0.048672562735374666,
229
- -1.199591061144479,
230
- -0.1947893583084762,
231
- ],
227
+ 0.014586929059030904,
228
+ -0.025228407778416825,
229
+ -0.21476143248697746,
230
+ -0.19509051168348637]
232
231
  )
233
232
 
234
233
  cat['Bmag'] = (
@@ -249,7 +248,7 @@ def get_cat_vizier(
249
248
  cat['Imag'] = (
250
249
  cat['imag']
251
250
  + np.polyval(pI1, cat['gmag'] - cat['rmag'])
252
- + np.polyval(pI2, cat['imag'] - cat['zmag'])
251
+ + np.polyval(pI2, cat['rmag'] - cat['imag'])
253
252
  )
254
253
 
255
254
  cat['e_Bmag'] = cat['e_gmag']
@@ -385,90 +384,169 @@ def get_cat_vizier(
385
384
  cat['i_SDSS'] = g - (-0.29676 + 0.64728 * bp_rp - 0.10141 * bp_rp ** 2)
386
385
 
387
386
  elif catalog == 'skymapper':
388
- # to PS1
389
- for _ in ['u', 'g', 'r', 'i', 'z']:
390
- cat[_ + 'mag'] = cat[_ + 'PSF']
387
+ log("Augmenting the catalogue with Pan-STARRS photometry")
388
+
389
+ # SkyMapper DR4 to PS1 griz, my fit based on Pancino et al. (2022)
390
+ pg1,pg2 = (
391
+ [
392
+ -0.07715320986152466,
393
+ 0.2694597282089696,
394
+ 0.04069379065128178,
395
+ 0.01396290714542747
396
+ ],
397
+ [
398
+ 0.026097008342026252,
399
+ -0.14040957287568073,
400
+ 0.133647539780504,
401
+ 0.013962907145427432
402
+ ]
403
+ )
404
+ pr1,pr2 = (
405
+ [
406
+ 0.08779280979185472,
407
+ -0.23257704629617004,
408
+ 0.1890698144343673,
409
+ -0.008125550119663026
410
+ ],
411
+ [
412
+ -0.06273832689338121,
413
+ 0.21909317812693613,
414
+ -0.23340488268623696,
415
+ -0.00812555011966309
416
+ ]
417
+ )
418
+ pi1,pi2 = (
419
+ [
420
+ 0.03553380678975111,
421
+ -0.021174189684500792,
422
+ -0.028159666883815007,
423
+ 0.0009748746568893062
424
+ ],
425
+ [
426
+ 0.00911922467970264,
427
+ -0.0362286983251751,
428
+ 0.1403094994141109,
429
+ 0.0009748746568892609
430
+ ]
431
+ )
432
+ pz1,pz2 = (
433
+ [
434
+ 0.08071260245520126,
435
+ -0.051693023216670575,
436
+ -0.0739439627982131,
437
+ -0.0020460270205769223
438
+ ],
439
+ [
440
+ 0.09720715174271254,
441
+ -0.32063637962189184,
442
+ 0.37918283208242526,
443
+ -0.0020460270205769305
444
+ ]
445
+ )
446
+
447
+ cat['gmag'] = (
448
+ cat['gPSF']
449
+ + np.polyval(pg1, cat['gPSF'] - cat['rPSF'])
450
+ + np.polyval(pg2, cat['rPSF'] - cat['iPSF'])
451
+ )
452
+ cat['rmag'] = (
453
+ cat['rPSF']
454
+ + np.polyval(pr1, cat['gPSF'] - cat['rPSF'])
455
+ + np.polyval(pr2, cat['rPSF'] - cat['iPSF'])
456
+ )
457
+ cat['imag'] = (
458
+ cat['iPSF']
459
+ + np.polyval(pi1, cat['gPSF'] - cat['rPSF'])
460
+ + np.polyval(pi2, cat['rPSF'] - cat['iPSF'])
461
+ )
462
+ cat['zmag'] = (
463
+ cat['zPSF']
464
+ + np.polyval(pz1, cat['gPSF'] - cat['rPSF'])
465
+ + np.polyval(pz2, cat['rPSF'] - cat['iPSF'])
466
+ )
467
+
468
+ for _ in ['g', 'r', 'i', 'z']:
391
469
  cat['e_' + _ + 'mag'] = cat['e_' + _ + 'PSF']
392
470
 
393
471
  log("Augmenting the catalogue with Johnson-Cousins photometry")
394
472
 
395
- # Johnson-Cousins, copy from PS1 above
473
+ # SkyMapper DR4 to Johnson-Cousins BVRI, my fit based on Pancino et al. (2022)
396
474
  pB1, pB2 = (
397
475
  [
398
- 0.10339527794499666,
399
- -0.492149523946056,
400
- 1.2093816061394638,
401
- 0.061925048331498395,
476
+ -0.22773918482205113,
477
+ 0.1818124624962873,
478
+ 1.0021365492384895,
479
+ 0.10762635377473588
402
480
  ],
403
481
  [
404
- -0.2571974580267897,
405
- 0.9211495207523038,
406
- -0.8243222108864755,
407
- 0.0619250483314976,
408
- ],
482
+ -0.004034933919297649,
483
+ 0.08214592357213418,
484
+ -0.07535454054888649,
485
+ 0.10762635377473558
486
+ ]
409
487
  )
410
488
  pV1, pV2 = (
411
489
  [
412
- -0.011452922062676726,
413
- -9.949308251868327e-05,
414
- -0.4650511584366353,
415
- -0.007076854914511554,
490
+ -0.02545732895304914,
491
+ 0.03256423830249228,
492
+ -0.33074199873567045,
493
+ -0.002938730214382037
416
494
  ],
417
495
  [
418
- 0.012749150754020416,
419
- 0.057554580469724864,
420
- -0.09019328095355343,
421
- -0.007076854914511329,
422
- ],
496
+ -0.007342074336918033,
497
+ 0.08255055271047995,
498
+ -0.14349325478829064,
499
+ -0.0029387302143822
500
+ ]
423
501
  )
424
502
  pR1, pR2 = (
425
503
  [
426
- 0.004905242602502597,
427
- -0.046545625824660514,
428
- 0.07830702317352654,
429
- -0.08438139204305026,
504
+ 0.07296699439306827,
505
+ -0.1943702618426095,
506
+ 0.15375263988851387,
507
+ -0.08547735652048871
430
508
  ],
431
509
  [
432
- -0.07782426914647306,
433
- 0.14090289318728444,
434
- -0.3634922073369279,
435
- -0.08438139204305031,
436
- ],
510
+ -0.07378125129406726,
511
+ 0.18462924970775316,
512
+ -0.40720945890364135,
513
+ -0.08547735652048903
514
+ ]
437
515
  )
438
516
  pI1, pI2 = (
439
517
  [
440
- -0.02274814414922734,
441
- 0.048462952908062046,
442
- -0.046965058282604985,
443
- -0.19478935830847588,
518
+ -0.00925391710305653,
519
+ 0.046223960182760516,
520
+ -0.06889215990613289,
521
+ -0.19321699685334734
444
522
  ],
445
523
  [
446
- 0.025124060889537177,
447
- -0.048672562735374666,
448
- -1.199591061144479,
449
- -0.1947893583084762,
450
- ],
524
+ 0.01197866152020802,
525
+ -0.044370062623186206,
526
+ -0.05231484699406009,
527
+ -0.19321699685334745
528
+ ]
451
529
  )
452
530
 
453
531
  cat['Bmag'] = (
454
- cat['gmag']
455
- + np.polyval(pB1, cat['gmag'] - cat['rmag'])
456
- + np.polyval(pB2, cat['rmag'] - cat['imag'])
532
+ cat['gPSF']
533
+ + np.polyval(pB1, cat['gPSF'] - cat['rPSF'])
534
+ + np.polyval(pB2, cat['rPSF'] - cat['iPSF'])
457
535
  )
458
536
  cat['Vmag'] = (
459
- cat['gmag']
460
- + np.polyval(pV1, cat['gmag'] - cat['rmag'])
461
- + np.polyval(pV2, cat['rmag'] - cat['imag'])
537
+ cat['gPSF']
538
+ + np.polyval(pV1, cat['gPSF'] - cat['rPSF'])
539
+ + np.polyval(pV2, cat['rPSF'] - cat['iPSF'])
462
540
  )
463
541
  cat['Rmag'] = (
464
- cat['rmag']
465
- + np.polyval(pR1, cat['gmag'] - cat['rmag'])
466
- + np.polyval(pR2, cat['rmag'] - cat['imag'])
542
+ cat['rPSF']
543
+ + np.polyval(pR1, cat['gPSF'] - cat['rPSF'])
544
+ + np.polyval(pR2, cat['rPSF'] - cat['iPSF'])
467
545
  )
468
546
  cat['Imag'] = (
469
- cat['imag']
470
- + np.polyval(pI1, cat['gmag'] - cat['rmag'])
471
- + np.polyval(pI2, cat['imag'] - cat['zmag'])
547
+ cat['iPSF']
548
+ + np.polyval(pI1, cat['gPSF'] - cat['rPSF'])
549
+ + np.polyval(pI2, cat['rPSF'] - cat['iPSF'])
472
550
  )
473
551
 
474
552
  cat['e_Bmag'] = cat['e_gmag']
@@ -514,7 +592,7 @@ def get_cat_vizier(
514
592
  log("Converting the catalogue Sloan magnitudes to Pan-STARRS ones")
515
593
 
516
594
  # umag, gmag, rmag, imag and zmag are Sloan ugriz magnitudes! Let's get PS1 ones instead
517
- # Fits are based on clean Landolt sample from https://arxiv.org/pdf/1203.0297.pdf
595
+ # Fits are based on clean Landolt sample from https://arxiv.org/pdf/2205.06186
518
596
  pg = [-0.030414391501015867, -0.09960002492299584, -0.002910024005294562]
519
597
  pr = [-0.009566553708653305, 0.014924591443344211, -0.003928147919030857]
520
598
  pi = [-0.010802807724098494, 0.01124900218746879, 0.01274293783734852]
@@ -528,6 +606,16 @@ def get_cat_vizier(
528
606
  cat['imag'] = cat['i_SDSS'] + np.polyval(pi, cat['g_SDSS'] - cat['r_SDSS'])
529
607
  cat['zmag'] = cat['z_SDSS'] + np.polyval(pz, cat['g_SDSS'] - cat['r_SDSS'])
530
608
 
609
+ elif catalog == 'sdss':
610
+ log("Converting the catalogue Sloan magnitudes to AB ones")
611
+
612
+ # Zero point biases from https://www.sdss4.org/dr16/algorithms/fluxcal/#SDSStoAB
613
+ cat['umag'] -= 0.04
614
+ cat['zmag'] += 0.02
615
+
616
+ for _ in ['u', 'g', 'r', 'i', 'z']:
617
+ cat[_ + '_SDSS'] = cat[_ + 'mag']
618
+
531
619
  return cat
532
620
 
533
621
 
@@ -91,18 +91,12 @@ def get_cutout(
91
91
  image,
92
92
  candidate,
93
93
  radius,
94
- mask=None,
95
- background=None,
96
- diff=None,
97
- template=None,
98
- convolved=None,
99
- err=None,
100
- footprint=None,
101
94
  header=None,
102
95
  wcs=None,
103
96
  time=None,
104
97
  filename=None,
105
98
  name=None,
99
+ **kwargs
106
100
  ):
107
101
  """Create the cutout from one or more image planes based on the candidate object.
108
102
 
@@ -114,24 +108,18 @@ def get_cutout(
114
108
  :param image: The science image for `image` plane of the cutout
115
109
  :param candidate: The candidate object that should at least contain `x` and `y` fields
116
110
  :param radius: Cutout radius in pixels. Cutout will have a square shape with :code:`2*ceil(radius) + 1` width
117
- :param mask: The mask image for `mask` plane of the cutout, optional
118
- :param background: The background for `background` plane of the cutout, optional
119
- :param diff: Difference image for `diff` plane of the cutout, optional
120
- :param template: Template image for `template` plane of the cutout, optional
121
- :param convolved: Convolved template image for `convolved` plane of the cutout, optional
122
- :param err: Noise model image for `err` plane of the cutout, optional
123
- :param footprint: Candidate footprint (boolean) image for `footprint` plane of the cutout, optional
124
111
  :param header: The header for original image. It will be copied to `header` field of the cutout and modified accordingly to properly represent the shape and WCS of the cutout. Optional
125
112
  :param wcs: WCS for the original image. Will be copied to `wcs` field of the cutout with appropriate adjustment of the center so that it properly represents the astrometric solution on the cutout. Takes precedence over `header` parameter in defining cutout WCS. Optional
126
113
  :param time: Time (:class:`astropy.time.Time` or :class:`datetime.datetime` or a string representation compatible with them) of the original image acquisition, to be copied to `time` field of the cutout. Optional
127
114
  :param filename: Filename of the original image, to be stored in `filename` field of the cutout. Optional
128
115
  :param name: The object name, to be stored in the `name` field of the cutout. Optional
116
+ :param \**kwargs: All additional keyword arguments are interpreted as additional image planes (e.g. mask, diff, template etc).
129
117
  :returns: Cutout structure as described below.
130
118
 
131
119
  Cutout is represented by a dictionary with at least the following fields:
132
120
 
133
121
  - `image` - primary image plane, centered on the candidate position
134
- - `mask`, `background`, `diff`, `template`, `convolved`, `err`, `footprint` - corresponding secondary image planes, if provided as parameters to the routine
122
+ - `mask`, `background`, `diff`, `template`, `convolved`, `err`, `footprint`, etc - corresponding secondary image planes, if provided as parameters to the routine
135
123
  - `header` - header of the original image modified to properly represent the cutout WCS, if provided as a parameter to the routine
136
124
  - `wcs` - WCS solution for the original image, modified to properly represent the cutout WCS, if provided as a parameter to the routine
137
125
  - `meta` - dictionary of additional metadata for the cutout. It will be populated with all fields of the candidate object, plus additionally:
@@ -154,6 +142,10 @@ def get_cutout(
154
142
  if wcs is not None:
155
143
  cutout['wcs'] = wcs
156
144
 
145
+ # Let's update header info with this WCS
146
+ astrometry.clear_wcs(crophead, remove_underscored=True, remove_history=True)
147
+ crophead += wcs.to_header(relax=True)
148
+
157
149
  if crophead is not None:
158
150
  cutout['header'] = crophead
159
151
 
@@ -162,26 +154,9 @@ def get_cutout(
162
154
  cutout['wcs'] = wcs
163
155
 
164
156
  # Image planes
165
- if mask is not None:
166
- cutout['mask'] = crop_image_centered(mask, x0, y0, radius)
167
-
168
- if background is not None:
169
- cutout['background'] = crop_image_centered(background, x0, y0, radius)
170
-
171
- if diff is not None:
172
- cutout['diff'] = crop_image_centered(diff, x0, y0, radius)
173
-
174
- if template is not None:
175
- cutout['template'] = crop_image_centered(template, x0, y0, radius)
176
-
177
- if convolved is not None:
178
- cutout['convolved'] = crop_image_centered(convolved, x0, y0, radius)
179
-
180
- if err is not None:
181
- cutout['err'] = crop_image_centered(err, x0, y0, radius)
182
-
183
- if footprint is not None:
184
- cutout['footprint'] = crop_image_centered(footprint, x0, y0, radius)
157
+ for pname,plane in kwargs.items():
158
+ if plane is not None and np.ndim(plane) == 2:
159
+ cutout[pname] = crop_image_centered(plane, x0, y0, radius)
185
160
 
186
161
  # Metadata
187
162
  for _ in candidate.keys():
@@ -229,6 +204,9 @@ def write_cutout(cutout, filename):
229
204
  data = None
230
205
  elif type(data) == Time or type(data) == datetime.datetime:
231
206
  data = Time(data).to_value('fits')
207
+ elif not np.isscalar(data):
208
+ # NumPy arrays and like
209
+ data = repr(np.ma.filled(data))
232
210
  elif np.isreal(data) and np.isnan(data):
233
211
  data = 'NaN'
234
212
  elif np.isreal(data) and not np.isfinite(data):
@@ -260,18 +238,8 @@ def write_cutout(cutout, filename):
260
238
  hdus.append(hdu)
261
239
 
262
240
  # Store imaging data to named extensions
263
- for _ in [
264
- 'image',
265
- 'template',
266
- 'convolved',
267
- 'diff',
268
- 'adjusted',
269
- 'mask',
270
- 'err',
271
- 'background',
272
- 'footprint',
273
- ]:
274
- if _ in cutout:
241
+ for _ in cutout.keys():
242
+ if _ not in ['meta', 'header', 'wcs'] and np.ndim(cutout[_]) == 2:
275
243
  data = cutout[_]
276
244
 
277
245
  if data.dtype == bool:
@@ -305,6 +273,10 @@ def load_cutout(filename):
305
273
  data = np.nan
306
274
  elif data == 'Inf':
307
275
  data = np.inf
276
+ elif isinstance(data, str) and data.startswith('array('):
277
+ # FIXME: any safer way to convert it back to array?..
278
+ array = np.array
279
+ data = eval(data)
308
280
 
309
281
  cutout['meta'][name] = data
310
282
 
@@ -322,6 +294,9 @@ def load_cutout(filename):
322
294
 
323
295
  hdus.close()
324
296
 
297
+ if cutout['header']:
298
+ cutout['wcs'] = WCS(cutout['header'])
299
+
325
300
  return cutout
326
301
 
327
302
 
@@ -158,16 +158,16 @@ class LCs:
158
158
  self.lcs[_] = []
159
159
  self.lcs[_].append(__)
160
160
 
161
- if i % N == 0 and verbose is not None:
161
+ if i % N == 0 and verbose == True:
162
162
  sys.stdout.write("\r %d points - %d lcs" % (i, len(self.lcs['x'])))
163
163
  sys.stdout.flush()
164
164
 
165
- if verbose is not None:
165
+ if verbose == True:
166
166
  sys.stdout.write("\n")
167
167
  sys.stdout.flush()
168
168
 
169
169
  for _ in self.lcs.keys():
170
- if isinstance(self.lcs[_], list):
170
+ if isinstance(self.lcs[_], list) and _ not in ['ids']:
171
171
  self.lcs[_] = np.array(self.lcs[_])
172
172
 
173
173
  self.lcs['ra'], self.lcs['dec'] = astrometry.xyztoradec(