Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix aperture estimation, use local bkg from an annulus for aperture photometry, add the web interface to explore the end results #16

Merged
merged 28 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
107f7a8
add util func to estimate appropriate apertures
juanep97 Jul 18, 2023
c607510
remove unused code
juanep97 Jul 18, 2023
76bed81
add fwhm column to aperphotresult
juanep97 Jul 18, 2023
9e18ed4
typo
juanep97 Jul 18, 2023
3118e89
allow extra agrs to photopolarimetry funcs
juanep97 Jul 18, 2023
45dff42
now aperture photometry uses local annulus bkg
juanep97 Jul 18, 2023
e729cb3
fix caha polarimetry, fix aperpix estimation
juanep97 Jul 18, 2023
a1112de
fix iop4admin model permissions
juanep97 Jul 18, 2023
6be6866
remove model admin permissions from iop4admin
juanep97 Aug 8, 2023
4d1c904
fix wrong attribute name, code style in .gitignore
juanep97 Aug 9, 2023
6ad886e
keep eveything in the same dir (`~/.iop4data`)
juanep97 Sep 10, 2023
b61788e
add portal to iop4site to explore the data
juanep97 Sep 10, 2023
13407dc
remove permissions from the modeladmin
juanep97 Sep 10, 2023
9d13315
remove unused plot.html
juanep97 Sep 11, 2023
62e1e00
fix url order in default iop4site
juanep97 Sep 11, 2023
d9b3755
add more info en about page
juanep97 Sep 11, 2023
eb80a23
test config fix
juanep97 Sep 11, 2023
06f9605
fix in tests
juanep97 Sep 11, 2023
de67097
add missing module in documentation
juanep97 Sep 11, 2023
01bedf4
fix for multiprocessing reduction in linux
juanep97 Sep 11, 2023
ffe9ad0
improve style of iop4 web portal
juanep97 Sep 12, 2023
42cd8c7
add info about current version in iop4 web portal
juanep97 Sep 12, 2023
bd72730
fix in style iop4 web portal
juanep97 Sep 12, 2023
a671bdb
fix in style iop4 web portal
juanep97 Sep 12, 2023
06dcbc0
fix in style iop4 web portal
juanep97 Sep 12, 2023
d6e4488
docstrings iop4lib.utils, unused imports
juanep97 Sep 12, 2023
a368e37
fix: make stats return empty dict if file does not exist
juanep97 Sep 13, 2023
7e63e95
remove duplicated for in parallel.py
juanep97 Sep 14, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ priv.*
# other files
**/static/iop4admin/js9
**/migrations

# IDE files
.vscode/

Expand Down
3 changes: 3 additions & 0 deletions docs/iop4lib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ iop4lib reference
.. automodule:: iop4lib.utils.astrometry
:members:

.. automodule:: iop4lib.utils.parallel
:members:

iop4lib.telescopes
==================
Telescope specific code.
Expand Down
48 changes: 42 additions & 6 deletions iop4admin/modeladmins/aperphotresult.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,12 @@

class AdminAperPhotResult(admin.ModelAdmin):
model = AperPhotResult
list_display = ['id', 'get_telescope', 'get_datetime', 'get_src_name', 'get_src_type', 'aperpix', 'get_reducedfit', 'get_obsmode', 'pairs', 'get_rotangle', 'get_src_type', 'flux_counts', 'flux_counts_err', 'bkg_flux_counts', 'bkg_flux_counts_err', 'modified']
list_display = ['id', 'get_telescope', 'get_datetime', 'get_src_name', 'get_src_type', 'get_fwhm', 'get_aperpix', 'get_reducedfit', 'get_obsmode', 'pairs', 'get_rotangle', 'get_src_type', 'get_flux_counts', 'get_flux_counts_err', 'get_bkg_flux_counts', 'get_bkg_flux_counts_err', 'modified']
readonly_fields = [field.name for field in AperPhotResult._meta.fields]
search_fields = ['id', 'astrosource__name', 'astrosource__srctype', 'reducedfit__id']
list_filter = ['astrosource__srctype', 'reducedfit__epoch__telescope', 'reducedfit__obsmode']

def has_module_permission(self, *args, **kwargs):
return True

def has_view_permission(self, *args, **kwargs):
return True


@admin.display(description="TELESCOPE")
def get_telescope(self, obj):
Expand Down Expand Up @@ -58,3 +54,43 @@ def get_obsmode(self, obj):
def get_rotangle(self, obj):
return obj.reducedfit.rotangle

@admin.display(description="fwhm")
def get_fwhm(self, obj):
if obj.fwhm is None:
return "-"
return f"{obj.fwhm:.1f}"

@admin.display(description="aperpix")
def get_aperpix(self, obj):
if obj.aperpix is None:
return "-"
return f"{obj.aperpix:.1f}"

@admin.display(description="flux_counts")
def get_flux_counts(self, obj):
if obj.flux_counts is None:
return "-"
else:
return f"{obj.flux_counts:.1f}"

@admin.display(description="flux_counts_err")
def get_flux_counts_err(self, obj):
if obj.flux_counts_err is None:
return "-"
else:
return f"{obj.flux_counts_err:.1f}"

@admin.display(description="bkg_flux_counts")
def get_bkg_flux_counts(self, obj):
if obj.bkg_flux_counts is None:
return "-"
else:
return f"{obj.bkg_flux_counts:.1f}"

@admin.display(description="bkg_flux_counts_err")
def get_bkg_flux_counts_err(self, obj):
if obj.bkg_flux_counts_err is None:
return "-"
else:
return f"{obj.bkg_flux_counts_err:.1f}"

18 changes: 0 additions & 18 deletions iop4admin/modeladmins/astrosource.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,6 @@ class AdminAstroSource(admin.ModelAdmin):
list_display = ['name', 'other_name', 'ra_hms', 'dec_dms', 'srctype', 'get_last_reducedfit', 'get_details']
search_fields = ['name', 'other_name', 'ra_hms', 'dec_dms', 'srctype', 'comment']
list_filter = ('srctype',)

def has_module_permission(self, *args, **kwargs):
return True

def has_view_permission(self, *args, **kwargs):
return True

# # by default exclude calibrators and non-polarized stars
# def get_queryset(self, request):
# # Get the original queryset
# queryset = super().get_queryset(request)

# # Check if the filter is not already applied by checking if the 'is_active' key is not in the request's GET parameters
# if 'srctype__exact' not in request.GET:
# # Apply the default filter
# queryset = queryset.exclude(srctype=SRCTYPES.CALIBRATOR).exclude(srctype=SRCTYPES.UNPOLARIZED_FIELD_STAR)

# return queryset

@admin.display(description='CALIBRATES')
def get_calibrates(self, obj):
Expand Down
6 changes: 1 addition & 5 deletions iop4admin/modeladmins/epoch.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@ class AdminEpoch(admin.ModelAdmin):
readonly_fields = [field.name for field in Epoch._meta.fields]
ordering = ['-night','-telescope']

def has_module_permission(self, *args, **kwargs):
return True

def has_add_permission(self, *args, **kwargs):
return True


@admin.display(description='Status')
def status(self, obj):
Expand Down
6 changes: 1 addition & 5 deletions iop4admin/modeladmins/masterbias.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ class AdminMasterBias(AdminFitFile):
model = MasterBias
list_display = ['id', 'telescope', 'night', 'imgsize', 'get_built_from', 'options']

def has_module_permission(self, *args, **kwargs):
return True

def has_view_permission(self, *args, **kwargs):
return True


@admin.display(description='Options')
def options(self, obj):
Expand Down
6 changes: 1 addition & 5 deletions iop4admin/modeladmins/masterflat.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ class AdminMasterFlat(AdminFitFile):
model = MasterFlat
list_display = ['id', 'telescope', 'night', 'imgsize', 'band', 'obsmode', 'rotangle', 'exptime', 'masterbias', 'get_built_from', 'options']

def has_module_permission(self, *args, **kwargs):
return True

def has_view_permission(self, *args, **kwargs):
return True


@admin.display(description='Options')
def options(self, obj):
Expand Down
6 changes: 1 addition & 5 deletions iop4admin/modeladmins/photopolresult.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@ class AdminPhotoPolResult(admin.ModelAdmin):
ordering = ['-juliandate']
list_filter = ['astrosource__srctype', 'epoch__telescope', 'obsmode']

def has_module_permission(self, *args, **kwargs):
return True

def has_view_permission(self, *args, **kwargs):
return True


@admin.display(description="TELESCOPE")
def get_telescope(self, obj):
Expand Down
6 changes: 1 addition & 5 deletions iop4admin/modeladmins/rawfit.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,7 @@ class AdminRawFit(AdminFitFile):
"imgsize",
)

def has_module_permission(self, *args, **kwargs):
return True

def has_view_permission(self, *args, **kwargs):
return True


def telescope(self, obj):
return obj.epoch.telescope
Expand Down
6 changes: 1 addition & 5 deletions iop4admin/modeladmins/reducedfit.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,7 @@ class AdminReducedFit(AdminFitFile):
"imgsize",
)

def has_module_permission(self, *args, **kwargs):
return True

def has_view_permission(self, *args, **kwargs):
return True


@admin.display(description='OPTIONS')
def options(self, obj):
Expand Down
Loading