# A control file to test polynomial "filling" of spectra Arts2 { INCLUDE "general/general.arts" INCLUDE "general/agendas.arts" INCLUDE "general/planet_earth.arts" # (standard) emission calculation Copy( iy_main_agenda, iy_main_agenda__Emission ) # cosmic background radiation Copy( iy_space_agenda, iy_space_agenda__CosmicBackground ) # standard surface agenda (i.e., make use of surface_rtprop_agenda) Copy( iy_surface_agenda, iy_surface_agenda__UseSurfaceRtprop ) # sensor-only path Copy( ppath_agenda, ppath_agenda__FollowSensorLosPath ) # no refraction Copy( ppath_step_agenda, ppath_step_agenda__GeometricPath ) # ---- Species --------------------------------------------------------------- abs_speciesSet( species=[ "O3", "H2O" ] ) # ---- Atmospheric scenario -------------------------------------------------- # Dimensionality of the atmosphere AtmosphereSet1D # A pressure grid rougly matching 0 to 80 km in 1 km steps. VectorNLogSpace( p_grid, 81, 1.013e5, 1 ) AtmRawRead( basename = "testdata/tropical" ) AtmFieldsCalc # ---- Absorption ------------------------------------------------------------ # Agenda for scalar gas absorption calculation Copy(abs_xsec_agenda, abs_xsec_agenda__noCIA) # on-the-fly absorption Copy( propmat_clearsky_agenda, propmat_clearsky_agenda__OnTheFly ) ReadXML( abs_lines, "testdata/ozone_line.xml" ) abs_lines_per_speciesCreateFromLines abs_cont_descriptionInit # ---- Observation geometry -------------------------------------------------- NumericCreate( z_platform ) NumericCreate( za ) # Platform altitude NumericSet( z_platform, 50 ) # Zenith angle NumericSet( za, 60 ) MatrixSetConstant( sensor_pos, 1, 1, z_platform ) Copy( z_surface, sensor_pos ) MatrixSetConstant( sensor_los, 1, 1, za ) # ---- Create fast f_grid ---------------------------------------------------- NumericCreate( v0 ) NumericCreate( fw ) IndexCreate( nlogpart ) NumericCreate( fw_fine ) NumericCreate( df_fine ) # Centre frequency NumericSet( v0, 1.108360400e+11 ) # One sided width of f_grid NumericSet( fw, 500e6 ) # Numer of points (on each side) of logarithmic part IndexSet( nlogpart, 35 ) # One sided width of fine grid at centre of f_grid NumericSet( fw_fine, 240e3 ) # Spacing of this fine grid NumericSet( df_fine, 40e3 ) # A logarithmically spaced grid between [fw_fine,fw] NumericCreate( f1 ) NumericCreate( f2 ) VectorCreate( flog ) Copy( f1, fw_fine ) Copy( f2, fw ) VectorNLogSpace( flog, nlogpart, f1, f2 ) # First part of f_grid is flog "mirrored" VectorFlip( f_grid, flog ) VectorScale( f_grid, f_grid, -1 ) # Append an equidistant grid between [-fw_fine+df_fine,fw_fine-df_fine] VectorCreate( feqd ) Copy( f1, fw_fine ) NumericScale( f1, f1, -1 ) NumericAdd( f1, f1, df_fine ) NumericScale( f2, f1, -1 ) VectorLinSpace( feqd, f1, f2, df_fine ) Append( f_grid, feqd ) # Append flog Append( f_grid, flog ) # Add v0 VectorAddScalar( f_grid, f_grid, v0 ) #--- Checks & Misc settings -------------------------------------------------- IndexSet( stokes_dim, 1 ) jacobianOff cloudboxOff abs_xsec_agenda_checkedCalc propmat_clearsky_agenda_checkedCalc atmfields_checkedCalc atmgeom_checkedCalc cloudbox_checkedCalc StringSet( iy_unit, "RJBT" ) #-- Calculate spectrum for monochromatic grid and store as y1(x1) sensorOff sensor_checkedCalc yCalc VectorCreate( x1 ) VectorCreate( y1 ) Copy( x1, f_grid ) Copy( y1, y ) # WriteXML( output_file_format, x1 ) WriteXML( output_file_format, y1 ) # ---- Create reference f_grid ----------------------------------------------- Copy( f1, fw ) NumericScale( f1, f1, -1 ) VectorLinSpace( f_grid, f1, fw, 30e3 ) VectorAddScalar( f_grid, f_grid, v0 ) #-- Calculate spectrum for reference grid and store as ye(x2) sensorOff sensor_checkedCalc yCalc VectorCreate( x2 ) VectorCreate( ye ) Copy( x2, f_grid ) Copy( ye, y ) # WriteXML( output_file_format, x2 ) WriteXML( output_file_format, ye ) # ---- Create spectra with polynomial filling --------------------------------- Copy( f_grid, x1 ) FlagOn( sensor_norm ) AntennaOff sensor_responseInit sensor_responseFillFgrid( sensor_response, sensor_response_f, sensor_response_pol, sensor_response_dlos, sensor_response_f_grid, sensor_response_pol_grid, sensor_response_dlos_grid, 3, 2 ) sensor_checkedCalc yCalc WriteXML( output_file_format, sensor_response_f_grid, "TestFgrid.x3.xml" ) WriteXML( output_file_format, y, "TestFgrid.y3.xml" ) sensor_responseInit sensor_responseFillFgrid( sensor_response, sensor_response_f, sensor_response_pol, sensor_response_dlos, sensor_response_f_grid, sensor_response_pol_grid, sensor_response_dlos_grid, 5, 4 ) sensor_checkedCalc yCalc WriteXML( output_file_format, sensor_response_f_grid, "TestFgrid.x5.xml" ) WriteXML( output_file_format, y, "TestFgrid.y5.xml" ) }