diff --git a/skycalc_ipy/data/almanacquery_165c934eb0ad618a6f874d193e3013a5d8eeac6f3fd986076ae474746cdde416.json b/skycalc_ipy/data/almanacquery_165c934eb0ad618a6f874d193e3013a5d8eeac6f3fd986076ae474746cdde416.json deleted file mode 100644 index 8787d99..0000000 --- a/skycalc_ipy/data/almanacquery_165c934eb0ad618a6f874d193e3013a5d8eeac6f3fd986076ae474746cdde416.json +++ /dev/null @@ -1 +0,0 @@ -{"observation": {"day_flag": 0, "earth_inc": 2.78072, "horizon_alt": -1.64667, "horizon_alt_atmrefrac": -1.94667, "jd": 2451180.58546297, "local_date_day": 1, "local_date_hr": 23, "local_date_min": 3, "local_date_month": 1, "local_date_sec": 4, "local_date_year": 1999, "lst_hr": 4, "lst_min": 6, "lst_sec": 34, "mjd": 51180.08546297, "observatory": "paranal", "observatory_lat": -24.6274, "observatory_lat_deg": -24, "observatory_lat_min": 37, "observatory_lat_sec": 38, "observatory_lon": -70.4039, "observatory_lon_deg": -70, "observatory_lon_min": 24, "observatory_lon_sec": 14, "season_flag": 1, "sky_color": "#000000", "time_flag": 1, "ut_date_day": 2, "ut_date_hr": 2, "ut_date_min": 3, "ut_date_month": 1, "ut_date_sec": 4, "ut_date_year": 1999, "zenith_alpha": 61.6431, "zenith_alpha_hr": 4, "zenith_alpha_min": 6, "zenith_alpha_sec": 34, "zenith_delta": -24.6274, "zenith_delta_deg": -24, "zenith_delta_min": 37, "zenith_delta_sec": 38}, "target": {"ecl_lat": 15.862, "ecl_lon": 97.5403, "target_airmass": 2.64281, "target_alt": 22.2337, "target_az": 309.241, "target_barycentric_redshift": 9.72953e-05, "target_barycentric_velocity": 29.1684, "target_ha": 3.3762, "target_ha_hr": 3, "target_ha_min": 22, "target_ha_sec": 34, "targetculmination_day": 2, "targetculmination_hr": 22, "targetculmination_min": 40, "targetculmination_month": 1, "targetculmination_sec": 30, "targetculmination_year": 1999, "targetrise_day": 2, "targetrise_hr": 17, "targetrise_min": 22, "targetrise_month": 1, "targetrise_sec": 13, "targetrise_year": 1999, "targetset_day": 3, "targetset_hr": 3, "targetset_min": 52, "targetset_month": 1, "targetset_sec": 4, "targetset_year": 1999}, "sun": {"astro_twilightrise_day": 2, "astro_twilightrise_hr": 8, "astro_twilightrise_min": 28, "astro_twilightrise_month": 1, "astro_twilightrise_sec": 18.983, "astro_twilightrise_year": 1999, "astro_twilightset_day": 2, "astro_twilightset_hr": 1, "astro_twilightset_min": 2, "astro_twilightset_month": 1, "astro_twilightset_sec": 28.05, "astro_twilightset_year": 1999, "civil_twilightrise_day": 2, "civil_twilightrise_hr": 9, "civil_twilightrise_min": 31, "civil_twilightrise_month": 1, "civil_twilightrise_sec": 3.774, "civil_twilightrise_year": 1999, "civil_twilightset_day": 1, "civil_twilightset_hr": 23, "civil_twilightset_min": 59, "civil_twilightset_month": 1, "civil_twilightset_sec": 42.993, "civil_twilightset_year": 1999, "nautical_twilightrise_day": 2, "nautical_twilightrise_hr": 9, "nautical_twilightrise_min": 0, "nautical_twilightrise_month": 1, "nautical_twilightrise_sec": 24.414, "nautical_twilightrise_year": 1999, "nautical_twilightset_day": 2, "nautical_twilightset_hr": 0, "nautical_twilightset_min": 30, "nautical_twilightset_month": 1, "nautical_twilightset_sec": 22.491, "nautical_twilightset_year": 1999, "sun_alpha": 282.2, "sun_alpha_hr": 18, "sun_alpha_min": 48, "sun_alpha_sec": 47, "sun_alt": -28.25, "sun_angular_diameter": 0.53289, "sun_angular_diameter_deg": 0, "sun_angular_diameter_min": 31, "sun_angular_diameter_sec": 58, "sun_aveflux": 141.74, "sun_az": 222.814, "sun_delta": -22.9652, "sun_delta_deg": -22, "sun_delta_min": 57, "sun_delta_sec": 54, "sun_earth_dist": 1.00002, "sun_earth_dist_km": 149601000.0, "sun_flag": 0, "sun_msf_firstmonth": 2, "sun_msf_firstyear": 1947, "sun_msf_lastmonth": 1, "sun_msf_lastyear": 2019, "sunculmination_day": 1, "sunculmination_hr": 16, "sunculmination_min": 43, "sunculmination_month": 1, "sunculmination_sec": 34.6498, "sunculmination_year": 1999, "sunrise_day": 2, "sunrise_hr": 9, "sunrise_min": 49, "sunrise_month": 1, "sunrise_sec": 52.211, "sunrise_year": 1999, "sunset_day": 1, "sunset_hr": 23, "sunset_min": 40, "sunset_month": 1, "sunset_sec": 54.463, "sunset_year": 1999}, "moon": {"moon_alpha": 102.05, "moon_alpha_hr": 6, "moon_alpha_min": 48, "moon_alpha_sec": 11, "moon_alt": 30.3886, "moon_angular_diameter": 0.546266, "moon_angular_diameter_deg": 0, "moon_angular_diameter_min": 32, "moon_angular_diameter_sec": 46, "moon_az": 44.8524, "moon_delta": 20.188, "moon_delta_deg": 20, "moon_delta_min": 11, "moon_delta_sec": 16, "moon_earth_dist": 0.947953, "moon_earth_dist_km": 364393, "moon_flag": 1, "moon_fli": 0.999411, "moon_phi": 177.219, "moon_position_angle": 182.849, "moon_sun_sep": 177.219, "moon_target_sep": 83.4925, "moon_zenith_angle": 319.763, "moonculmination_day": 2, "moonculmination_hr": 4, "moonculmination_min": 49, "moonculmination_month": 1, "moonculmination_sec": 27.457, "moonculmination_year": 1999, "moonrise_day": 1, "moonrise_hr": 23, "moonrise_min": 6, "moonrise_month": 1, "moonrise_sec": 51.553, "moonrise_year": 1999, "moonset_day": 2, "moonset_hr": 10, "moonset_min": 30, "moonset_month": 1, "moonset_sec": 57.672, "moonset_year": 1999}, "execution_datetime": "2017-01-07T00:00:00 UTC"} \ No newline at end of file diff --git a/skycalc_ipy/data/almanacquery_165c934eb0ad618a6f874d193e3013a5d8eeac6f3fd986076ae474746cdde416.params.json b/skycalc_ipy/data/almanacquery_165c934eb0ad618a6f874d193e3013a5d8eeac6f3fd986076ae474746cdde416.params.json deleted file mode 100644 index db977d8..0000000 --- a/skycalc_ipy/data/almanacquery_165c934eb0ad618a6f874d193e3013a5d8eeac6f3fd986076ae474746cdde416.params.json +++ /dev/null @@ -1 +0,0 @@ -{"input_type": "ut_time", "coord_year": 1999, "coord_month": 1, "coord_day": 2, "coord_ut_hour": 2, "coord_ut_min": 3, "coord_ut_sec": 4, "coord_ra": 11.0, "coord_dec": 22.0} \ No newline at end of file diff --git a/skycalc_ipy/data/skymodel_100c4b1167bb736756014695fbf69a57d1af3b52f8f14a2af1144d3b4122647b.fits b/skycalc_ipy/data/skymodel_100c4b1167bb736756014695fbf69a57d1af3b52f8f14a2af1144d3b4122647b.fits deleted file mode 100644 index ba05ed0..0000000 --- a/skycalc_ipy/data/skymodel_100c4b1167bb736756014695fbf69a57d1af3b52f8f14a2af1144d3b4122647b.fits +++ /dev/null @@ -1,14 +0,0 @@ -SIMPLE = T / file does conform to FITS standard BITPIX = 16 / number of bits per data pixel NAXIS = 0 / number of data axes EXTEND = T / FITS dataset may contain extensions COMMENT FITS (Flexible Image Transport System) format is defined in 'AstronomyCOMMENT and Astrophysics', volume 376, page 359; bibcode: 2001A&A...376..359H DATE = '2017-01-07T00:00:00' / file creation date (YYYY-MM-DDThh:mm:ss UT) COMMENT COMMENT SkyCalc version: 2.0.6 COMMENT COMMENT ESO Sky Model www.eso.org/observing/etc/skycalc/skycalc.htm COMMENT Documentation www.eso.org/observing/etc/doc/skycalc/helpskycalc.html COMMENT and www.eso.org/observing/etc/doc/skycalc/helpskycalccli.html COMMENT References: Noll et al. (2012, A&A 543, A92) COMMENT and Jones et al. (2013, A&A 560, A91) COMMENT COMMENT column lam: Vacuum wavelength in micron COMMENT column flux: sky emission radiance flux in ph/s/m2/micron/arcsec2 COMMENT column trans: sky transmission COMMENT COMMENT Individual emission components in ph/s/m2/micron/arcsec2: COMMENT column flux_sml: scattered moonlight COMMENT column flux_ssl: scattered starlight COMMENT column flux_zl: zodiacal light COMMENT column flux_tie: telescope/instrument thermal emission COMMENT column flux_tme: molecular emission lower atmosphere COMMENT column flux_ael: airglow emission Lines COMMENT column flux_arc: airglow/residual emission COMMENT COMMENT Individual transmission components: COMMENT column trans_o3: ozone uv/optical absorption COMMENT column trans_ma: molecular absorption COMMENT column trans_rs: rayleigh scattering COMMENT column trans_ms: mie scattering COMMENT COMMENT Input parameters: COMMENT {"airmass": 1.0, COMMENT "pwv_mode": "pwv", COMMENT "season": 0, COMMENT "time": 0, COMMENT "pwv": 3.5, COMMENT "msolflux": 130.0, COMMENT "incl_moon": "Y", COMMENT "moon_sun_sep": 90.0, COMMENT "moon_target_sep": 45.0, COMMENT "moon_alt": 45.0, COMMENT "moon_earth_dist": 1.0, COMMENT "incl_starlight": "Y", COMMENT "incl_zodiacal": "Y", COMMENT "ecl_lon": 135.0, COMMENT "ecl_lat": 90.0, COMMENT "incl_loweratm": "Y", COMMENT "incl_upperatm": "Y", COMMENT "incl_airglow": "Y", COMMENT "incl_therm": "N", COMMENT "therm_t1": 0.0, COMMENT "therm_e1": 0.0, COMMENT "therm_t2": 0.0, COMMENT "therm_e2": 0.0, COMMENT "therm_t3": 0.0, COMMENT "therm_e3": 0.0, COMMENT "vacair": "vac", COMMENT "wmin": 300.0, COMMENT "wmax": 2000.0, COMMENT "wgrid_mode": "fixed_wavelength_step", COMMENT "wdelta": 100.0, COMMENT "wres": 20000, COMMENT "lsf_type": "none", COMMENT "lsf_gauss_fwhm": 5.0, COMMENT "lsf_boxcar_fwhm": 5.0, COMMENT "observatory": "2640"} END XTENSION= 'BINTABLE' / binary table extension BITPIX = 8 / 8-bit bytes NAXIS = 2 / 2-dimensional binary table NAXIS1 = 144 / width of table in bytes NAXIS2 = 18 / number of rows in table PCOUNT = 0 / size of special data area GCOUNT = 1 / one data group (required keyword) TFIELDS = 18 / number of fields in each row TTYPE1 = 'lam ' / label for field 1 TFORM1 = '1D ' / data format of field: 8-byte DOUBLE TTYPE2 = 'flux ' / label for field 2 TFORM2 = '1D ' / data format of field: 8-byte DOUBLE TTYPE3 = 'dflux1 ' / label for field 3 TFORM3 = '1D ' / data format of field: 8-byte DOUBLE TTYPE4 = 'dflux2 ' / label for field 4 TFORM4 = '1D ' / data format of field: 8-byte DOUBLE TTYPE5 = 'trans ' / label for field 5 TFORM5 = '1D ' / data format of field: 8-byte DOUBLE TTYPE6 = 'dtrans1 ' / label for field 6 TFORM6 = '1D ' / data format of field: 8-byte DOUBLE TTYPE7 = 'dtrans2 ' / label for field 7 TFORM7 = '1D ' / data format of field: 8-byte DOUBLE TTYPE8 = 'flux_sml' / label for field 8 TFORM8 = '1D ' / data format of field: 8-byte DOUBLE TTYPE9 = 'flux_ssl' / label for field 9 TFORM9 = '1D ' / data format of field: 8-byte DOUBLE TTYPE10 = 'flux_zl ' / label for field 10 TFORM10 = '1D ' / data format of field: 8-byte DOUBLE TTYPE11 = 'flux_tie' / label for field 11 TFORM11 = '1D ' / data format of field: 8-byte DOUBLE TTYPE12 = 'flux_tme' / label for field 12 TFORM12 = '1D ' / data format of field: 8-byte DOUBLE TTYPE13 = 'flux_ael' / label for field 13 TFORM13 = '1D ' / data format of field: 8-byte DOUBLE TTYPE14 = 'flux_arc' / label for field 14 TFORM14 = '1D ' / data format of field: 8-byte DOUBLE TTYPE15 = 'trans_ma' / label for field 15 TFORM15 = '1D ' / data format of field: 8-byte DOUBLE TTYPE16 = 'trans_o3' / label for field 16 TFORM16 = '1D ' / data format of field: 8-byte DOUBLE TTYPE17 = 'trans_rs' / label for field 17 TFORM17 = '1D ' / data format of field: 8-byte DOUBLE TTYPE18 = 'trans_ms' / label for field 18 TFORM18 = '1D ' / data format of field: 8-byte DOUBLE COMMENT COMMENT SkyCalc version: 2.0.6 COMMENT COMMENT ESO Sky Model www.eso.org/observing/etc/skycalc/skycalc.htm COMMENT Documentation www.eso.org/observing/etc/doc/skycalc/helpskycalc.html COMMENT and www.eso.org/observing/etc/doc/skycalc/helpskycalccli.html COMMENT References: Noll et al. (2012, A&A 543, A92) COMMENT and Jones et al. (2013, A&A 560, A91) COMMENT COMMENT column lam: Vacuum wavelength in micron COMMENT column flux: sky emission radiance flux in ph/s/m2/micron/arcsec2 COMMENT column trans: sky transmission COMMENT COMMENT Individual emission components in ph/s/m2/micron/arcsec2: COMMENT column flux_sml: scattered moonlight COMMENT column flux_ssl: scattered starlight COMMENT column flux_zl: zodiacal light COMMENT column flux_tie: telescope/instrument thermal emission COMMENT column flux_tme: molecular emission lower atmosphere COMMENT column flux_ael: airglow emission Lines COMMENT column flux_arc: airglow/residual emission COMMENT COMMENT Individual transmission components: COMMENT column trans_o3: ozone uv/optical absorption COMMENT column trans_ma: molecular absorption COMMENT column trans_rs: rayleigh scattering COMMENT column trans_ms: mie scattering COMMENT COMMENT COMMENT Input parameters: COMMENT {"airmass": 1.0, COMMENT "pwv_mode": "pwv", COMMENT "season": 0, COMMENT "time": 0, COMMENT "pwv": 3.5, COMMENT "msolflux": 130.0, COMMENT "incl_moon": "Y", COMMENT "moon_sun_sep": 90.0, COMMENT "moon_target_sep": 45.0, COMMENT "moon_alt": 45.0, COMMENT "moon_earth_dist": 1.0, COMMENT "incl_starlight": "Y", COMMENT "incl_zodiacal": "Y", COMMENT "ecl_lon": 135.0, COMMENT "ecl_lat": 90.0, COMMENT "incl_loweratm": "Y", COMMENT "incl_upperatm": "Y", COMMENT "incl_airglow": "Y", COMMENT "incl_therm": "N", COMMENT "therm_t1": 0.0, COMMENT "therm_e1": 0.0, COMMENT "therm_t2": 0.0, COMMENT "therm_e2": 0.0, COMMENT "therm_t3": 0.0, COMMENT "therm_e3": 0.0, COMMENT "vacair": "vac", COMMENT "wmin": 300.0, COMMENT "wmax": 2000.0, COMMENT "wgrid_mode": "fixed_wavelength_step", COMMENT "wdelta": 100.0, COMMENT "wres": 20000, COMMENT "lsf_type": "none", COMMENT "lsf_gauss_fwhm": 5.0, COMMENT "lsf_boxcar_fwhm": 5.0, COMMENT "observatory": "2640"} END ?333333@2Bz@G*CW@G*CW?r -d@ wz?*?A&22@l =@淕???$?E?X?ٙ@<@7`_@7`_?q1 Q+@}I;` @*y} ^@>jYn@!'J@L X?h8??荐?s?X?@X(]@9\;;@9\;;?,K@y 6;@"2x@F䕲2+@ F2@P'?Ր?ݕ$?ˬ~\?ѥ?333333@[@SoS@@SoS@?Yr@tT"@!b@I-@Yd&@[J@??sM?o@)?,?ffffff@ t$@L֭@L֭?ѩ։@m7GD@ʅ@IB@^!/2@XpW?|&?%)?&B?U\g?陙@'f@c&@c&?sp@e9kj@ ( -r@Gf -@zB\@eth#?lUo?O?@?q.l?@$̾@qi\@qi\?@}@]F_T[?@[_@DfZ@/\@r1?ƒ4?#?ﰲ?]?@[ @W@W?J(iyX@V27@/L@C@~]@xM*-?oH??Qb? ]!?񙙙@Pcb5@a;@a;??݀??# r(?Fz-?@H1?h@90Z5@90Z5?.ť.@GQ{?Us]Z@<&]?5!Δ@S{tf@e??Pr??$[?@c?ffffff@H@CB@CB?ѯ_ @ q\̔?}WA@ -u?a @Ul"@K-o? -Y???߄е?@Z@z@=0@=0?D獗@?ٺW?Ä/@7%p?ݎ~z@i <@~XcH?(a5v???F<@U>? -W{R@%h ?Ӛ>@%Y|u@1 -P -@@RL I?'΀&??B?2m^?ffffff@j:@p *@p *?/[{3 -@SFF?6@ m?C@/_@`+@*z>?V7Ye??6N~?ԍ$@@"Oӹ@-@-?ך'*@HO/ -?|d@DR@xi@~>/H?׻?IG$??Ξ?׃S"6 \ No newline at end of file diff --git a/skycalc_ipy/data/skymodel_100c4b1167bb736756014695fbf69a57d1af3b52f8f14a2af1144d3b4122647b.params.json b/skycalc_ipy/data/skymodel_100c4b1167bb736756014695fbf69a57d1af3b52f8f14a2af1144d3b4122647b.params.json deleted file mode 100644 index a35f7e9..0000000 --- a/skycalc_ipy/data/skymodel_100c4b1167bb736756014695fbf69a57d1af3b52f8f14a2af1144d3b4122647b.params.json +++ /dev/null @@ -1 +0,0 @@ -{"airmass": 1.0, "pwv_mode": "pwv", "season": 0, "time": 0, "pwv": 3.5, "msolflux": 130.0, "incl_moon": "Y", "moon_sun_sep": 90.0, "moon_target_sep": 45.0, "moon_alt": 45.0, "moon_earth_dist": 1.0, "incl_starlight": "Y", "incl_zodiacal": "Y", "ecl_lon": 135.0, "ecl_lat": 90.0, "incl_loweratm": "Y", "incl_upperatm": "Y", "incl_airglow": "Y", "incl_therm": "N", "therm_t1": 0.0, "therm_e1": 0.0, "therm_t2": 0.0, "therm_e2": 0.0, "therm_t3": 0.0, "therm_e3": 0.0, "vacair": "vac", "wmin": 300.0, "wmax": 2000.0, "wgrid_mode": "fixed_wavelength_step", "wdelta": 100.0, "wres": 20000, "lsf_type": "none", "lsf_gauss_fwhm": 5.0, "lsf_boxcar_fwhm": 5.0, "observatory": "2640"} \ No newline at end of file diff --git a/skycalc_ipy/ui.py b/skycalc_ipy/ui.py index d1a55fe..f205747 100644 --- a/skycalc_ipy/ui.py +++ b/skycalc_ipy/ui.py @@ -147,10 +147,17 @@ def get_sky_spectrum(self, return_type="table", filename=None): if filename is not None: skm.write(filename) - tbl = table.Table(skm.data[1].data) - tbl["lam"].unit = u.um + tbl = table.Table.read(skm.data) + if tbl["lam"].unit is None: + tbl["lam"].unit = u.um + for colname in tbl.colnames: if "flux" in colname: + # Somehow, astropy doesn't quite parse the unit correctly. + # Still, we shouldn't blindly overwrite it, so at least check. + funit = tbl[colname].unit + if not str(funit) in ("ph/s/m2/micron/arcsec2", "None"): + raise ValueError(f"Unexpected flux unit: {funit}") tbl[colname].unit = u.Unit("ph s-1 m-2 um-1 arcsec-2") date_created = dt.now().strftime("%Y-%m-%dT%H:%M:%S")