Giter Site home page Giter Site logo

Comments (10)

lspitler avatar lspitler commented on July 28, 2024 1

I'm going to try and fix it and PR it...

from gunagala.

lspitler avatar lspitler commented on July 28, 2024

@bazkiaei is this still an issue? @AnthonyHorton do you have a suggested fix for us to implement?

from gunagala.

bazkiaei avatar bazkiaei commented on July 28, 2024

@bazkiaei is this still an issue? @AnthonyHorton do you have a suggested fix for us to implement?

I believe it is solved due to clipping below zero pixel values within "Fix axis 18 WIP" pull request and adding a warning to the code.

from gunagala.

lspitler avatar lspitler commented on July 28, 2024

@bazkiaei I just tried running the jupyter notebook code using this branch and it fails on the 5th cell running:

sky_image = huntsman.make_noiseless_image(centre='14h41m -60d54m',
                                         obs_time='2018-04-12T08:00',
                                         filter_name='g')

I get this error:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-5-47b8d37b5389> in <module>()
----> 1 sky_image = huntsman.make_noiseless_image(centre='14h41m -60d54m',
      2                                          obs_time='2018-04-12T08:00',
      3                                          filter_name='g')
      4 
      5 plt.imshow(sky_image)

AttributeError: 'Imager' object has no attribute 'make_noiseless_image'

Do you get the same error?

from gunagala.

bazkiaei avatar bazkiaei commented on July 28, 2024

@bazkiaei I just tried running the jupyter notebook code using this branch and it fails on the 5th cell running:

sky_image = huntsman.make_noiseless_image(centre='14h41m -60d54m',
                                         obs_time='2018-04-12T08:00',
                                         filter_name='g')

I get this error:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-5-47b8d37b5389> in <module>()
----> 1 sky_image = huntsman.make_noiseless_image(centre='14h41m -60d54m',
      2                                          obs_time='2018-04-12T08:00',
      3                                          filter_name='g')
      4 
      5 plt.imshow(sky_image)

AttributeError: 'Imager' object has no attribute 'make_noiseless_image'

Do you get the same error?

I was getting that error at the first days I was working on Mock Image Generator. I think the reason is that you are on develop branch of gunagala. In that case you should change the branch to image_sime.

from gunagala.

AnthonyHorton avatar AnthonyHorton commented on July 28, 2024

@bazkiaei That axes order fix and CRVAL are unrelated. CRVAL is used to set the RA and dec of the 'reference pixel', i.e. it determines where on the sky the imager is pointing. Might be work checking the axis order of CRPIX, though...

@lee It doesn't get set until make_noiseless_image is run because I was assuming that the on sky position of the imager would only become relevant when creating a simulated image, at which point it gets set from the centre argument of the make_noiseless_image call. There's not really any sensible default value, and (at the time, at least) there didn't seem to be any reason for setting it before the make_noiseless_image call. Could add a method for pre-setting CRVAL if there is a need, though?

from gunagala.

bazkiaei avatar bazkiaei commented on July 28, 2024

@bazkiaei That axes order fix and CRVAL are unrelated. CRVAL is used to set the RA and dec of the 'reference pixel', i.e. it determines where on the sky the imager is pointing. Might be work checking the axis order of CRPIX, though...

@lee It doesn't get set until make_noiseless_image is run because I was assuming that the on sky position of the imager would only become relevant when creating a simulated image, at which point it gets set from the centre argument of the make_noiseless_image call. There's not really any sensible default value, and (at the time, at least) there didn't seem to be any reason for setting it before the make_noiseless_image call. Could add a method for pre-setting CRVAL if there is a need, though?

Oh, I thought this is related to the error that was arising. @AnthonyHorton thank you for informing me.

from gunagala.

lspitler avatar lspitler commented on July 28, 2024

@AnthonyHorton the trouble is that make_noiseless_image make a call implying there is a WCS before one has been set if self.sky doesn't have an attribute 'relative_brightness'. The offending line is: pixel_coords = self.wcs.all_world2pix(((coords.ra.degree, coords.dec.degree),), 0) \

I think you just want to set pixel_coords = self.get_pixel_coords(centre) no matter what?

from gunagala.

AnthonyHorton avatar AnthonyHorton commented on July 28, 2024

@lee Ah, OK. Probably quite a bit of scope for tidying up there. Rather too much setting things as a side effect of doing other things going on, which makes bugs like this more likely.

from gunagala.

AnthonyHorton avatar AnthonyHorton commented on July 28, 2024

Fixed by #25

from gunagala.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.