Skip to content

Trouble initializing galaxy model with multiple bands #12

@wmwv

Description

@wmwv

When trying to initialize the galaxy model with multiple bands, the initializing is not working, leaving parameters as None:

[Calm-4 sn-forward-model] sh tests/test_one_lightcurve.sh
Truth file /Users/wmwv/data/RomanDESCSims/ is not a file.
Astropy WCS not tangent plane coordinate system! May not be compatible with AstroPhot.
Astropy WCS not tangent plane coordinate system! May not be compatible with AstroPhot.
Using pupil mask 'SKINNY' and detector 'SCA01'.
Using pupil mask 'SKINNY' and detector 'SCA01'.
Using pupil mask 'SKINNY' and detector 'SCA17'.
No source spectrum supplied, therefore defaulting to 5700 K blackbody
Computing wavelength weights using synthetic photometry for F158...
Using pupil mask 'SKINNY' and detector 'SCA17'.
PSF calc using fov_arcsec = 5.000000, oversample = 4, number of wavelengths = 10
Creating optical system model:
Initialized OpticalSystem: Roman+WFI
Roman Entrance Pupil: Loaded amplitude transmission from /Users/wmwv/data/webbpsf-data/WFI/pupils/RST_WIM_Filter_skinny_SCA_17.fits.gz
Roman Entrance Pupil: Loaded OPD from /Users/wmwv/data/webbpsf-data/upscaled_HST_OPD.fits
Added pupil plane: Roman Entrance Pupil
Added coordinate inversion plane: OTE exit pupil
Added pupil plane: Field Dependent Aberration (SCA17)
Added detector with pixelscale=0.11 and oversampling=4: WFI detector
Calculating PSF with 10 wavelengths
 Propagating wavelength = 1.382e-06 m
 Propagating wavelength = 1.426e-06 m
 Propagating wavelength = 1.47e-06 m
 Propagating wavelength = 1.514e-06 m
 Propagating wavelength = 1.558e-06 m
 Propagating wavelength = 1.602e-06 m
 Propagating wavelength = 1.646e-06 m
 Propagating wavelength = 1.69e-06 m
 Propagating wavelength = 1.734e-06 m
 Propagating wavelength = 1.778e-06 m
  Calculation completed in 7.015 s
PSF Calculation completed.
Calculating jitter using gaussian
Jitter: Convolving with Gaussian with sigma=0.012 arcsec
        resulting image peak drops to 0.973 of its previous value
 Adding extension with image downsampled to detector pixel scale.
 Downsampling to detector pixel scale, by 4
 Downsampling to detector pixel scale, by 4
Astropy WCS not tangent plane coordinate system! May not be compatible with AstroPhot.
Astropy WCS not tangent plane coordinate system! May not be compatible with AstroPhot.
[W NNPACK.cpp:64] Could not initialize NNPACK! Reason: Unsupported hardware.
Traceback (most recent call last):
  File "/Users/wmwv/Roman/sn-forward-model/python/RomanDESCForwardModelLightcurves.py", line 1116, in <module>
    parse_and_run()
  File "/Users/wmwv/Roman/sn-forward-model/python/RomanDESCForwardModelLightcurves.py", line 1106, in parse_and_run
    run_multiple_transients(
  File "/Users/wmwv/Roman/sn-forward-model/python/RomanDESCForwardModelLightcurves.py", line 691, in run_multiple_transients
    run_one_transient(
  File "/Users/wmwv/Roman/sn-forward-model/python/RomanDESCForwardModelLightcurves.py", line 936, in run_one_transient
    model_host_sn.initialize()
  File "/usr/local/lib/python3.11/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/astrophot/utils/decorators.py", line 22, in wrapped
    result = func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/astrophot/models/_shared_methods.py", line 44, in targeted
    return func(self, target=send_target, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/astrophot/utils/decorators.py", line 50, in wrapper
    return func(*bound.args, **bound.kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/astrophot/models/group_model_object.py", line 135, in initialize
    model.initialize(target=target_copy, parameters=parameters[model.name])
  File "/usr/local/lib/python3.11/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/astrophot/utils/decorators.py", line 22, in wrapped
    result = func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/astrophot/models/_shared_methods.py", line 44, in targeted
    return func(self, target=send_target, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/astrophot/utils/decorators.py", line 50, in wrapper
    return func(*bound.args, **bound.kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/astrophot/models/sersic_model.py", line 77, in initialize
    super().initialize(target=target, parameters=parameters)
  File "/usr/local/lib/python3.11/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/astrophot/utils/decorators.py", line 22, in wrapped
    result = func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/astrophot/models/_shared_methods.py", line 44, in targeted
    return func(self, target=send_target, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/astrophot/utils/decorators.py", line 50, in wrapper
    return func(*bound.args, **bound.kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/astrophot/models/galaxy_model_object.py", line 105, in initialize
    pa=(parameters["PA"].value - target.north).detach().cpu().item(),
        ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions