linan7788626 / Hoopla

MIT License
1 stars 2 forks source link

differences in zoom or image sizes #18

Open anumore opened 7 years ago

anumore commented 7 years ago

@linan7788626 The images appear with different zoom in the lower panels compared to upper panels. Since the code knows what the true image size is, there should be some way to ensure that all panels display images of the same size and zoom. could you please make them appear the same in all panels irrespective of the size of the images uploaded by a user? Thanks, Anu

linan7788626 commented 7 years ago

@anumore I just fixed this; pictures are the same size in all the blocks now, so if you upload square images, everything should be okay. But following this issue, we might concern more:

By default, the size of the image is 9x9 arcsecond^2, and the number of pixels is 400*400. However, when one inputs different lensing systems, the box size could be different, so if the number of pixels is fixed, we need to change the pixel size to get correct model. My question is whether we should grab the box size (arcseconds) from the input image automatically Or cut out the images with the same size (e.g., 9x9 arcsecond^2) before we feed the images into Hoopla?

anumore commented 7 years ago

@linan7788626 Thanks so much. I will check later.

Would it help if the user is allowed to send x,y dimensions of their image as an input? Can you map those to the dimensions that's fixed in your code?

I think its fine to have some limitations or requirements on the user-end as long as they are explained on the page.

How can you know the size of the input image in arcsecond unless you are reading header info on pixel scale ?? Its the "No. of pixels" that would matter. I need to check how you are dealing with the image sizes and what assumptions you are making. Anyway, if the code doesn't allow too much freedom, then its fine to just explain the requirements on the image size, aspect ratio, etc.

Side note: I haven't checked but I suppose the uploaded images need to be in jpeg,png, pdf format? It may be obvious to expert users but it wouldn't hurt to add a tool tip for the acceptable formats on "Upload Lensed images". could you please add a tool tip? :-)

Thanks, Anu

linan7788626 commented 7 years ago

@anumore

Would it help if the user is allowed to send x,y dimensions of their image as an input? Can you map those to the dimensions that's fixed in your code? I think it's fine to have some limitations or requirements on the user-end as long as they are explained on the page.

Yes, I can map the input images to the required size in my code, but picking the center of the cut-out image is a problem. For example, an input image is 1024x768; I need to find a lensing system first then cut out a 400x400 image. However, lens finding is not involved in Hoopla now (one day we hope space warps would do this for us :-) ), so, as you said, I prefer to have users do some preprocessing on the image first before they feed the image into Hoopla.

How can you know the size of the input image in arcsecond unless you are reading header info on pixel scale ?? Its the "No. of pixels" that would matter. I need to check how you are dealing with the image sizes and what assumptions you are making. Anyway, if the code doesn't allow too much freedom, then its fine to just explain the requirements on the image size, aspect ratio, etc.

So far, I did not read the header info, and all the examples in this repo have the same size (9x9 arcsecond^2), so the pixel size is fixed in Hoopla. Probably, we should set a text bar to ask users to input the box size of the image they input. The freedom of the input image is not much; you have to input a square image as large as (9x9 arcsecond^2). Otherwise, the calculation of lensing is wrong.

Side note: I haven't checked but I suppose the uploaded images need to be in jpeg,png, pdf format? It may be obvious to expert users but it wouldn't hurt to add a tool tip for the acceptable formats on "Upload Lensed images". could you please add a tool tip? :-)

Thank you so much for this suggestion, I am working on adding tooltips now.

Thanks, Nan

anumore commented 7 years ago

You can just explain on the page that either the lens system has to be at the center of the image which will be resized to 400 px on the side or the user could provide such an image, if possible. I believe a smaller (<400px) image is still fine - as long as the lens is at the center.

I don't understand why you cannot work in pixel units (??) because the pixel scale is anyway set by you and is arbitrary.

linan7788626 commented 7 years ago

Yes, I should claim that only square pictures are acceptable, and users need to claim the boxsize in units of arcsec.

I am able to work in pixel units, and I set the pixel scale in the code. I fixed the boxsize just for convenience. :-)

anumore commented 7 years ago

If you can work in pixel units, then that's great. You can remove the (unnecessary) dependance on an arbitrary pixel scale because the user can provide an image with any pixel scale and the JSON file that you output will have relative positions in pixel units which will be easy for them to work with. Don't you think? :)

linan7788626 commented 7 years ago

Thanks, I will think about working in pixel units. :-)

anumore commented 7 years ago

Thanks for the consideration :-)