GithubHelp home page GithubHelp logo

richteague / gofish Goto Github PK

View Code? Open in Web Editor NEW
12.0 12.0 7.0 8.22 MB

๐ŸŽฃ Fish for line detections by exploiting the known velocity structure of the disk.

License: GNU General Public License v3.0

Python 98.55% TeX 1.45%

gofish's People

Contributors

arfon avatar labarba avatar richteague avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

gofish's Issues

Wrong extent on teardrop plot

Hi @richteague,

There is an issue (or my misunderstanding) with a teardrop plot extent. The extent keyword in the matplotlib's imshow sets the location of the image borders, not the location of the image corner pixels' centers.

extent = [velax[0], velax[-1], rvals[0], rvals[-1]]

In your case, rvals are the locations of the bin centers, right? For example, the can be:

 2.01438614 2.3242917  2.63419726 2.94410282 3.25400838 3.56391393
 3.87381949 4.18372505 4.49363061 4.80353617 5.11344173 5.42334729
 5.73325285 6.04315841 6.35306397 6.66296953 6.97287509 7.28278065 

That namely means that the pixel centers are (I will round) 0.15, 0.45, 0.75, ..., with a pixel size 0.3. In this case, the desired extent in the radial coordinate will be from the first rval - 0.15 to the last rval + 0.15.

If you want to keep imshow, the extent should be changed to:

velstep = velax[1] - velax[0]
rstep = rvals[1] - rvals[0]
extent = [velax[0] - velstep / 2, velax[-1] + velstep / 2, 
          rvals[0] - rstep / 2, rvals[-1] + rstep / 2]

The corresponding tutorial: https://matplotlib.org/3.1.1/tutorials/intermediate/imshow_extent.html

I would propose though to use the method pcolormesh, as it also can handle not-uniform coordinate steps. (shading='gourand') can be used if the coordinates are left as is, or the coordinates can be rewritten to correctly match the edges of the pixels.

https://matplotlib.org/3.1.1/api/_as_gen/matplotlib.pyplot.pcolormesh.html

Best,
Greg

_readpositionaxis read CRPIX from the fits header, but does not use it

The method _readpositionaxis reads the CRPIX value from the fits image header, but it does not use it. Instead, the origin of the axis is assigned to the middle pixel.
Not sure if it is a good idea to actually use the CRPIX value, but if it's not used, it shouldn't be read. Also, I couldn't find an explicit mention in the documentation that the center of the disk is assumed to equal the central pixel of the image (if x0 and y0 are set to 0).

FOV not working with some cubes

In some cubes the xaxis attribute is flipped relative to what GoFish expects (it wants xaxis to decrease with index). This causes issues when trying to cut down to a sub-cube based on the FOV argument. A simple work around now is just to avoid the FOV argument.

beam PA unit mismatch when making the convolution kernel in convolve_with_beam()

Hi @richteague,

I found an issue with the PA of the beam that is used when convolving the keplerian mask. In convolve_with_beam() the beam PA (in degrees) is passed along to astropy.convolution.Gaussian2DKernel, which expects a rotation angle in radians (at least in astropy 5.1.1: https://docs.astropy.org/en/stable/api/astropy.convolution.Gaussian2DKernel.html).
I fixed it by replacing theta=self.bpa with theta=np.deg2rad(self.bpa) , but any similar conversion would do the trick.

Cheers,
Leon

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.